Elastix gets mad if the Internet conection is down

Discussion in 'General' started by kalderista, Jan 11, 2010.

  1. kalderista

    Joined:
    Oct 21, 2008
    Messages:
    179
    Likes Received:
    0
    Is it a bug?

    I've an elastix with ISDN and SIP trunk. If the Internet coexion is down, I can't get inbounds ISDN calls, even the ISDN service is working OK. It's very strange. Even aoutbounds ISDN calls also.

    Does anybody know anything about this?

    Thanks.
     
  2. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    That is an ongoing problem with the SIP stack in asterisk (I assume that you are using SIP extensions here, which causes that network catch-22) when it can't find a nameserver, I don't think it has yet been solved totally, if there is not a nameserver on your local network, then add one, for myself I install dnsmasq, which is a lightweight local caching name server, either in your network or on the Elastix box itself, this action largely covers the neediness of Asterisk to resolve a sip service provider by name even if it wasn't asked for,
    Other solutions suggest that you monitor your network and disable your SIP trunks when there is only a notwork. but I find that a little prone to latency and "over engineered".

    So basically:

    yum install dnsmasq
    man dnsmasq
    then edit /etc/dnsmasq.conf to suit. finally, only have the dnsmasq server as a nameserver in /etc/resolv.conf


    as to the how-to's of the last line, I believe you will find some recipes here and many more on google. (Basically all you do is add your normally reliable nameservers to this configuration file file)
     
  3. mbit

    Joined:
    Jul 4, 2007
    Messages:
    466
    Likes Received:
    0
    The problem basically comes into play with a sip trunk is added to the system with a DNS name. If the internet goes down and asterisk cannot resolve the DNS name then the whole SIP channel stops. There is no perfect solution as yet but as Dicko has said you can use a DNS program.

    I generally use Bind. It is easy to get working and seems to fix the issue. Remember it generally only caches until you reboot the system.

    Install Process

    yum install bind bind-utils bind-libs caching-nameserver

    In your elastix interface put your DNS server as 127.0.0.1. Now start the server

    service named start

    Make sure it starts on boot

    chkconfig named on

    Now your machine will be its own DNS server and cache entries. If the internet goes down you will still be able to receive ISDN calls and perform as normal.
     
  4. kalderista

    Joined:
    Oct 21, 2008
    Messages:
    179
    Likes Received:
    0
    Thanks!!!! Traying...
     
  5. kalderista

    Joined:
    Oct 21, 2008
    Messages:
    179
    Likes Received:
    0
    Ok,...

    I've been trying mbit's rcomendation, but it doesn't work. I did it exactly as you posted it but I got same result. Do I have to congiure any configuration file?

    thanks again!
     
  6. kalderista

    Joined:
    Oct 21, 2008
    Messages:
    179
    Likes Received:
    0
    well... still dont't work

    I've been searching for some and I have configured bind editting /etc/named.caching-nameserver.conf. The file is originaly like this:

    Code:
    // DO NOT EDIT THIS FILE - use system-config-bind or an editor
    // to create named.conf - edits to this file will be lost on 
    // caching-nameserver package upgrade.
    //
    options {
    	listen-on port 53 { 127.0.0.1; };
    	listen-on-v6 port 53 { ::1; };
    	directory 	"/var/named";
    	dump-file 	"/var/named/data/cache_dump.db";
            statistics-file "/var/named/data/named_stats.txt";
            memstatistics-file "/var/named/data/named_mem_stats.txt";
    and I have addednext line with the directions of my ISP's DNS servers:


    Code:
    forwarders { 208.67.222.222; 208.67.220.220; };
    after this I stablished 172.0.0.1 as my unique dns server in elastix pannel and reooted it, but i doesn't work even the internet connection is up... the IP phones are not able to register in asterisk.

    Does anymody recomend dnsmasq instead of bind? Do I have to do anything else? it seems that the DNS server is missing.

    thankssssss!!!!!
     

Share This Page