VoIP, Linux, Security & much more fun
If you need any help regarding these subjects do not hesitate about sending me a text

FusionPBX offers a way to remotely reboot your registered endpoints. Of course, those endpoints must honor the SIP signal. However, the problem becomes when you have many extensions. Last week, I had the challenge to reboot more than one thousand endpoints, where eight hundred of them were registered in a single server. As you imagine, the clicking way is too much hassle. There should be another way.

Sadly, as for this day, nor FusionPBX 4.2 (latest stable branch when writing this article) nor FusionPBX 4.3 (August 26th, 2017) offers a simple way to accomplish this task. After reading the code, I found that all elements were there, I just needed to iterate them to send the signals to all the registered endpoints. So I did it, I took the code from the other parts and joined them to produce a script that will reboot all the listed endpoints. And here it is my pull request that hopefully would be accepted in FusionPBX 4.3.

This patch will enable FusionPBX to reboot all the listed endpoints. If you are watching only endpoints of a tenant and you click on the button, it will only reboot endpoints registered on that endpoint. If you are listing all the endpoints and click on the button, it will reboot all the endpoints in your server.

Patching your FusionPBX 4.2 to Reboot all your Endpoints

By policy, FusionPBX 4.2 will only accept security patches. Sadly, I doubt this would qualify as one. I will explain here how to patch yourself your own deployment.

  1. Find the file app/registrations/app_languages.php and add the following translation content.
    $text['button-reboot_all']['en-us'] = "Reboot all";
    $text['button-reboot_all']['ar-eg'] = "";
    $text['button-reboot_all']['de-at'] = "Neu starten";
    $text['button-reboot_all']['de-ch'] = "Neu starten"; //copied from de-de
    $text['button-reboot_all']['de-de'] = "Neu starten";
    $text['button-reboot_all']['es-cl'] = "Reiniciar todo";
    $text['button-reboot_all']['es-mx'] = "Reiniciar todo"; //copied from es-cl
    $text['button-reboot_all']['fr-ca'] = "Redémarrer tout"; //copied from fr-fr
    $text['button-reboot_all']['fr-fr'] = "Redémarrer tout";
    $text['button-reboot_all']['he-il'] = "";
    $text['button-reboot_all']['it-it'] = "";
    $text['button-reboot_all']['nl-nl'] = "";
    $text['button-reboot_all']['pl-pl'] = "Zrestartuj";
    $text['button-reboot_all']['pt-br'] = "Reiniciando";
    $text['button-reboot_all']['pt-pt'] = "Reinicialização";
    $text['button-reboot_all']['ro-ro'] = "";
    $text['button-reboot_all']['ru-ru'] = "Перезагрузить";
    $text['button-reboot_all']['sv-se'] = "Starta Om";
    $text['button-reboot_all']['uk-ua'] = "Перезавантажити";
  2. Edit the file app/registrations/status_registrations_inc.php and add the following lines where the buttons are displayed.
    echo "<input type='button' class='btn' name='' alt='".$text['button-reboot_all']."' onclick=\"window.location='cmd.php?cmd=reboot&profile=".$sip_profile_name."&show=".$show."'\" value='".$text['button-reboot_all']."' ".$onhover_pause_refresh.">\n";
  3. Finally, create the file app/registrations/cmd-all.php with this content.

You are ready to go. Please note that it is up to the endpoint to honor or not the SIP signal. Happy rebooting.

Good luck!

blog comments powered by Disqus
If you need more help than the free one provided here...