Connect MiaRec to Twilio Flex
Procedure overview
The process of integrating MiaRec platform with Twilio Flex requires a few steps:
- Enable Dual Channel Call Recording plugin in Twilio Flex
- Create API keys for MiaRec, which will be used to pull call recordings from Twilio platform
- 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:
-
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.
-
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.
-
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.
-
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.
Under Plugin Library, locate the Dual Chanel Call Recording plugin:
Click Install button and wait for the plugin to install.
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:
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:
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
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.
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.
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.
Select Twilio Flex from the list and click Continue:
Enter your Account SID, API key SID and API Key Secret that you created in the previous steps.
Select Twilio for the Recording method.
Click Continue and wait a few seconds for the MiaRec platform to connect to your Twilio organization and verify everything.
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.
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.
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.
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.
In the next screen, click Create subscription button.
In the Create new subscription page, enter the descriptive name under Subscription description (for example, "MiaRec webhook events").
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
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.
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.