Exemplo n.º 1
0
  private void handleBusyCall(Intent intent) {
    SessionDescriptor session = (SessionDescriptor) intent.getParcelableExtra(Constants.SESSION);

    if (currentCallManager != null && session.equals(currentCallManager.getSessionDescriptor())) {
      Log.w("RedPhoneService", "Duplicate incoming call signal, ignoring...");
      return;
    }

    handleMissedCall(extractRemoteNumber(intent));

    try {
      SignalingSocket signalingSocket =
          new SignalingSocket(
              this,
              session.getFullServerName(),
              Release.SERVER_PORT,
              localNumber,
              password,
              OtpCounterProvider.getInstance());

      signalingSocket.setBusy(session.sessionId);
      signalingSocket.close();
    } catch (SignalingException e) {
      Log.w("RedPhoneService", e);
    }
  }