DNS name for sip provider is wrong in Asterisk only

We have an issue where one of our SIP providers has changed the IP they would like to receive traffic from us on. Although we hate the idea of using DNS at all on our Asterisk system, this provider prefers that we use their DNS name to send them outbound traffic.

We could send traffic directly to their IP address by replacing the DNS name with IP address in sip.conf but this is not my preference. I would prefer to figure out why, Asterisk is still sending traffic to their old IP address.

When I ping the hostname at the command line in CentOS, I get the correct IP address back but, our provider says we have sent hundreds of calls to them in the last 24 hours to the old IP address.

Does Asterisk need to be restarted in order to do a new DNS lookup and send the traffic to the correct address? It seems to me I have always noticed Asterisk doing DNS lookups at startup time.

Is my only choice to restart Asterisk on our live system and kill all the live calls?

Thanks in advance.

The chan_sip module does not do asynchronous DNS. Hostnames are generally resolved at configuration load time, but enabling dnsmgr (using the dnsmgr.conf) may allow it to re-resolve periodically.

Just issued “sip reload” at the CLI, should I expect that this caused Asterisk to re-resolve the DNS names in sip.conf?

Potentially. You may have to do “touch /etc/asterisk/sip.conf” to have it see that the file has changed, I don’t remember the behavior of chan_sip in that regard.

Did you trace the packets on the wire?

One issue, I face with Asterisk with chan_sip and chan_pjsip: Many providers require that the fromdomain is their domain not the one of the Asterisk server. In other words, have you double-checked that your issue is at the network layer and not on the SIP layer actually?

I solved this by reloading sip.conf and doing the touching the sip.conf file. This was good because it kept me from killing all the live calls with a restart.

All is well now, thanks for the assist.

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