在linux下执行脚本文件 /usr/local/php/bin/php /usr/local/www/test.php ,这里输出的数据可以传到另外一个php页面
$options = array(
'host' => '172.0.0.1',
'scheme' => 'tcp://',
'port' => 5038,
'username' => 'test',
'secret' => 'test',
'connect_timeout' =>10000,
'read_timeout' => 10000
);
$client =new ClientImpl($options);
$client->open();
$client->registerEventListener(function (EventMessage $event) {
var_dump($event);
},function (EventMessage $event) {
return $event instanceof NewchannelEvent;
}
);
$running = true;
while($running) {
echo $callid;
$client->process();
usleep(10000);
}
$options = array(
'host' => '172.0.0.1',
'scheme' => 'tcp://',
'port' => 5038,
'username' => 'test',
'secret' => 'test',
'connect_timeout' =>10000,
'read_timeout' => 10000
);
$client =new ClientImpl($options);
$client->open();
$client->registerEventListener(function (EventMessage $event) {
var_dump($event);
},function (EventMessage $event) {
return $event instanceof NewchannelEvent;
}
);
$running = true;
while($running) {
echo $callid;
$client->process();
usleep(10000);
}
resource fsockopen ( string $hostname [, int $port = -1 [, int &$errno [, string &$errstr [, float $timeout = ini_get("default_socket_timeout") ]]]] )