Five9 and Mindful integration guide

Integrate the Five9 platform with Mindful services

This guide provides instructions for integrating Mindful with Five9 Virtual Contact Center (VCC). Here, you can learn how to configure Mindful Callback, Scheduler, and Datastore to integrate with Five9 VCC. Each step in the integration process will be demonstrated through examples that can be used as templates for your specific integration.

Overview

The configuration presented in this guide follows the outline below:

  • Configure the Mindful platform

  • Configure Five9

    • Configure a secure SIP trunk

    • Create an Auth Profile

    • Modify the inbound IVR script in VCC Administrator

    • Create the return call (callback) IVR script

    • Create and apply a Connector for the Mindful Agent Answer API

  • (Optional) Configure second chance callback

Note:
  • Callback offers are made in the Five9 inbound IVR script, rather than Mindful.

  • This guide assumes the use of a secure SIP trunk between both platforms with Secure RTP for voice traffic.

  • The configuration in this guide is an example and may be used as a template for integrating with Mindful. Any sample code in this guide should not be considered ready for production.

Definitions and acronyms

TermDescription
ANI (or CLI)Automatic Number Identification is the number of the caller, also known as Calling Line Identification in some markets.
APIAn Application Programming Interface is a set of functions that allows applications to request service from other applications.
DIDDirect Inward Dialing phone number
DNISThe Dialed Number Identification Service is the number of the callee (typically the number that is being dialed) in a voice call.
Mindful CallbackCallback is the part of the Mindful platform that provides the capability to request and receive callbacks.
DatastoreThis service adds the capability to store and retrieve custom data through an API.
SchedulerScheduler is the feature of Mindful that allows callbacks to be requested via API from other applications.
PSTNThe public circuit-switched telephone network
RTP/SRTPReal-time Transport Protocol is a network protocol used to deliver audio and video over IP networks. SRTP is the secure (encrypted) version of RTP.
SIPSession Initiation Protocol is a signaling protocol used in IP communications.
TFNToll-free number
TLSTransport Layer Security is an encryption protocol used for secure SIP signaling between two endpoints.
TTSText-to-speech

Inbound call flow

inbound call flow diagram
  • A customer places a call into the Five9 contact center.

  • The DNIS is matched to the campaign associated with the inbound IVR script.

  • After checking the status of Mindful, the Estimated Wait Time (EWT), and the caller's preference for the callback option, the inbound IVR script may optionally post the required user data to the Mindful Datastore.

  • The call is then transferred back to the phone number of the relevant Mindful Call Target via the TLS SIP trunk between Five9 and Mindful, along with optional custom SIP headers.

Note: This section illustrates the process of requesting a callback through an inbound call into Mindful. However, callbacks can also be requested using the Mindful Scheduler APIs, with associated user data sent to the Mindful Datastore via the Datastore API. Regardless of the method used to create the callback, the logic of the callback IVR script will remain the same.

Note that if any of the following conditions occur, the call will queue to the agent skill at normal priority instead of being transferred to Mindful:

  • The Mindful API indicates that an offer should not be made.

  • The EWT is below the configured threshold.

  • The caller declines the callback offer.

  • There is another error in the IVR script, such as a query-module or function failure.

Return-call (callback) call flow

callback call flow diagram
  • Mindful initiates a call to the customer's callback number. The customer presses DTMF 1 to speak to an agent.

  • Mindful establishes a call to the contact center through the TLS trunk between Mindful and Five9.

  • The DNIS of the agent leg is matched to the Campaign associated with the callback IVR script.

  • The callback IVR script optionally retrieves any custom SIP headers and/or retrieves user data from the Mindful Datastore using a Query module, with the caller's ANI passed in as the search key.

  • The call is queued to an agent skill at a higher priority than inbound calls.

Note: This section illustrates a customer-first call flow. Mindful also supports an agent-first call flow, where the agent leg is initiated first. The configuration and IVR scripts remain the same regardless of the method used.

Configure the Mindful platform

Before your ACD can send inbound calls to Mindful, there are a few items that must be configured on the Mindful side:

  • At least one Call Target to register and dial callbacks

  • A Data Set Template in Mindful Datastore (if you intend to use Datastore to store custom user data and context)

There are a few settings in Callback that must be adjusted to integrate with your ACD:

Registration

Callback > Call Targets > Your Call Target > General tab > Registration

  • Offer ASAP Callback — Select this checkbox to offer callbacks to be returned as soon as possible.
  • Offer Scheduled Callback — Select one or both of these checkboxes (Voice and/or Widget/API) if you wish to offer callback scheduling for specific dates and times.

Contact Center

Voice > Call Targets > Your Call Target > General tab > Contact Center

  • Callback Telephony Type — Select "SIP".
  • Callback Number — This will be configured in a later step.

Callback Strategy

Voice > Call Targets > Your Call Target > General tab > Callback Strategy

Most of the Callback Strategy settings are not relevant to the integration, and they can be set however you would like. However, there is one notable exception when using the Customer First Callback Strategy.

When using Customer First, enable Wait for live Agent. This will prompt agents to press a digit to accept a callback, which provides an Agent Answer event to Mindful. The Agent Answer events assist in calculating an accurate Estimated Callback Time (ECBT).

screenshot of the wait for live agent setting

Phone Numbers

Configuration > Phone Numbers

On the Phone Numbers page, provision as many SIP numbers as needed and assign a number to each Call Target in your Organization. This is the number to use when configuring the SIP endpoint to which to send inbound calls for callback treatment.

Datastore configuration

Mindful Datastore allows you to store user data to maintain call context at critical points in an interaction. If you intend to use Datastore, you will need to perform the next few steps within the Datastore user interface.

A Data Set Template contains a collection of Data Keys that allows the Mindful Datastore to store customer data during the callback request process. This collection includes:

  • The set's name and description

  • How long you want to retain collected data submitted with this Data Set

  • What information you want the set to collect (through configuration of Data Keys)

  • The API token that is used to associate data submitted via POST requests and return information via GET requests

The Mindful Solution Delivery team can assist with setting up a Data Set Template, as well as a unique authentication token. To create one on your own, use the steps below.

  1. On the Data Set Templates page (Datastore > Data Set Templates), click Add Data Set Template. This takes you to the New Data Set Template page.

    screenshot of the data set templates pagescreenshot of the new data set template page
    • Name — Enter a name that will be recognizable to others in your organization.

    • Description — Enter a description for the benefit of other Administrators.

    • Data Retention Period (Hours) — Manually enter or use the +/- buttons to customize your Data Retention Period. You can retain data for 1 hour, or for up to 48 hours.

    • API Token — The system automatically generates your API Token.

      Important: If your API Token is already plugged into your routing logic, regenerating the token here will break that link. To re-establish the link, update your host with the new API Token. Contact Mindful Support for assistance.
    • Template Data Keys — You can select from existing Data Keys in your system or add new keys. The selected keys will filter out any submitted data that does not correspond to one of the configured keys, and will only retain submitted data that matches the configured keys.

  2. Click Add Template Data Key. This opens the New Template Data Key modal window.

    • Click in the Manually Enter Data Keys field.
      • If your Mindful Datastore instance contains existing Data Keys, select one from the dropdown list that appears.

      • If not, type the name of a new Data Key here.

    • When finished, click Add.

    Your key will now appear in the Template Data Keys list.

Example

In our example integration, we set up the following Data Keys for callbacks:


example data keys
  • FirstName
  • LastName
  • AccNum
  • CallId

You can configure Data Keys in the same way for any user data that you need to maintain in your environment.

With the Mindful Datastore integration already enabled for your Organization, you can now enable it for individual Call Targets. Complete the following steps for all Call Targets within your Organization:

  1. Open Call Targets > Your Call Target > General tab > Mindful Datastore Integration.

  2. Select the Mindful Datastore Integration checkbox to reveal additional settings below.

  3. In the Data Set Template field, select the Template that you created in a previous step.

datastore settings

Configure a secure SIP trunk

You will need a TLS SIP trunk between Five9 and Mindful. It is recommended to route voice call traffic between Five9 domains and Mindful through this SIP trunk.

Important:

To ensure calls are directed over the SIP trunk, inform your Five9 project team to utilize the TLS SIP trunk for all calls to Mindful. The Mindful Solution Delivery team will provide a range of numbers associated with your Mindful account. Share this number range with the Five9 project team to ensure calls to those numbers are routed to Mindful via the TLS SIP trunk.

After the project concludes, if additional numbers need to be added to route calls through the SIP trunk, follow the process outlined by Five9 below:

Inbound to Five9 (from Mindful):

  • Email cases@five9.com to request that the provided numbers be routed via SIP inbound to Five9 and provisioned to this domain. Include the following information in your email:

    • Account number
    • Account name
    • Carrier group
  • Once the numbers are added to the domain, your VCC admin must assign them to a running campaign or a Five9 agent contact for the desired call routing.

Outbound (from Five9 to Mindful):

  • Email cases@five9.com and inform them that numbers have been added at the Mindful end of your SIP path. Request Five9 to update DCR with the provided number(s) to ensure they use SIP to route outbound calls.

  • Provision the numbers at the Mindful end to be routed once received via SIP from Five9.

Create an Auth Profile

In order to invoke the Mindful API in the inbound IVR script later, Five9 needs a Auth Profile containing OAuth2 credentials associated with your Mindful organization.

As part of the Inbound call flow, the VCC IVR script will send a request to the Mindful Get Offer API endpoint to ensure that the relevant Mindful Call Target is available and ready to register callbacks. The API response will also include an EWT phrase that can be played to callers to help them make informed decisions.

Create a new Auth Profile (Actions > Configuration > Auth Profiles) configured as seen below:

example auth profile
  • Type — Select "OAuth2"

  • Name — Enter a descriptive name, such as "Mindful Call Target OAuth2".

  • Notes — Enter descriptive notes for future reference, as needed.

  • OAuth2-Flow — Select "Client Credentials Grant".
  • Auth URL — Enter the OAuth credentials URL of the Mindful API (https://auth.getmindful.com/oauth2/token).

  • Client Id and Client Secret — Enter the Client ID and Secret from a Mindful Application Client.

  • Scope — Enter mindful-api/callback.metric.read and mindful-api/callback.status.read separated by a space.

  • Supply In — Select "HTTP Authorization Header".

You can now reference this Auth Profile in the inbound IVR script in a later step.

Configure IVR scripts

You will need to modify the inbound IVR script to add Mindful callback logic, and create a new IVR script to handle callbacks coming from Mindful back into Five9.

For instructions on configuring both scripts, see Five9 IVR scripts, then return to this guide when finished.

Create and apply a new Connector for the Agent Answer API

The Mindful Agent Answer API endpoint allows Five9 to advise Mindful of the exact moment that an agent answers a callback, which helps Mindful calculate accurate statistics, such as ECBT punctuality. To invoke this endpoint, you will need to configure a new Connector and apply it to the return call campaign.

Configure a new Connector

Follow the steps below to configure the Connector:

  1. On the home page, select the "Connectors" tile.

  2. Click Create to get started.

  3. Configure the connector as shown below:

    example connector configuration
  • Name and Description — Enter a name and a description such as "Submit an agent answer event to Mindful".

  • URL — Enter the base URL of the Agent Answer API endpoint (api.getmindful.com//v2/callback/agentAnswer)

  • Method — Select "GET".

example params
  • Parameters — Add the following parameters to be appended to the base URL in a query string, in the format shown:

    • (Required) ani — 1@Call.ANI@

    • (Required) apiKey — Enter your API Key for a Mindful Application Client.

    • (Optional) agentId — @Agent.id@

    • (Optional) queueId - @Call.skill_id

example triggers
  • On the Trigger tab, select the "Call" tile.

  • Select “On Call Accepted” in the On Call Event drop-down menu.

Apply the Connector

After creating the new connector for the Agent Answer API, apply the connector to the return call campaign via the steps below:

  1. On the home page, select the "Campaigns" tile.

  2. Select your return call campaign, then open the Integrations tab.

  3. In the Connectors section, click Add, then select the new Connector:

    example of applying the connector

This will apply the connector logic to any calls that arrive at the Skill Transfer Module in the assigned IVR Script.

(Optional) Configure second chance Callback

Second chance callback offers callers the opportunity to receive a callback after they initially decline the offer in the inbound IVR script. This option is presented while the call is in the queue, as part of the announcements played during the wait.

Important:
  • When a caller accepts the second chance callback offer and leaves the queue, it may result in an Abandon statistic for that call. This should be taken into account when generating inbound call reports.

  • The second chance callback IVR script logic ensures that calls exiting the second chance Transfer to ACD Skill module due to reaching the Max Queue Time will be transferred to Mindful. To prevent this, it is recommended to set the Max Queue Time to cover contact center queue durations and enable it when agents are unavailable or not logged in.

  • If a caller has accepted a callback offer, whether the initial callback offer or a second chance offer, and the transfer fails, the caller should not be offered another callback. This is reflected in the IVR script logic outlined below.

The diagram below assumes that the inbound IVR script logic is already implemented. This diagram begins at the point where the caller is initially offered a callback.

second chance callback ivr script diagram
Note:

Ensure that the appropriate Skill Transfer modules are used based on the caller's response to the initial callback offer and the specific conditions encountered during the call flow.

A separate Skill Transfer module should be included for queueing to a skill with second chance callback only for calls where the caller has declined the initial callback offer.

For any other scenarios where the caller is not being transferred to Mindful, such as low EWT, an invalid response from the Mindful status check, script errors, or transfer errors, the call should be queued to a skill using a Skill Transfer module without the second chance offer.

Update the Inbound IVR Script for second chance callback

The inbound IVR script logic must be modified as shown:

I.V.R. script changes for second chance callback

The main change involves the addition of a new Skill Transfer module (named 2CC_skillQueue in this example) that is triggered when the result of the offerCallback Menu module is either "Queue" or "No Match". The output from this new Skill Transfer module is treated as if the caller had accepted the initial offer (the callback output from the offerCallback Menu module).

In the 2CC_skillQueue Skill Transfer module, configure the General tab as follows:

example skill transfer module

Take note of the Termination Digit, which is set to 1 in this example. If a caller presses 1 while in the queue, the call will exit the queue and proceed to the next module in the IVR Script.

To provide the second chance callback offer, it should be added to the Announcement tab of the second chance Skill Transfer module.

skill transfer module properties

During the call queueing process, the following sequence is implemented in this example:

  • The caller will hear hold music for 120 seconds.

  • After the hold music, a built-in EWT announcement will be played.

  • Following the EWT announcement, the caller will hear a custom second chance callback prompt (for example, "To receive a callback instead of waiting in line, press 1"). This prompt can be added using the Prompts section in Five9, either as a wav file or generated using TTS.

Both announcement lines are enabled and set to loop. In the example, the announcements will repeat every 120 seconds until one of the following conditions is met:

  • The caller abandons.

  • The caller is connected with an agent.

  • The module Max Queue Time expires.

  • The caller presses the configured Termination Digit.

If the caller presses the Termination Digit, the IVR script can optionally set the SIP headers or data to be posted to the Mindful Datastore and then transfer the call to Mindful.