-1

I have a requirement where I need to ring multiple numbers when a person calls the Twilio number. If one of the phones are engaged I want to ring one of the other available phones.

How can I do this?

I can achieve ringing multiple phones using the below code. But the issue is when one of the phones are engaged it takes the next person calling the Twilio number to the voicemail instead of ringing one of the other available phones.

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Dial>
    <Number>NUMBER1</Number>
    <Number>NUMBER2</Number>
    <Number>NUMBER3</Number>
  </Dial>
</Response>

Thank you very much!

2 Answers2

1

Anyone looking for a solution for this answer, this is how I did it.

On the phone settings of NUMBER1 I forwarded calls to NUMBER2 when NUMBER1 is busy/not answered. Did the same to NUMBER2 and NUMBER3. On the NUMBER3 phone switched off voicemail.

1

In your solution then if NUMBER1 and NUMBER2 are busy this is what will happen. I'll call up, Twilio will connect me to NUMBER1 and start charging you for an incoming call, NUMBER1 will divert to NUMBER2 and start charging for a divert, then NUMBER 2 will divert to NUMBER3 and start charging for a divert. You are now paying for 3 calls for me to talk to NUMBER3.

I would either:

  • Use answering machine detection within Twilio and route calls answered by an answerphone back into a modified multi dial without the nuber which is busy
  • If all incoming calls are through Twilio then generate the multi dial TwiML dynamically based on who already has an active Twilio call
  • Write some basic code for the phones which triggers an HTTP request when a call starts/ends, have that request trigger a database update on your server to record the status of all phones and use the database entries to determine which numbers to include in the multi dial TwiML. This is my favourite as it's easy and doesn't matter if the calls are incoming/outgoing Twilio/not. No idea if its feasible on IOS, but I wrote a script on Android to mute/unmute my TV when I
    get calls which makes an HTTP request exactly like this and it took about 5 minutes.
miknik
  • 5,748
  • 1
  • 10
  • 26