Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e5246b2 authored by Hung-ying Tyan's avatar Hung-ying Tyan Committed by Android Git Automerger
Browse files

am 8a33e964: am 5306e0a8: Merge "SIP: add PEER_NOT_REACHABLE error feedback." into gingerbread

Merge commit '8a33e964'

* commit '8a33e964':
  SIP: add PEER_NOT_REACHABLE error feedback.
parents bb5fb60c 8a33e964
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -1036,8 +1036,7 @@ class SipSessionGroup implements SipListener {

        private void onError(Response response) {
            int statusCode = response.getStatusCode();
            if (!mInCall && ((statusCode == Response.TEMPORARILY_UNAVAILABLE)
                    || (statusCode == Response.BUSY_HERE))) {
            if (!mInCall && (statusCode == Response.BUSY_HERE)) {
                endCallOnBusy();
            } else {
                onError(getErrorCode(statusCode), createErrorMessage(response));
@@ -1046,11 +1045,22 @@ class SipSessionGroup implements SipListener {

        private SipErrorCode getErrorCode(int responseStatusCode) {
            switch (responseStatusCode) {
                case Response.TEMPORARILY_UNAVAILABLE:
                case Response.FORBIDDEN:
                case Response.GONE:
                case Response.NOT_FOUND:
                case Response.NOT_ACCEPTABLE:
                case Response.NOT_ACCEPTABLE_HERE:
                    return SipErrorCode.PEER_NOT_REACHABLE;

                case Response.REQUEST_URI_TOO_LONG:
                case Response.ADDRESS_INCOMPLETE:
                case Response.AMBIGUOUS:
                    return SipErrorCode.INVALID_REMOTE_URI;

                case Response.REQUEST_TIMEOUT:
                    return SipErrorCode.TIME_OUT;

                default:
                    if (responseStatusCode < 500) {
                        return SipErrorCode.CLIENT_ERROR;
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ public abstract class Connection {
        CONGESTION,                     /* outgoing call to congested network */
        MMI,                            /* not presently used; dial() returns null */
        INVALID_NUMBER,                 /* invalid dial string */
        NUMBER_UNREACHABLE,             /* cannot reach the peer */
        INVALID_CREDENTIALS,            /* invalid credentials */
        TIMED_OUT,                      /* client timed out */
        LOST_SIGNAL,
+5 −0
Original line number Diff line number Diff line
@@ -609,6 +609,7 @@ public class SipPhone extends SipPhoneBase {
                }
                synchronized (SipPhone.class) {
                    setState(Call.State.DISCONNECTED);
                    mSipAudioCall.close();
                    mOwner.onConnectionEnded(SipConnection.this);
                    Log.v(LOG_TAG, "-------- connection ended: "
                            + mPeer.getUriString() + ": "
@@ -821,6 +822,9 @@ public class SipPhone extends SipPhoneBase {
        public void onError(SipAudioCall call, SipErrorCode errorCode,
                String errorMessage) {
            switch (errorCode) {
                case PEER_NOT_REACHABLE:
                    onError(Connection.DisconnectCause.NUMBER_UNREACHABLE);
                    break;
                case INVALID_REMOTE_URI:
                    onError(Connection.DisconnectCause.INVALID_NUMBER);
                    break;
@@ -838,6 +842,7 @@ public class SipPhone extends SipPhoneBase {
                case SERVER_ERROR:
                case CLIENT_ERROR:
                default:
                    Log.w(LOG_TAG, "error: " + errorCode + ": " + errorMessage);
                    onError(Connection.DisconnectCause.ERROR_UNSPECIFIED);
            }
        }
+3 −0
Original line number Diff line number Diff line
@@ -43,6 +43,9 @@ public enum SipErrorCode {
    /** When the remote URI is not valid. */
    INVALID_REMOTE_URI,

    /** When the peer is not reachable. */
    PEER_NOT_REACHABLE,

    /** When invalid credentials are provided. */
    INVALID_CREDENTIALS,