Hi, i have trouble with one bx and message rejected after internet going down
for some time.
I found this script, but I’m not sure if I can use this on Astlinux.
Can anyone help me to adapt this to Astlinux I would like to check internet and
if internet connection broke and coming again I would like to restart asterisk
if no registered.
I think I need an script in combination with a cron job that check if
registration fail. If registration fail then make sip reload.
And if Internet going down for some time and up after some time, I would like
check that and if internet UP an the registration fail or rejected. I would
like reboot PBX or only Asterisk…
could be something like thiis what I found:
asterisk -rx " sip show registry" | grep -w Unregistered && asterisk -rx " sip
reload"
I found this to on the net. Can someone help me to combine those two cron.
asterisk restart if the net is down and once a
day just before 7am:
crontab -e:
55 6 * * * /usr/sbin/asterisk -r -x "restart gracefully" >/dev/null 2>&1
5,10,15,20,25,30,35,40,45,50,55 * * * * /root/scripts/check_net
/root/check_net
#!/usr/bin/perl
$net=`/bin/ping -c 02 google.com 2>&1 | /bin/grep -c 'unknown host'`;
if ($net==1) {
print `/bin/date`;
print `/usr/sbin/asterisk -r -x "restart gracefully"`;
}
Regards
Nedi
_______________________________________________
Astlinux-users mailing list
Astlinux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/astlinux-users
Donations to support AstLinux are graciously accepted via PayPal to
pay...@krisk.org.