php文件(demo.php);
#!/usr/bin/php -q
<?php
set_time_limit(0);
ini_set('max_execution_time', 0);
require('phpagi.php');
$agi = new AGI();
$timeParameter = $argv[1];
$agi->verbose("................Demo.......................");
sleep((int)$timeParameter*100);
$agi->verbose("................Demo1.......................");
?>
拨号计划;
[demo_3]
exten => 003,1,AGI(demo.php,3)
[demo_4]
exten => 004,1,AGI(demo.php,4)
我需要多次执行 demo.php 异步,我应该在需要时关闭特定的通道。当我从控制台调用 003@demo 时没问题。
asterisk -rx "console dial 003@demo_3" //it is running but not running with multiple
asterisk -rx "console dial 003@demo_3" // it is running
asterisk -rx "console dial 004@demo_4" // but it is not running with async
我该怎么办?我尝试从 Extension.But 调用呼叫。但 php 没有等待 400 秒。php 在 30 秒后完成。例如;
Extension:104
asterisk -rx "channel originate local/003@demo_3 extension 104@from-internal"
asterisk -rx "channel originate local/004@demo_4 extension 104@from-internal"
asterisk -rx "channel request hangup local/003@demo_3" // I can run it when I want