Recording a phone call with Twilio

There are multiple ways to record phone calls made and received on your Twilio account:

<Record> in TwiML

You can add the <Record> verb to the TwiML file that Twilio fetches after we connect your phone call. Use this approach if you want to record one person talking. This is how you would build a voicemail system, or a phone poll that asked users to record something.

Make sure to specify an action url on the <Record>. Failure to do so will result in looping. If you also provide a recordingStatusCallback parameter, you will receive a webhook with all the recording details when the recording is available for access. For more information, see our documentation on the <Record> verb in TwiML.

<Dial record=”record-from-answer”> or
<Dial record=”record-from-answer-dual”> or
<Dial record=”record-from-ringing”> or
<Dial record=”record-from-ringing-dual”> in TwiML

Use this method if you want to record both sides of a conversation. This is how you would record a forwarded call, or any type of call based on <Dial>. For mono-channel recordings (both legs of the call on one channel), use “record-from-answer” or “record-from-ringing”.  For dual-channel recordings (two legs of the call on separate channels), use “record-from-answer-dual” or “record-from-ringing-dual”.

If you provide a recordingStatusCallback parameter, you will receive a webhook with all the recording details when the recording is available for access.  For more information, see our documentation on the <Dial> verb in TwiML.

<Conference record=”record-from-start”> in TwiML

Use the attribute above if you want to record the entirety of your conference call. This type of recording will start only when a conference is bridged, i.e. when participants are able to talk to each other. If you’d like to start your recording as soon as the <Dial> starts, use one of the <Dial> recording parameters noted above. Note that you can specify record on <Dial> as well as on <Conference> which will return two separate recordings.

If you provide a recordingStatusCallback parameter, you will receive a webhook with all the recording details when the recording is available for access.  For more information, see our documentation on the <Conference> noun in TwiML.

Record=”true” in REST API

You can append the parameter "Record=true" when making a POST request for Twilio to make an outgoing call via the REST API. Use this if you want to record the entirety of an outgoing call. For dual-channel recordings (two legs of the call on separate channels), append the parameter "RecordingChannels=dual".  By default, the recording will be mono-channel.

If you provide a recordingStatusCallback parameter, you will receive a webhook with all the recording details when the recording is available for access.  For more information, see our documentation on placing an outgoing call with the REST API.

Recording calls on your outbound Elastic SIP trunk

You can configure your outbound Elastic SIP trunk to record all of your calls that go over your trunk. You can choose to set the recording functionality to  “Record from Ringing” or “Record from Answer”. To configure your trunk go to your list of Outbound SIP Trunks in the Console, click on the trunk you want to configure and select your desired setting under the “Call Recording” section.

Hosting your TwiML

You can write TwiML and host it on a server of your choosing, but you also have the option to use Twilio as your host if you’ve coded up a simple recording script using just TwiML. To use Twilio as your host, we’ll use a tool called TwiML Bins that you can find in your Console. Simply create a new Bin to paste your code into and then save it to one of your Twilio numbers.

How to view your recordings

You can view all your recordings in the Recordings Log section of the Console. You can also fetch recordings from your account via a GET request to the “Recordings” resource.

Have more questions? Submit a request
Powered by Zendesk