示例#1
0
    @Override
    public void onRegistrationFailed(ISipSession session, int errorCode, String message) {
      if (DEBUG)
        Log.d(
            TAG,
            "onRegistrationFailed(): "
                + session
                + ": "
                + SipErrorCode.toString(errorCode)
                + ": "
                + message);
      synchronized (SipService.this) {
        if (notCurrentSession(session)) return;

        switch (errorCode) {
          case SipErrorCode.INVALID_CREDENTIALS:
          case SipErrorCode.SERVER_UNREACHABLE:
            if (DEBUG) Log.d(TAG, "   pause auto-registration");
            stop();
            break;
          default:
            restartLater();
        }

        mErrorCode = errorCode;
        mErrorMessage = message;
        mProxy.onRegistrationFailed(session, errorCode, message);
        mMyWakeLock.release(session);
      }
    }
示例#2
0
 @Override
 public void onError(SipAudioCall call, int errorCode, String errorMessage) {
   if (SACA_DBG) {
     log(
         "onError: call="
             + call
             + " code="
             + SipErrorCode.toString(errorCode)
             + ": "
             + errorMessage);
   }
   switch (errorCode) {
     case SipErrorCode.SERVER_UNREACHABLE:
       onError(Connection.DisconnectCause.SERVER_UNREACHABLE);
       break;
     case SipErrorCode.PEER_NOT_REACHABLE:
       onError(Connection.DisconnectCause.NUMBER_UNREACHABLE);
       break;
     case SipErrorCode.INVALID_REMOTE_URI:
       onError(Connection.DisconnectCause.INVALID_NUMBER);
       break;
     case SipErrorCode.TIME_OUT:
     case SipErrorCode.TRANSACTION_TERMINTED:
       onError(Connection.DisconnectCause.TIMED_OUT);
       break;
     case SipErrorCode.DATA_CONNECTION_LOST:
       onError(Connection.DisconnectCause.LOST_SIGNAL);
       break;
     case SipErrorCode.INVALID_CREDENTIALS:
       onError(Connection.DisconnectCause.INVALID_CREDENTIALS);
       break;
     case SipErrorCode.CROSS_DOMAIN_AUTHENTICATION:
       onError(Connection.DisconnectCause.OUT_OF_NETWORK);
       break;
     case SipErrorCode.SERVER_ERROR:
       onError(Connection.DisconnectCause.SERVER_ERROR);
       break;
     case SipErrorCode.SOCKET_ERROR:
     case SipErrorCode.CLIENT_ERROR:
     default:
       onError(Connection.DisconnectCause.ERROR_UNSPECIFIED);
   }
 }
示例#3
0
 @Override
 public void onError(ISipSession session, int errorCode, String message) {
   if (DEBUG)
     Log.d(TAG, "sip session error: " + SipErrorCode.toString(errorCode) + ": " + message);
 }