DNS Resolution failed in ARI outbound call

Hi there,
I’m using asterisk v18.8.0 on centos OS with PJSIP channel driver.

I am making outbound call using ARI and getting following error in pjsip debug logs and call is not getting connected.

[Sep 12 16:41:10] DEBUG[13948] res_pjsip/pjsip_resolver.c: Performing SIP DNS resolution of target ‘SIP.DOMAIN.XYZ’
[Sep 12 16:41:10] DEBUG[13948] res_pjsip/pjsip_resolver.c: Transport type for target ‘SIP.DOMAIN.XYZ’ is ‘UDP transport’
[Sep 12 16:41:10] DEBUG[13948] res_pjsip/pjsip_resolver.c: [0x7f44bf204b68] Created resolution tracking for target ‘SIP.DOMAIN.XYZ’
[Sep 12 16:41:10] DEBUG[13948] res_pjsip/pjsip_resolver.c: [0x7f44bf204b68] Added target ‘SIP.DOMAIN.XYZ’ with record type ‘1’, transport ‘UDP transport’, and port ‘5060’
[Sep 12 16:41:10] DEBUG[13948] res_pjsip/pjsip_resolver.c: [0x7f44bf204b68] Starting initial resolution using parallel queries for target ‘SIP.DOMAIN.XYZ’
[Sep 12 16:41:10] DEBUG[13948] res_pjsip_session.c: PJSIP/devtest-00001ba7 TSX State: Calling Inv State: CONFIRMED
[Sep 12 16:41:10] DEBUG[13948] res_pjsip_session.c: Function session_inv_on_tsx_state_changed called on event TSX_STATE
[Sep 12 16:41:10] DEBUG[13948] res_pjsip_session.c: The state change pertains to the endpoint ‘devtest(PJSIP/devtest-00001ba7)’
[Sep 12 16:41:10] DEBUG[13948] res_pjsip_session.c: The inv session does NOT have an invite_tsx
[Sep 12 16:41:10] DEBUG[13948] res_pjsip_session.c: The UAC BYE transaction involved in this state change is 0x7f44bebb1e38
[Sep 12 16:41:10] DEBUG[13948] res_pjsip_session.c: The current transaction state is Calling
[Sep 12 16:41:10] DEBUG[13948] res_pjsip_session.c: The transaction state change event is TX_MSG
[Sep 12 16:41:10] DEBUG[13948] res_pjsip_session.c: The current inv state is CONFIRMED
[Sep 12 16:41:10] DEBUG[13948] res_pjsip_session.c: Nothing delayed
[Sep 12 16:41:10] DEBUG[13948] res_pjsip_session.c: PJSIP/devtest-00001ba7 TSX State: Calling Inv State: CONFIRMED
[Sep 12 16:41:10] DEBUG[13948] res_pjsip_session.c: Topology: Pending: (null topology) Active: (null topology)
[Sep 12 16:41:10] DEBUG[13948] res_pjsip_session.c:
[Sep 12 16:41:10] DEBUG[13948] res_pjsip_session.c:
[Sep 12 16:41:10] DEBUG[13948] channel.c: Channel 0x7f43f09b0320 ‘PJSIP/devtest-00001ba7’ destroying
[Sep 12 16:41:10] DEBUG[13936] dns.c: DNS search failed for SIP.DOMAIN.XYZ

This domain (SIP.DOMAIN.XYZ) is defined in /etc/hosts file. Tried restarting system, asterisk, updating configurations but not working. I got some srv related stuff but I’m not able to understand it completely.

Please guide me to resolve this issue.

Hi team,
any update regarding this please.

The forum is not a support ticket system, and there is no support team. People respond if and when they want to.

what result when you ping SIP.DOMAIN.XYZ ?

I got response back in less than 1ms for ping to the domain.

Update regarding this issue:
Few hours back after hours of debugging, I am finally able to fix this issue.
What I found was that by default asterisk (at least v18.8.0 what I’m using) doesn’t prefer /etc/hosts file for DNS resolution. It primarily relies on DNS server defined in /etc/resolv.conf file and in my case since internet connectivity is not there on server so asterisk was unable to resolve the IP address of domain and was not working as expected and causing failed acknowledgement responses.
So, I spin up local DNS server using dnsmasq and add mapping for my domains and it worked

2 Likes

Great post back, this will hopefully help someone else with a similar issue.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.