dslijian2015 2014-06-20 17:36
浏览 58

phpagi冻结/暂停/阻止任何命令

I'm using PHPAGI and I'm having a bit of trouble. 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):

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. Once I answer, my log receives the first two messages. It then hangs on $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?

  • 写回答

1条回答 默认 最新

  • doujiebo9849 2014-06-20 18:50
    关注

    Found the issue. I'm actually having AGI() call a script, which runs Laravel as an artisan command. I think the problem is that standard input/output aren't being routed to the exec() command in the script. I'll ask the question a different way in a different post.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看