No Internet connection, not even internal calls allowed...is this normal??

Eight pages later and I still think the best solution is to avoid SIP trunks and use IAX if possible.

PiaF has the capabilities of being its own DNS server authorative for everything under it. If it were setup and it can be setup through webmin, then I would suspect that we wouldn't have this issue of losing all calls because the Internet broke.

This is another high priority project on my list: document the procedure for setting an authorative DNS server using webmin. then testing it to verify that it solves this problem.
 
As an alternative to a DNS server. How about creating host file entries on PiaF that match domain names to IP addresses? More work but again can be done through webmin.
 
A Brand New Hope

Looks like after a number of years, the pain may be over with 1.6.1.
The DNS lookup will no longer block everything else going on as dns lookup for a sip trunk is now asynchronous.
Now just fix syntax changes in your custom dial plans, and move over from zaptel!
Can't wait for a pbxinaf approved "gold" version of 1.6

See comments regarding the asterix bug fix at
freepbx.org/v2/ticket/3505
And under dns section
http://linuxinnovations.com/applications1.4-1.6.2.html
 
This is a dirty hack of an idea, but what about a cron job that runs something like:
host mysipprovider.com > /etc/mysipproviderips.txt

Then, if your Internet goes down. You can manually ssh into your PiaF box, and copy from that file into your /etc/hosts file?

Or if you are real ambitious, you could make a Perl (or whatever) script to automatically copy the host (or nslookup) output to your /etc/hosts file every day unless the DNS lookup fails (ie Internet is down).

Thoughts?
 
Yes, look at the pingtest script somewhere on this thread.
That's what it does, set a cron to run it every two minutes, then the script pings an outside website, if it fails, then it swaps out all your sip trunk stuff for an alternate config file you created (no sip trunks) and reloads. Then once your internet is up, it will swap them back.
For me, as long as there are enough IAX2 providers, having all IAX2 trunks is more robust.
I am looking for a moment to test out 1.6.2 which supposedly fixed this problem. Bad news is someone reports issue still exists in 1.8.
 
Here's What Works For Us

Here's what works for us. You've got to have a Bind DNS Caching Server running on your PIAF box to keep it going with an Internet outage. If you use FQDNs on phones, then the primary DNS address must be the internal or external IP address of your server depending upon where the phones are located.

Here's a simple script to install and get bind running properly (we hope) on your server. Log into your server as root. Then...

Code:
yum -y install bind*

cd /var/named
service named stop
wget http://pbxinaflash.net/source/bind/bind.tgz
tar zxvf bind.tgz
rm bind.tgz

echo nameserver 127.0.0.1 > /etc/resolv.conf

sed -i 's|$nameserver|127.0.0.1|' /sbin/dhclient-script

service named start
service network restart

dig pbxinaflash.com
dig pbxinaflash.com

# look at the output for the second dig command issued above
# 2d dig command should show a very short DNS lookup time, e.g.
#;; Query time: 1 msec
#;; SERVER: 127.0.0.1#53(127.0.0.1)
# IF ALL IS WELL...

#be sure to set named for auto start on bootup

chkconfig  named  on --level 2345
chkconfig --list named

# named should be configured to start with RunLevels 2,3,4,5



IMPORTANT
: When you're finished with the above, run a dig command (e.g. dig inbound1.vitelity.net) for each of the FQDNs of your SIP trunk providers! This caches the info on your server for a rainy day. You can find the info with FreePBX: Tools, Asterisk Info, SIP Info, SIP Registry.
 
Wow, I'll certainly give it a try. Thanks.
It's been many years with work arounds, mileage varying for each person.
 
┌────────────────────────System Information───────────────────────────┐
│ Asterisk = ONLINE | Dahdi = ONLINE | MySQL = ONLINE │
│ SSH = ONLINE | Apache = ONLINE | Iptables = ONLINE │
│ Fail2ban = ONLINE | Internet = ONLINE | Ip6Tables = ONLINE │
│ BlueTooth = ONLINE | Hidd = ONLINE | NTPD = ONLINE │
│ SendMail = ONLINE | Samba = ONLINE | Webmin = ONLINE │
│ Ethernet0 = ONLINE | Ethernet1 = N/A | Wlan0 = N/A │
│ │
│ PBX in a Flash Version = 1.7.5.5 │
│ FreePBX Version = 2.8.1.4 │
│ Running Asterisk Version = Asterisk 1.8.1.1 │
│ Asterisk Source Version = 1.8.1.1 │
│ Dahdi Source Version = 2.4.0+2.4.0 │
│ Libpri Source Version = 1.4.11.5 │
│ IP Address = 192.168.0.10 on eth0 │
│ Operating System = CentOS release 5.5 (Final) │
│ Kernel Version = 2.6.18-194.17.4.el5 - 32 Bit

Finally had a chance to test this on 1.8 on a basically stock pbxiaf install - no bind or adjustments to dns/networking.
I am using dhcp for ip address and behind a router with no ports open.
I set up two sip trunks with registrations, they are registered, and qualify says ok. I can dial out the vitelity sip trunk. I have some old (were working) iax trunks with all fqdn addresses commented out.
My one sip extension is xlite softphone on the lan.

I can't get it to break. So, I never tried Ward's script but glad to know it's there.

I unplugged the dsl connection and waited.
Xlite phone stayed registered to the Pbx's numerical ip address, and I could dial to asterisk voicemail.
Also tried this after a sip reload.
Then tried a reboot of the pbx.
My xlite sip extension continued to work even though my internet was down the whole time.

One user posted in this thread that his sip extensions went down using asterisk 1.8, but I find everything seems ok on a stock install. I had read that this issue was fixed with Asterisk 1.6 (1.8?). I'll play some more when I upgrade to Asterisk 1.8.4 or later, or if someone posts an issue I may not have tested.
 
For those of you who are still using Asterisk 1.4, I finally found a "fix" that works (and explains why some people haven't had success with a similar fix).

1. Either configure all of your external SIP trunks using IP addresses, or add the names and IP addressses of your SIP trunk providers to your hosts file, i.e.

cd /etc
nano hosts

add:

55.11.22.11 www.yourprovider.com

(replacing 55.11.22.11 with your SIP providers IP and www.yourprovider.com with the name you use in the trunk configuration).

You'll need to make similar entries for all external SIP trunks that you use.

Save and Exit (Ctrl-O, Ctrl-x).

2. Ensure that your SIP Settings are correct in Asterisk. Go to the FreePBX GUI. Click on Tools, and then Asterisk SIP Settings. Look at the "NAT Settings" section.

You'll notice that, by default, NAT appears to be set at "Yes" and "External IP" is Blank. In reality, however, none of these items are set in the relevant .conf files until you make a change here and then submit the changes.

Set the NAT Settings, IP Configuration, External IP, and Local Networks properly and click submit.

A typical set-up is like this:

IP Configuration: Dynamic
External IP: yourdomain.com (get one free at dyndns.org)
Local Networks: 192.168.1.0/255.255.255.0

The key here, I think, is that Asterisk knows which IPs are local to you so that it won't attempt reverse DNS queries for all of your phones. If you don't have that set correctly, the problems will continue.

You may also be able to get by with:

NAT: No.
IP Configuration: Public

However, this may break other features (especially remote extensions).

When you're done, go the command line and type:

amportal restart
 
Can anyone confirm 100% that this issue is fixed in 1.8?


Never mind, no internet for 15 minutes = no calls.
 
I'm guessing so. Sad, I just don't understand why this doesn't get fixed.

Because it is a feature and not a bug! Seriously This has been around for years and on iirc I had a "nice" chat with one of the asterisk developers and this was the tack they took. I eventually stopped trying due to this attitude. Eventually I may have to take out my c programming book and "uninclude" this feature. Another explanation is blaming poorly configured DNS which of course is not Asterisk's problem. Really LAN's should be able to continue to run even if your ISP goes down. If you look over on the digium forums you will see this subject comes up regularly and most of the responses are to hang more software onto your system to fix a problem that should not be there in the first place. Also the obvious fixes to only use IP instead of FQDN works most of the time....However with some vendors this just does not work.

:beatdeadhorse5:


Tom
 
Assign real IP addresses to all of your trunks, and you'll never have the problem again. :idea:
 
Assign real IP addresses to all of your trunks, and you'll never have the problem again. :idea:

OMG, that works. Its been an hour with no internet and my phones are still working!

Is this valid for all versions of Asterisk or just 1.8?

This should be a put into a sticky post.
 
Ward, I'm having issues with your fix from message #86.

The first yum statement fails with a bunch of problems. I think things have changed since you did this.

I then have problems starting named later in your script.

First some background:
pbxinaflash 1.7.5.7 silver with dahdi support.

The error message from named is:

Locating //etc/named.conf failed

I didn't go any farther after that.

Are there some fixes for this to add a caching name server to a pbxinaflash box?

Thanks,
Jay
 

Members online

Forum statistics

Threads
26,688
Messages
174,412
Members
20,259
Latest member
Fadeek86
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top