Pre-built Queued Callback and Voicemail plugin is available in Flex UI 2.x.x
This guide is only for Flex UI 1.x.x. If you have Flex UI 2.x.x, install the ready-to-use Queued Callback and Voicemail plugin. You must be logged in to Twilio console to access the Flex Plugin Library.
This solution features sample code that is provided "as is" and is not production grade. The featured code does not account for edge case handling, scalability, and reliability. It is not covered under Twilio's Service Level Agreement (SLA) and support plans.
This solution supports Flex applications that can handle up to 1 call per second. We do not recommend this solution if your contact center exceeds that limit as you will run into API limits enforced by TaskRouter.
The Queued Callback and Voicemail for Flex solution helps Flex admins automate handling of agent callback requests from customers instead of having them wait longer in a queue. In this solution, the customer hears the callback menu options as soon as they call the number provisioned on your Flex application. Your contact center agents will receive the details including the requested callback number, and a localized time for the customer's inbound call.
The call is on hold for the period of time that you've configured within queue-menu.protected.js. When the time period expires, it will go on and route according to the workflow configuration.
User leaving a voicemail message or requesting a callback from an agent
npm -v
in your terminal to check)
node -v
in your terminal to check)
Twilio CLI along with the Flex CLI Plugin and the Serverless Plugin. Run the following commands to install them:
_10# Install the Twilio CLI_10npm install twilio-cli@2.0 -g_10# Install the Serverless and Flex as Plugins_10twilio plugins:install @twilio-labs/plugin-serverless_10twilio plugins:install @twilio-labs/plugin-flex
If you're running Linux, click on the Linux tab for the Twilio CLI installation instructions. If you're running Windows, make sure to run the Windows command prompt as an administrator to install the Serverles/Flex plugins for the Twilio CLI. The Windows commands in this guide use PowerShell (for Node.js/npm installation).
To provision Twilio resources and deploy this solution using a script, skip to the download step. After installing the dependencies, run node provision
and follow the instructions.
Make sure to activate the correct Twilio account before deploying the Flex plugin.
After the script is complete, enable the plugin on your Flex application.
30-45 minutes
In order to use the solution, you need to prepare your Flex Task Assignment workspace.
Navigate to your Flex project in the Twilio Console. Copy your ACCOUNT SID and AUTH TOKEN, and create a new Twilio CLI profile using those credentials:
_10twilio profiles:create
You will be prompted to enter your Twilio Account SID, Auth Token, and a shorthand identifier for your profile. When choosing a shorthand identifier, pick one that is meaningful and easy to remember. Once your profile has been created, activate it by running:
_10twilio profiles:use PROFILE_ID
Keep in mind that this account will be used for the rest of the deployment. In order to switch accounts, use the following command:
_10twilio profiles:use DIFFERENT_PROFILE_ID
Retrieve your Flex Task Assignment workspace ID:
_10twilio api:taskrouter:v1:workspaces:list
Example Workspace SID
_10SID Friendly Name Prioritize Queue Order_10WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Flex Task Assignment FIFO
To retrieve your Flex workspace SID from the Twilio Console, navigate to the TaskRouter Dashboard.
In the Twilio Console, select your Flex project and navigate to All Products & Services > TaskRouter > Workspaces > Flex Task Assignment > Task Channels. Create two task channels: one for callback and one for voicemail, so you can route the associated tasks to available agents.