Today I had a brief power outage which caused the Asterisk server and DSL modem to reboot. The Asterisk server came up before the internet connection was working, so it failed when try to look up some of the hosts for my outbound voip providers in sip.conf. Asterisk never recovered from that, i.e. it never retried so those providers were unavailable. The only provider that was still available was one that I had entered the IP address for, rather than the host name. Have any of you run into this issue, and if so, how have you solved it? It seems that since Asterisk periodically tries to reregister it should also retry the DNS lookup at the same time, rather than never trying again if the lookup fails. This would indicate that Asterisk would also fail if the voip provider changed the IP address of its server because Asterisk would never see the new IP address. Here are some workarounds I thought of, but none of them are particularly good: 1) Get a UPS so my machines won't reboot when the power fails. This actually might not solve anything, because I'm connected to a remote DSLAM in my neighborhood that I believe does not have backup power, so it won't work when the power is out. But perhaps Asterisk is more robust after it has booted (I'll have to test this). 2) Change all host names in sip.conf to IP addresses. This is kind of ugly and also will break when a voip provider changes their IP address. There is a reason for DNS! 3) Have a cron job send asterisk periodic "sip reload" commands. 4) Delay the start of asterisk until the internet connection has come up. This could cause me to be without any phones if there is any delay or failure in bringing up the network (I also have zap channels and PSTN lines). 5) A hybrid of ideas 3 and 4 above: Have a startup script that waits for the internet connection to come up, and then sends a "sip reload" command to Asterisk. Any other ideas? John
> > Today I had a brief power outage which caused the Asterisk server and > DSL modem to reboot. The Asterisk server came up before the internet > connection was working, so it failed when try to look up some of the > hosts for my outbound voip providers in sip.conf. > > Asterisk never recovered from that, i.e. it never retried so those > providers were unavailable. The only provider that was still available > was one that I had entered the IP address for, rather than the hostname.><snip> Are you sure that it was Asterisk? Did you try an nslookup after the network came up while Asterisk wasn't working? How long did you leave it before taking matters into your own hands? DNS will do negative caching as well as positive. If sip.sometel.com failed to resolve (because it doesn't exist or because your network wasn't up), your caching dns server or resolver or both may remember this as a 'negative cache' entry, so that it remembers that it doesn't exist. If your asterisk server is responsible for the network connection, then the ifup/pon script should take care of flushing the dns cache for you for exactly this reason. If you have another server or router that is responsible for the connection then the server running asterisk will have no idea that its negative cache is no longer valid. hth James
I have the similar problem but with IAX. I have two servers. First is primary with dynamic IP and open 4569 port. Second is behind firewall. If first server is being disconnected for some time, the second server cannot reconnect. I have to either restart asterisk or stop it, wait for some time and start it again. The same situation is happening when primary server changes IP address. On 8/22/06, John Marvin <jm-asterisk@themarvins.org> wrote:> > Today I had a brief power outage which caused the Asterisk server and > DSL modem to reboot. The Asterisk server came up before the internet > connection was working, so it failed when try to look up some of the > hosts for my outbound voip providers in sip.conf. > > Asterisk never recovered from that, i.e. it never retried so those > providers were unavailable. The only provider that was still available > was one that I had entered the IP address for, rather than the host name. > > Have any of you run into this issue, and if so, how have you solved it? > It seems that since Asterisk periodically tries to reregister it should > also retry the DNS lookup at the same time, rather than never trying > again if the lookup fails. This would indicate that Asterisk would also > fail if the voip provider changed the IP address of its server because > Asterisk would never see the new IP address. > > Here are some workarounds I thought of, but none of them are > particularly good: > > 1) Get a UPS so my machines won't reboot when the power fails. This > actually might not solve anything, because I'm connected to a remote > DSLAM in my neighborhood that I believe does not have backup power, so > it won't work when the power is out. But perhaps Asterisk is more robust > after it has booted (I'll have to test this). > > 2) Change all host names in sip.conf to IP addresses. This is kind of > ugly and also will break when a voip provider changes their IP address. > There is a reason for DNS! > > 3) Have a cron job send asterisk periodic "sip reload" commands. > > 4) Delay the start of asterisk until the internet connection has come > up. This could cause me to be without any phones if there is any delay > or failure in bringing up the network (I also have zap channels and PSTN > lines). > > 5) A hybrid of ideas 3 and 4 above: Have a startup script that waits for > the internet connection to come up, and then sends a "sip reload" > command to Asterisk. > > Any other ideas? > > John > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-- Best regards, Michael Strelnikov -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060821/fd951b09/attachment.htm
John Marvin wrote:> Today I had a brief power outage which caused the Asterisk server and > DSL modem to reboot. The Asterisk server came up before the internet > connection was working, so it failed when try to look up some of the > hosts for my outbound voip providers in sip.conf. > > Asterisk never recovered from that, i.e. it never retried so those > providers were unavailable. The only provider that was still available > was one that I had entered the IP address for, rather than the host name. > > Have any of you run into this issue, and if so, how have you solved it? > It seems that since Asterisk periodically tries to reregister it should > also retry the DNS lookup at the same time, rather than never trying > again if the lookup fails. This would indicate that Asterisk would also > fail if the voip provider changed the IP address of its server because > Asterisk would never see the new IP address. > > Here are some workarounds I thought of, but none of them are > particularly good: > > 1) Get a UPS so my machines won't reboot when the power fails. This > actually might not solve anything, because I'm connected to a remote > DSLAM in my neighborhood that I believe does not have backup power, so > it won't work when the power is out. But perhaps Asterisk is more robust > after it has booted (I'll have to test this). > > 2) Change all host names in sip.conf to IP addresses. This is kind of > ugly and also will break when a voip provider changes their IP address. > There is a reason for DNS! > > 3) Have a cron job send asterisk periodic "sip reload" commands. > > 4) Delay the start of asterisk until the internet connection has come > up. This could cause me to be without any phones if there is any delay > or failure in bringing up the network (I also have zap channels and PSTN > lines). > > 5) A hybrid of ideas 3 and 4 above: Have a startup script that waits for > the internet connection to come up, and then sends a "sip reload" > command to Asterisk. > > Any other ideas?If memory serves correctly, most of the above has been raised as issues in the past and the suggested work around has been to run a dns caching server on the asterisk box. FWIW, I always use IP addresses instead of dns names. But, I don't have to deal with dynamic ip changes of any device either.