Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I connect to a network that doesn't have WAN access. If PIJSIP performs domain name login, it will be blocked in the DNS resolution function getaddrinfo. This will last about 40 seconds. During the blocking period, calls between IP and IP cannot be received, and calls cannot be made. #3952

Closed
zhuangguangkang0013 opened this issue May 10, 2024 · 2 comments

Comments

@zhuangguangkang0013
Copy link

Describe the bug

I'm using PJSIP on android 8.1, for IP to IP calls. At the same time, the server account will be logged in to make remote calls. When I connect to a network that doesn't have WAN access. If PIJSIP performs domain name login, it will be blocked in the DNS resolution function getaddrinfo. This will last about 40 seconds. During the blocking period, IP-to-IP calls cannot be received and calls cannot be made. How can I circumvent this issue. It may appear that the network successfully logged in to the server account at the beginning. Then the router is disconnected and pjsip will automatically reconnect at this time. thus causing this problem.

Steps to reproduce

I'm using PJSIP on android 8.1, for IP to IP calls. At the same time, the server account will be logged in to make remote calls. When I connect to a network that doesn't have WAN access. If PIJSIP performs domain name login, it will be blocked in the DNS resolution function getaddrinfo. It may also appear that the network logs in to the server account successfully at the beginning. Then the router is disconnected and pjsip will automatically reconnect at this time. thus causing this problem.

PJSIP version

2.12

Context

android os 8.1,

Log, call stack, etc

2024-05-10 21:52:06~2024-05-10 21:52:46.Automatic re-login to the domain name server is completely blocked when there is no network. Unable to accept any calls/rings from IP within 40 seconds.

2024-05-10 21:52:06.314  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:06.312    pjsua_acc.c  2acc->contact: <sip:6002@10.0.0.100:5060;ob>
2024-05-10 21:52:06.318  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:06.315    pjsua_acc.c  Acc 1: setting registration..
2024-05-10 21:52:06.328  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:06.326       endpoint  .Request msg REGISTER/cseq=21442 (tdta0xd47f2064) created.
2024-05-10 21:52:06.337  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:06.335  tsx0xd67ef864  ..Transaction created for Request msg REGISTER/cseq=21443 (tdta0xd47f2064)
2024-05-10 21:52:06.340  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:06.337  tsx0xd67ef864  .Sending Request msg REGISTER/cseq=21443 (tdta0xd47f2064) in state Null
2024-05-10 21:52:06.343  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:06.340  sip_resolve.c  ..DNS resolver not available, target 'open.xx.icloudx.com:5060' type=UDP will be resolved with getaddrinfo()
2024-05-10 21:52:06.346  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:06.343 addr_resolv_so  ..DNS resolver pj_getaddrinfo
2024-05-10 21:52:06.349  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:06.346 addr_resolv_so  ..DNS resolver pj_getaddrinfo1
2024-05-10 21:52:46.375  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:46.372 addr_resolv_so  ..DNS resolver pj_getaddrinfo2
2024-05-10 21:52:46.379  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:46.376  sip_resolve.c  ..DNS resolver pj_getaddrinfo3
2024-05-10 21:52:46.383  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:46.380  sip_resolve.c  ..Failed to resolve 'open.xx.icloudx.com': gethostbyname() has returned error (PJ_ERESOLVE)
2024-05-10 21:52:46.387  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:46.384  tsx0xd67ef864  ..Failed to send Request msg REGISTER/cseq=21443 (tdta0xd47f2064)! err=70018 (gethostbyname() has returned error (PJ_ERESOLVE))
2024-05-10 21:52:46.391  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:46.388  tsx0xd67ef864  ..State changed from Null to Terminated, event=TRANSPORT_ERROR
2024-05-10 21:52:46.394  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:46.392    pjsua_acc.c  ....2contact_rewritten:0,rewrite_method:6,code:502
2024-05-10 21:52:46.398  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:46.395    pjsua_acc.c  ....SIP registration failed, status=502 (gethostbyname() has returned error (PJ_ERESOLVE))
2024-05-10 21:52:46.402  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:46.399    pjsua_acc.c  ....Scheduling re-registration retry for acc 1 in 298 seconds..
2024-05-10 21:52:46.411  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:46.409      sip_reg.c  .Error sending request: gethostbyname() has returned error (PJ_ERESOLVE)
2024-05-10 21:52:46.416  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:46.413    pjsua_acc.c  Scheduling re-registration retry for acc 1 in 295 seconds..
2024-05-10 21:52:46.429  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:46.427  tsx0xd67ef864  Timeout timer event
2024-05-10 21:52:46.431  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:46.429  tsx0xd67ef864  .State changed from Terminated to Destroyed, event=TIMER
2024-05-10 21:52:46.433  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:46.431 tdta0xd47f2064  ..Destroying txdata Request msg REGISTER/cseq=21443 (tdta0xd47f2064)
2024-05-10 21:52:46.435  6156-6184  pjsip-pjsua_0           com.gvs.pjsip                        D  21:52:46.434  tsx0xd67ef864  Transaction destroyed!
@trengginas
Copy link
Member

getaddrinfo() is a blocking API call, it is controlled by the OS. Alternatively, you can provide a nameserver or do the resolving on the app side and use the IP address.

@zhuangguangkang0013
Copy link
Author

getaddrinfo() is a blocking API call, it is controlled by the OS. Alternatively, you can provide a nameserver or do the resolving on the app side and use the IP address.

yes. i try set dns server ip address .It works fine now.thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants