Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

How to record a single side of a call


Learn to programmatically record only one side of a call with Twilio Programmable Voice by using the RecordingTrack parameter in a POST request. You can use this guide to create self-service automation, inbound contact centers, outbound contact centers, sales dialers, call tracking systems, and AI/ML transcription.

See Related reference documentation to learn more about the TwiML and API requests used in this guide.


How it works

how-it-works page anchor

RecordingTrack is an optional parameter that can be used to select whether the inbound, outbound or both audio tracks of the call should be recorded. The inbound track represents the audio received by Twilio, and the outbound track represents the audio that Twilio generates on the call.

For example, if the caller is interacting with an IVR, the inbound track contains the caller's voice and the outbound track contains the audio generated via either <Say> or <Play>. Alternatively, if the caller is connected to agent via <Dial>, then the outbound track will contain the audio spoken by agent.

(warning)

Warning

When inbound or outbound audio track is recorded, the resulting recording file will always be mono-channel. When audio is recorded using both, you can choose either separate channel (dual) or mixed (mono).

This table illustrates the expected outcome when using recordingTrack and attributes together to request a recording:

RecordingTrackRecordingChannelOutcome
--Records the inbound and the outbound audio of the call mixed in a single channel of the recording file.
-monoRecords the inbound and the outbound audio of the call mixed in a single channel of the recording file.
-dualRecords the inbound and the outbound audio of the call in two separate channels of the recording file.
inbound-Records the inbound audio of the call in a single channel of the recording file. The inbound track is the audio that is received by Twilio from the call.
outbound-Records the outbound audio of the call in a single channel of the recording file. The outbound track is the audio that is generated by Twilio.
both-Records the inbound and the outbound audio of the call mixed in a single channel of the recording file.
inboundmonoRecords the inbound audio of the call in a single channel of the recording file. The inbound track is the audio that is received by Twilio from the call.
inbounddual (→ mono)Records the inbound audio of the call in a single channel of the recording file. The inbound track is the audio that is received by Twilio from the call. Note: if you set "RecordingChannel=dual", this will be ignored and automatically set to mono.
outboundmonoRecords the outbound audio of the call in a single channel of the recording file. The outbound track is the audio that is generated by Twilio.
outbounddual (→ mono)Records the outbound audio of the call in a single channel of the recording file. The outbound track is the audio that is generated by Twilio. Note: if you set "RecordingChannel=dual", this will be ignored and automatically set to mono.
bothmonoRecords the inbound and the outbound audio of the call mixed in a single channel of the recording file.
bothdualRecords the inbound and the outbound audio of the call in two separate channels of the recording file

How to configure Single Party Call Recording

how-to-configure-single-party-call-recording page anchor

You can enable single party recording for any given call using the following Twilio's Programmable Voice APIs:

(information)

Info

This feature is not yet available in TwiML <Record> or <Conference>. SIP Trunking calls also do not currently support this functionality.

Set RecordingTrack on a new outbound CallLink to code sample: Set RecordingTrack on a new outbound Call
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createCall() {
11
const call = await client.calls.create({
12
from: "+14155552344",
13
record: true,
14
recordingTrack: "outbound",
15
to: "+14155552345",
16
url: "https://www.example.com",
17
});
18
19
console.log(call.sid);
20
}
21
22
createCall();

Response

Note about this response
1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"answered_by": null,
4
"api_version": "2010-04-01",
5
"caller_name": null,
6
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
7
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",
8
"direction": "inbound",
9
"duration": "15",
10
"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",
11
"forwarded_from": "+141586753093",
12
"from": "+14155552344",
13
"from_formatted": "(415) 867-5308",
14
"group_sid": null,
15
"parent_call_sid": null,
16
"phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
17
"price": "-0.03000",
18
"price_unit": "USD",
19
"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
20
"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",
21
"status": "completed",
22
"subresource_uris": {
23
"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",
24
"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
25
"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",
26
"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",
27
"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",
28
"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",
29
"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",
30
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",
31
"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"
32
},
33
"to": "+14155552345",
34
"to_formatted": "(415) 867-5309",
35
"trunk_sid": null,
36
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
37
"queue_time": "1000"
38
}
(warning)

Warning

The default value of the record attribute is do-not-record. Make sure you set this to true as it will not be automatically enabled regardless of RecordingTrack property.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createCallRecording() {
11
const recording = await client
12
.calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.recordings.create({ recordingTrack: "inbound" });
14
15
console.log(recording.accountSid);
16
}
17
18
createCallRecording();

Response

Note about this response
1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"api_version": "2010-04-01",
4
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"conference_sid": null,
6
"channels": 2,
7
"date_created": "Fri, 14 Oct 2016 21:56:34 +0000",
8
"date_updated": "Fri, 14 Oct 2016 21:56:34 +0000",
9
"start_time": "Fri, 14 Oct 2016 21:56:34 +0000",
10
"price": null,
11
"price_unit": null,
12
"duration": null,
13
"sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
14
"source": "StartCallRecordingAPI",
15
"status": "in-progress",
16
"error_code": null,
17
"encryption_details": null,
18
"track": "both",
19
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
20
}
Configure recording party when adding a new participant to a conferenceLink to code sample: Configure recording party when adding a new participant to a conference
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createParticipant() {
11
const participant = await client
12
.conferences("ConferenceSid")
13
.participants.create({
14
from: "+14155552344",
15
record: true,
16
recordingTrack: "inbound",
17
to: "+14155552345",
18
});
19
20
console.log(participant.accountSid);
21
}
22
23
createParticipant();

Response

Note about this response
1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"label": "customer",
5
"conference_sid": "ConferenceSid",
6
"date_created": "Fri, 18 Feb 2011 21:07:19 +0000",
7
"date_updated": "Fri, 18 Feb 2011 21:07:19 +0000",
8
"end_conference_on_exit": false,
9
"muted": false,
10
"hold": false,
11
"status": "queued",
12
"start_conference_on_enter": true,
13
"coaching": false,
14
"call_sid_to_coach": null,
15
"queue_time": "1000",
16
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
17
}

Configure recording party using <Dial>

configure-recording-party-using-dial page anchor

Use <Dial> verb to dial a new participant from an active ongoing call and record the call specifying what audio should be recorded using recordingTrack parameter. The following example illustrates how to record the inbound audio:

(warning)

Warning

The default value of the record attribute is do-not-record. Make sure you set this to true as it will not be automatically enabled regardless of RecordingTrack property.

1
const VoiceResponse = require('twilio').twiml.VoiceResponse;
2
3
const response = new VoiceResponse();
4
const dial = response.dial({
5
record: 'record-from-answer',
6
recordingTrack: 'inbound',
7
recordingStatusCallback: 'https://www.myexample.com/recording-handler',
8
});
9
dial.number('+15551239876');
10
11
console.log(response.toString());

Output

1
<Response>
2
<Dial record="record-from-answer"
3
recordingTrack="inbound"
4
recordingStatusCallback="https://www.myexample.com/recording-handler">
5
<Number>+15551239876</Number>
6
</Dial>
7
</Response>

How to determine which track has been recorded

how-to-determine-which-track-has-been-recorded page anchor

The request made to recordingStatusCallback contains the track attribute to indicate which audio track was recorded. It is recommended to subscribe to the recordings callback in order to know which audio track has been chosen.

You can also check this information from the call recordings log in Twilio Console(link takes you to an external page) or the legacy Console(link takes you to an external page).


Use cases for recording a single side of a call with Twilio Programmable Voice

use-cases-for-recording-a-single-side-of-a-call-with-twilio-programmable-voice page anchor

This guide teaches the basics required for the following use cases:

Create self-service automation with Twilio Programmable Voice

create-self-service-automation-with-twilio-programmable-voice page anchor

You can use this guide to record only the caller's side of the interaction when they interact with an IVR. This allows you to analyze customer responses without including the automated prompts in the recording file.

To learn more advanced features that you can use with self-service automation, see Voice self-service automation.

Create an inbound contact center with Twilio Programmable Voice

create-an-inbound-contact-center-with-twilio-programmable-voice page anchor

You can use this guide to record specifically the agent or the customer side of a call. This is useful for quality assurance and training purposes where individual track isolation is required.

To learn more advanced features that you can use with inbound contact centers, see Voice inbound contact center.

Create an outbound contact center with Twilio Programmable Voice

create-an-outbound-contact-center-with-twilio-programmable-voice page anchor

You can use this guide to isolate the audio of your agents during outbound campaigns. Recording a single track simplifies the process of reviewing agent performance and compliance.

To learn more advanced features that you can use with outbound contact centers, see Voice outbound call center.

Create a sales dialer with Twilio Programmable Voice

create-a-sales-dialer-with-twilio-programmable-voice page anchor

You can use this guide to record sales pitches or customer feedback during outbound sales calls. Isolating tracks helps in cleaning up audio for CRM logging and sales coaching.

To learn more advanced features that you can use with sales dialers, see Voice sales dialer.

Create call tracking with Twilio Programmable Voice

create-call-tracking-with-twilio-programmable-voice page anchor

You can use this guide to record and analyze specific participants in a tracked call. This helps in identifying which party initiated specific keywords or sentiments during the conversation.

To learn more advanced features that you can use with call tracking, see Voice call tracking.

Create transcriptions for AI or ML with Twilio Programmable Voice

create-transcriptions-for-ai-or-ml-with-twilio-programmable-voice page anchor

You can use this guide to capture clean, single-sided audio for high-accuracy AI transcription. By isolating the inbound track, you ensure that the machine learning model only processes the speaker's voice without background noise or Twilio-generated audio.

To learn more advanced features that you can use with AI or ML transcription, see Voice AI/ML transcription.


After following this guide, you can programmatically record a single side of a call using Twilio Programmable Voice. You can verify this by checking the track attribute in your recordingStatusCallback or by viewing the recording logs in the Twilio Console to confirm only one audio track was captured.


Explore the following guides to build on what you've learned in this guide: