27 lines
659 B
PHP
27 lines
659 B
PHP
<?php
|
|
function agiRunCmdWrapper($fd, $server)
|
|
{
|
|
return function ($command) use ($server, $fd) {
|
|
print_r("-----> EXECUTAR COMANDO $command\n");
|
|
$server->send($fd, $command . "\n");
|
|
$response = '';
|
|
while (true) {
|
|
$response = $server->table->get($fd);
|
|
// var_dump($response);
|
|
if ($response['data']) break;
|
|
sleep(1);
|
|
}
|
|
$server->table->set($fd, array(
|
|
'agi' => 1,
|
|
'data' => '',
|
|
));
|
|
return $response['data'];
|
|
};
|
|
}
|
|
function agiLogWrapper()
|
|
{
|
|
return function ($texto) {
|
|
print_r("-----> LOG $texto\n");
|
|
};
|
|
}
|