我使用PHPAGI,我遇到了一些麻烦。我已经将问题简化为几行代码。首先,我的背景:
[script]
exten=>s,1,AGI(asterisk_callback.php)
我的实际代码(使用Laravel 4):
Log::info('[callback script] Creating PHPAGI..');
$agi = new AGI();
Log::info('[callback script] Trying noop..');
$agi->noop('Can you see me?');
Log::info('[callback script] Success!');
当我删除.call文件时,我确实收到了一个电话。一旦我回答,我的日志会收到前两条消息。然后它挂在$ agi-> noop()上。我的电话会保持在线状态,一旦我挂机,脚本将继续并记录成功!"
Asterisk有以下日志:
Connected to Asterisk 11.7.0~dfsg-1ubuntu1 currently running on playground (pid = 26298)
> Channel SIP/vitel-outbound-00000000 was answered
-- Executing [s@callback_script:1] AGI("SIP/vitel-outbound-00000000", "asterisk_callback.php,53,SIP/vitel-outbound-00000000") in new stack
-- Launched AGI Script /usr/share/asterisk/agi-bin/asterisk_callback.php
> 0x7f84dc0181d0 -- Probation passed - setting RTP source address to 64.2.142.190:15106
...它冻结在这里,直到我挂断电话。然后我得到:
-- <SIP/vitel-outbound-00000000>AGI Script asterisk_callback.php completed, returning 4
== Spawn extension (callback_script, s, 1) exited non-zero on 'SIP/vitel-outbound-00000000'
[Jun 20 12:33:44] NOTICE[26511]: pbx_spool.c:402 attempt_thread: Call completed to SIP/2144769335@vitel-outbound/n
我是否在使用phpagi做错了什么?
答案 0 :(得分:0)
发现了这个问题。我实际上有AGI()调用一个脚本,它运行Laravel作为工匠命令。我认为问题是标准输入/输出没有路由到脚本中的exec()命令。我会在不同的帖子中以不同的方式提问。