react-native-pjsip icon indicating copy to clipboard operation
react-native-pjsip copied to clipboard

Stoped in PJSIP_INV_STATE_CONNECTING

Open maurojones opened this issue 4 years ago • 1 comments

I receive the call, display the call but I can't finish the connecting and answer the call:

My code:

  endpoint.on("call_received", (call) => {
    console.info('call_received', _myCall);
    if (_myCall != null) {
      declineCall(call) // Decline call when more that one calls are ringing
    }
    _myCall = call;
    _myId = uuid.v1();
    RNCallKeep.displayIncomingCall(_myId, call.getRemoteFormattedNumber(), 'Portaria');
  })

  endpoint.on("call_changed", (call) => {
    console.info('call_changed', call.getState());
  })

  endpoint.on("call_terminated", (call) => {
    activeCall = null;
    RNCallKeep.endCall(_myId);
    _myId = '';
    console.info('call_terminated');
  })

  RNCallKeep.addEventListener('answerCall', () => {
    endpoint.answerCall(_myCall)
      .then(x => {
        console.info('answerCall Ok', x);
        activeCall = _myCall;
        console.info('start call');
        endpoint.useSpeaker(_myCall);
        RNCallKeep.startCall(_myId, _myCall.getRemoteFormattedNumber());
      })
      .catch(x => console.info('answerCall error', x));
  })

  RNCallKeep.addEventListener('endCall', () => {
    declineCall(_myCall);
  })

My console: INFO call_received null INFO call_changed PJSIP_INV_STATE_INCOMING INFO call_changed PJSIP_INV_STATE_CONNECTING INFO answerCall Ok true INFO start call

How I made de call CONNECTING ???

maurojones avatar Jul 12 '21 16:07 maurojones

for me it was the issue with codes please try:

endpoint.changeCodecSettings({ 'G722/16000/1': 0, 'G7221/16000/1': 0, 'G7221/32000/1': 0, 'GSM/8000/1': 80, 'PCMA/8000/1': 100, 'PCMU/8000/1': 120, 'iLBC/8000/1': 0, 'opus/48000/2': 0, 'speex/16000/1': 0, 'speex/32000/1': 0, 'speex/8000/1': 0, })

Also check if you don't have issue with libsrtp if so please take a look at the podfile and get rid of (if possible) openssl. (pjsip has conflict with openssl 1.1.0 and it need to be compiled in the other way to support both openssl and libsrtp)

m4r00p avatar Sep 02 '21 18:09 m4r00p