Hi,
I am trying to implement the WaitExten function in my dialplan, however it is not working as expected. Basically I want to call a few numbers one by one, play them a message(press 1 to accept the call, press 2 to reject) asking for an input and decide what to do based on the number entered.
Here is my extensions.conf:
[code]exten=>400,1,Progress() ;telephony signaling
same => n,Playback(followme/pls-hold-while-try,noanswer)
same => n,Dial(PJSIP/6010,20,rU(ackcall^s^1)) ; call using ackcall context
same => n,Dial(PJSIP/6002,20,rU(ackcall^s^1)) ; my contacts in emergency
same => n,Playback(followme/sorry,noanswer)
same => n,Hangup()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; used for implementation of looped call with feedback
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[ackcall]
exten => s,1,Background(followme/no-recording&followme/options) ;1 to answer, 2 to reject
same=>n,WaitExten(5) ;wait for five seconds till the called person enterss a number
same=>n,Set(GOSUB_RESULT=BUSY) ;no number entered, this contact is marked as busy
exten=>1,1,Playback(you-entered)
same=>n,SayNumber(1)
same=>n,NoOp() ;pressed 1, do nothing, the call is bridged
exten=>2,1,Set(GOSUB_RESULT=BUSY) ;pressed 2, mark as busy
exten=>i,1,Set(GOSUB_RESULT=BUSY) ;pressed an invalid number [/code]
However, the call is bridged no matter what number is pressed. If no number is pressed, then the call is ended - works as expected (this is just for the moment, eventually i want to replay the message and wait for input again if nothing is pressed). Are there maybe other solutions for this scenario? Can anyone help me? Thank you very much in advance!