#!/usr/bin/php -q
<?php
set_time_limit(0);
ini_set('max_execution_time', 0);
require('phpagi.php');
$agi = new AGI();
$agi->verbose("................Demo.......................");//it's running
sleep(500);//code start to waiting here
$agi->verbose("................Demo1.......................");//But not running this line.30 sec after php completed."Spawn extension ... exited non-zero on ...."
?>
DialPlan:
[demo]
exten => 003,1,AGI(demo.php,3)
Logs:
AGI Script demo.php completed
Spawn extension ... exited non-zero on ...
104 Extension:
asterisk -rx "channel originate local/004@autocall_4 extension 104@from-internal"
No problem when I use console dial.But have a this problem when I call from extension.I must call from extension because I couldn’t multiple call from console.
I need multiple execute php async and I should be shut down specific chanel when I want
A console log (core set debug 3, core set verbose 3, agi set debug on) and a dialplan snippet may help. Please cut-n-paste text – no pictures. Please wrap the text in pre-formatted text tags so the forum doesn’t eat special characters.
I’d assume the caller gave up waiting for an answer long before the 500 seconds were up.
I can’t work out what you mean by multi execute and async. At first I thought you were referring to fast AGI, but this is a normal AGI where the script is run synchronously and a process is launched for every AGI application call.
It would probably help if you explained what you are trying to achieve that you think needs the use of AGI.