No Internet - Asterisk Grinds to a Halt

I think it is fairly well known that if a system loses internet that asterisk grinds to a halt trying to resolve URLs for SIP Trunks. Is this just with a certain version of asterisk or all versions? Is the best option to replace URL in SIP Trunk with IP?

We had a school system using SIP and POTS lines for backup in case of emergency. Internet was lost so Asterisk stopped and the phones at that point couldn’t reach the system or use the POTS lines.

Besides the conversion of URL to IP in the SIP Trunks is there anyway to keep this from happening?

It’s a “feature” of Chan-SIP. In addition to the DNS issue, Chan-SIP will not work in this scenario.

One thing to try is establishing a caching DNS in your local network and using that “local” nameserver on your PBX (in addition to the “best practice” of 127.0.0.1 and 8.8.8.8). This way, common DNS addresses will be available in the event of a total Internet failure. Note that the caching DNS can be on the local PBX box or it can be a “more stand-alone” service on another service in the network.

One other problem you are going to run into is that the resolution of those addresses is still going to try to route calls out through the SIP ports, which is (after all) what the system was designed to do. Depending on the outage duration, this can also affect your system’s performance.

1 Like

That is a bad feature for Chan-SIP for sure. I feel though that the phones can still talk to the server even if internet is down as long as I don’t have the system trying to resolve any name addresses. I like the idea of a separate internal DNS server as well. Does this continue to be an issue even in the latest version of Asterisk?

Using IP adresses everywhere instead of URLs fixed this for me.

1 Like

Yeah the DNS resolution problem will still be an issue unless you have a “last resort” service (like an on-server cache or a local DNS). You need the requests to terminate one way or another, instead of just “hanging” for 30 seconds while the external connection fails.

As @chrischevy pointed out, using IP addresses instead of names (which works well in Chan-SIP but has the potential to go sideways on PJ-SIP) is a reasonable solution as well.

1 Like

Or just use PJSIP. Which doesn’t have this problem.

Yeah part of the reason Chan_SIP was deprecated in Aug 2014 and replaced with PJSIP as the main SIP driver for Asterisk. Chan_SIP is basically dead, it will most likely be “no-load” in Asterisk 17 (which means it installs but isn’t loaded for actual use like other modules) and probably completely gone in the next couple versions.

Working with Chan_SIP on new installs is not the best option these days. It’s just not supported and hasn’t been touched by Digium in 4 years.

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