我想为多级 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 后会播放音频文件并退出。