Fix: file encode
parent
b64dbec5cb
commit
0df56d1f77
|
@ -3,14 +3,14 @@
|
|||
"id": "1",
|
||||
"idmaster": "0",
|
||||
"cmd": "start",
|
||||
"value": "7999"
|
||||
"value": "8999"
|
||||
},
|
||||
{
|
||||
"id": "2",
|
||||
"idmaster": "1",
|
||||
"cmd": "playaudio",
|
||||
"value": "welcome.wav",
|
||||
"value2": "2",
|
||||
"value": "32021341DIGITEOCPF.mp3",
|
||||
"value2": "5",
|
||||
"value3": "1",
|
||||
"value4": "false"
|
||||
},
|
||||
|
@ -24,7 +24,7 @@
|
|||
"id": "4",
|
||||
"idmaster": "3",
|
||||
"cmd": "playaudio",
|
||||
"value": "timeout.wav",
|
||||
"value": "Agradecimento.wav",
|
||||
"value2": "2",
|
||||
"value3": "1",
|
||||
"value4": "false"
|
|
@ -1,3 +1,4 @@
|
|||
#!/usr/bin/php -q
|
||||
<?php
|
||||
require 'vendor/autoload.php';
|
||||
require 'includes/wrapper-noswoole.php';
|
||||
|
@ -31,4 +32,4 @@ $agientrada->run();
|
|||
|
||||
fclose($stdin);
|
||||
fclose($stdout);
|
||||
exit();
|
||||
exit();
|
|
@ -2,8 +2,24 @@
|
|||
function agiRunCmdWrapper($stdin, $stdout)
|
||||
{
|
||||
return function ($command) use ($stdin, $stdout) {
|
||||
$texto = "-----> EXECUTAR COMANDO $command";
|
||||
return $texto;
|
||||
|
||||
// $texto = "-----> EXECUTAR COMANDO $command";
|
||||
// return $texto;
|
||||
|
||||
$return = '';
|
||||
fwrite($stdout, $command . "\n");
|
||||
fflush($stdout);
|
||||
while ($line = fgets($stdin)) {
|
||||
$return.= $line;
|
||||
if (strpos($line, 'result=') !== false) {
|
||||
if (substr($line,0,22) != '100 result=0 Trying...') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$return = trim($return);
|
||||
return $return;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue