I am having difficulty transferring a call to a queue through PHPAGI. I am using the $agi->exec('Queue',"1000"); but the call keeps looping and the static agents never ring. Eventually I have to then restart the Asterisk.
Any help would be appreciated.
I know we can do it through the dialplan, but the situation requires me to do it from the AGI script.
And after days of trying different things, finally I have it working with below. Posting it here so that it may help others too.
[code]$agi->exec('Transfer',"1000");[/code]
Edit:
a better way of doing it is using the Goto application. I had tried it previously but call kept hanging up and the transfer never happened. Then I just commented the hangup from the code and it worked like a charm. For Goto application to work with the phpagi code that I have, I had to comment the hangup.
Following works perfect.
[code]#!/usr/bin/php -q
<?PHP
require('/var/lib/asterisk/agi-bin/phpagi.php');
include('mylib.php');
$agi = new AGI();
$log = new Logging();
$agi->answer();
$agi->exec('Goto',"ext-queues,1000,1");
//$agi->hangup();
?>[/code]