Play message and interrupt with DTMF on unanswered call

We want to play an authentication PIN prompt on outbound calls, which means that we want to:

  • Play a message to the caller
  • On the unanswered outbound call
  • Which can be interrupted with a DTMF key press
  • And read what the DTMF key pressed was

We’ve tried:

  • Using “background” but it answers the call to play the message
  • Using “playback” but it won’t be interrupted by a DTMF key press
  • Using “stream file” but the audio can’t be heard by the caller

Does anyone know of a way to do all of what we want? Thank you in advance!

Are you using ARI? I achieve this by starting a playback and storing it by ID in memory. When I receive a DTMF, I grab the object from the ID and call Playback#stop

Thank you but no, we’re using AGI not ARI.

I’ve found the solution though - to use Progress before using using stream file.

Hope this helps someone else.

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