How To press One While Twilio Call is Making

117 views Asked by At

I have this line of code in python to call in Twilio.

During a call, it says to press one to continue the call. So, how do I press one while on a call?

call = client_.calls.create(
                 record = True,
                 twiml=phone_call,
                 from_=from_phone_number_,
                  to = to_phone_number_,
                   url=url_to_xml)
1

There are 1 answers

0
IObert On

The keyword you are looking for is DTMF tones. You can use the <Play> verb to play DTMF tones as well as 1/2 second waits:

<?xml version="1.0" encoding="UTF-8" ?>
<Response>
    <Play digits="wwww3"></Play>
</Response>

You can use the <Pause> verb to tell Twilio to pause processing TwiML for a specified number of seconds:

<?xml version="1.0" encoding="UTF-8" ?>
<Response>
    <Pause length="5"/>
    <Say>Hi there.</Say>
</Response>