I want to achieve the following scenario, When i play audio from MP3Player, I want the input to be capture by the DTMF stroke.
I know this can be done with a simple dialplan, Background Application.
I want this to be done in PHP AGI script, where it plays the MP3 sound and get the user interruption DTMF stroke and store into the variable.
getting DTMF digits in PHP agi achieve by get_data() or wait_for_digits(). what I want to achieve is something like background function. Let me know if you think the same feature can be achieved by python or Perl agi other than PHP
'mp3player()' is an Asterisk application, not an AGI command. You execute it via the 'exec' AGI command.
Thus, any ‘status’ that is returned is the status of the 'exec', not 'mp3player().'
It appears that 'mp3player()' does not set any channel variable to indicate the interrupting keystroke.
Why do you want to play MP3s? If you can convert the MP3 to WAV, you can use 'stream file' or something else that will allow you to ‘read’ the interrupting digit in your AGI.
Maybe if you expand on your application we can suggest a solution. Or maybe you could add that feature to 'mp3player().' Although I suspect 'mp3player()' is not a widely used application.
The source language does not change the AGI commands available – unless the command is not implemented in the library you are using.
Thank you @sedwards - It’s working as i expected, it has the escape character to get the DTMF. It store in a ASCII format, i have to convert using chr() function in php.