datso / react-native-pjsip

A PJSIP module for React Native.
http://datso.github.io/react-native-pjsip
GNU General Public License v3.0
273 stars 229 forks source link

SIP Calling doesn't working makeCall function. #181

Open kiritm-nimblechapps opened 5 years ago

kiritm-nimblechapps commented 5 years ago

Hi.

I have integrate the SIP Calling in my App. I have valid username, password and domain. By use of them successfully create an account. After creating account I Call the function of makeCall to pass account and destination. For destination I have passing phone number or SIP address.

According to document I have integrate and makeCall() but call is not connect to the destination.

iOS Version : 11.2

Please help me what is mistake.

Response of MakeCall

{ _id: 0,
  _callId: 'dX293S3YYb0es9tSAW8.3D4XfXmv9fVE',
  _accountId: 0,
  _localContact: '<sip:0662505070@27.109.11.102:41487;ob>',
  _localUri: 'John1 <sip:0662505070@131.191.161.131>',
  _remoteContact: '',
  _remoteUri: 'sip:9974569875@131.191.161.131',
  _state: 'PJSIP_INV_STATE_CALLING',
  _stateText: 'CALLING',
  _held: false,
  _muted: false,
  _speaker: false,
  _connectDuration: -1,
  _totalDuration: 0,
  _remoteOfferer: 0,
  _remoteAudioCount: 0,
  _remoteVideoCount: 0,
  _remoteNumber: '9974569875',
  _remoteName: null,
  _audioCount: 1,
  _videoCount: 1,
  _lastStatusCode: null,
  _lastReason: '',
  _media: [],
  _provisionalMedia: 
   [ { audioStream: { confSlot: -1 },
       type: 'PJMEDIA_TYPE_AUDIO',
       videoStream: { captureDevice: 0, windowId: -1 },
       status: 'PJSUA_CALL_MEDIA_NONE',
       dir: 'PJMEDIA_DIR_NONE' },
     { audioStream: { confSlot: -1 },
       type: 'PJMEDIA_TYPE_VIDEO',
       videoStream: { captureDevice: -3, windowId: -1 },
       status: 'PJSUA_CALL_MEDIA_NONE',
       dir: 'PJMEDIA_DIR_NONE' } ],
  _constructionTime: 1558013296 }

Thanks.

yunhanxia commented 5 years ago

I think you forgot to add the port, your destination should be look like this "sip:0662505070@131.191.161.131:5161"

kiritm-nimblechapps commented 5 years ago

I think you forgot to add the port, your destination should be look like this "sip:0662505070@131.191.161.131:5161"

I have added port inside domain like you say, I got message "Invalid Domain". I think domain is right because account is successfully created use of the domain.

ofito commented 5 years ago

I think you forgot to add the port, your destination should be look like this "sip:0662505070@131.191.161.131:5161"

I have added port inside domain like you say, I got message "Invalid Domain". I think domain is right because account is successfully created use of the domain.

Hi!, I have the same problem, after a few second from 'PJSIP_INV_STATE_CALLING' there is Timeout Request, I tried in real device with 4g network and it's working as I want, my problem only happens when I'm connected to a Wifi network, I don't know if there is some problem with my ports or something.

ekremanli commented 5 years ago

Please write PjSipLogWriter results.

vietmobilefolk commented 4 years ago

I think you forgot to add the port, your destination should be look like this "sip:0662505070@131.191.161.131:5161"

I have added port inside domain like you say, I got message "Invalid Domain". I think domain is right because account is successfully created use of the domain.

Hi!, I have the same problem, after a few second from 'PJSIP_INV_STATE_CALLING' there is Timeout Request, I tried in real device with 4g network and it's working as I want, my problem only happens when I'm connected to a Wifi network, I don't know if there is some problem with my ports or something.

Did you resolve your issue, I faced the same today.

DrSchmurge commented 4 years ago

I think you forgot to add the port, your destination should be look like this "sip:0662505070@131.191.161.131:5161"

I have added port inside domain like you say, I got message "Invalid Domain". I think domain is right because account is successfully created use of the domain.

Hi!, I have the same problem, after a few second from 'PJSIP_INV_STATE_CALLING' there is Timeout Request, I tried in real device with 4g network and it's working as I want, my problem only happens when I'm connected to a Wifi network, I don't know if there is some problem with my ports or something.

Hi, I had an issue when makeCall partially works,depending on different network types (NAT or no NAT , and different MTU size). I changed the codecs like this:

await 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});

It worked for me