dual-channel-recording
Native dual-channel recording is now available and can be enabled via the Twilio Console. The first agent to join the call will be on the left channel, and the other participants on the right channel. See the changelog entry for more details, including restrictions and instructions to enable.
This template feature will remain available for use cases that are not supported by the native feature. If you need the conditional recording functionality that this feature provides, you can use the conditional-recording
feature instead, which works with the native recording functionality.
A version of this feature is also available in the Flex Plugin Library. If you prefer to use the Plugin Library version alongside the template, please remove this feature from your instance of the template to prevent conflicts.
There are various ways to enable call recordings with Twilio Flex. Let's outline those methods to better understand when using this custom solution would be preferable.
- The simplest approach is to turn on "Call Recording" in Flex Settings on the Twilio Console. Enabling this setting records the conference and automatically updates the task attribute
conversations.segment_link
with the recording URL so it can be played back in Flex Insights.- Pros:
- One click configuration, no custom code or setup required
- All inbound and outbound calls are automatically recorded
- Cons:
- Conference recordings are single channel, or mono, recordings. This means analytics tools like Flex Insights are unable to determine if the customer or the agent is speaking, limiting capabilities of those tools such as detecting cross talk.
- No option for custom business logic to determine which calls are recorded. All calls, inbound and outbound, are recorded.
- Pros:
- Follow our Enabling Dual-Channel Recordings guide to start a dual-channel recording in Studio and capture recording metadata on the task attributes for playback in Flex Insights
- Pros:
- No custom code required. Configuration is done entirely in Studio's graphical interface.
- Recordings are dual-channel, capturing customer and agent audio in their own audio channels
- Custom business logic can be leveraged in Studio to selectively record calls
- All audio played to the customer by the IVR can be included in the recording, depending where in the Studio flow the recording is started. This is helpful for situations when you need to capture a specific message played to the customer, such as a notification that the call is being recorded.
- Cons:
- All audio played to the caller while they wait in queue for an agent to become available will be included in the recording. This is likely not an issue for contact centers with low wait times, but when wait times are long, recording durations will increase along with recording storage costs.
- This method does not address outbound calls from Flex as Studio flows are only triggered by inbound calls. So a custom solution would be required to record outbound calls.
- Pros:
- The solution in this feature is the third method we'll consider. Recordings are started from a this plugin, leveraging a server side Twilio Function to call the Twilio Recordings API. The task attribute
conversations.media
is updated with the recording metadata so Flex Insights can play the recording.- Pros:
- Recordings are dual-channel, capturing customer and agent audio in their own audio channels
- The same solution works for both inbound and outbound calls
- Custom business logic can be leveraged to selectively record calls
- The recording begins from the moment the customer and agent are connected, so no IVR or queue hold audio is captured in the recording
- Cons:
- Custom code is required, both on the front end and the backend (facilitated by this feature)
- If it's desired to record the IVR messaging, that will not be included
- If the worker uses the "Join Call" button in Flex UI when multiple instances are open, and the worker call leg is the one being recorded, the recording will not restart when the new instance's call leg starts.
- Pros:
setup and dependencies
The feature is enabled via flex-config asset for your environment. There is also a channel
configuration property to choose which perspective should be recorded--the customer perspective or the worker perspective. For example, if the customer is on hold and channel
is set to customer
, the recording will contain hold music. If channel
is set to worker
, the recording will not contain hold music and the worker will be heard instead.
If enabling the dual channel recording feature - you should also disable the call recording flag in the Flex Configuration within Twilio Console > Flex > Manage > Voice.
You may also optionally specify task attributes and/or queues that should exclude a task from being recorded by the dual-channel recording feature:
- To exclude recording tasks based on the task attributes present, set the
exclude_attributes
configuration property to an array of key/value pair objects. For example, to prevent recording outbound calls:"exclude_attributes": [{ "key":"direction", "value":"outbound" }]
- To exclude recording tasks based on queue name or queue SID, set the
exclude_queues
configuration property to an array of queue names or SIDs. For example:"exclude_queues": ["Queue Name 1", "Queue Name 2"] // or ["WQxxx", "WQxxx2"]
how it works
Whenever an inbound or outbound call task is accepted, a serverless function is called to start a recording with recordingChannels
set to dual
. The customer call SID or the worker call SID will be used for the recording based on the value of the channel
configuration property.