Asterisk dialplan help for WaitExten and TIMEOUT

below is my dialplan.

[google-tts-announce-order-final-for-api-2]

exten => s,1,NoOp(Announcing Order ID and total to confirm order via API)
exten => s,n,Playback(custom/this-call-from-websitename-to-confirm-your-order)
exten => s,n,Playback(custom/you-have-placed-order-for-rupees)

exten => s,n,Set(order_total=${order_total})
exten => s,n,System(/usr/bin/python3 /var/www/html/api-call/google_tts_save_wav_order_total.py ${order_total})
exten => s,n,Playback(/var/www/html/api-call/audio-files/total-${order_total})

exten => s,n,Playback(custom/with-order-id)

exten => s,n,Set(order_id=${order_id})
exten => s,n,System(/usr/bin/python3 /var/www/html/api-call/google_tts_save_wav_order_id.py ${order_id})
exten => s,n,Playback(/var/www/html/api-call/audio-files/order-${order_id})

exten => s,n,Playback(custom/press-1-2-3-confirm-cancelled-order)

; Wait for 10 seconds for input
exten => s,n,WaitExten(10)

; If no input is received, handle timeout
exten => t,1,NoOp(Timeout reached, no input received)
exten => t,n,System(curl "https://websitename.in/ivr-freepbx-confirm.php?order_id=${order_id}&press=no-press")
exten => t,n,Playback(custom/no-response-received)
exten => t,n,Hangup()

; Handling specific key presses
exten => 1,1,NoOp(User pressed 1: Confirm order)
exten => 1,n,System(curl "https://websitename.in/ivr-freepbx-confirm.php?order_id=${order_id}&press=1")
exten => 1,n,Playback(custom/your-order-confirmed)
exten => 1,n,Hangup()

exten => 2,1,NoOp(User pressed 2: Cancel order)
exten => 2,n,System(curl "https://websitename.in/ivr-freepbx-confirm.php?order_id=${order_id}&press=2")
exten => 2,n,Playback(custom/your-order-cancelled)
exten => 2,n,Hangup()

exten => 3,1,NoOp(User pressed 3: Speak to customer care)
exten => 3,n(ivrsel-1),Goto(timeconditions,2,1)
exten => 3,n,System(curl "https://websitename.in/ivr-freepbx-confirm.php?order_id=${order_id}&press=3")
exten => 3,n,Playback(custom/pending-confirmation)
exten => 3,n(ivrsel-1),Goto(timeconditions,2,1)
exten => 3,n,Hangup()

; Repeat prompt if needed
exten => repeat,1,NoOp(No input received, repeating the prompt)
exten => repeat,n,Goto(s,1)

issue is when I press 1 2 or 3 during this Playback

exten => s,n,Playback(custom/press-1-2-3-confirm-cancelled-order)

It is not working it is working only after playback end.

need help in it.

i have added this

exten => s,n(start),Set(TIMEOUT(digit)=3)

in start but still not working.

Playback doesn’t accept DTMF. It just plays back a sound file. You would want to use Background[1].

[1] BackGround - Asterisk Documentation

Can i use

same=>n,Set(TIMEOUT(digit)=1)

To accept dtmf any time?
I have applied this but still not working.

No, you can’t. That just sets a digit timeout for certain situations. It has no impact on whether the dialplan application will accept DTMF and what it will do with it. That’s up to the dialplan application.

What does this mean? jcolp’s answer was correct. You must be running Background or WaitExten for DTMF to be accepted as part of a dialplan extension number.

Also, if your dialplan is complete, for the context, there will never be a possible second digit, so the digit timeout will never be used.

You have two priorities with the same name for this extension. That is not valid. I’m not sure if “-” is allowed in priority names, given that you can use addition and subtraction when referencing, at least, the special names “s” and “n”. Also, neither ivrsel, nor ivrset-1, are referenced.

This is unreachable.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.