Search code examples
twiliodtmf

Can I send digits to an incoming twilio call with twiml?


I have a twilio number that can process incoming calls with twiml. These incoming calls expect the recipient to press some digits after the call is connected.

If I were making an outgoing call, I could use the sendDigits attribute of a <Dial> tag. However, I can't figure out how to do this in response to an incoming call.

If I were receiving the call in a web client, I could use connection.sendDigits

Is there a way to do this in just twiml? Should I just play a recording file of various DTMF tones?

Edit: To clarify, I'm receiving calls from another automated system that expects additional numbers to be dialed after the call is connected.


Solution

  • Turns out the way to to do this is by using the <Play> twiml tag, which accepts a digits attribute.

    <Play digits="94"></Play>