Matt
Matt

Reputation: 394

How to know when a call is forwarded from Twilio?

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:

Upvotes: 2

Views: 596

Answers (1)

Matt
Matt

Reputation: 394

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>

Upvotes: 2

Related Questions