[英]phpagi freezing/halting/blocking on any command
I'm using PHPAGI and I'm having a bit of trouble. 我正在使用PHPAGI,但遇到了一些麻烦。 I've simplified the problem to only a few lines of code.
我已将问题简化为仅几行代码。 First, my context:
首先,我的背景:
[script]
exten=>s,1,AGI(asterisk_callback.php)
And my actual code (Using Laravel 4): 和我的实际代码(使用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!');
When I drop a .call file, I do receive a call. 当我放下.call文件时,我确实接到了电话。 Once I answer, my log receives the first two messages.
回答后,我的日志将收到前两个消息。 It then hangs on $agi->noop().
然后挂在$ agi-> noop()上。 My phone call will stay live, and once I hang up the script will continue and log "Success!"
我的电话将保持通话状态,一旦挂断,脚本将继续并记录“成功!”。
Asterisk has the following log: 星号具有以下日志:
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
... It freezes here until I hang up the call. ...冻结在这里,直到我挂断电话。 Then I get:
然后我得到:
-- <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
Am I doing something wrong with phpagi? 我用phpagi做错了吗?
Found the issue. 找到了问题。 I'm actually having AGI() call a script, which runs Laravel as an artisan command.
我实际上正在让AGI()调用脚本,该脚本将Laravel作为工匠命令运行。 I think the problem is that standard input/output aren't being routed to the exec() command in the script.
我认为问题在于标准输入/输出没有路由到脚本中的exec()命令。 I'll ask the question a different way in a different post.
我将在不同的帖子中以不同的方式提出问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.