TwiML™ Voice: <Pause>

The <Pause> verb waits silently for a specific number of seconds. If <Pause> is the first verb in a TwiML document, Twilio will wait the specified number of seconds before picking up the call.

Verb Attributes

The <Pause> verb supports the following attributes that modify its behavior:

Attribute Name Allowed Values Default Value
length integer > 0 1 second

length

The 'length' attribute specifies how many seconds Twilio will wait silently before continuing on.

Nesting Rules

You can't nest any verbs within <Pause>, but you can nest the <Pause> verb within the following verbs:

Examples

Example 1: Simple pause

This example demonstrates using <Pause> to wait between two <Say> verbs.

Loading Code Samples...
Language
SDK Version:
  • 5.x
SDK Version:
  • 7.x
SDK Version:
  • 3.x
SDK Version:
  • 5.x
SDK Version:
  • 6.x
SDK Version:
  • 5.x
Format:
  • TwiML
const VoiceResponse = require('twilio').twiml.VoiceResponse;

const response = new VoiceResponse();
response.say('I will pause 10 seconds starting now!');
response.pause({
    length: 10
});
response.say('I just paused 10 seconds');

console.log(response.toString());
using Twilio.TwiML;
using System;


class Example
{
    static void Main()
    {
        var response = new VoiceResponse();
        response.Say("I will pause 10 seconds starting now!");
        response.Pause(length: 10);
        response.Say("I just paused 10 seconds");

        Console.WriteLine(response.ToString());;
    }
}
<?php
require_once './vendor/autoload.php';
use Twilio\Twiml;

$response = new Twiml();
$response->say('I will pause 10 seconds starting now!');
$response->pause(['length' => 10]);
$response->say('I just paused 10 seconds');

echo $response;
require 'twilio-ruby'

response = Twilio::TwiML::VoiceResponse.new
response.say('I will pause 10 seconds starting now!')
response.pause(length: 10)
response.say('I just paused 10 seconds')

puts response
from twilio.twiml.voice_response import Pause, VoiceResponse, Say

response = VoiceResponse()
response.say('I will pause 10 seconds starting now!')
response.pause(length=10)
response.say('I just paused 10 seconds')

print(response)
import com.twilio.twiml.Pause;
import com.twilio.twiml.VoiceResponse;
import com.twilio.twiml.Say;
import com.twilio.twiml.TwiMLException;


public class Example {
    public static void main(String[] args) {
        Say say = new Say.Builder("I will pause 10 seconds starting now!")
            .build();
        Say say2 = new Say.Builder("I just paused 10 seconds").build();
        Pause pause = new Pause.Builder().length(10).build();
        VoiceResponse response = new VoiceResponse.Builder().say(say)
            .pause(pause).say(say2).build();

        try {
            System.out.println(response.toXml());
        } catch (TwiMLException e) {
            e.printStackTrace();
        }
    }
}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Say>I will pause 10 seconds starting now!</Say>
    <Pause length="10"/>
    <Say>I just paused 10 seconds</Say>
</Response>
Simple pause

Example 2: Delayed pickup

This example demonstrates using <Pause> to delay Twilio for 5 seconds before accepting a call.

Loading Code Samples...
Language
SDK Version:
  • 5.x
SDK Version:
  • 7.x
SDK Version:
  • 3.x
SDK Version:
  • 5.x
SDK Version:
  • 6.x
SDK Version:
  • 5.x
Format:
  • TwiML
const VoiceResponse = require('twilio').twiml.VoiceResponse;

const response = new VoiceResponse();
response.pause({
    length: 5
});
response.say('Hi there.');

console.log(response.toString());
using Twilio.TwiML;
using System;


class Example
{
    static void Main()
    {
        var response = new VoiceResponse();
        response.Pause(length: 5);
        response.Say("Hi there.");

        Console.WriteLine(response.ToString());;
    }
}
<?php
require_once './vendor/autoload.php';
use Twilio\Twiml;

$response = new Twiml();
$response->pause(['length' => 5]);
$response->say('Hi there.');

echo $response;
require 'twilio-ruby'

response = Twilio::TwiML::VoiceResponse.new
response.pause(length: 5)
response.say('Hi there.')

puts response
from twilio.twiml.voice_response import Pause, VoiceResponse, Say

response = VoiceResponse()
response.pause(length=5)
response.say('Hi there.')

print(response)
import com.twilio.twiml.Pause;
import com.twilio.twiml.VoiceResponse;
import com.twilio.twiml.Say;
import com.twilio.twiml.TwiMLException;


public class Example {
    public static void main(String[] args) {
        Pause pause = new Pause.Builder().length(5).build();
        Say say = new Say.Builder("Hi there.").build();
        VoiceResponse response = new VoiceResponse.Builder().pause(pause)
            .say(say).build();

        try {
            System.out.println(response.toXml());
        } catch (TwiMLException e) {
            e.printStackTrace();
        }
    }
}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Pause length="5"/>
    <Say>Hi there.</Say>
</Response>
Delayed pickup

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.

1 / 1
Loading Code Samples...
SDK Version:
  • 5.x
SDK Version:
  • 7.x
SDK Version:
  • 3.x
SDK Version:
  • 5.x
SDK Version:
  • 6.x
SDK Version:
  • 5.x
Format:
  • TwiML
const VoiceResponse = require('twilio').twiml.VoiceResponse;

const response = new VoiceResponse();
response.say('I will pause 10 seconds starting now!');
response.pause({
    length: 10
});
response.say('I just paused 10 seconds');

console.log(response.toString());
using Twilio.TwiML;
using System;


class Example
{
    static void Main()
    {
        var response = new VoiceResponse();
        response.Say("I will pause 10 seconds starting now!");
        response.Pause(length: 10);
        response.Say("I just paused 10 seconds");

        Console.WriteLine(response.ToString());;
    }
}
<?php
require_once './vendor/autoload.php';
use Twilio\Twiml;

$response = new Twiml();
$response->say('I will pause 10 seconds starting now!');
$response->pause(['length' => 10]);
$response->say('I just paused 10 seconds');

echo $response;
require 'twilio-ruby'

response = Twilio::TwiML::VoiceResponse.new
response.say('I will pause 10 seconds starting now!')
response.pause(length: 10)
response.say('I just paused 10 seconds')

puts response
from twilio.twiml.voice_response import Pause, VoiceResponse, Say

response = VoiceResponse()
response.say('I will pause 10 seconds starting now!')
response.pause(length=10)
response.say('I just paused 10 seconds')

print(response)
import com.twilio.twiml.Pause;
import com.twilio.twiml.VoiceResponse;
import com.twilio.twiml.Say;
import com.twilio.twiml.TwiMLException;


public class Example {
    public static void main(String[] args) {
        Say say = new Say.Builder("I will pause 10 seconds starting now!")
            .build();
        Say say2 = new Say.Builder("I just paused 10 seconds").build();
        Pause pause = new Pause.Builder().length(10).build();
        VoiceResponse response = new VoiceResponse.Builder().say(say)
            .pause(pause).say(say2).build();

        try {
            System.out.println(response.toXml());
        } catch (TwiMLException e) {
            e.printStackTrace();
        }
    }
}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Say>I will pause 10 seconds starting now!</Say>
    <Pause length="10"/>
    <Say>I just paused 10 seconds</Say>
</Response>
SDK Version:
  • 5.x
SDK Version:
  • 7.x
SDK Version:
  • 3.x
SDK Version:
  • 5.x
SDK Version:
  • 6.x
SDK Version:
  • 5.x
Format:
  • TwiML
const VoiceResponse = require('twilio').twiml.VoiceResponse;

const response = new VoiceResponse();
response.pause({
    length: 5
});
response.say('Hi there.');

console.log(response.toString());
using Twilio.TwiML;
using System;


class Example
{
    static void Main()
    {
        var response = new VoiceResponse();
        response.Pause(length: 5);
        response.Say("Hi there.");

        Console.WriteLine(response.ToString());;
    }
}
<?php
require_once './vendor/autoload.php';
use Twilio\Twiml;

$response = new Twiml();
$response->pause(['length' => 5]);
$response->say('Hi there.');

echo $response;
require 'twilio-ruby'

response = Twilio::TwiML::VoiceResponse.new
response.pause(length: 5)
response.say('Hi there.')

puts response
from twilio.twiml.voice_response import Pause, VoiceResponse, Say

response = VoiceResponse()
response.pause(length=5)
response.say('Hi there.')

print(response)
import com.twilio.twiml.Pause;
import com.twilio.twiml.VoiceResponse;
import com.twilio.twiml.Say;
import com.twilio.twiml.TwiMLException;


public class Example {
    public static void main(String[] args) {
        Pause pause = new Pause.Builder().length(5).build();
        Say say = new Say.Builder("Hi there.").build();
        VoiceResponse response = new VoiceResponse.Builder().pause(pause)
            .say(say).build();

        try {
            System.out.println(response.toXml());
        } catch (TwiMLException e) {
            e.printStackTrace();
        }
    }
}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Pause length="5"/>
    <Say>Hi there.</Say>
</Response>