Search code examples
twiliotransfer

Twilio - Play an audio file to the person call is transferred to before connecting


The answer to this my be out there, but I'm having trouble locating it do to I don't know what the feature would be called.

I have a phone system setup where people call in with an option to press zero to be transferred to a live person. The person it goes to also receives calls from other places and I would like to notify them with an audio file and possibly a action with a little more info about the call before it's connected.

Example of what I would like to happen: A call is placed to our system and they press zero, they hear on-hold music while a action is started.The phone rings in our office and the receptionist picks it up. After answering they hear something like 'incoming call from some company, connecting now', and then the call connects to the other person.

I have everything working in the system right now minus the piece of audio the receptionist would hear before the call is connected.

Is there a feature like this built into Twilio?


Solution

  • Twilio evangelist here.

    What you're describing is called a 'whisper' and its pretty easy to set up with Twilio. I'd start by reading through the Call Screening and Recording How to which includes an example of a whisper.

    Specifically, check out examples 4 and 5 which shows how to include the url attribute on the <Number> noun. The url you provide there will be requested when the second call is answered and allows you to return TwiML that Twilio will execute to that call before we bridge the two calls together.

    Hope that helps.