Loading services/java/com/android/server/sip/SipService.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -404,6 +404,7 @@ public final class SipService extends ISipService.Stub { public void onConnectivityChanged(boolean connected) public void onConnectivityChanged(boolean connected) throws SipException { throws SipException { mSipGroup.onConnectivityChanged(); if (connected) { if (connected) { resetGroup(mLocalIp); resetGroup(mLocalIp); if (mOpened) openToReceiveCalls(); if (mOpened) openToReceiveCalls(); Loading services/java/com/android/server/sip/SipSessionGroup.java +13 −5 Original line number Original line Diff line number Diff line Loading @@ -153,6 +153,13 @@ class SipSessionGroup implements SipListener { mSessionMap.clear(); mSessionMap.clear(); } } synchronized void onConnectivityChanged() { for (SipSessionImpl s : mSessionMap.values()) { s.onError(SipErrorCode.DATA_CONNECTION_LOST, "data connection lost"); } } public SipProfile getLocalProfile() { public SipProfile getLocalProfile() { return mLocalProfile; return mLocalProfile; } } Loading Loading @@ -213,7 +220,7 @@ class SipSessionGroup implements SipListener { Log.d(TAG, "sesssion key from event: " + key); Log.d(TAG, "sesssion key from event: " + key); Log.d(TAG, "active sessions:"); Log.d(TAG, "active sessions:"); for (String k : mSessionMap.keySet()) { for (String k : mSessionMap.keySet()) { Log.d(TAG, " ..... '" + k + "': " + mSessionMap.get(k)); Log.d(TAG, " ..." + k + ": " + mSessionMap.get(k)); } } SipSessionImpl session = mSessionMap.get(key); SipSessionImpl session = mSessionMap.get(key); return ((session != null) ? session : mCallReceiverSession); return ((session != null) ? session : mCallReceiverSession); Loading @@ -222,7 +229,7 @@ class SipSessionGroup implements SipListener { private synchronized void addSipSession(SipSessionImpl newSession) { private synchronized void addSipSession(SipSessionImpl newSession) { removeSipSession(newSession); removeSipSession(newSession); String key = newSession.getCallId(); String key = newSession.getCallId(); Log.d(TAG, " +++++ add a session with key: '" + key + "'"); Log.d(TAG, "+++ add a session with key: '" + key + "'"); mSessionMap.put(key, newSession); mSessionMap.put(key, newSession); for (String k : mSessionMap.keySet()) { for (String k : mSessionMap.keySet()) { Log.d(TAG, " ..... " + k + ": " + mSessionMap.get(k)); Log.d(TAG, " ..... " + k + ": " + mSessionMap.get(k)); Loading Loading @@ -998,7 +1005,8 @@ class SipSessionGroup implements SipListener { onRegistrationFailed(errorCode, message); onRegistrationFailed(errorCode, message); break; break; default: default: if (mInCall) { if ((errorCode != SipErrorCode.DATA_CONNECTION_LOST) && mInCall) { fallbackToPreviousInCall(errorCode, message); fallbackToPreviousInCall(errorCode, message); } else { } else { endCallOnError(errorCode, message); endCallOnError(errorCode, message); Loading telephony/java/com/android/internal/telephony/sip/SipPhone.java +6 −3 Original line number Original line Diff line number Diff line Loading @@ -635,9 +635,9 @@ public class SipPhone extends SipPhoneBase { @Override @Override protected void onError(DisconnectCause cause) { protected void onError(DisconnectCause cause) { Log.w(LOG_TAG, "SIP error: " + cause); Log.w(LOG_TAG, "SIP error: " + cause); if (mSipAudioCall.isInCall()) { if (mSipAudioCall.isInCall() // Don't end the call when in call. && (cause != DisconnectCause.LOST_SIGNAL)) { // TODO: how to deliver the error to PhoneApp // Don't end the call when in a call. return; return; } } Loading Loading @@ -829,6 +829,9 @@ public class SipPhone extends SipPhoneBase { case TRANSACTION_TERMINTED: case TRANSACTION_TERMINTED: onError(Connection.DisconnectCause.TIMED_OUT); onError(Connection.DisconnectCause.TIMED_OUT); break; break; case DATA_CONNECTION_LOST: onError(Connection.DisconnectCause.LOST_SIGNAL); break; case INVALID_CREDENTIALS: case INVALID_CREDENTIALS: onError(Connection.DisconnectCause.INVALID_CREDENTIALS); onError(Connection.DisconnectCause.INVALID_CREDENTIALS); break; break; Loading voip/java/android/net/sip/SipErrorCode.java +4 −1 Original line number Original line Diff line number Diff line Loading @@ -47,5 +47,8 @@ public enum SipErrorCode { INVALID_CREDENTIALS, INVALID_CREDENTIALS, /** The client is in a transaction and cannot initiate a new one. */ /** The client is in a transaction and cannot initiate a new one. */ IN_PROGRESS; IN_PROGRESS, /** When data connection is lost. */ DATA_CONNECTION_LOST; } } Loading
services/java/com/android/server/sip/SipService.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -404,6 +404,7 @@ public final class SipService extends ISipService.Stub { public void onConnectivityChanged(boolean connected) public void onConnectivityChanged(boolean connected) throws SipException { throws SipException { mSipGroup.onConnectivityChanged(); if (connected) { if (connected) { resetGroup(mLocalIp); resetGroup(mLocalIp); if (mOpened) openToReceiveCalls(); if (mOpened) openToReceiveCalls(); Loading
services/java/com/android/server/sip/SipSessionGroup.java +13 −5 Original line number Original line Diff line number Diff line Loading @@ -153,6 +153,13 @@ class SipSessionGroup implements SipListener { mSessionMap.clear(); mSessionMap.clear(); } } synchronized void onConnectivityChanged() { for (SipSessionImpl s : mSessionMap.values()) { s.onError(SipErrorCode.DATA_CONNECTION_LOST, "data connection lost"); } } public SipProfile getLocalProfile() { public SipProfile getLocalProfile() { return mLocalProfile; return mLocalProfile; } } Loading Loading @@ -213,7 +220,7 @@ class SipSessionGroup implements SipListener { Log.d(TAG, "sesssion key from event: " + key); Log.d(TAG, "sesssion key from event: " + key); Log.d(TAG, "active sessions:"); Log.d(TAG, "active sessions:"); for (String k : mSessionMap.keySet()) { for (String k : mSessionMap.keySet()) { Log.d(TAG, " ..... '" + k + "': " + mSessionMap.get(k)); Log.d(TAG, " ..." + k + ": " + mSessionMap.get(k)); } } SipSessionImpl session = mSessionMap.get(key); SipSessionImpl session = mSessionMap.get(key); return ((session != null) ? session : mCallReceiverSession); return ((session != null) ? session : mCallReceiverSession); Loading @@ -222,7 +229,7 @@ class SipSessionGroup implements SipListener { private synchronized void addSipSession(SipSessionImpl newSession) { private synchronized void addSipSession(SipSessionImpl newSession) { removeSipSession(newSession); removeSipSession(newSession); String key = newSession.getCallId(); String key = newSession.getCallId(); Log.d(TAG, " +++++ add a session with key: '" + key + "'"); Log.d(TAG, "+++ add a session with key: '" + key + "'"); mSessionMap.put(key, newSession); mSessionMap.put(key, newSession); for (String k : mSessionMap.keySet()) { for (String k : mSessionMap.keySet()) { Log.d(TAG, " ..... " + k + ": " + mSessionMap.get(k)); Log.d(TAG, " ..... " + k + ": " + mSessionMap.get(k)); Loading Loading @@ -998,7 +1005,8 @@ class SipSessionGroup implements SipListener { onRegistrationFailed(errorCode, message); onRegistrationFailed(errorCode, message); break; break; default: default: if (mInCall) { if ((errorCode != SipErrorCode.DATA_CONNECTION_LOST) && mInCall) { fallbackToPreviousInCall(errorCode, message); fallbackToPreviousInCall(errorCode, message); } else { } else { endCallOnError(errorCode, message); endCallOnError(errorCode, message); Loading
telephony/java/com/android/internal/telephony/sip/SipPhone.java +6 −3 Original line number Original line Diff line number Diff line Loading @@ -635,9 +635,9 @@ public class SipPhone extends SipPhoneBase { @Override @Override protected void onError(DisconnectCause cause) { protected void onError(DisconnectCause cause) { Log.w(LOG_TAG, "SIP error: " + cause); Log.w(LOG_TAG, "SIP error: " + cause); if (mSipAudioCall.isInCall()) { if (mSipAudioCall.isInCall() // Don't end the call when in call. && (cause != DisconnectCause.LOST_SIGNAL)) { // TODO: how to deliver the error to PhoneApp // Don't end the call when in a call. return; return; } } Loading Loading @@ -829,6 +829,9 @@ public class SipPhone extends SipPhoneBase { case TRANSACTION_TERMINTED: case TRANSACTION_TERMINTED: onError(Connection.DisconnectCause.TIMED_OUT); onError(Connection.DisconnectCause.TIMED_OUT); break; break; case DATA_CONNECTION_LOST: onError(Connection.DisconnectCause.LOST_SIGNAL); break; case INVALID_CREDENTIALS: case INVALID_CREDENTIALS: onError(Connection.DisconnectCause.INVALID_CREDENTIALS); onError(Connection.DisconnectCause.INVALID_CREDENTIALS); break; break; Loading
voip/java/android/net/sip/SipErrorCode.java +4 −1 Original line number Original line Diff line number Diff line Loading @@ -47,5 +47,8 @@ public enum SipErrorCode { INVALID_CREDENTIALS, INVALID_CREDENTIALS, /** The client is in a transaction and cannot initiate a new one. */ /** The client is in a transaction and cannot initiate a new one. */ IN_PROGRESS; IN_PROGRESS, /** When data connection is lost. */ DATA_CONNECTION_LOST; } }