Dialing Multiple Numbers Simultaneously with Twilio

Yesterday, Brad Gessler asked whether he could use Twilio to simultaneously call multiple people for a call routing app.  This is a common use case, even for something as simple as a front desk phone of a small business that rings multiple people and hangs up once the first person answers.

Twilio-multi-dial-twitter-Q

Answer: YES, you can do that with Twilio.

I’m going to show you the TwiML you’ll need to
implement it.

Because the <Number> element can be nested within <Dial>, you can include multiple numbers under the same <Dial> element, like this:

<?xml version=“1.0″ encoding=“UTF-8″?>

<Response>

<Dial>

    <Number>877-555-1212</Number>

    <Number>877-999-1234</Number>

    <Number>877-123-4567</Number>

</Dial>

</Response>

This command will dial all three numbers simultaneously, and the first number to answer will be connected to the call while the other two will be hung up on.

Tips & Advice When Using This Feature

A word to the wise, in the case of calling a phone that automatically goes to voicemail or an automated answering system, it’s likely the call will be picked up faster by one of these machines than any human being can answer.

If you want to offer a voicemail box as a fall back in the case that all three lines do not answer, try using a handler to determine the next step for the call based on the DialStatus, like this:

<?xml version=“1.0″ encoding=“UTF-8″?>

<Response>

<Dial action=“/handleDialStatus.php” method=“GET”>

    <Number>877-555-1212</Number>

    <Number>877-999-1234</Number>

    <Number>877-123-4567</Number>

</Dial>

</Response>

When <Dial> ends, Twilio will submit to the action URL with the parameter
DialStatus with one of the following scenarios:

  • nobody picks up, DialStatus=no-answer
  • the line is busy,
    DialStatus=busy
  • he called party picked up, DialStatus=answered
  • an
    invalid phone number was provided, DialStatus=failed

Your web application can look at the DialStatus parameter and decide what to
do next.
If an action URL is provided for Dial, Twilio will always post to it, regardless of outcome of Dial.
All verbs remaining in the document will be unreachable and ignored.

Related Resources in the Twilio Documentation:

TwiML Dial Verb

Twilio REST API Call Resource

Posted by Danielle Morrill on May 14, 2009
  • http://polleverywhere.com Brad Gessler

    This is awesome… we use RingCentral to do something similar for our companies phone system and I can’t stand how complicated and convoluted it is to configure everything that should be so simple.
    When I find some time I’m def. going to be playing with this!

  • http://polleverywhere.com Brad Gessler

    This is awesome… we use RingCentral to do something similar for our companies phone system and I can’t stand how complicated and convoluted it is to configure everything that should be so simple.
    When I find some time I’m def. going to be playing with this!

  • http://polleverywhere.com Brad Gessler

    This is awesome… we use RingCentral to do something similar for our companies phone system and I can’t stand how complicated and convoluted it is to configure everything that should be so simple.
    When I find some time I’m def. going to be playing with this!

  • http://polleverywhere.com Brad Gessler

    This is awesome… we use RingCentral to do something similar for our companies phone system and I can’t stand how complicated and convoluted it is to configure everything that should be so simple.
    When I find some time I’m def. going to be playing with this!

  • http://www.quickschools.com/ Fariza

    This is very helpful. Now, I am just wondering how the code will look like if I want to initiate multiple calls using the REST API (i.e. our application is to initiate calls to multiple agents)and have the calls dropped when one of the agents picks up the phone.

  • http://www.quickschools.com/ Fariza

    This is very helpful. Now, I am just wondering how the code will look like if I want to initiate multiple calls using the REST API (i.e. our application is to initiate calls to multiple agents)and have the calls dropped when one of the agents picks up the phone.

  • http://www.quickschools.com/ Fariza

    This is very helpful. Now, I am just wondering how the code will look like if I want to initiate multiple calls using the REST API (i.e. our application is to initiate calls to multiple agents)and have the calls dropped when one of the agents picks up the phone.

  • http://www.quickschools.com/ Fariza

    plus, i also want to have a one-minute delay between each outgoing call. =D

  • http://www.quickschools.com/ Fariza

    plus, i also want to have a one-minute delay between each outgoing call. =D

  • http://www.quickschools.com/ Fariza

    plus, i also want to have a one-minute delay between each outgoing call. =D

  • http://www.quickschools.com/ Fariza

    plus, i also want to have a one-minute delay between each outgoing call. =D

  • Barry Carter

    OK, but is it possible to call 3 numbers at the same time and connect all 3 of them with the caller? An instant 4-person conference call from one twilio number? If so, how

    • http://www.twilio.com Twilio

      Barry, this is possible but not something that we’ve seen anyone build yet.

      • Mr J

        How would that TwiML snippet look like? I’m actually planning on an app that will call N persons to have them into a conference quickly.

        1. An alarm goes off.
        2. A signal is sent to my server.
        3. An automatic call to N persons to host a conference with all of them.
        4. They agree who is best suited to handle the alarm in question.