Call Recording and Voicemail with Twilio Flex

While call recording is not built-in to Twilio Flex, it's customizable nature offers users a number of options for call recording and setting up a voicemail box. Read on for more information.

Notice: Links to call recordings will automatically be appended to a task’s attributes. Any applications (including Twilio Marketplace add-ons) that consume the TaskRouter event feed have visibility into these task attributes, including the URL for any call recordings.

Record Calls

You can record incoming calls with Flex using the Actions Framework. In only a few lines of code, you can add commands to record the agent-leg of any conference call. Here’s an example of what this code might look like in your plugin:

flex.Actions.addListener("beforeAcceptTask", (payload) => {
payload.conferenceOptions.record = 'true';
payload.conferenceOptions.recordingStatusCallback = 'https://mysite.com/recordingcallbackurl';
});

This example tells Flex to modify the conferenceOptions before a task is accepted.

  • ...conferenceOptions.record = 'true' tells us to record the agent-leg of the conference call.
  • ...conferenceOptions.recordingStatusCallback = '...' tells us to reach out or call back to the url given when the call recording file has been processed, and is available for you.

For help adding this code to your hosted Flex instance, please see Creating Plugins for Twilio Flex.

Start and Stop Recording

Using the Recording Controls API, you can begin, pause, and stop recording a call at any time with a simple API request. We've created a guide to walk users through adding a button to the Flex UI to control call recording here: How to Control Recordings with Twilio Flex.

For more information on controlling call recordings, please see Getting Started with Call Recording Controls.

Record Voicemail

With TaskRouter and a couple of Functions, you can route waiting callers to your own custom voicemail box. For a full walkthrough on setting this up, please see Implementing Voicemail with Twilio Flex, TaskRouter, and WFO.

View, Download, and Delete Call Recordings

Call recordings are accessible via the Recordings Log section of the Console, and the REST API. You can see a list of your recordings, download them, and delete them from either of these resources. Recording files are kept in Twilio’s cloud storage until you delete them.

For more information, please see Downloading and Deleting Twilio Call Recordings

Legal Implications of Call Recording

If you choose to record calls, you need to comply with certain laws and regulations, including those regarding obtaining consent to record (such as California’s Invasion of Privacy Act and similar laws in other jurisdictions). Additional information on the legal implications of call recording can be found here.

Notice: Twilio recommends that you consult with your legal counsel to make sure that you are complying with all applicable laws in connection with communications you record or store using Twilio.

Related Topics

Have more questions? Submit a request
Powered by Zendesk