Thursday, March 24, 2011

Keep Your PBX in a Flash ( PIAF ) Running During An Internet Outage!

PBX in a Flash ( PIAF ) Can Run without Internet
If you experienced PIAF server was not able to route any calls after losing your Internet connection, even between local extensions Ward Mundy just Tweeted how we could avoid this.
The solution is to run a Bind DNS Caching Server running on your PIAF box to keep it going with an Internet outage. If you decided to use this solution, and if you are using FDQNs on your phones, the primary DNS server address must internal or external IP address of your server, where your phones are attached.
Ward Mundy, on the PIAF forum, has provided a simple script to run on your server and a set of files to get everything setup properly like ROOT server information and forwarding DNS queries to Google DNS servers.. The script is not shell script so you will have to run each line by themselves. (You can convert it into a shell script, if you have many PIAF servers running.)
After logging into your server with root capability (root or a sudo account) run the following code at the end of the article. Once you run the code and satisfied that everything is fine, run a dig command (e.g. dig for each of the FQDNs of your SIP trunk providers! This will cache the DNS information on your server to be used when the need arises. You can find the info with FreePBX: Tools, Asterisk Info, SIP Info, SIP Registry. Happy calling;

yum -y install bind*

cd /var/named
service named stop
tar zxvf bind.tgz
rm bind.tgz

echo nameserver > /etc/resolv.conf

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

service named start
service network restart


# 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

#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


Blog Widget by LinkWithin