寻求有关 Asterisk 中 IVR 菜单的帮助
我正在编写一个 IVR 菜单,我需要允许我的用户在通信过程中随时按 0 退出。 以下是我的做法:
exten => 0,1,Playback(good-bye)
exten => 0,2,Playback(beep)
exten => 0,3,Hangup
但是,通过这样做,当用户在播放某些文件或正在进行其他操作时按零时,他/她无法退出,就像他/她没有退出一样按零。 我希望我说得足够清楚,并且您可以帮助我解决这个问题。 干杯
I am writing an IVR menu and I need to allow my users to press 0 anytime during the communication to exit. The following is how I do it:
exten => 0,1,Playback(good-bye)
exten => 0,2,Playback(beep)
exten => 0,3,Hangup
However, by doing so, when the user presses zero while some file is being played back or some other operation is taking place, he/she cannot exit, it is like if he/she didn't press zero. I hope I am clear enough and that you can help me out with this.
cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于 IVR,您需要使用 Background() 和/或 WaitExten() 而不是 Playback()。 以下是 IVR 拨号方案示例:
希望对您有所帮助。
在 Asterisk CLI 中,执行“显示应用程序背景”和“显示应用程序 WaitExten”以获取这些应用程序的手册。
For an IVR, you want to use Background() and/or WaitExten() instead of Playback(). Here's a sample IVR dialplan:
Hope this helps.
In the Asterisk CLI, do 'show application Background' and 'show application WaitExten' for the manual of these applications.
AFAIK,Asterisk 只能在您调用“Background”或“WaitExten”时才能接收按键。 因此,如果您正在运行某些 AGI,它必须调用这两个命令之一。
AFAIK, Asterisk would only be able to pick up on the key press when you've called Background, or WaitExten. So if you're running some AGI, it will have to have invoked one of those two commands.
Asterisk 并不总是等待用户输入。 仅在后台、WaitExten、Read 命令期间。 如果您使用 Playback(),Asterisk 在播放音频文件时会忽略任何 DTMF。
您可以用 Read() 替换 Playback,但必须将读取超时设置为非常低的值,否则在使用 Read() 播放每个音频文件后将会出现静音。 如果您使用 Read() 那么您必须检查用户输入的值以检查退出,类似这样......
而不是
您需要
Asterisk is not always waiting for user input. Only during the Background, WaitExten, Read commands. If you're using Playback(), Asterisk ignores any DTMF while it's playing the audio file.
You can replace Playback with Read() but you have to set the read timeout to a very low value or there will be a silence after every audio file you play with Read(). If you use Read() then you have to check the value input by the user to check for exit, something like this...
Instead of
you need