Elastix dies when internet connection lost.

Discussion in 'General' started by BenS, Apr 19, 2008.

  1. BenS

    Joined:
    Aug 7, 2007
    Messages:
    38
    Likes Received:
    0
    This is a real headache. How can I stop Elastix from dying when the Internet service is down?

    If and when Internet service goes down for whatever reason (it has been known to happen on more than a few occassions), Elastix dies completely. Not even the local extension works not to mention incoming PSTN.

    Has anyone a solution for this?
     
  2. bas103

    Joined:
    Mar 24, 2008
    Messages:
    11
    Likes Received:
    0
    I don't know how much this plays into your situation but I've noticed at times if 'e' box can't communicate with device assigned as gateway or DNS server it doesn't speak to anything even if its on the local network so you may want to see if it is your gateway route going down when you loose internet. Don't know if others have seen this but its happened to me on more than one occasion hope this helps.
     
  3. BenS

    Joined:
    Aug 7, 2007
    Messages:
    38
    Likes Received:
    0
    Like many people, I have my router as the gateway eg: 192.168.1.1 Primary DNS: 192.168.1.10 (my local server) and sec DNS is the Router again 192.168.1.1

    I have changed the DNS around too but didnt help. How do I overcome this spastic behavior when Internet is lost? Surely there are people that use Elastix inhouse using PSTN not having any internet at all - Just using Elastix as a normal PBX with PSTN trunks only. Does that mean that people must have internet to use Elastix? Surely it does not make sense.

    If you have a solution we certainly can do with some help to resolve this.

    Thanks in advance.
     
  4. tbooth

    Joined:
    Feb 24, 2007
    Messages:
    338
    Likes Received:
    0
    there a huge threads about this topic over to the trixbox forums. if your using sip trunks and the internet goes down all sip phones go down on the lan.
    If your not using sip trunks it wont effect your box.
     
  5. vlad

    Joined:
    Nov 15, 2007
    Messages:
    86
    Likes Received:
    0
    Hello,

    I'm recommend you active the a bind on your Elastix box, and how name server use the same server.
    nameserver 127.0.0.1

    Regards.
     
  6. BenS

    Joined:
    Aug 7, 2007
    Messages:
    38
    Likes Received:
    0
    I have activated Bind and also changed the name server in elastix. While it shows that the registration is still there but I still cant make calls between extensions. All my extensions are sip phones.
     
  7. BenS

    Joined:
    Aug 7, 2007
    Messages:
    38
    Likes Received:
    0
    I have tried various ways. All my IP phones and ATAs have fix IP address and I disabled DNS and gateway in all of them. I installed Bind DNS to the Elastix box, create a DNS cache and point the router DNS to the elastix box hoping that eventhough there is no internet connection, it will be fooled into thinking that the sip trunks are still registered - which it did but as soon as I disconnect the Internet cable to the router (after it recycle) all extensions are dead again. The system still think that registration is there.. LOL

    What a mess. Only a little lump of hair left on my head :)


    Any other suggestions please ...
     
  8. lek

    lek Guest

    Weird issue!

    BenS, what is your asterisk version? Could you post a full log with verbose 9 and console debug activated?

    You can activate console debug adding "debug" at the end of the console line in the logger.conf
     
  9. BenS

    Joined:
    Aug 7, 2007
    Messages:
    38
    Likes Received:
    0
    Edgar,

    I have just updated asterisk to v1.4.19 and the issue still remains.

    I went to CLI and activate verbose to 9

    then I disconnect the Internet connection.

    Then I tried to call an internal number.

    ..... there is absolutely nothing showing on the console.

    When I connect the internet back on, the console start getting the normal information again.
     
  10. CleveJ

    Joined:
    Nov 12, 2007
    Messages:
    100
    Likes Received:
    0
    It certainly is. It is very easy to simulate this problem all you have to do is unplug your internet connection, and wait long enough to see the results, all the extensions will be registered to your Elastix server and you will have dial tone, if you try to call another extension nothing happens even at cli. I struck this problem by sheer coincident when my internet connection went down and my whole system was dead, this is when I asked the question from Ben S, he too did not realise it at first, but when you keep your internet connection off long enough the problem surfaces. Hope we can find a solution for this.
     
  11. BenS

    Joined:
    Aug 7, 2007
    Messages:
    38
    Likes Received:
    0
    The damn mystery has been solved.. me think.

    I think it is a fundamental flaw in the design of Asterisk.

    1. Asterisk is assuming that when a call is being made, the call is going to be made via a trunk IF a sip trunk is recorded. Therefore Asterisk will scan for SIP trunk availability. Once Asterisk finds a trunk it will start sip. If it does not find an available trunk it will give up and start sip then you can make a call.

    2. If no SIP trunk is registered at all then it will start sip immediately and you can make a call.

    This is not an issue if you only have 1 sip trunk because when Asterisk failed on that trunk, it will give up and start sip. The only thing you notice will be a slight delay between your dialling and the other phone ringing. Normally it is just a slight irritation - nothing more.

    The problem starts when you have multiple SIP trunk. If you have 2 SIP trunks, the delay before Asterisk gives up is a little longer and you can still dial internal number after a slightly longer delay. In many cases the delay is enough for users to think that nothing is happening, but if you keep waiting it will dial.

    However if you have 3 or more trunks, the delay becomes so long for Asterisk to cycle through all your SIP trunks is such that the phone system becomes unusable. Although if you keep waiting, it will eventually ring but the waiting can take upto half an hour depending on how many sip trunks you have... NO GOOD.

    This is where the fundamental flaw is.

    Asterisk should dial the number without scanning for SIP trunk (even if you have SIP trunks) unless the number dialed is part of an outbound route that requires SIP trunk. It does this with IAX why cant it do it with SIP?

    I tested this by adding 1 sip trunk then 2 sip trunks etc. The delay becomes progressively longer and longer the more sip trunks I added.... which brought me to the above conclusion.

    Question is: How do we stop this from happenning?
     
  12. bas103

    Joined:
    Mar 24, 2008
    Messages:
    11
    Likes Received:
    0
    Delay is not an asterisk thing per say but a freePBX distro macro thing. I've run *now with multi trunks hunting and fall through is quick, less than 3 sec but freePBX you get 300 second delay as shown by console between trunk attemps. I've posted in past about possable time reduction but no response.
     
  13. BenS

    Joined:
    Aug 7, 2007
    Messages:
    38
    Likes Received:
    0
    If this is the case which I do think is logical after reading your post. This ought to be reported to the freePBX team as a possible bug.
     
  14. icbnsys

    Joined:
    Nov 27, 2007
    Messages:
    20
    Likes Received:
    0
    This issue points to the bug on sip_channel use by Asterisk. There is a lot of old thread in Trix forum about this one. What happen was when you lost your internet you lost you DNS server, a common scenario on small to medium scale LAN/WAN installation. When the the sip_channels tries do a hostname resolution for SIP trunks it loops endlessly an dies. Note that the name resolution includes your own hostname.

    DNS caching such as having your own BIND locally seems to delay the problem from happening. But if you have a hostname taken from a DDNS that has short TTL, local BIND cannot help.

    A quick fix that I am using is to declare all the SIP trunks on my hostfile. On SIP providers that has multiple servers, just select the one with lowest latency.

    This is not happening with IAX trunks. So you may also consider IAX providers a priority.
     
  15. BenS

    Joined:
    Aug 7, 2007
    Messages:
    38
    Likes Received:
    0
  16. GPLLAW

    Joined:
    Nov 15, 2007
    Messages:
    1
    Likes Received:
    0
    Ben,
    You may not be aware of this, and the companies involved may not be upset about it, but your website has numerous trademark violations on it. It is not sufficient to have a page somewhere with the trademarks listed. The first instance of any trademark used on any page must have the (R) symbol next to it. You also cannot use other companies trademarks to promote your own website without their written consent. Just thought you might want to be aware of the legal issues on your site.

    GPLLaw
     
  17. augustynr

    Joined:
    Nov 20, 2007
    Messages:
    113
    Likes Received:
    0
    Hi,
    I have looked through all the posts on this topic and cannot find a solution for a single server with no sipura based trunks ...
    Can someone actualy point me to one if there is one.
    I find it difficult to believe that people live with this issue ...<br><br>Post edited by: augustynr, at: 2008/07/03 10:31
     

Share This Page