For reasons that aren't necessarily clear Asterisk fails to register. This results in inbound calls failing and either being redirected to the failover destination or the VFX voicemail platform.
This is not a regular occurance - it is something that has been reported by several users here on Geekzone (including myself) who have encountered this issue periodically, I've had it happen on two or three occasions in the past year. When it does happen however it is annoying!
The fix for this issue simply requires sending a "SIP RELOAD" command to Asterisk which will force it to reregister all SIP peers.
To make things simple for people I'll show you how to automate this process so that your system will perform this task automatically which should minimise the intances of this happening.
Linux includes a built in scheduler called cron. This enables tasks to be run at a selected time. We'll create a script that forces Asterisk to register all SIP trunks once every 30 minutes.
Connect to your Asterisk/trixbox system via SSH.
Now we need to edit the cron configuration file. We'll do this in the nano editor which is included in trixbox. Depending on your Linux distribution you may have a different favourite editor.
# nano /etc/crontab
The nano editor will then come up and you can add text. Scroll down to below the cron.monthly task and then add a new line.
*/30 * * * * root /usr/sbin/asterisk -rx "sip reload"
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
*/30 * * * * root /usr/sbin/asterisk -rx "sip reload" <------ ADD THIS LINE
05 0 * * * root rm -f /var/lib/asterisk/sounds/tts/tts*
*/5 * * * * root /etc/init.d/apf stop >> /dev/null 2>&1
Now press CTRL X and press Y and enter to save.
Every 30 minutes the cron scheduler will now force a SIP reload command. If you Registration has failed this will resolve the issue. This 30 minute period could be changed if required.
Other related posts:
Anker make some of the best USB chargers and powerbanks available. Now you can get their products shipped directly to New Zealand
United Airlines pulls out of New Zealand for Southern Hemisphere Winter – AKL/SFO becomes seasonal.
Air New Zealand launches Flexitime Membership (and how it can save you $$$)
Comment by Datacraft, on 2-Sep-2009 15:09
Reminds me of the days when Matt used to write hacks to reload Asterisk every night. Good to see after all these years nothing has changed!
Add a comment
Please note: comments that are inappropriate or promotional in nature will be deleted.
E-mail addresses are not displayed, but you must enter a valid e-mail address to confirm your comments.
Are you a registered Geekzone user? Login to have the fields below automatically filled in for you and to enable links in comments. If you have (or qualify to have) a Geekzone Blog then your comment will be automatically confirmed and shown in this blog post.