Internal SIP does not work when internet goes out

Hi all,

I have a strange issue with my Asterisk 1.6.0.2 and FreePBX setup.
Asterisk has both a SIP account and an ISDN chan_dahdi connection to the outside world. The trunks support failover.

However, I have a very strange issue. If the internet goes down, all of a sudden I cannot reach any of the internal sip phones anymore. All SCCP phones are still online. I can see in the logs that while the internet is down. Here is an extract from the log when internet went down:

[Aug 10 11:01:40] WARNING[3956] acl.c: Unable to lookup 'sipconnect.sipgate.de'
[Aug 10 11:02:14] NOTICE[3956] chan_sip.c:    -- Registration for '[email protected]' timed out, trying again (Attempt #1)
[Aug 10 11:02:34] WARNING[3956] acl.c: Unable to lookup 'sipconnect.sipgate.de'
[Aug 10 11:02:54] NOTICE[3956] chan_sip.c: Peer 'yy' is now UNREACHABLE!  Last qualify: 74
[Aug 10 11:02:54] NOTICE[3956] chan_sip.c: Peer 'zz' is now UNREACHABLE!  Last qualify: 72
[Aug 10 11:02:54] NOTICE[3956] chan_sip.c: Peer 'aa' is now UNREACHABLE!  Last qualify: 17

So, first it complains that it is unable to lookup sipgate.de. This is understood and fine. No problems. It will keep trying to connect to it.
But why do the Peers go offline? I can ping them from the asterisk server without issues.

Many thanks.

This is a known problem that goes back many years.
The problem is in the DNS lookup code for the sip stack.

To make a long story short, some people have limited success by using a local caching dns server. Personally, I found that didn’t help for more than 15 minutes.

The only thing that totally prevents the problem for me is to remove all DNS names from your sip registrations. Hard code the IP addresses of your sip providers.

Ugly, but that will keep your remaining channels alive.

I have no issues hard-coding the IP addresses on the SIP registrations. I doubt they change very often anyway. Other than the reg string, do I need to change any of the other FQN?

I really do wish they would fix that though.

Or could I just put in an entry in /etc/hosts?

Yes, the hosts file works. I’ve done that.