简体   繁体   English

将呼叫转移到PHPAGI中的队列

[英]Transfer call to a Queue in PHPAGI

I am having difficulty transferring a call to a queue through PHPAGI. 我很难通过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. 我知道我们可以通过拨号计划来做到这一点,但是这种情况需要我从AGI脚本中完成。

Thanks in advance. 提前致谢。

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. 更好的方法是使用Goto应用程序。 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. 为了使Goto应用程序可以使用我拥有的phpagi代码,我必须对挂断进行注释。

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();
?>

There are no difference between dialplan and agi queue call. Dialplan和agi队列调用之间没有区别。

You can debug what really you agi do by dooing 您可以通过dooing调试agi的实际功能

asterisk -r
agi set debug on

But in your case it more likly you use incorrect queue config 但是,根据您的情况,更可能是您使用了错误的队列配置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM