am 5dde95b8: Merge "Fix the bug of authentication in an outgoing call." into gingerbread
Merge commit '5dde95b8fe0fea1a115a68f8acf826371da89da7' into gingerbread-plus-aosp * commit '5dde95b8fe0fea1a115a68f8acf826371da89da7': Fix the bug of authentication in an outgoing call.
This commit is contained in:
@@ -19,6 +19,7 @@ package com.android.server.sip;
|
|||||||
import gov.nist.javax.sip.clientauthutils.AccountManager;
|
import gov.nist.javax.sip.clientauthutils.AccountManager;
|
||||||
import gov.nist.javax.sip.clientauthutils.UserCredentials;
|
import gov.nist.javax.sip.clientauthutils.UserCredentials;
|
||||||
import gov.nist.javax.sip.header.SIPHeaderNames;
|
import gov.nist.javax.sip.header.SIPHeaderNames;
|
||||||
|
import gov.nist.javax.sip.header.ProxyAuthenticate;
|
||||||
import gov.nist.javax.sip.header.WWWAuthenticate;
|
import gov.nist.javax.sip.header.WWWAuthenticate;
|
||||||
import gov.nist.javax.sip.message.SIPMessage;
|
import gov.nist.javax.sip.message.SIPMessage;
|
||||||
|
|
||||||
@@ -731,7 +732,8 @@ class SipSessionGroup implements SipListener {
|
|||||||
Response response = event.getResponse();
|
Response response = event.getResponse();
|
||||||
String nonce = getNonceFromResponse(response);
|
String nonce = getNonceFromResponse(response);
|
||||||
if (((nonce != null) && nonce.equals(mLastNonce)) ||
|
if (((nonce != null) && nonce.equals(mLastNonce)) ||
|
||||||
(nonce == mLastNonce)) {
|
(nonce == null)) {
|
||||||
|
mLastNonce = nonce;
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
mClientTransaction = mSipHelper.handleChallenge(
|
mClientTransaction = mSipHelper.handleChallenge(
|
||||||
@@ -764,9 +766,12 @@ class SipSessionGroup implements SipListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String getNonceFromResponse(Response response) {
|
private String getNonceFromResponse(Response response) {
|
||||||
WWWAuthenticate authHeader = (WWWAuthenticate)(response.getHeader(
|
WWWAuthenticate wwwAuth = (WWWAuthenticate)response.getHeader(
|
||||||
SIPHeaderNames.WWW_AUTHENTICATE));
|
SIPHeaderNames.WWW_AUTHENTICATE);
|
||||||
return (authHeader == null) ? null : authHeader.getNonce();
|
if (wwwAuth != null) return wwwAuth.getNonce();
|
||||||
|
ProxyAuthenticate proxyAuth = (ProxyAuthenticate)response.getHeader(
|
||||||
|
SIPHeaderNames.PROXY_AUTHENTICATE);
|
||||||
|
return (proxyAuth == null) ? null : proxyAuth.getNonce();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean readyForCall(EventObject evt) throws SipException {
|
private boolean readyForCall(EventObject evt) throws SipException {
|
||||||
|
|||||||
Reference in New Issue
Block a user