I've improved this workaround a bit. No longer with 'timed event', but with a real service restart check:
Intro: When LinuxMCE is restarted, the SIP provider isn't regristed anymore. You need to place 1 outgoing call, and then it's solved. Of course, when you reload the router (=restart the linuxmce service), then you need to replace an outside phonecall.
Since it's a bit hard to keep this in mind for the rest of your life, i've added a kind of check script. This script is placed in the crontab, and checks each x-minutes if the service 'asterisk' has been restarted. If it isn't, it does nothing. If it is, i'll place a file into /var/spool/asterisk/outgoing and will call this number.
In this example below, change 0123456789 with your external number. I've put my own phonenumber in here. So it's just initate the call, and drops it after 1 second.
more /scripts/sys_call_outside_org.call
Channel: Local/0123456789@trusted
WaitTime: 1
Context: outgoing
Extension: 200
Priority: 1
more /scripts/sys_call_check.sh
#!/bin/bash
if tail -20 /var/log/asterisk/full | grep "chan_sip.c: SIP channel loading"
then
: # colon is a null and is required
#Run Script to launch an outgoing call
sudo /scripts/sys_call_launch.sh
#Add additional log files"
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "The service for Asterisk has been apparantly been restarted." >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "The script '/script/sys_call_check.sh' launched a outgoing call" >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated." >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated..." >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated...." >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated....." >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated......" >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated......." >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated........" >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated........." >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated.........." >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated..........." >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated............" >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated............." >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated.............." >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated..............." >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated................" >> /var/log/asterisk/full
else
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "The script '/script/sys_call_check.sh' has nothing to do..." >> /var/log/asterisk/full
fi
if tail -100 /var/log/pluto/18_Asterisk.log | grep "Got a reload command from 0"
then
: # colon is a null and is required
#Run Script to launch an outgoing call
sudo /scripts/sys_call_launch.sh
#Add additional log files"
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Asterisk has been apparantly been restarted by Linxumce." >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "The script '/script/sys_call_check.sh' launched a outgoing call" >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "The script '/script/sys_call_check.sh' launched a outgoing call" >> /var/log/pluto/18_Asterisk
.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated.." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated..." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated...." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated....." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated......" >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated......." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated........" >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated........." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated.........." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated..........." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated............" >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated............." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated.............." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated..............." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated................" >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated................." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated.................." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated..................." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated...................." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated....................." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated......................" >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated......................." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated........................" >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated........................." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated.........................." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated..........................." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated............................" >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated............................." >> /var/log/pluto/18_Asterisk.log
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated.............................." >> /var/log/pluto/18_Asterisk.log
else
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "The script '/script/sys_call_check.sh' has nothing to do..." >> /var/log/pluto/18_Asterisk.log
fi
more /scripts/sys_call_launch.sh
#!/bin/bash
sleep 60
cp /scripts/sys_call_outside_org.call /scripts/sys_call_outside.call
mv /scripts/sys_call_outside.call /var/spool/asterisk/outgoing/.
more /etc/crontab
<knip>
*/7 * * * * root /scripts/sys_call_check.sh &> /dev/null
</knip>
Comments to improve this more are of course welcome...