Elastix dies when there is no internet connection

Discussion in 'General' started by userfromca, Jan 7, 2009.

  1. userfromca

    Joined:
    Jun 30, 2007
    Messages:
    30
    Likes Received:
    0
    I have read the thread started by BenS on whirpool forum and all the suggestions of making a fake trunk or installing caching DNS but it does not work for me. Any new fix or work-around? I do not like the idea of using SPA3000 or another local hardware SIP trunk just to circumnavigate this bug.

    http://forums.whirlpool.net.au/forum-re ... 60451.html
     
  2. wiseoldowl

    Joined:
    Aug 19, 2008
    Messages:
    251
    Likes Received:
    0
    I hate to break it to you but it appears that the FreePBX developers are not going to be doing anything on this until at least the next milestone (see http://www.freepbx.org/trac/ticket/3199 and note the comments). Feel free to add your comments to that ticket, but my impression is that this is something that is not a very high priority for them (I may be wrong).

    Basically what's needed is a module that will disable selected SIP trunks when internet connectivity is lost. Maybe such a module could be included in Elastix?
     
  3. gbrook

    Joined:
    Aug 29, 2007
    Messages:
    74
    Likes Received:
    0
    srvlookup=no solved the problem for me

    Cheers
    Garry
     
  4. userfromca

    Joined:
    Jun 30, 2007
    Messages:
    30
    Likes Received:
    0
    The easiest solution so far. I will try this but what would be the downside of using this? Routing issues when VOSP changes IP addresses?
     
  5. wiseoldowl

    Joined:
    Aug 19, 2008
    Messages:
    251
    Likes Received:
    0
    Where are you placing that, in the individual trunk configuration?

    I wonder if it could be placed in one of the custom SIP files and work just as well. If so, you could run a bash or perl script that checks every five minutes to see if you have a working Internet connection (I think I am running something that checks my IP address every five minutes and rewrites sip_nat.conf it it changes, so the two functions could probably be combined). All you'd have to do is add it to the appropriate file, then reload Asterisk. Once your Internet connection was restored you could reverse the process. This would only work if the srvlookup=no could be placed in one of the general files such as sip_nat.conf (only because I'm already rewriting that file) or sip_general_custom.conf (although strangely enough, I find I already have that statement in there, yet it did not seem to have any effect the last time we had an Internet outage).

    It's just weird where this works and where it doesn't. I keep hoping that eventually the FreePBX folks (and in turn, Elastix) will switch from Asterisk to FreeSwitch as the basic engine - I can't imagine the FreeSwitch people would allow this type of stupid bug to continue to exist, whereas the Asterisk developers seem quite content to let a bug like this go unfixed through several major versions. And at the core, this IS an Asterisk problem - the FreePBX folks could write a workaround for it (and I wish they would; they've had to do it for other Asterisk bugs) but the real fault is in Asterisk itself.
     
  6. Reaper

    Joined:
    Jun 16, 2008
    Messages:
    20
    Likes Received:
    0
    Try to setup a local dns server and point elastix to it.
     
  7. wiseoldowl

    Joined:
    Aug 19, 2008
    Messages:
    251
    Likes Received:
    0
    Well, since a local DNS server is not included with Elastix (although that might not be such a bad idea) that's probably not something that most users (including me) would be capable of. However, I *do* have Webmin installed; do you know of any simple DNS servers that can be set up using Webmin?

    By the way, I read a comment in another thread that leads me to think this problem might be fixed in Asterisk 1.6, although until we get that there's no way to know for sure. It seems to me there was another thread in this forum where someone did upgrade both FreePBX and Asterisk. I'd be happy if we could just upgrade FreePBX and not have it mess up the Extensions page in Elastix, as some have reported it does if you try to upgrade.

    EDIT: Added link to the other thread!
     
  8. Reaper

    Joined:
    Jun 16, 2008
    Messages:
    20
    Likes Received:
    0
    Bind or bind9 is pretty simple to setup. Even got a gui for gnome.
     
  9. userfromca

    Joined:
    Jun 30, 2007
    Messages:
    30
    Likes Received:
    0
    I followed following instructions to setup caching DNS server from PIAF forum. But that does not work either.

     
  10. Bob

    Bob

    Joined:
    Nov 4, 2007
    Messages:
    2,400
    Likes Received:
    1
    Very similar in concept to the one above, if you want to look at www.elastixconnection.com. There is a new tutorial on there called DNS Cache for Elastix.

    It is not as complex to setup. However, I do not have failing SIP system to test it with, so any feedback is welcome...

    Regards

    Bob
     
  11. wiseoldowl

    Joined:
    Aug 19, 2008
    Messages:
    251
    Likes Received:
    0
    For those who (like me) found that the icon wasn't clickable, try http://www.elastixconnection.com/index. ... &Itemid=83
     
  12. Bob

    Bob

    Joined:
    Nov 4, 2007
    Messages:
    2,400
    Likes Received:
    1
    Wiseoldowl,

    Thanks for that (link). I have been trying to do twenty different things here, and forgot to link it correctly.

    Definitely interested in any feedback regarding SIP issue. Tutorial must be followed closely (e.g. no other DNS entries in Elastix)

    Regards

    Bob
     
  13. wiseoldowl

    Joined:
    Aug 19, 2008
    Messages:
    251
    Likes Received:
    0
    Well, I tried setting it up, (and before you ask, yes, I did reboot the system) but at first the ping test didn't work. However, putting the original DNS servers back caused it to work again. So, I think to myself, that dnsmasq server isn't running, so I go into Webmin, to System | Bootup and Shutdown and look at the entry for dnsmasq and sure enough, it's not set to start on boot. So I check the box next to it, click the button that says "Start Now and On Boot", change the DNS setting in Elastix back to 127.0.0.1, and voila! It works!

    I love Webmin! :)

    Now to see what happens during the next Internet outage (unfortunately, that's the only way I'll be able to give it a full test, and I'm not at liberty to create an "artificial" outage by pulling the plug on the Internet connection).

    And, thank you for this tutorial - if it works as intended it's going to be a big help!
     
  14. Bob

    Bob

    Joined:
    Nov 4, 2007
    Messages:
    2,400
    Likes Received:
    1
    Wiseoldowl,

    Be a daredevil, take a risk....just pull the plug, no one will know :laugh:

    Thanks for the immediate feedback....I am not sure why your DNSMASQ did not start, as the YUM install does all of that. I can confirm I have made no changes for DNSMASQ startup, other than a reboot when I had finished configuring everything....

    Furthermore I have checked dnsmasq is in /etc/init.d and it is.

    If any one else can confirm that it does not start (like wiseoldowl), please let me know...

    If you want to confirm it is running, just type dnsmasq at the command line and you should get back

    dnsmasq: failed to create listening socket: Address already in use

    showing it running.

    Also you can type

    ps -e | grep dnsmasq

    which should return the following line

    3679 ? 00:00:00 dnsmasq

    Hope this helps....

    Wiseoldowl,

    Thanks for the interim feedback, and look forward to your outage as I am aware your issue has been constant for quite sometime, and would provide valuable feedback.

    Regards

    Bob
     
  15. wiseoldowl

    Joined:
    Aug 19, 2008
    Messages:
    251
    Likes Received:
    0
    Without going into long drawn-out explanations, it's a matter of not having physical access (particularly at this time of night). I could maybe make the connection go away for about half a minute (if that), but that's probably not long enough for the problem to manifest. Of course, now that I'm waiting for an outage I suppose this connection will turn super-reliable (and that would not bother me a bit!).

    Oh, and the non-clickable button I was referring to is on the page at http://www.elastixconnection.com/index. ... &Itemid=83 - I'm not sure what you fixed, but it wasn't the button/icon (bottom item in the right-hand column). All the other button/icons on the page are clickable, but that one isn't. Just thought you might want to know.
     
  16. Bob

    Bob

    Joined:
    Nov 4, 2007
    Messages:
    2,400
    Likes Received:
    1
    Wiseoldowl,

    No problems, was just mucking around. You are absolutely right, I think that it is when the SIP devices re-register which could be over a period of 10 minutes (for most systems), which is when the issue shows up.

    As for the link, yes I looked at the wrong one. Thanks for your detail...I have now added a link like the rest of the tutorial icons....

    Thanks again

    Bob
     
  17. wiseoldowl

    Joined:
    Aug 19, 2008
    Messages:
    251
    Likes Received:
    0
    Oh, oh...

    Noticed today that calls were not going out as they should, did a "sip show peers" from the CLI and NONE of my trunks appeared in the list! Changed the DNS settings in Elastix back to what they originally were, did a "restart when convenient" from the CLI and lo and behold, all the connections came back! Hmmmm...

    I guess the moral is, once you set this up, keep a close eye on it for a day or two. On our system dnsmasq IS running, but apparently something isn't quite right, and I don't have the skills to figure out what the problem is.

    On the plus side, even though it couldn't see the outgoing trunks, it completed calls between internal extensions just fine, so that part worked - but losing the trunks was kind of a bummer... :(
     
  18. augustynr

    Joined:
    Nov 20, 2007
    Messages:
    113
    Likes Received:
    0
    Well, I went through this and when I loose internet it seems like my phones loose registration for couple of minutes at a time and then get it back and then loose again ....
    Any idea ?
     
  19. Mirko87

    Joined:
    Oct 20, 2008
    Messages:
    128
    Likes Received:
    0
    Hi to every one...

    This is an interesting problem to solve... I've hearded it on an Italian forums, and they have 2 solutions:

    1- Modify the /etc/hosts file, and insert into your Voip Service Provider IP followed by the domain name. But this isn't the right way, infact, if a Voip Service Provider changes the IP of a Server this solution make your System go down until you change the IP again.

    2-Use a Script (during this week, if I'll find it, I'll post here), that makes a ping to www.google.com every 5 minutes, and if the ping don't answer the Script disable the trunks... When the ping return to answer it re-able the trunks... But at the moment I have nothing in my hand, because the web page of the Script is Offline... It was written for Asterisk 1.4.

    By the way, yesterday I make my internet connction down for 5 minutes, but Elastix was OK...

    At sip show registry instead of Regitered I have Request Sent, but the System worked right. So that, how many minutes need to make the PBX go down?

    It's a problem...

    Mirko
     
  20. wiseoldowl

    Joined:
    Aug 19, 2008
    Messages:
    251
    Likes Received:
    0
    Bingo. This is also why I wouldn't use srvlookup=no - it might solve the immediate problem but cause bigger problems down the road.

    This is actually the correct way, except that as far as I know, there's no way to enable or disable individual trunks from a script (though I'd be happy to be proven wrong on that point). I already have a perl script that checks one of the sites that returns your current IP address and if necessary (if your IP address changes) it rewrites sip_nat.conf and then restarts asterisk, so it might be pretty easy to modify that one to add this functionality. Even this might not be totally safe because it assumes that if the site you check is down then the Internet is down, which may not be true - you might just be unable to reach that site.

    Anyway, if you can figure out how to enable or disable a trunk from within a script, that would be the key to something that would work fairly reliably.

    Probably depends on the registration timeout - I don't know what the default is in Asterisk but it would not surprise me if it might be 15 minutes, or even more (maybe even as much as an hour?).
     

Share This Page