Asterisk Log File: Unable to Lookup SIP Provider URL

Our SIP trunk provider is Twilio. We have configured in Twilio the trunk “Termination Sip Uri” as “alliancemaintenance.pstn.twilio. com”, and that is what is entered in the FreePBX → Trunk → sip Settings → Outgoing → PEER Details:

host=alliancemaintenance.pstn.twilio. com
type=peer
dtmfmode=rfc2833
disallow=all
allow=ulaw

As far as I can tell, the URL resolves to Twilio’s IPs properly in DNS. I check it using MXToolBox DNS Lookup.

We have periods where we can’t call out, and I’m thinking it might be related to these messages in the Asterisk Log File:

[2019-01-30 15:02:08] ERROR[11964] netsock2.c: getaddrinfo("alliancemaintenance.pstn.twilio. com", "(null)", ...): Name or service not known
[2019-01-30 15:02:08] WARNING[11964] acl.c: Unable to lookup 'alliancemaintenance.pstn.twilio. com'
[2019-01-30 15:07:08] ERROR[11964] netsock2.c: getaddrinfo("alliancemaintenance.pstn.twilio. com", "(null)", ...): Name or service not known
[2019-01-30 15:07:08] WARNING[11964] acl.c: Unable to lookup 'alliancemaintenance.pstn.twilio. com'
[2019-01-30 15:12:08] ERROR[11964] netsock2.c: getaddrinfo("alliancemaintenance.pstn.twilio. com", "(null)", ...): Name or service not known
[2019-01-30 15:12:08] WARNING[11964] acl.c: Unable to lookup 'alliancemaintenance.pstn.twilio. com'

These two messages will repeat every five minutes, and continue for 20 or so minutes, sometimes up to a few hours (with no other log activity mixed in).

Note: since I’m a new user, the Forum doesn’t allow me to post “links”. So each time dot-com is used in this message, I have put a space in front of the dot-com so the Forum doesn’t consider it a link.

Does anyone have any insight into this issue? Thanks.


In case it is helpful, here is a larger section of the log with the log lines before and after the period in question:

[2019-01-30 13:59:00] VERBOSE[25490][C-000001c5] pbx.c: Executing [s@crm-hangup:7] AGI("SIP/Twilio1-000003ba", "sangomacrm.agi") in new stack
[2019-01-30 13:59:00] VERBOSE[25490][C-000001c5] res_agi.c: Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
[2019-01-30 13:59:01] VERBOSE[25490][C-000001c5] res_agi.c: <SIP/Twilio1-000003ba>AGI Script sangomacrm.agi completed, returning 0
[2019-01-30 13:59:01] VERBOSE[25490][C-000001c5] pbx.c: Executing [s@crm-hangup:8] Return("SIP/Twilio1-000003ba", "") in new stack
[2019-01-30 13:59:01] VERBOSE[25490][C-000001c5] app_stack.c: Spawn extension (ext-group, h, 1) exited non-zero on 'SIP/Twilio1-000003ba'
[2019-01-30 13:59:01] VERBOSE[25490][C-000001c5] app_stack.c: SIP/Twilio1-000003ba Internal Gosub(crm-hangup,s,1) complete GOSUB_RETVAL=
[2019-01-30 15:02:08] ERROR[11964] netsock2.c: getaddrinfo("alliancemaintenance.pstn.twilio. com", "(null)", ...): Name or service not known
[2019-01-30 15:02:08] WARNING[11964] acl.c: Unable to lookup 'alliancemaintenance.pstn.twilio. com'
[2019-01-30 15:07:08] ERROR[11964] netsock2.c: getaddrinfo("alliancemaintenance.pstn.twilio. com", "(null)", ...): Name or service not known
[2019-01-30 15:07:08] WARNING[11964] acl.c: Unable to lookup 'alliancemaintenance.pstn.twilio. com'
[2019-01-30 15:12:08] ERROR[11964] netsock2.c: getaddrinfo("alliancemaintenance.pstn.twilio. com", "(null)", ...): Name or service not known
[2019-01-30 15:12:08] WARNING[11964] acl.c: Unable to lookup 'alliancemaintenance.pstn.twilio. com'
[2019-01-30 15:17:08] ERROR[11964] netsock2.c: getaddrinfo("alliancemaintenance.pstn.twilio. com", "(null)", ...): Name or service not known
[2019-01-30 15:17:08] WARNING[11964] acl.c: Unable to lookup 'alliancemaintenance.pstn.twilio. com'
[2019-01-30 15:22:08] ERROR[11964] netsock2.c: getaddrinfo("alliancemaintenance.pstn.twilio. com", "(null)", ...): Name or service not known
[2019-01-30 15:22:08] WARNING[11964] acl.c: Unable to lookup 'alliancemaintenance.pstn.twilio. com'
[2019-01-30 15:27:08] ERROR[11964] netsock2.c: getaddrinfo("alliancemaintenance.pstn.twilio. com", "(null)", ...): Name or service not known
[2019-01-30 15:27:08] WARNING[11964] acl.c: Unable to lookup 'alliancemaintenance.pstn.twilio. com'
[2019-01-30 15:29:09] VERBOSE[12031][C-000001c6] netsock2.c: Using SIP RTP TOS bits 184
[2019-01-30 15:29:09] VERBOSE[12031][C-000001c6] netsock2.c: Using SIP RTP CoS mark 5
[2019-01-30 15:29:09] VERBOSE[40851][C-000001c6] pbx.c: Executing [+18008508610@from-trunk:1] NoOp("SIP/Twilio0-000003bc", "Catch-All DID Match - Found +18008508610 - You probably want a DID for this.") in new stack
[2019-01-30 15:29:09] VERBOSE[40851][C-000001c6] pbx.c: Executing [+18008508610@from-trunk:2] Log("SIP/Twilio0-000003bc", "WARNING,Friendly Scanner from 54.172.60.0") in new stack
[2019-01-30 15:29:09] WARNING[40851][C-000001c6] Ext. +18008508610: Friendly Scanner from 54.172.60.0
[2019-01-30 15:29:09] VERBOSE[40851][C-000001c6] pbx.c: Executing [+18008508610@from-trunk:3] Set("SIP/Twilio0-000003bc", "__FROM_DID=+18008508610") in new stack
[2019-01-30 15:29:09] VERBOSE[40851][C-000001c6] pbx.c: Executing [+18008508610@from-trunk:4] Goto("SIP/Twilio0-000003bc", "ext-did,s,1") in new stack
[2019-01-30 15:29:09] VERBOSE[40851][C-000001c6] pbx_builtins.c: Goto (ext-did,s,1)
[2019-01-30 15:29:09] VERBOSE[40851][C-000001c6] pbx.c: Executing [s@ext-did:1] Set("SIP/Twilio0-000003bc", "__DIRECTION=INBOUND") in new stack

You do see the space, right?

Also, Twilio’s current documentation states to use Asterisk 15 and PJSIP trunks.
This page: https://www.twilio.com/docs/sip-trunking/sample-configuration
Has this link for FreePBX: https://www.twilio.com/docs/documents/53/TwilioElasticSIPTrunking-FreePBX-Configuration-Guide-Version1-0-FINAL-06122018.pdf

Yeah when you google, the first hit is some post from 2016…
image

But the PDF linked above is dated June 12, or December 6, of 2018. depending on how they formatted the date…

Hi Dave Burgess.

Yes. This statement is in the original post:

The forum literally would not let me post without making those lines not look like links.

Thanks for any additional insight you might have.

The reason for not being able to resolve the name in the log file could well be that your have no (or incorrect) DNS servers configured on your system. Go into Admin/System Admin and if you can see “DNS” on the right hand side look at the DNS server list and make sure there is at least one valid DNS server address in their (if not try using Google DNS: 8.8.8.8 & 8.8.4.4 - on separate lines).

You can also check in the file /etc/resolve.conf. That should have some lines that should look something like:

nameserver 8.8.8.8
nameserver 8.8.4.4

Checked the DNS list in FreePBX. The only one listed was the gateway’s IP for that network/subnet. I have updated the list to Google’s DNS servers as you suggested.

Thanks, I’ll report back if that solves the issue.

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