Asterisk : create a multi-level IVR example -
i want create example multi-level ivr. let's welcome menu, asked enter employeeid. there second menu after that, , have option go previous menu. idea how ?
here's pseudo-code example doesn't work, because don't know yet how create 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 have same => n,waitexten(5) exten => 0,1,playback(digits/0) ; if enter 0, play welcome menu same => n,goto(testmenu,start,1) // ??? ok ? , suppose want skip background(welcomeoption) part directly ? // if 1 enterred, lets ask 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 employeeid 1-8 , 9 going previous menu. when 1-8 entered, play audio file , quit.
[testmenu] exten => 0,n,verbose(1, "inside test-menu") exten => 0,n(testmenu-start),noop() exten => 0,n(welcomeintro-skip-press5),background(welcomeintro) ;if user presses 5, skips this. exten => 0,n(welcomeintro-skipped),noop() exten => 0,n,background(welcomeoption) exten => 0,n,set(userchoice1=0) ;this first choice user enter. exten => 0,n,read(userchoice1,,1,,1,10) ;read documentation on read function know does. exten => 0,n,playback(enteredchoice) exten => 0,n,saydigits(${userchoice1}) exten => 0,n,execif($[${userchoice1} = 1]?goto(askempid,0,askempid-start)) exten => 5,1,goto(testmenu,0,welcomeintro-skipped) exten => i,1,playback(pbx-invalid) ; invalid exten => t,1,playback(byebye) ; timeout [askempid] .... suppose employeeid 1-8 , 9 going previous menu. , when 1-8 entered, play audio file , quit.
this small sample of code might like. can work on , tailor suit requirements. note have not tested it.
hth.
Comments
Post a Comment