Get DTMF during MOH in AGI file

I have asterisk 13.21.0 and developed an agi built on perl. I’m trying to execute WaitExten application with ‘m’ option using EXEC() function from agi.
For eg. $AGI->exec(“WaitExten”,“2,m(default)”);
The above code is in while loop where I continuesly check if any DTMF is entered by caller. It works fine but the problem is audio is breaking when the above line is executed everytime. So, instead of continueous moh, it plays with 1 sec of pause in between.

How to get rid of this? Any other alternative to listen DTMF in an AGI while continueing MOH?
Any help will be appreciated.
Thank you.

Use AMI events, or reconsider the requirements.

Note that, WaitExten is rather special and is a special case of a special case when used in AGI. (Normally it causes a restart of the dialplan, not even just a GoTo.)

Also note that playing anything but dialtone risks remote echoes causing talk off.

The version of Asterisk is too old for me to know whether it differs from current versions in any of the above.

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