Benj
Benj

Reputation: 1875

Forward a call in Twilio with a greeting to the called party

I have a Twilio app that receives calls from a Caller and forwards them to a Recipient based on attributes of the incoming call. When calling the recipient, I would like to play a greeting message before making the calls - is there a way to do this?

My TwiML response currently looks something like this:

<Response>
    <Dial number="+18005551212"/>
</Response>

I would like to do something like this, but don't know how:

<Response>
    <Dial>
        <Number>+18005551212</Number>
        <SayToRecipient>This is AwesomeApp. I am forwarding a call from 301-555-1212. BEEP.</SayToRecipient>
        <NowConnectTheCalls/>
    </Dial>
</Response>

Is there away to do this?

Upvotes: 1

Views: 663

Answers (1)

Devin Rader
Devin Rader

Reputation: 10366

Twilio evangelist here.

Yup. What you want to do is called a whisper and we have a How To that shows you how to build this:

https://www.twilio.com/docs/howto/ivrs-call-screening-and-recording

The short version is that the <Number> noun has a URL attribute that allows you to pass TwiML to Twilio that we will execute when the dialed party answers but before the two calls are connected.

Hope that helps.

Upvotes: 2

Related Questions