Elastix dies when there is no internet connection

userfromca

Joined
Jun 30, 2007
Messages
30
Likes
0
Points
0
#1
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
 

wiseoldowl

Joined
Aug 19, 2008
Messages
251
Likes
0
Points
0
#2
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?
 

gbrook

Joined
Aug 29, 2007
Messages
74
Likes
0
Points
0
#3
srvlookup=no solved the problem for me

Cheers
Garry
 

userfromca

Joined
Jun 30, 2007
Messages
30
Likes
0
Points
0
#4
srvlookup = no
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?
 

wiseoldowl

Joined
Aug 19, 2008
Messages
251
Likes
0
Points
0
#5
gbrook said:
srvlookup=no solved the problem for me
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.
 

Reaper

Joined
Jun 16, 2008
Messages
20
Likes
0
Points
0
#6
Try to setup a local dns server and point elastix to it.
 

wiseoldowl

Joined
Aug 19, 2008
Messages
251
Likes
0
Points
0
#7
Reaper said:
Try to setup a local dns server and point elastix to it.
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!
 

Reaper

Joined
Jun 16, 2008
Messages
20
Likes
0
Points
0
#8
Bind or bind9 is pretty simple to setup. Even got a gui for gnome.
 

userfromca

Joined
Jun 30, 2007
Messages
30
Likes
0
Points
0
#9
Reaper said:
Try to setup a local dns server and point elastix to it.
I followed following instructions to setup caching DNS server from PIAF forum. But that does not work either.

1. Install cache only name server on the Asterisk server (BIND with caching configuration)
yum -y install caching-nameserver
chkconfig --add named
chkconfig --level 345 named on
echo "* IN A 127.0.0.2" >> /var/named/localdomain.zone
service named start

2. Set Asterisk as its own DNS server by adding 127.0.0.1 on the first line of /etc/resolve.conf, like
127.0.0.1
your.other.dns.servers

3. Make sure Asterisk has default settings for file /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=your_asterisk_server_name.localdomain
(Do not change HOSTNAME to your_asterisk_server_name.yourdomain.com )

4. Then in file /etc/hosts, something like
127.0.0.1 your_asterisk_server_name.localdomain your_asterisk_server_name localhost.localdomain localhost

5. Reboot (try without the internet connected)
 

Bob

Joined
Nov 4, 2007
Messages
2,400
Likes
1
Points
36
#10
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
 

wiseoldowl

Joined
Aug 19, 2008
Messages
251
Likes
0
Points
0
#11

Bob

Joined
Nov 4, 2007
Messages
2,400
Likes
1
Points
36
#12
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
 

wiseoldowl

Joined
Aug 19, 2008
Messages
251
Likes
0
Points
0
#13
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!
 

Bob

Joined
Nov 4, 2007
Messages
2,400
Likes
1
Points
36
#14
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
 

wiseoldowl

Joined
Aug 19, 2008
Messages
251
Likes
0
Points
0
#15
Bob said:
Wiseoldowl,

Be a daredevil, take a risk....just pull the plug, no one will know :laugh:
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.
 

Bob

Joined
Nov 4, 2007
Messages
2,400
Likes
1
Points
36
#16
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
 

wiseoldowl

Joined
Aug 19, 2008
Messages
251
Likes
0
Points
0
#17
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... :(
 

augustynr

Joined
Nov 20, 2007
Messages
113
Likes
0
Points
0
#18
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 ?
 

Mirko87

Joined
Oct 20, 2008
Messages
128
Likes
0
Points
0
#19
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
 

wiseoldowl

Joined
Aug 19, 2008
Messages
251
Likes
0
Points
0
#20
Mirko87 said:
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.
Bingo. This is also why I wouldn't use srvlookup=no - it might solve the immediate problem but cause bigger problems down the road.

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.
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.

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?
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?).
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,916
Messages
130,922
Members
17,598
Latest member
giornaso
Top