I have tried everything I can find on the Linux forums about this, so have brought it back to see if it is a FreePBX (or Asterisk) issue.
FreePBX 14.0.5.2.
Asterisk 13.19.1
As has been noted elsewhere, after a system reboot, the phones often need to be re-started to avoid some tricky BLF behaviour. I want to automate the phone restart after an overnight episode of system reboot (usually after a power failure.)
Thanks to help from others on this forum, I have the script to run the phone restart:
asterisk -rx “pjsip send notify restart-yealink endpoint [ext numbers]” (after a modification of the sip_notify_custom.conf)
I have been able to write that into an executable file which runs from the CLI and restarts all the phones every time, without fail.
All of the advice is to either run this in rc.local (/etc/rc.d/rc.local) by adding the line to end of the file.
When I do that, and then run rc.local from the CLI, the phones re-start. But when I actually reboot, the phones do not restart.
So I tried crontrab (as root) and added @crontab /root/rebootphones.cron Again, the phones do not restart at reboot even though the rebootphones.cron file works when run from the CLI ( and even though it still shows up in the cron log)
Adding sleep 120 (ie @reboot sleep 120 /root/rebootphones.cron) doesn’t fix it.
I also moved it to a different folder in usr but same outcome.
As an experiment, in the crontab file I tried * 20 * * * rebootphones.cron And that actually worked!
I would prefer to use rc.local as that seems more what is intended for this kind of job. But neither that nor the cron works for me.
It looks like I will have the option of running a daily 6am cronjob to do this task, but I would rather only do it when I need to ie after a reboot.
Any one who can set me straight gets a chocolate frog.