Asterisk drops all extensions if Internet connection drops

I have a system running Asterisk 1.2.10 behind a D-Link DGL-4300. The Asterisk box works fine, but if my Internet connectivity goes down it drops even my internal phones registrations. It seems as if the Asterisk box was ignoring them. When the Internet comes back, as if by magic all my extensions are able to register.

Just recently, I replaced my DGL-4300 with a PfSense Firewall and the behavior is the same. Also, I used the “localnet and externip” parameters and they worked fine with the DGL-4300 all the time but with PfSense router I get all sorts of issues (one way audio, no incoming calls, etc…). I need this settings because I have SIP phones outside of my network.

Any help would be appreciated.

it’s a well known issue that gets raised sometimes, but i don’t remember what was ever done.

does the problem go away if you use an IP address rather than a FQDN for your registrations ?

this same issue is causing me all sorts of problems. i think it’s a DNS issue so have set up a DNS server on the Asterisk machine which is, obviously, the primary DNS for the Asterisk box (itself). i just tested by unplugging the internet connection and Asterisk kept working, so this might be a part of the solution. (i only tested for 30 seconds, maybe Asterisk would have died after a longer period.)


IIRC it’s a problem that actually stops SIP registrations. if your phones only re-register once an hour, then it might take up to an hour for you to see the problem.

i just can’t remember whether an IP address rather than a hostname is a workaround. bad news if your provider moves your proxy or registrar.

Well, I use static IP addresses on all my extensions. Is this issue affecting all versions of Asterisk? I have a friend that is running an SVN Trunk (higher than 1.12.10) and he does not seem to have this problem. I wonder if upgrading to a later version, say 1.2.13 would solve the problem.

Also, what can you say about the “localnet and extenip” settings that I had.
I had to take them out because they don’t work with my new router.
What do you suggest?


What do you mean by they didnt work with your new router. Is it a dynamic IP issue ?

When I use externip and localnet in Asterisk, it does not work.
The setting used to work when I had my DGL-4300 in front. But, since I replaced the DGL-4300 with my PfSense firewall, this trick does not work anymore. Some of my providers reject my registration.

Also, if my Internet connectivity fails (i.e. I turn off/reboot my firewall), Asterisk does not allow my extensions to register.


Try adding the following settings, The problem is your external sip peers are trying to register.

[quote]# registerattempts = Number : Number of SIP REGISTER messages to send to a SIP Registrar before giving up. Default 0 (no limit). (New in v1.2.x).

registertimeout = Number : Number of seconds to wait for a response from a SIP Registrar before classifying the SIP REGISTER has timed out. Default 20 seconds. (New in v1.2.x). [/quote]

Also its worth adding the peers to your hosts file incase of DNS problems

The answer to this problem is here: … 53&forum=2

You must remove all CNAMEs from sip.conf and iax.conf and use IP addresses. Especially in the the ‘register => xx’ section.

Digium has recognized that Asterisk’s DNS system is inadequate.