Dear Sir,
Now I can hide Icons by using remove() function. thanks a lot.But I get another icon display problem now, that need your help.
When I reload all my asterisk configuration file by using "reload" command, all buttons I configured will become double immediate, for example from 5 extension buttons to 10 buttons, and so does Icons and logout button, and it will not happen if I use "sip reload" command.
How can I avoid buttons and Icons become double when I exec "reload" command in AMI Mode?
function reload_conf()
{
$socket = fsockopen("127.0.0.1","5038", $errno, $errstr);
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: fop2\r\n");
fputs($socket, "Secret: fop2sec\r\n\r\n");
fputs($socket, "Action: Command\r\n");
fputs($socket, "Command: extensions reload\r\n\r\n");
fputs($socket, "Action: Command\r\n");
fputs($socket, "Command: sip reload\r\n\r\n");
fputs($socket, "Action: Logoff\r\n\r\n");
$wrets=fgets($socket,128);
fclose($socket);
}
Calling reload_conf() function will not effect buttons on FOP2 web page.
function reload_all()
{
$socket = fsockopen("127.0.0.1","5038", $errno, $errstr);
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: test\r\n");
fputs($socket, "Secret: test\r\n\r\n");
fputs($socket, "Action: Command\r\n");
fputs($socket, "Command: reload\r\n\r\n");
fputs($socket, "Action: Logoff\r\n\r\n");
$wrets=fgets($socket,128);
fclose($socket);
}
Calling reload_all() function will make buttons/Icons on FOP2 web page become double.