3
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial action="actionurl/" callerId="+1xxxxxxxxxx" record="record-from-answer-dual" timeLimit="3600" timeout="30">
<Number>+1yyyyyyyyyy</Number>
</Dial>
</Response>

My current TWIML is as follows. This places an outgoing call from the browser with number +1xxxxxxxxxx to +1yyyyyyyyyy. I want to play a recording saying "The call is being recorded" to the party being called. I am trying to find a solution without creating a conference.

I acheived this behavior for incoming calls quite easily by using the Say verb and then dialing the web application client.

1 Answers1

0

Twilio developer evangelist here.

You can do this with what is called a whisper. A whisper allows you to leave a message or allow the person being called to provide some input before being connected.

To implement a whisper, you use the url attribute of <Number> to point to the TwiML you want to play before the calls are connected. In the case of a message, that TwiML can be a <Say> element with the message you want to read.

It would look something like this:

<Response>
  <Dial action="actionurl/" callerId="+1xxxxxxxxxx" record="record-from-answer-dual" timeLimit="3600" timeout="30">
    <Number url="/recording-message">+1yyyyyyyyyy</Number>
  </Dial>
</Response>

And then at /recording-message you would return more TwiML:

<Response>
  <Say>This call is being recorded for monitoring or training purposes.</Say>
</Response>
philnash
  • 70,667
  • 10
  • 60
  • 88