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 233 forks source link

Cannot add an account based in IPV6 environment. #51

Closed imakou closed 6 years ago

imakou commented 6 years ago

Hi, Everything works fine in IPV4 but in the IPV6 environment. I cannot even add an account to this situation. Could someone give me an idea of the troubleshooting? Should I modify my sip server or my RN code? Btw, thanks for this awesome lib.

There is the message from the console:

13:37:50.184    pjsua_acc.c  Adding account: id=allen <sip:213@sip.myserver.com>
13:37:50.185    pjsua_acc.c  .Account allen <sip:213@sip.myserver.com> added with id 0
13:37:50.185    pjsua_acc.c  .Acc 0: setting registration..
13:37:50.185 sip_transport.  ..Warning: unable to determine local interface, fallback to default interface!
13:37:50.185       endpoint  ..Request msg REGISTER/cseq=40591 (tdta0x134821200) created.
13:37:50.186 sip_transport.  ..Warning: unable to determine local interface, fallback to default interface!
13:37:50.186 tsx0x1348026a8  ...Transaction created for Request msg REGISTER/cseq=40592 (tdta0x134821200)
13:37:50.186 tsx0x1348026a8  ..Sending Request msg REGISTER/cseq=40592 (tdta0x134821200) in state Null
13:37:50.186  sip_resolve.c  ...DNS resolver not available, target 'sip.myserver.com:0' type=TCP will be resolved with getaddrinfo()
13:37:50.189  sip_resolve.c  ...Failed to resolve 'sip.myserver.com'. Err=70018 (gethostbyname() has returned error (PJ_ERESOLVE))
13:37:50.189 tsx0x1348026a8  ...Failed to send Request msg REGISTER/cseq=40592 (tdta0x134821200)! err=70018 (gethostbyname() has returned error (PJ_ERESOLVE))
13:37:50.189 tsx0x1348026a8  ...State changed from Null to Terminated, event=TRANSPORT_ERROR
13:37:50.189    pjsua_acc.c  .....SIP registration failed, status=502 (gethostbyname() has returned error (PJ_ERESOLVE))
13:37:50.189    pjsua_acc.c  .....Scheduling re-registration retry for acc 0 in 0 seconds..
13:37:50.189      sip_reg.c  ..Error sending request, status=70018
13:37:50.189    pjsua_acc.c  ..Unable to create/send REGISTER: gethostbyname() has returned error (PJ_ERESOLVE) [status=70018]
13:37:50.199 tsx0x1348026a8 !Timeout timer event
13:37:50.199 tsx0x1348026a8  .State changed from Terminated to Destroyed, event=TIMER
13:37:50.199 tdta0x13482120  ..Destroying txdata Request msg REGISTER/cseq=40592 (tdta0x134821200)
13:37:50.199 tsx0x1348026a8  Transaction destroyed!
13:37:50.957    pjsua_acc.c  Acc 0: setting registration..
13:37:50.958 sip_transport.  .Warning: unable to determine local interface, fallback to default interface!
13:37:50.959       endpoint  .Request msg REGISTER/cseq=58356 (tdta0x13682bc00) created.
13:37:50.959 sip_transport.  .Warning: unable to determine local interface, fallback to default interface!
13:37:50.959 tsx0x1368288a8  ..Transaction created for Request msg REGISTER/cseq=58357 (tdta0x13682bc00)
13:37:50.960 tsx0x1368288a8  .Sending Request msg REGISTER/cseq=58357 (tdta0x13682bc00) in state Null
13:37:50.960  sip_resolve.c  ..DNS resolver not available, target 'sip.myserver.com:0' type=TCP will be resolved with getaddrinfo()
13:37:50.963  sip_resolve.c  ..Failed to resolve 'sip.myserver.com'. Err=70018 (gethostbyname() has returned error (PJ_ERESOLVE))
13:37:50.963 tsx0x1368288a8  ..Failed to send Request msg REGISTER/cseq=58357 (tdta0x13682bc00)! err=70018 (gethostbyname() has returned error (PJ_ERESOLVE))
13:37:50.963 tsx0x1368288a8  ..State changed from Null to Terminated, event=TRANSPORT_ERROR
13:37:50.963    pjsua_acc.c  ....SIP registration failed, status=502 (gethostbyname() has returned error (PJ_ERESOLVE))
13:37:50.963    pjsua_acc.c  ....Scheduling re-registration retry for acc 0 in 292 seconds..
13:37:50.964      sip_reg.c  .Error sending request, status=70018
13:37:50.964    pjsua_acc.c  .Unable to create/send REGISTER: gethostbyname() has returned error (PJ_ERESOLVE) [status=70018]
13:37:50.964    pjsua_acc.c  Scheduling re-registration retry for acc 0 in 300 seconds..
13:37:50.972 tsx0x1368288a8  Timeout timer event
13:37:50.972 tsx0x1368288a8  .State changed from Terminated to Destroyed, event=TIMER
13:37:50.972 tdta0x13682bc0  ..Destroying txdata Request msg REGISTER/cseq=58357 (tdta0x13682bc00)
13:37:50.972 tsx0x1368288a8  Transaction destroyed!
imakou commented 6 years ago

I found some reference below which explains some settings I can try. But, I struggle with compiling newer Vialer-pjsip-iOS to replace VialerPJSIP.framework in react-native-pjsip. It seems that it's not easy by just replacing a new VialerPJSIP.framework.

Can someone advise? Thanks.

https://trac.pjsip.org/repos/wiki/IPv6#NAT64

imakou commented 6 years ago

Is it possible to change some IPV6 settings in files where is in VialerPJSIP.framework then compile again to make new settings for IPV6 to be effective??

Thanks.

datso commented 6 years ago

@imakou If ipv6 is very important to you, I suggest you to start with android. Just clone the repo https://github.com/datso/react-native-pjsip-builder that able to build Android version in Docker, and modify config you want :)

datso commented 6 years ago

Closed due to inactivity :) Please re-open the ticket with steps and env how it could be reproduced.