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?