Remote phone restart with Grandstream HT286

We are running PIAF with Asterisk 1.6 and FreePBX

We use Grandstream HT286 adapters as endpoints and would like the ability to remotely reboot the adapters. The remote restart module does not work. Is there any other way to remotely restart the adapters or can we fix this module to work with Grandstream?


<?php $ext = '1000'; $pass = 'admin'; $output = shell_exec("asterisk -rx 'sip show peers like ".$ext."'"); if(preg_match("/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/",$output,$matches)) { $ip = $matches[0]; exec('curl -c cookies.txt -d"P2='.$pass.'&Login=Login&gnkey=0b82" http://'.$ip.'/dologin.htm'); exec("curl -b cookies.txt http://".$ip."/rs.htm"); } ?>


I’ve been looking and trying with no avail for some time. Is it possible for you to send this over to me too? Thanks much in advance.

Hi dcitelecom!

Grandstream does not support SIP NOTIFY unless it has been generated by a GAPSLITE server. Endpoint Manager will reboot these phones with a hack-around way.

Message me on the PBX in a Flash forums or here and I can give you the two line PHP script to do the reboots.

Using Endpoing Manager, and this code, to reboot a GXP2120 causes curl to just sit after calling the cgi-bin/rs (after the phone reboots) and this causes apache to hang until curl is killed.

I tried adding the --connect-timeout option but that had no effect as it’s connecting just fine, just not shutting down properly. Any ideas how to resolve that?

Also, it doesn’t reboot GXP1450’s, despite using the same reboot URL, same variable names, everything.

With the newest Grandstream firmware the phone is rebooted as follows:




Where can I put these changes? I made these changes in base.php in the grandstream directory but I don’t see it ever executing.