Asterisk:创建多级IVR示例
我想创建一个多级 IVR 的示例。假设有一个欢迎菜单,要求您输入您的员工 ID。之后有第二个菜单,您可以选择返回上一个菜单。知道怎么做吗?
这是一个不起作用的伪代码示例,因为我还不知道如何创建多级 IVR。
[TestMenu]
exten => start,1,Answer()
same => n,Log(NOTICE, call starts)
same => n,Background(welcomeintro) // welcome menu
same => n,Background(welcomeoption) // options that your have
same => n,WaitExten(5)
exten => 0,1,Playback(digits/0) ; if enter 0, play back the welcome menu
same => n,Goto(TestMenu,start,1) // ??? is it ok ? and suppose that I want to skip to Background(welcomeoption) part directly ?
// if 1 is enterred, lets ask for employeeid
exten => 1,1,Playback(digits/1) ;
same => n,Playback(askemployeeid)
same => n,goto ????
exten => i,1,Playback(pbx-invalid) ; invalid
same => n,Goto(TestMenu,start,1)
exten => t,1,Playback(byebye) ; timeout
same => n,Hangup()
[employeeid]
....
假设employeeid为1-8,9为返回上一级菜单。当输入1-8时,将播放音频文件并退出。
I want to create an example for a multi-level IVR. Let's say a welcome menu, where you are asked to enter your employeeid. Then there is a second menu after that, and you have the option to go back to the previous menu. Any idea how to do that ?
Here's a pseudo-code example that doesn't work, because I don't know yet how to create a multi-level IVR.
[TestMenu]
exten => start,1,Answer()
same => n,Log(NOTICE, call starts)
same => n,Background(welcomeintro) // welcome menu
same => n,Background(welcomeoption) // options that your have
same => n,WaitExten(5)
exten => 0,1,Playback(digits/0) ; if enter 0, play back the welcome menu
same => n,Goto(TestMenu,start,1) // ??? is it ok ? and suppose that I want to skip to Background(welcomeoption) part directly ?
// if 1 is enterred, lets ask for employeeid
exten => 1,1,Playback(digits/1) ;
same => n,Playback(askemployeeid)
same => n,goto ????
exten => i,1,Playback(pbx-invalid) ; invalid
same => n,Goto(TestMenu,start,1)
exten => t,1,Playback(byebye) ; timeout
same => n,Hangup()
[employeeid]
....
Suppose that the employeeid is 1-8 and 9 is for going back to the previous menu. When 1-8 is entered, it will play a audio file and quit.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这只是代码的一小部分示例。您可以对此进行研究并根据您的要求进行定制。请注意,我还没有测试过。
HTH。
This is just a small sample of what the code might look like. You can work on this and tailor it to suit your requirements. Note that I have not tested it.
HTH.