Skip to contentSkip to navigationSkip to topbar
On this page

Supervisor Barge-In and Coach (Flex UI 1.x.x)


(information)

Pre-built Supervisor Barge and Coach plugin is available in Flex UI 2.x.x

This guide is only for Flex UI 1.x.x, which reached End of Life on June 30, 2024. To build on a current version, we recommend you upgrade to Flex UI 2.x.x and install the ready-to-use Supervisor Barge and Coach(link takes you to an external page) plugin instead. You must be logged in to Twilio Console to access the Flex Plugin Library.


Overview

overview page anchor
(warning)

Warning

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)(link takes you to an external page) and support plans(link takes you to an external page).

The Flex Supervisor Barge-In and Coach solution allows contact center supervisors to barge in and coach agents while they are on a live call. When the supervisor barges in, they will now join the call between the agent and the customer. When the supervisor coaches the agent, they can listen to the call between the customer and the agent, and can provide feedback to the agent without the customer hearing it. The supervisor can also listen to the call in incognito mode.


This solution enhances the supervisor's UI with three buttons for barging in and coaching, and a coaching mode. Within Teams View(link takes you to an external page), you can click on the agent you wish to coach and the buttons will be available once you begin to observe the live call.

First, select the call you wish to observe.

teams-view-hidden.width-1600.

This brings up the Call Canvas where you can click on the Monitor button to enable the Barge-In and Coach buttons.

The Barge-In button in the middle allows you to join the call between an agent and a customer. You can toggle the button to mute and unmute yourself. The Coach button on the right allows you to only talk to the agent you are observing, leaving the customer out of the coaching segment of the call. Toggling this button enables Coach mode and the left button converts to a Mute/Unmute button for the coaching mode.

When monitoring is enabled, you can click on the eye icon to toggle between Normal and Private mode. Normal Mode displays the coaching supervisor's name to the agent while Private Mode keeps the coaching information hidden.

call-canvas-barge-in-coach.

barge-in-and-coach (1).

To deploy this solution, you will need:

  • An active Twilio account with Flex provisioned. Refer to the Flex Quickstart to create one.

  • npm version 6.0.0 installed (type npm -v in your terminal to check)

  • A Node.js long-term-support (LTS) version(link takes you to an external page) installed, 14 recommended (type node -v in your terminal to check)

  • Twilio CLI along with the Flex Plugins CLI and the Serverless Toolkit. Run the following commands to install them:

    1
    # Install the Twilio CLI
    2
    npm install twilio-cli@2.0 -g
    3
    # Install the Serverless and Flex as Plugins
    4
    twilio plugins:install @twilio-labs/plugin-serverless
    5
    twilio plugins:install @twilio-labs/plugin-flex
(information)

Info

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).


30-45 minutes


Tested Flex Versions and Operating Systems

tested-flex-versions-and-operating-systems page anchor
  • Flex v1.125.4-1.26.3
  • macOS / Unix
  • Windows 10

Configure your Flex Workspace

configure-your-flex-workspace page anchor

In order to use the solution, you need to prepare your Flex Task Assignment workspace.

Retrieve your Flex settings

retrieve-your-flex-settings page anchor

Step 1

step-1 page anchor

Navigate to your Flex project in the Twilio Console(link takes you to an external page). Copy your ACCOUNT SID and AUTH TOKEN, and create a new Twilio CLI profile using those credentials:

twilio 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 that you can remember. Once your profile has been created, activate it by running:

twilio 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:

twilio profiles:use DIFFERENT_PROFILE_ID

Retrieve your Flex Task Assignment workspace ID:

twilio api:taskrouter:v1:workspaces:list

Example Workspace SID

1
SID Friendly Name Prioritize Queue Order
2
WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Flex Task Assignment FIFO
3

To retrieve your Flex workspace SID from the Twilio Console, navigate to the TaskRouter Dashboard.


Download the Flex Supervisor Barge-in and Coach Plugin

download-the-flex-supervisor-barge-in-and-coach-plugin page anchor

Download the plugin source code here(link takes you to an external page) and unzip the files in a local directory.

You can view the source code on GitHub: https://github.com/twilio-professional-services/plugin-supervisor-barge-coach(link takes you to an external page)


Deploy your Twilio Function

deploy-your-twilio-function page anchor

We will deploy the Barge-in and Coach functions to your Flex application. The functions are called from the plugin you will deploy in the next step and integrates with TaskRouter, passing in required attributes to perform the chat transfer.

Step 1: Change into the functions directory and rename .env.example(link takes you to an external page).

macOS/LinuxWindows
plugin-supervisor-barge-coach $ cd functions && mv .env.example .env

Step 2: Open .env and set the environment variables mentioned in the file.

1
TWILIO_ACCOUNT_SID = your Account SID from twil.io/console
2
TWILIO_AUTH_TOKEN = your Auth Token from twil.io/console
3
TWILIO_WORKSPACE_SID = your Flex Task Assignment workspace ID
4

Step 3: Run npm install in the functions folder.

Step 4: Deploy the Twilio functions to your account using the Twilio CLI:

twilio serverless:deploy
(information)

Info

When running on Windows, you may see an error with the Twilio Serverless deployment command. To work around the issue, set your TWILO_ACCOUNT_SID and TWILO_AUTH_TOKEN as environment variables. Refer to the previous section for examples of how to set an environment variable in Windows.

Example Function Deployment Output

example-function-deployment-output page anchor
1
Creating 1 Functions
2
Serverless project successfully deployed
3
4
Deployment Details
5
Domain: https://barge-coach-XXXX.twil.io
6
Service:
7
barge-coach (ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) ...

Step 4: Copy and save the domain returned when you deploy a function. You will need it in the next step.

If you forget to copy the domain, you can also refer to it by navigating to Functions > API(link takes you to an external page).

Debugging Tip: Pass the -l or logging flag to review deployment logs. For example, you can pass -l debug to turn on debugging logs.


Once you have deployed the function, it is time to deploy the plugin to your Flex instance.

Run the following commands in the plugin directory. We will leverage the Twilio CLI to build and deploy the Plugin.

1
plugin-supervisor-barge-coach $ npm install
2

From the plugin directory, rename the .env.example file to .env and update the variables with the appropriate values:

var REACT_APP_SERVICE_BASE_URL = https://barge-coach-XXXX-dev.twil.io

Paste the domain from Step 4 into the REACT_APP_SERVICE_BASE_URL variable. The function deployed in the previous step is called by the plugin source code.

To update the REACT_APP_TASK_CHANNEL_SID variable, run the following:

twilio api:taskrouter:v1:workspaces:task-channels:list --workspace-sid WSxxxxxxxxxxxxxxxxxx

When you are ready to deploy the plugin, run the following in a command shell:

twilio flex:plugins:deploy --major --changelog "Deploying major version of Barge-in and Coach plugin" --description "Supervisor Barge-in and Coach plugin"

Example Plugin Deployment Output

example-plugin-deployment-output page anchor
1
Validating deployment of plugin plugin-supervisor-barge-coach
2
| Compiling a production build of plugin-supervisor-barge-coachPlugin plugin-supervisor-barge-coach was successfully compiled with some warnings.
3
Compiling a production build of plugin-supervisor-barge-coach
4
Uploading plugin-supervisor-barge-coach
5
Registering plugin plugin-supervisor-barge-coach with Plugins API
6
Registering version v1.0.0 with Plugins API
7
8
🚀 Plugin (private) plugin-supervisor-barge-coach@1.0.0 was successfully deployed using Plugins API
9
10
Next Steps:
11
Run $ twilio flex:plugins:release --plugin plugin-supervisor-barge-coach@1.0.0 --name "Autogenerated Release 1624517195294" --description "The description of this Flex Plugin Configuration." to enable this plugin on your Flex application
12
13

The previous step only deploys your plugin. You still need to enable the Plugin on your Flex application. To enable, run the following:

twilio flex:plugins:release --plugin plugin-supervisor-barge-coach@1.0.0 --name "Autogenerated Release 1624570680076" --description "Enabling Barge-in and Coach for supervisors."

View plugin on your Plugins Dashboard

view-plugin-on-your-plugins-dashboard page anchor

After running the suggested next step, navigate to the Plugins Dashboard(link takes you to an external page) to review your recently deployed plugin and confirm that it's enabled for your contact center.

You are all set to test the Barge-in and Coach functionalities on your Flex application!

(warning)

Warning

Keep in mind that your Agents need to refresh their browsers in order to get the latest changes.


Testing will require two users on your Flex account with admin privileges. Logging in as an administrator enables you to access both the supervisor and the agent views. If you are testing it by yourself, log in to your Flex application with the two user credentials. Ensure that you are using two separate browser windows, one in incognito mode. In one window, you should be logged in as an agent accepting a call, while in the other as a supervisor observing/coaching the agent.

Step 1: Change your agent status to Available in the upper right corner of the Flex UI. This enables you to receive incoming calls.

Step 2: Call the number associated with your Flex instance (you can find the Twilio-provisioned number for your Flex instance on the Admin panel(link takes you to an external page) under "Test Drive").

Step 3: Switch to the supervisor session and navigate to the Teams View(link takes you to an external page) Tab. Click the phone icon to observe an ongoing agent call.

Step 4: From the supervisor session, click the Monitor button. This enables the Barge-In and Coach buttons.

call-canvas-barge-in-coach.

Clicking Barge-In unmutes the supervisor and allows all parties (agent and customer) to hear the supervisor. Toggle this on/off to test.

Clicking Coach unmutes you only to the agent/worker you are observing. No other participant on the call will hear you.

Clicking on the Normal Mode button toggles you between normal and incognito mode.

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.