Twilio to have pause period when using loop to repeat voice call

665 Views Asked by At

I tried repeating a message in voice call as python code here which was guided here but not working i.e. no pause at all whatever number for :length it is <Pause length="3">

call = client.calls.create(
    twiml = f'''
    <Response>
        <Gather>
            <Say loop="{loop}">{message}</Say>
            <Pause length="3"></Pause>
        </Gather>
        <Redirect>/gather.xml</Redirect>
    </Response>
    ''',
    to    = to,
    from_ = from_,
)
1

There are 1 best solutions below

10
On

Take a look at SSML Pause.

Adding a Pause

SSML Break Tag

I tried out the below, and it worked. Don't forget your <Gather> action url.

<Response>
    <Gather>
        <Say loop="3">This is a message with a pause between loops<break time="3s"/></Say>
    </Gather>
    <Redirect>/gather.xml</Redirect>
</Response>