- Sun 26th Apr 2015, 21:41
#1808
- Appreciate my support? Feel free to buy me a coffee.
- Voipfone are offering you the chance to trial their VoIP service for free for 30 days. Sign me up!
- Sign up for a Dropbox account using my referral link and get an extra 500 MB of bonus space. Sign me up!
As mentioned elsewhere I have FreePBX running on an Raspberry pi. (RasPBX)
I have several trunks registered, Voipfone, Voicehost and Sipgate to name a few. I have had issues with the Voipfone trunk where everything appears to work ok for a few days then out of nowhere inbound calls fail. The caller will hear one ring then the engaged tone. :-/
I have setup the following script to run as a cron job every minute - it will watch for the failure and reload asterisk to resolve it. Just follow the instructions! :P
Type:
Next we need to set the permissions of the file we just created, to do this type:
I have several trunks registered, Voipfone, Voicehost and Sipgate to name a few. I have had issues with the Voipfone trunk where everything appears to work ok for a few days then out of nowhere inbound calls fail. The caller will hear one ring then the engaged tone. :-/
I have setup the following script to run as a cron job every minute - it will watch for the failure and reload asterisk to resolve it. Just follow the instructions! :P
Type:
Code: Select all
Copy and paste into above:
nano /home/pi/scripts/asterisk-reload-watchdog.sh
Code: Select all
Now press CTRL X then Y to save the and exit the file.#!/bin/bash
asterisk -rx "sip show registry" | grep -q "No Authentication"
if [ $? == 0 ]; then
amportal a r
fi
Next we need to set the permissions of the file we just created, to do this type:
Code: Select all
Now that we have our script we just need to setup a cronjob to run it every 60 seconds. To do this type:
chmod +x /home/pi/scripts/asterisk-reload-watchdog.sh
Code: Select all
Copy and paste into above:
sudo crontab -e
Code: Select all
Now press CTRL X then Y to save the and exit the file.*/1 * * * * /usr/bin/sudo /home/pi/scripts/asterisk-reload-watchdog.sh >> /home/pi/scripts/asterisk-reload-watchdog.log
- Appreciate my support? Feel free to buy me a coffee.
- Voipfone are offering you the chance to trial their VoIP service for free for 30 days. Sign me up!
- Sign up for a Dropbox account using my referral link and get an extra 500 MB of bonus space. Sign me up!
How did this post make you feel?