Loading services/java/com/android/server/sip/SipSessionGroup.java +19 −1 Original line number Diff line number Diff line Loading @@ -810,6 +810,12 @@ class SipSessionGroup implements SipListener { } } private boolean crossDomainAuthenticationRequired(Response response) { String realm = getRealmFromResponse(response); if (realm == null) realm = ""; return !mLocalProfile.getSipDomain().trim().equals(realm.trim()); } private AccountManager getAccountManager() { return new AccountManager() { public UserCredentials getCredentials(ClientTransaction Loading @@ -831,6 +837,15 @@ class SipSessionGroup implements SipListener { }; } private String getRealmFromResponse(Response response) { WWWAuthenticate wwwAuth = (WWWAuthenticate)response.getHeader( SIPHeaderNames.WWW_AUTHENTICATE); if (wwwAuth != null) return wwwAuth.getRealm(); ProxyAuthenticate proxyAuth = (ProxyAuthenticate)response.getHeader( SIPHeaderNames.PROXY_AUTHENTICATE); return (proxyAuth == null) ? null : proxyAuth.getRealm(); } private String getNonceFromResponse(Response response) { WWWAuthenticate wwwAuth = (WWWAuthenticate)response.getHeader( SIPHeaderNames.WWW_AUTHENTICATE); Loading Loading @@ -937,7 +952,10 @@ class SipSessionGroup implements SipListener { return true; case Response.UNAUTHORIZED: case Response.PROXY_AUTHENTICATION_REQUIRED: if (handleAuthentication(event)) { if (crossDomainAuthenticationRequired(response)) { onError(SipErrorCode.CROSS_DOMAIN_AUTHENTICATION, getRealmFromResponse(response)); } else if (handleAuthentication(event)) { addSipSession(this); } else if (mLastNonce == null) { onError(SipErrorCode.SERVER_ERROR, Loading telephony/java/com/android/internal/telephony/Connection.java +1 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ public abstract class Connection { INVALID_NUMBER, /* invalid dial string */ NUMBER_UNREACHABLE, /* cannot reach the peer */ INVALID_CREDENTIALS, /* invalid credentials */ OUT_OF_NETWORK, /* calling from out of network is not allowed */ TIMED_OUT, /* client timed out */ LOST_SIGNAL, LIMIT_EXCEEDED, /* eg GSM ACM limit exceeded */ Loading telephony/java/com/android/internal/telephony/sip/SipPhone.java +3 −0 Original line number Diff line number Diff line Loading @@ -870,6 +870,9 @@ public class SipPhone extends SipPhoneBase { case SipErrorCode.INVALID_CREDENTIALS: onError(Connection.DisconnectCause.INVALID_CREDENTIALS); break; case SipErrorCode.CROSS_DOMAIN_AUTHENTICATION: onError(Connection.DisconnectCause.OUT_OF_NETWORK); break; case SipErrorCode.SOCKET_ERROR: case SipErrorCode.SERVER_ERROR: case SipErrorCode.CLIENT_ERROR: Loading voip/java/android/net/sip/SipErrorCode.java +5 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,9 @@ public class SipErrorCode { /** When data connection is lost. */ public static final int DATA_CONNECTION_LOST = -10; /** Cross-domain authentication required. */ public static final int CROSS_DOMAIN_AUTHENTICATION = -11; public static String toString(int errorCode) { switch (errorCode) { case NO_ERROR: Loading @@ -82,6 +85,8 @@ public class SipErrorCode { return "IN_PROGRESS"; case DATA_CONNECTION_LOST: return "DATA_CONNECTION_LOST"; case CROSS_DOMAIN_AUTHENTICATION: return "CROSS_DOMAIN_AUTHENTICATION"; default: return "UNKNOWN"; } Loading Loading
services/java/com/android/server/sip/SipSessionGroup.java +19 −1 Original line number Diff line number Diff line Loading @@ -810,6 +810,12 @@ class SipSessionGroup implements SipListener { } } private boolean crossDomainAuthenticationRequired(Response response) { String realm = getRealmFromResponse(response); if (realm == null) realm = ""; return !mLocalProfile.getSipDomain().trim().equals(realm.trim()); } private AccountManager getAccountManager() { return new AccountManager() { public UserCredentials getCredentials(ClientTransaction Loading @@ -831,6 +837,15 @@ class SipSessionGroup implements SipListener { }; } private String getRealmFromResponse(Response response) { WWWAuthenticate wwwAuth = (WWWAuthenticate)response.getHeader( SIPHeaderNames.WWW_AUTHENTICATE); if (wwwAuth != null) return wwwAuth.getRealm(); ProxyAuthenticate proxyAuth = (ProxyAuthenticate)response.getHeader( SIPHeaderNames.PROXY_AUTHENTICATE); return (proxyAuth == null) ? null : proxyAuth.getRealm(); } private String getNonceFromResponse(Response response) { WWWAuthenticate wwwAuth = (WWWAuthenticate)response.getHeader( SIPHeaderNames.WWW_AUTHENTICATE); Loading Loading @@ -937,7 +952,10 @@ class SipSessionGroup implements SipListener { return true; case Response.UNAUTHORIZED: case Response.PROXY_AUTHENTICATION_REQUIRED: if (handleAuthentication(event)) { if (crossDomainAuthenticationRequired(response)) { onError(SipErrorCode.CROSS_DOMAIN_AUTHENTICATION, getRealmFromResponse(response)); } else if (handleAuthentication(event)) { addSipSession(this); } else if (mLastNonce == null) { onError(SipErrorCode.SERVER_ERROR, Loading
telephony/java/com/android/internal/telephony/Connection.java +1 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ public abstract class Connection { INVALID_NUMBER, /* invalid dial string */ NUMBER_UNREACHABLE, /* cannot reach the peer */ INVALID_CREDENTIALS, /* invalid credentials */ OUT_OF_NETWORK, /* calling from out of network is not allowed */ TIMED_OUT, /* client timed out */ LOST_SIGNAL, LIMIT_EXCEEDED, /* eg GSM ACM limit exceeded */ Loading
telephony/java/com/android/internal/telephony/sip/SipPhone.java +3 −0 Original line number Diff line number Diff line Loading @@ -870,6 +870,9 @@ public class SipPhone extends SipPhoneBase { case SipErrorCode.INVALID_CREDENTIALS: onError(Connection.DisconnectCause.INVALID_CREDENTIALS); break; case SipErrorCode.CROSS_DOMAIN_AUTHENTICATION: onError(Connection.DisconnectCause.OUT_OF_NETWORK); break; case SipErrorCode.SOCKET_ERROR: case SipErrorCode.SERVER_ERROR: case SipErrorCode.CLIENT_ERROR: Loading
voip/java/android/net/sip/SipErrorCode.java +5 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,9 @@ public class SipErrorCode { /** When data connection is lost. */ public static final int DATA_CONNECTION_LOST = -10; /** Cross-domain authentication required. */ public static final int CROSS_DOMAIN_AUTHENTICATION = -11; public static String toString(int errorCode) { switch (errorCode) { case NO_ERROR: Loading @@ -82,6 +85,8 @@ public class SipErrorCode { return "IN_PROGRESS"; case DATA_CONNECTION_LOST: return "DATA_CONNECTION_LOST"; case CROSS_DOMAIN_AUTHENTICATION: return "CROSS_DOMAIN_AUTHENTICATION"; default: return "UNKNOWN"; } Loading