Skip to content

Connect MiaRec to Twilio Flex

Procedure overview

The process of integrating MiaRec platform with Twilio Flex requires a few steps:

  1. Enable Dual Channel Call Recording plugin in Twilio Flex
  2. Create API keys for MiaRec, which will be used to pull call recordings from Twilio platform
  3. Create Event Stream to push real-time call events to MiaRec

Step 1. Enable Dual Channel Call Recording plugin

Note

In Twilio Flex, there are multiple options to record calls:

  1. Enable Call Recording under Flex > Voice settings in Twilio Console. Enabling this setting records both inbound and outbound calls, but the recordings are single channel, or mono, recordings. This means analytics tools like AI Insights in MiaRec are unable to determine if the customer or the agent is speaking, limiting capabilities of those tools.

  2. Enable dual-channel recording in Twilio Studio flows. Recordings are dual-channel, capturing customer and agent audio in their own audio channels, but such a method doesn't address outbound calls from Flex as Studio flows are only triggered by inbound calls.

  3. Enable SIPREC integration between Twilio and MiaRec in Twilio Studio flows. With these method, the MiaRec platform will be receving real-time audio stream from Twilio and record the calls into dual-channel (stereo) files. This method doesn't address outbound calls from Flex as Studio flows are only triggered by inbound calls.

  4. Enable Dual Channel Call Recording plugin under Plugin library. With this plugin, both inbound and outbound call scenarios are being recorded automatically, and the recordings are dual-channel (stereo).

Ihis this guide, we will use the Dual Channel Call Recording plugin as it is the easiest way to enable dual-channel recording for both inbound and outbound call scenarios.

Login to the Twilio Flex Admin Console at flex.twilio.com/admin and click Plugins link.

Twilio Flex Admin Console - Plugins

Under Plugin Library, locate the Dual Chanel Call Recording plugin:

Dual Channel Recording Plugin in Plugin Library

Click Install button and wait for the plugin to install.

Dual Channel Recording Plugin - Installed

Now, when you make inbound or outbound calls in Twilio Flex, such calls will be automatically recorded in Twilio. You will be able to see such recordings in Twilio Console under Monitor > Logs > Call recordings:

Twilio Monitor Logs Call Recordings

In the next step, we will enable an integration with the MiaRec platform, which will pull these recordings and analyze for AI Insights and Auto QA (agent evaluation).

Step 2. Create API key credentials for MiaRec

In Twilio Admin Console, navigate to Keys & Credentials by clicking Account pop-up menu in top-right corner:

API keys and Credentials popup menu

Click Create new API key button and fill the required attributes:

  • Choose the Friendly name, for example "MiaRec"
  • Select Restricted - Beta under Key type
  • Under Permissions, check the following boxes:

    • Calls > calls: Read and List
    • Calls > call.recordings: Read and List
    • Recordings > recordings: Read and List
    • Iam > accounts: Read

Create API key

Create API key permissions

Click Create button. In the new screen, you will see API Key SID and Secret values. Copy these values and save into secure location, for example, your password manager. You will need these values in the next step.

API key credentials

Step 3. Get Account SID from Twilio Admin Console

Navigate to the landing page in Twilio Admin Console at console.twilio.com and find your Account SID. You will need this value in the next step.

Twilio Account SID

Step 4. Configure API credentials in the MiaRec platform

Login to the MiaRec platform with your admin credentials. Contact your MiaRec representative if you do not have an account with MiaRec yet.

Navigate to Administration > System > Integration and click Add to create an integration with Twilio Flex.

MiaRec - create integration with Twilio Flex

Select Twilio Flex from the list and click Continue:

MiaRec - create integration with Twilio Flex

Enter your Account SID, API key SID and API Key Secret that you created in the previous steps.

Select Twilio for the Recording method.

MiaRec - create integration with Twilio Flex

Click Continue and wait a few seconds for the MiaRec platform to connect to your Twilio organization and verify everything.

MiaRec integration with Twilio Flex - progress

After all tests pass successfully, click Continue button. You will be navigated to the Connected Integration page details.

On this page, you need to copy the Webhook URL value that will be used in the next step, when we create Event Stream subscription.

MiaRec integration with Twilio Flex - progress

Step 5. Create Event Stream subscription

With Event Stream subscription, the Twilio platform will be sending real-time call events to the MiaRec platform. With such events, the call metadata will be enriched with information about agent who is handling the call, transfer and conference events, etc.

In Twilio Admin Console, navigate to Event Steams > Manage.

Click Create > New sink button to create a Sink for the MiaRec application.

Create Twilio Event Streams Sink

In the Create new sink page, choose a name for this sink (for example, MiaRec) and select Webhook as a sink type.

Click Next step.

Create Twilio Event Streams Sink

In the Create a new webhook sink step, paste the Webhook URL from the MiaRec application into the Destination input field.

Select POST for the Method.

Click Finish button.

Create Twilio Event Streams Sink

In the next screen, click Create subscription button.

Create Twilio Event Streams Sink

In the Create new subscription page, enter the descriptive name under Subscription description (for example, "MiaRec webhook events").

Create Twilio Event Streams Sink

Under Select event types for this subscription, select the following events:

  • TaskRouter > Reservation: all events
  • TaskRouter > Task: all events
  • Voice > Status Callback: Conference Participant Updated and Conference Updated events

Create Twilio Event Streams Sink

Create Twilio Event Streams Sink

Create Twilio Event Streams Sink

Click Create Subscription.

Congratulations! You completed the initial configuration.

Verify

Make a test call to see recordings in the MiaRec portal on the Recordings page.

MiaRec Twilio Flex call recording example

If you do not see recordings in the MiaRec portal after a reasonable time, contact the MiaRec support team to troubleshoot.

Next steps

Contact your MiaRec Customer Success manager to setup AI Insights and Auto QA for your contact center.