http://65.181.118.232/ami/call.php?context=internal
internal 0411 2 Up Dial SIP/callcentric/411,,Tt 0154 00:00:27 b95be771-7da6-4a5b-a
internal 18007142020 3 Up Dial SIP/18007142020@cpeak,25 18097143489 00:01:17 2b460c3f-553d-4d11-8
<?php
$command="core show channels verbose";
$context=$_GET[context];
$socket = fsockopen("127.0.0.1","5038", $errno, $errstr, 10);
if (!$socket){
echo "$errstr ($errno)\n";
}else{
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: admin\r\n");
fputs($socket, "Secret: a456\r\n\r\n");
fputs($socket, "Action: Command\r\n");
fputs($socket, "Command: $command\r\n\r\n");
fputs($socket, "Action: Logoff\r\n\r\n");
while (!feof($socket)){
$result=fgets($socket);
$result= stristr($result,"$context");
$d=strlen($result);
while ($d>0){
echo "$result<br><br>";
break;
}
}
fclose($socket);
}
?>
No hay comentarios:
Publicar un comentario