Transfer call to a Queue in PHPAGI

4.8k views Asked by At

I am having difficulty transferring a call to a queue through PHPAGI. I am using

$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 dial plan, but the situation requires me to do it from the AGI script.

Thanks in advance.

2

There are 2 answers

0
Jeet On BEST ANSWER

And after days of trying different things, finally I have it working with below. Posting it here so that it may help others too.

$agi->exec('Transfer',"1000");

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.

#!/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();
?>
0
arheops On

There are no difference between dialplan and agi queue call.

You can debug what really you agi do by dooing

asterisk -r
agi set debug on

But in your case it more likly you use incorrect queue config