<?php
require("setting.php");
$socket = fsockopen($host,"5038", $errno, $errstr,10);
if (!$socket){
echo "$errstr ($errno)\n";
}else{
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: $username\r\n");
fputs($socket, "Secret: $secret\r\n\r\n");
fputs($socket, "Action: WaitEvent\r\n");
fputs($socket, "Action: Logoff\r\n\r\n");
while(!feof($socket)){
$result=fread($socket,5000);
if(stristr($result,'SoftHangupRequest')){
echo $result;
break;
}
}
}
fclose($socket);
?>
http://www.ibm.com/developerworks/library/os-php-readfiles/
No hay comentarios:
Publicar un comentario