欲获得一个专业考试,请使用背景()和/或WaitExten()而不是“游戏”。 这里的样本是IVR diplan:
[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对这些应用手册的申请。