1
votes

I want to use Twilio / Twiml to create a sequential ring group when a call comes in. What I have currently rings all phone numbers in the group simultaneously.

<dial timeout="30">
   <number>xxx-xxx-xxxx</number>
   <number>xxx-xxx-xxxx</number>
</dial>

I dont want the simultaneous behavior, instead I want the dial verb to dial the first number and wait 30 seconds, then if there is no answer, ring the next phone number and so on.

How do I implement this using twiml?

Thanks in advance.

2

2 Answers

2
votes

Perhaps there is a more sophisticated way to do this but you could return multiple dial with a pause (and eventually a say) in between.

The pause will give time to the initiator to hangup before a next dial is executed.

<Dial timeout="30">
   <number>xxx-xxx-xxxx</number>
</Dial>

<Pause length="5"/>
<Say>Moving to call the next number. You can hangup now if you wish to stop this.</Say>
<Pause length="5"/>

<Dial timeout="30">
   <number>xxx-xxx-xxxx</number>
</Dial>

<Pause length="5"/>
<Say>Moving to call the next number. You can hangup now if you wish to stop this.</Say>
<Pause length="5"/>

<Dial timeout="30">
   <number>xxx-xxx-xxxx</number>
</Dial>
1
votes

Twilio developer evangelist here.

Alex is right, multiple <Number>s in a <Dial> will make calls in parallel, but multiple <Dial>s will do one after another.

An alternative you could build is known as "hunt" or "find me" and, in an implementation I created, uses Twilio Functions to return numbers in sequence. Check out the instructions for it here: https://github.com/philnash/useful-twilio-functions/tree/master/hunt