From: Michael K. <mic...@ip...> - 2018-09-14 21:53:24
|
Hi Nedi I’m looking at doing something similar. I will be using Monit. Regards Michael Knill Sent from my iPhone so please excuse my brevity. On 14 Sep 2018, at 7:31 am, nedi <ne...@gm...<mailto:ne...@gm...>> wrote: 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<http://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 Ast...@li...<mailto:Ast...@li...> https://lists.sourceforge.net/lists/listinfo/astlinux-users Donations to support AstLinux are graciously accepted via PayPal to pa...@kr...<mailto:pa...@kr...>. |