寻求有关 Asterisk 中 IVR 菜单的帮助 [英] Seek Help concerning IVR Menu in Asterisk

查看:27
本文介绍了寻求有关 Asterisk 中 IVR 菜单的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写 IVR 菜单,我需要允许我的用户在通信期间随时按 0 退出.以下是我的做法:

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

推荐答案

对于 IVR,您希望使用 Background() 和/或 WaitExten() 而不是 Playback().这是一个示例 IVR 拨号方案:

For an IVR, you want to use Background() and/or WaitExten() instead of Playback(). Here's a sample IVR dialplan:

[ivr_main]
; answer and play announcement
exten => s,1,Set(TIMEOUT(response)=2)
exten => s,2,Set(TIMEOUT(digit)=2)
exten => s,3,BackGround(/your/audio/file/announcement)
exten => s,4,WaitExten(2)
exten => s,5,GoTo(s|3) ; careful of this loop here! should GoTo() somewhere else!
; handle key presses
exten => 0,1,Playback(good-bye)
exten => 0,2,Playback(beep)
exten => 0,3,Hangup()
exten => 1,1,NoOp(do this if user presses 1)
exten => 2,1,NoOp(do this if user presses 2)
exten => 3,1,NoOp(do this if user presses 3)
exten => 4,1,NoOp(do this if user presses 4)
exten => 5,1,NoOp(do this if user presses 5)
; handle invalid key presses
exten => i,1,Playback(pbx-invalid)
exten => i,2,GoTo(s|3)
; handle time out (user did not make a selection)
exten => t,1,GoTo(0|1)   ; go to Hangup :-)

希望这会有所帮助.

在 Asterisk CLI 中,为这些应用程序的手册做显示应用程序背景"和显示应用程序 WaitExten".

In the Asterisk CLI, do 'show application Background' and 'show application WaitExten' for the manual of these applications.

这篇关于寻求有关 Asterisk 中 IVR 菜单的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆