How to know when a call is forwarded from Twilio?

435 views Asked by At

I have a (UK Landline) phone number at Twilio. I have set up call forwarding, so that the caller ID {{contact.channel.address}} is passed on to me (using Twilio studio).

I want to know when the call has been forwarded to me so that I can disambiguate from other calls. But, I also want to keep the original caller ID (if possible).

Is there a way to either:

  • Play a short audio message only to me before the caller connects, or

  • Somehow flag that the call was forwarded from a specific number, and display that on my phone (iPhone on EE uk).

1

There are 1 answers

0
Matt On

I found some pointers in here and here, and it's a called a "Whisper".

The simplest way to do this is to create two "Twiml Bins".

Bin 1 - Call Whisper to just <Say> a message

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Say>Forwarded from Twilio!</Say>
</Response>

Bin 2 - Call forward and whisper to forward the call, but execute the whisper Twiml (above) before connecting the caller:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Dial>
         <Number url="https://handler.twilio.com/twiml/{yourtwiliobinabove}">
            44xxxxxx(your number)
        </Number>  
    </Dial>
</Response>