I'm doing Asterisk Dial Plan in extensions.conf
.
I am creating a simple IVR in which invalid key press by customer should repeat only two times. After that it should disconnect.
But here loop goes indefinite.
[ivr1]
exten => 100,1,Goto(ivr1,s,1)
exten => s,1,Set(VOLUME(TX)=20)
exten => s,n,Answer(500)
same => n(loop),Background(playfile)
same => n,WaitExten(10)
exten => 1,1,Dial(SIP/ivr_218/xxxx,30,m(waiting-audio))
exten => 1,2,Dial(SIP/ivr_218/xxxx,30,m(waiting-audio))
same => n,Hangup(${ActionID},keypress1)
exten => 2,1,Dial(SIP/ivr_218/xxxx,30,m(waiting-audio))
same => n,Hangup(${ActionID},keypress2)
exten => i,1,Playback(playfile_for_invalid)
same => n,Goto(s,loop)
exten => t,1,Playback(playfile_for_noresponse)
same => n,Goto(s,loop)
exten => n,Hangup()