mosa lorans
mosa lorans

Reputation: 45

How To press One While Twilio Call is Making

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)

Upvotes: 0

Views: 173

Answers (1)

IObert
IObert

Reputation: 3816

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>

Upvotes: 1

Related Questions