I wrote an ivr in Asterisk, but after playing the audio file, I did not allow more than one digit.
In the matching pattern in _X! It means a digit or more than a digit, so why not apply in the following example?
[testdialplan]
exten => 33,1,Answer
same => n,Set(TIMEOUT(digit)=3)
same => n,Background(demo-congrats)
same => n,wait(3)
exten => _XXX!,1,NoOp(number1)