[英]Set waiting tone for asterisk agi function processing
I am using asterisk with normal PHP AGI following this link the problem is that my PHP AGI takes 5 seconds to execute .I just want to set some waiting tone for the user to wait until the AGI is been processing. 我正在使用带有正常PHP AGI的星号,在此链接后问题是我的PHP AGI需要5秒才能执行。我只想为用户设置一些等待音,等待AGI处理。 On the same link I found something: 在同一个链接上我找到了一些东西:
set music: Enable/Disable Music on hold generator, example "SET MUSIC ON default 设置音乐:启用/禁用音乐保持发生器,例如“SET MUSIC ON默认值
but I don't know exactly how to use I mean what would be the exact syntax and where do I put it. 但我不确切知道如何使用我的意思是什么是确切的语法,我把它放在哪里。
I have tried adding 我试过添加
same => n,Set(CHANNEL(musicclass)=default)
but it didn't work. 但它不起作用。
If you use phpagi, you have do something like this 如果你使用phpagi,你可以做这样的事情
$agi->set_music(true,"myholdclass")
...
$agi->set_music(false)
http://phpagi.sourceforge.net/phpagi2/docs/phpAGI/AGI.html#methodset_music http://phpagi.sourceforge.net/phpagi2/docs/phpAGI/AGI.html#methodset_music
Sure you need first describe myholdclass in /etc/asterisk/musiconhold.conf 当然,您需要首先在/etc/asterisk/musiconhold.conf中描述myholdclass
You put some sound file into your sound directory: 您将一些声音文件放入声音目录:
/var/lib/asterisk/mysoundFile
Then call the playback function: 然后调用播放功能:
Playback(mysoundFile)
For more information: http://www.voip-info.org/wiki/view/Asterisk+cmd+Playback 有关更多信息,请访问: http : //www.voip-info.org/wiki/view/Asterisk+cmd+Playback
请查看Playtones命令。
exten => s,2,Playtones(dial)
I have an easier solution for your problem. 我有一个更容易解决您的问题的方法。
You use Asterisk AGI for it, without needing to create an AGI script (I do not like the AGI mechanism. I have invented a framework that is more powerful, easier and flexible and allows me to do crazy stuff with Asterisk without ever touching the Dial plan or any other config file). 你可以使用Asterisk AGI,而不需要创建一个AGI脚本(我不喜欢AGI机制。我发明了一个更强大,更简单和灵活的框架,让我可以用Asterisk做疯狂的东西而不用触摸拨号盘计划或任何其他配置文件)。
For you problem, just do the following; 对于你的问题,只需执行以下操作;
create a symbolic link for the '/bin/echo' application in the agi directory by: 通过以下方式为agi目录中的'/ bin / echo'应用程序创建符号链接:
ln -s /bin/echo /var/lib/asterisk/agi-bin/echo
from your dial plan, start music on hold by calling exten => s,n,AGI( echo, SET MUSIC ON)
从您的拨号计划,通过调用exten => s,n,AGI( echo, SET MUSIC ON)
启动音乐
exten => s,n,AGI( echo, SET MUSIC OFF)
通过调用exten => s,n,AGI( echo, SET MUSIC OFF)
来暂停exten => s,n,AGI( echo, SET MUSIC OFF)
This is the easiest way without needing to create AGI pages. 这是最简单的方法,无需创建AGI页面。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.