GXW4248 Restart Script


#1

Hello All,

I am looking to restart GXW4248 via a script.
Which port does GXW4248 use for restart.
@grandstream
@grandstream any help would be appreciated.


#2

maybe by using ssh - reboot command
or using the python selenium library with the WebGUI


#3

could you share the code snippet or the library link?


#4

If GDMS supports the GXW, do the reset through there.


#5

i am using this function below, but the socket connection fails for GXW4248 and returns false, but the same script works fine for 4224

function reboot_gxw($ip_addr)
{
echo “\n\nREBOOT_GXW: “.$ip_addr.”:23\n\n”;
$socket = @fsockopen("$ip_addr",“23”, $errno, $errstr, 1000);
if (!$socket) {
echo “$errstr ($errno)<br />\n”;
echo “Unable to Connect to Gateway to reboot\n”;
return FALSE;;
}
read_up_to(“Grandstream GXW”,$socket);
sleep(3);
fputs($socket, “admin\r\n”);
read_up_to(“GXW”,$socket);
fputs($socket, “reboot\r\n”);
sleep(3);
read_up_to(“Rebooting”,$socket);
sleep(3);
fclose($socket);
}


#6

What about port 22 ?


#7

Yes, already tried and the script worked on port 22, but still, the gateway is not getting rebooted.


#8

so can you reboot this GXW via ssh?
meaning w/o using the script


#9

Yes, it REBOOTS via SSH