Contact Center Connector for Genesys Cloud
The below example describes how the Contact Center Connector (CCC) Framework can be used when interacting with Genesys Cloud. These instructions assume that the user has access to Genesys Cloud and is familiar with the platform.
Contact Center Platform
The contact center platform is responsible for handling incoming calls. With a Text-to-Speech (TTS) / Speech-to-Text (STT) engine it transcribes the words that the caller says and makes an HTTP call to a Teneo solution or to the Session Bridge, which forwards the request to a Teneo solution.
The solution executes a Flow and returns an answer to the contact center platform, containing an answer text and additional parameters which are processed in the contact center platform, such as transfers, callbacks, etc.
Text-to-Speech / Speech-to-Text Engine
The contact center platform needs a Text-to-Speech (TTS) and Speech-to-Text (STT) engine to transcribe the words spoken by the caller in text or read the answer from Teneo out loud to the caller.
In Genesys the following options are supported:
- Genesys Enhanced TTS
- Azure Speech
- Amazon Polly
STT/TTS only works using one of the engines mentioned above; the standard Genesys STT/TTS engine is not supported for Bot Flows
Session Bridge
The Session Bridge is a tool hosted on a server which transforms requests and responses. It is used to work around the restrictions of Genesys so that Teneo understands the requests and the other way around so that Genesys understand the responses.
The Session Bridge is mainly where the session management between Teneo and Genesys is handled. From Genesys, the Session Bridge is called and a bot URL to call Teneo is passed from the Bridge.
In short, the Session Bridge puts the session Id where the contrary software (i.e., Teneo or Genesys) can read it.
Teneo Solution
The published Teneo solution receives requests from the contact center platform with a text spoken by the caller and executes a Flow to provide an answer. Flows can also return additional data to control the contact center platform.
Bot Flow
The Bot Flow is the integration flow in Genesys that controls the communication with Teneo. Here the caller's voice input is transcribed, requests send and received from Teneo, the response is processed and the answer played from Teneo as an audio to the caller. Below flow diagram visualizes how it works:
flowchart A(Teneo API call: Begin session and get greeting message) --> B{is session initialized?} B --> |no| C(Store session id) C --> D(Passing answer to TTS engine and play audio) B --> |yes| E{Contains output text?} E --> |yes| D D --> F(Process output parameters) E --> |no| F F --> G{Action received?} G --> |no| N{User input required?} N --> |yes| O(Get user input from caller) O --> P(Teneo API call: send user input and parameters) P --> E N --> |no| P G --> |yes| H(Execute action) H --> K(Get data from platform) H --> L(Set conversation data) H --> M(Disconnect call) H --> I(Callback) H --> J(Transfer to queue) H --> U(Partial response) M --> R(Terminate session) R --> S((Flow end)) H --> T(Handle errors) K --> T T --> P I --> R J --> R K --> N L --> N U --> N
Actions
An action is a functionality that can be executed in the contact center. The action definitions, which is any action Teneo requires the contact center to perform, are created inside Teneo Flows and sent to the contact center platform.
As an example, a user says "Bye" and wants to finish a call. The call center sends the transcribed user input to Teneo, where a Flow is triggered that can handle this request. The flow returns a DISCONNECT
action request to the contact center platform. When the Contact Center Integration processes the returned data and finds the action, it executes the task to disconnect the call.
Actions are executed in the task Actions
which contains a switch-block that checks for the action name. Each case leads to an action task.
Action Tasks
Actions are structured inside tasks with the prefix [ACTION], which makes it easier to maintain and extend them.
The connection provides a collection of predefined actions that can be used right away or adapted to individual needs.
Non Terminating Actions
Non-terminating actions continue the dialogue loop after they are exectued and the results passed to Teneo.
- [ACTION] - Set data
- Sets conversation data; this data is gathered from the caller by Teneo and will be written in a JSON variable named
ConversationData
- Sets conversation data; this data is gathered from the caller by Teneo and will be written in a JSON variable named
- [ACTION] - Get data
- Gets data from Genesys; Teneo requests a specific key that can be added to the switch block and provide the requested data. The action contains the requested value, for example, the callback number and parameters required for gathering the data. The data is gathered in data tasks.
- [ACTION] - Partial response
- Handles the HTTP streaming scenario since Genesys doesn't support SSE messages.
Terminating Actions
Terminating actions are actions that are executed at the end of a conversation with Teneo. This means, when a terminating action is returned, there will be no further interaction with Teneo.
- [ACTION] - Disconnect
- Disconnects the call
- [ACTION] - Finish conversation
- Conversation is finished, the Teneo session will be terminated but the call is not yet disconnected; the Flow can continue with any other Flow functionality
- [ACTION] - Transfer
- Transfers the caller to a queue
- [ACTION] - Callback
- Creates a callback (immediately or scheduled).
Extending Actions
Existing actions can be customized and new actions can be added. To add a new action, follow these steps:
- Create a new action method in the Teneo CCC Framework Integration; the name for the new method must be unique.
- Add the new action as a new case in the switch block in the
Actions
task. The case must check for the exact action name as set in Teneo, note that it is case sensitive. If it is a terminating action, make sure to add a finishing block inside the new case after the action. - Create a new task with the prefix [ACTION] followed by the action name and call it inside the new action case.
- Add the action functionality to the task.
Data Tasks
Data tasks have the prefix [DATA] and contain a flow to get any data from Genesys. This data can be variables that exist in the contact center platform as well as results that are requested from the contact center platform API or other webservices that can be called by the contact center platform.
The data tasks are used by the GET_DATA action.
Data tasks have the prefix [DATA] and contain a flow to get any data from Genesys. This data can be variables that exist in the Contact Center platform as well as results that are requested from the Contact Center platform API or other webservices that can be called by the Contact Center platform. The data tasks are used by the GET_DATA action.
- [DATA] - Sum
- This is an example which shows how to return a result that requires two parameters to compute
- [DATA] - Callback number
- Returns the variable
caller.Ani
, which is the number of the caller; this is used in order to set up a callback
- Returns the variable
- [DATA] - Queue open
- Returns whether a queue is open or not; this task uses a Genesys data action that calls the Genesys API
- [DATA] - Queue waiting time
- Returns the waiting time of a queue; this task uses a Genesys data action that calls the Genesys API.
Extending Data Tasks
Data tasks can also be customized and new tasks can be added. The task [ACTION] - Get data contains the logic for selecting which [DATA] task will be called and for reading data keys and params.
The flow variable Task.Keys
contains the key names of the requested data and the variable Flow.KeyParams
contains the parameters for the function that computes the result.
To transport the result to Teneo, the variable Flow.InputParameters
should be updated and a new property added with the name of the key and the result as the value.
For example, when wanting to calculate the sum of two numbers: the key would be sum
and the parameters for computing the sum would be a
and b
. The action received from Teneo would look like the following:
{
"actionName" : "GET_DATA",
"actionData" : {
"sum" : {
"a" : 5,
"b" : 2
}
},
"isWaitingForUserInput" : false
}
- In the case block in [ACTION] - Get data add a case checking for
sum
. - Add a new task called [DATA] - Sum.
- Add an Update Data block that contains this expression:
SetJsonObjectProperty(Flow.InputParameters, "sum", ToString(ToInt(Flow.KeyParams.a) + ToInt(Flow.KeyParams.b)))
. This sets the result inFlow.InputParameters
using the keysum
as parameter name. The sum is calculated by accessing the values ofa
andb
in the variableFlow.KeyParams
.
Setup
TTS / STT
- To transcribe the callers voice input, Genesys requires to use a Text-to-Speech (TTS) / Speech-to-Text (STT) engine, such as Genesys advanced TTS, Microsoft Azure Speech or Amazon Polly
- In Genesys, in the Admin view under integrations, install the selected integration for the engine
- In the inbound call flow, under "Supported Languages", the TTS/STT engine must be set up.
Web Service Data Actions
- Install the Integration Web Service Data Actions under Admin -> Integrations
- Import the Web Service Data Action Teneo x Genesys Cloud - Bridge, available in the GitHub repository, under Admin -> Integrations -> Actions
- In the imported Web Service Data Action, go to configuration
- In Request URL template, set up the URL to the Session Bridge
- In the header
engine
, set up the URL to the Teneo bot - In the header
content-type
, verify that its value isapplication/json
- Save and publish the Web Service Data Action.
Genesys Data Actions
- Install the Integration Genesys Data Actions under Admin -> Integrations
- The Integration should add some static actions, one of them is called Get Estimated Wait Time. This is one of the actions used in the Bot Flow.
- For using Genesys Data Actions, an OAuth client must be configured
- For creating callbacks, the permission Conversation > Callback > Create is needed
- Download the Genesys Data Actions from the GitHub repository:
- Get agents on queue
- Scheduled callback
- Import the Genesys Data Actions under Admin -> Integrations -> Actions
- In Configuration -> Authentication of each Genesys Data Action, set up the OAuth client
- Save and publish the Genesys Data Actions.
Import the Bot Flow
- Download the
i3BotFlow
file from the GitHub repository- Alternatively you can also download the
yaml
file and use the tool Archy for importing the flow
- Alternatively you can also download the
- Go to Architect
- Select Bot Flows
- Create a new blank Bot Flow
- Import the Bot Flow
- Set up the missing link to the Web Service Data Action Teneo x Genesys Cloud - Bridge in the task [Teneo] - API
- Set up the missing link to the Genesys Data Action Scheduled callback in the task [ACTION] - Callback
- Set up the missing link to the Genesys Data Action Get agents on queue in the task [DATA] - Queue open
- Set up the missing link to the Genesys Data Action Get Estimated Wait Time in the task [DATA] - Queue waiting time
- Publish the Bot Flow.
Using Bot Flow
- Go to the Architect section
- Select Inbound Call Flows
- Create a new Inbound Call Flow
- Drag a Call Bot Flow action into the flow
- Select the published Bot Flow
- Go to Supported Languages and select the previously set up TTS engine
- Publish the flow
- Go to Admin -> Call routing and assign the Inbound Call Flow to a number.