Loading telephony/java/com/android/internal/telephony/sip/SipPhone.java +2 −2 Original line number Diff line number Diff line Loading @@ -818,9 +818,9 @@ public class SipPhone extends SipPhoneBase { } @Override public void onError(SipAudioCall call, String errorCode, public void onError(SipAudioCall call, SipErrorCode errorCode, String errorMessage) { switch (Enum.valueOf(SipErrorCode.class, errorCode)) { switch (errorCode) { case INVALID_REMOTE_URI: onError(Connection.DisconnectCause.INVALID_NUMBER); break; Loading voip/java/android/net/sip/SipAudioCall.java +4 −3 Original line number Diff line number Diff line Loading @@ -88,10 +88,11 @@ public interface SipAudioCall { * Called when an error occurs. * * @param call the call object that carries out the audio call * @param errorCode error code defined in {@link SipErrorCode} * @param errorCode error code of this error * @param errorMessage error message */ void onError(SipAudioCall call, String errorCode, String errorMessage); void onError(SipAudioCall call, SipErrorCode errorCode, String errorMessage); } /** Loading Loading @@ -125,7 +126,7 @@ public interface SipAudioCall { public void onCallHeld(SipAudioCall call) { onChanged(call); } public void onError(SipAudioCall call, String errorCode, public void onError(SipAudioCall call, SipErrorCode errorCode, String errorMessage) { onChanged(call); } Loading voip/java/android/net/sip/SipAudioCallImpl.java +48 −21 Original line number Diff line number Diff line Loading @@ -76,6 +76,9 @@ public class SipAudioCallImpl extends SipSessionAdapter private SipProfile mPendingCallRequest; private SipErrorCode mErrorCode; private String mErrorMessage; public SipAudioCallImpl(Context context, SipProfile localProfile) { mContext = context; mLocalProfile = localProfile; Loading @@ -88,8 +91,18 @@ public class SipAudioCallImpl extends SipSessionAdapter public void setListener(SipAudioCall.Listener listener, boolean callbackImmediately) { mListener = listener; if ((listener == null) || !callbackImmediately) return; try { if ((listener == null) || !callbackImmediately) { // do nothing } else if (mErrorCode != null) { listener.onError(this, mErrorCode, mErrorMessage); } else if (mInCall) { if (mHold) { listener.onCallHeld(this); } else { listener.onCallEstablished(this); } } else { SipSessionState state = getState(); switch (state) { case READY_TO_CALL: Loading @@ -97,14 +110,14 @@ public class SipAudioCallImpl extends SipSessionAdapter break; case INCOMING_CALL: listener.onRinging(this, getPeerProfile(mSipSession)); startRinging(); break; case OUTGOING_CALL: listener.onCalling(this); break; default: listener.onError(this, SipErrorCode.CLIENT_ERROR.toString(), "wrong state to attach call: " + state); case OUTGOING_CALL_RING_BACK: listener.onRingingBack(this); break; } } } catch (Throwable t) { Log.e(TAG, "setListener()", t); Loading @@ -131,6 +144,8 @@ public class SipAudioCallImpl extends SipSessionAdapter mInCall = false; mHold = false; mSessionId = -1L; mErrorCode = null; mErrorMessage = null; } public synchronized SipProfile getLocalProfile() { Loading Loading @@ -270,14 +285,20 @@ public class SipAudioCallImpl extends SipSessionAdapter } } private SipErrorCode getErrorCode(String errorCode) { return Enum.valueOf(SipErrorCode.class, errorCode); } @Override public void onCallChangeFailed(ISipSession session, String errorCode, String message) { Log.d(TAG, "sip call change failed: " + message); mErrorCode = getErrorCode(errorCode); mErrorMessage = message; Listener listener = mListener; if (listener != null) { try { listener.onError(SipAudioCallImpl.this, errorCode, message); listener.onError(SipAudioCallImpl.this, mErrorCode, message); } catch (Throwable t) { Log.e(TAG, "onCallBusy()", t); } Loading @@ -285,16 +306,20 @@ public class SipAudioCallImpl extends SipSessionAdapter } @Override public void onError(ISipSession session, String errorCode, String message) { public void onError(ISipSession session, String errorCode, String message) { Log.d(TAG, "sip session error: " + errorCode + ": " + message); mErrorCode = getErrorCode(errorCode); mErrorMessage = message; synchronized (this) { if (!isInCall()) close(true); if ((mErrorCode == SipErrorCode.DATA_CONNECTION_LOST) || !isInCall()) { close(true); } } Listener listener = mListener; if (listener != null) { try { listener.onError(SipAudioCallImpl.this, errorCode, message); listener.onError(SipAudioCallImpl.this, mErrorCode, message); } catch (Throwable t) { Log.e(TAG, "onError()", t); } Loading @@ -307,6 +332,8 @@ public class SipAudioCallImpl extends SipSessionAdapter try { mPeerSd = new SdpSessionDescription(sessionDescription); session.setListener(this); if (getState() == SipSessionState.INCOMING_CALL) startRinging(); } catch (Throwable e) { Log.e(TAG, "attachCall()", e); throwSipException(e); Loading Loading
telephony/java/com/android/internal/telephony/sip/SipPhone.java +2 −2 Original line number Diff line number Diff line Loading @@ -818,9 +818,9 @@ public class SipPhone extends SipPhoneBase { } @Override public void onError(SipAudioCall call, String errorCode, public void onError(SipAudioCall call, SipErrorCode errorCode, String errorMessage) { switch (Enum.valueOf(SipErrorCode.class, errorCode)) { switch (errorCode) { case INVALID_REMOTE_URI: onError(Connection.DisconnectCause.INVALID_NUMBER); break; Loading
voip/java/android/net/sip/SipAudioCall.java +4 −3 Original line number Diff line number Diff line Loading @@ -88,10 +88,11 @@ public interface SipAudioCall { * Called when an error occurs. * * @param call the call object that carries out the audio call * @param errorCode error code defined in {@link SipErrorCode} * @param errorCode error code of this error * @param errorMessage error message */ void onError(SipAudioCall call, String errorCode, String errorMessage); void onError(SipAudioCall call, SipErrorCode errorCode, String errorMessage); } /** Loading Loading @@ -125,7 +126,7 @@ public interface SipAudioCall { public void onCallHeld(SipAudioCall call) { onChanged(call); } public void onError(SipAudioCall call, String errorCode, public void onError(SipAudioCall call, SipErrorCode errorCode, String errorMessage) { onChanged(call); } Loading
voip/java/android/net/sip/SipAudioCallImpl.java +48 −21 Original line number Diff line number Diff line Loading @@ -76,6 +76,9 @@ public class SipAudioCallImpl extends SipSessionAdapter private SipProfile mPendingCallRequest; private SipErrorCode mErrorCode; private String mErrorMessage; public SipAudioCallImpl(Context context, SipProfile localProfile) { mContext = context; mLocalProfile = localProfile; Loading @@ -88,8 +91,18 @@ public class SipAudioCallImpl extends SipSessionAdapter public void setListener(SipAudioCall.Listener listener, boolean callbackImmediately) { mListener = listener; if ((listener == null) || !callbackImmediately) return; try { if ((listener == null) || !callbackImmediately) { // do nothing } else if (mErrorCode != null) { listener.onError(this, mErrorCode, mErrorMessage); } else if (mInCall) { if (mHold) { listener.onCallHeld(this); } else { listener.onCallEstablished(this); } } else { SipSessionState state = getState(); switch (state) { case READY_TO_CALL: Loading @@ -97,14 +110,14 @@ public class SipAudioCallImpl extends SipSessionAdapter break; case INCOMING_CALL: listener.onRinging(this, getPeerProfile(mSipSession)); startRinging(); break; case OUTGOING_CALL: listener.onCalling(this); break; default: listener.onError(this, SipErrorCode.CLIENT_ERROR.toString(), "wrong state to attach call: " + state); case OUTGOING_CALL_RING_BACK: listener.onRingingBack(this); break; } } } catch (Throwable t) { Log.e(TAG, "setListener()", t); Loading @@ -131,6 +144,8 @@ public class SipAudioCallImpl extends SipSessionAdapter mInCall = false; mHold = false; mSessionId = -1L; mErrorCode = null; mErrorMessage = null; } public synchronized SipProfile getLocalProfile() { Loading Loading @@ -270,14 +285,20 @@ public class SipAudioCallImpl extends SipSessionAdapter } } private SipErrorCode getErrorCode(String errorCode) { return Enum.valueOf(SipErrorCode.class, errorCode); } @Override public void onCallChangeFailed(ISipSession session, String errorCode, String message) { Log.d(TAG, "sip call change failed: " + message); mErrorCode = getErrorCode(errorCode); mErrorMessage = message; Listener listener = mListener; if (listener != null) { try { listener.onError(SipAudioCallImpl.this, errorCode, message); listener.onError(SipAudioCallImpl.this, mErrorCode, message); } catch (Throwable t) { Log.e(TAG, "onCallBusy()", t); } Loading @@ -285,16 +306,20 @@ public class SipAudioCallImpl extends SipSessionAdapter } @Override public void onError(ISipSession session, String errorCode, String message) { public void onError(ISipSession session, String errorCode, String message) { Log.d(TAG, "sip session error: " + errorCode + ": " + message); mErrorCode = getErrorCode(errorCode); mErrorMessage = message; synchronized (this) { if (!isInCall()) close(true); if ((mErrorCode == SipErrorCode.DATA_CONNECTION_LOST) || !isInCall()) { close(true); } } Listener listener = mListener; if (listener != null) { try { listener.onError(SipAudioCallImpl.this, errorCode, message); listener.onError(SipAudioCallImpl.this, mErrorCode, message); } catch (Throwable t) { Log.e(TAG, "onError()", t); } Loading @@ -307,6 +332,8 @@ public class SipAudioCallImpl extends SipSessionAdapter try { mPeerSd = new SdpSessionDescription(sessionDescription); session.setListener(this); if (getState() == SipSessionState.INCOMING_CALL) startRinging(); } catch (Throwable e) { Log.e(TAG, "attachCall()", e); throwSipException(e); Loading