twilioivr

Testing our IVR - Twilio send_digits


I am building a machine to bounce with our company's IVR. For that I need a degenerated IVR and specifically I wish to have it receiving a call and sending_digits to the IVR.

I could not figure out how to send_digits without first calling the other party.

Using python for this matter.

Can someone spill light on this?


Solution

  • Twilio developer evangelist here.

    I think you are asking how to receive a call on a Twilio number and play DTMF tones. If so, you can do that using the <Play> TwiML element.

    <Play> normally expects a URL that plays an audio file. However, you can also pass the digits attribute which will direct Twilio to send the DTMF tones down the line.

    You can add any digits you like as well as pauses using the w character. A single w will wait for half a second and you can use multiple in a row. For example this TwiML will direct Twilio to send the digits 123 then wait 1 second, then send 456, then end the call.

    <Response>
      <Play digits="123ww456"/>
    </Response>