Integrating Voice AI with a CTI system
Voice AI automatically supports all out-of-the-box computer telephony integrations (CTI) that are available with Pega Call. No action is required by you if you are using a standard CTI integration. However, if you use a custom CTI integration, you must implement a mechanism to notify the Voice AI desktop app of call connections and disconnections.
For more information about CTI integration, see the Pega Call Implementation Guide.
Custom CTI integration example
Pega Customer Service can integrate with an external CTI system in various ways. The following example describes one possible method by which a CTI system can route calls to an agent desktop with Voice AI features integrated:
- The CTI system sends a REST request to the Pega server to alert an incoming call to a CSR.
- The Pega server notifies the agent desktop of the incoming call by using a notification channel.
- Custom JavaScript code running on the agent desktop subscribes to the incoming call event, displays a screen pop, and starts the interaction.
- A JavaScript action invokes the function for the Voice AI desktop app to capture the audio.
To implement a customization that works in this way, make the following changes:
- Update the REST service activity with the following properties before invoking
the notification channel:
- .AISessionID
- Use the
@Utilities.pxGetNewGUID()
function to generate a GUIDV4 string. - .AIChannelID
- Use the Voice AI Channel ID setting in the Voice AI configuration set.
- Use the Expression Builder to build this property value.
- .AIIsolationID
- Use the Isolation ID setting of the Voice AI configuration set.
- Use the Expression Builder to build this property value.
- .AILanguageModel
- Use the Language Model setting of the Voice AI configuration set.
- Use the Expression Builder to build this property value.
- .AISpeechModel
- Use the Speech Model setting of the Voice AI configuration set.
- Use the Expression Builder to build this property value.
- .AIRecordOnlyMode
- Use the VAD Record Only Mode setting of the Voice AI configuration set.
- Use the Expression Builder to build this property value.
- .AIAccessToken
- Populate this parameter by calling the RetrieveAccessToken activity on the current primary page.
- OperatorID
- Enter the ID of the operator to whom the notification is sent.
- RouterURL
- Use the RetrieveAudioRouterURL data transform to populate the Voice AI transcript URL on the current primary page.
- Update the JavaScript function that is subscribed to the notification to invoke
the
pega.cs.voiceai.startCall
function with the following parameters:- sessionID
- channelId
- accessToken
- isolationId
- languageModel
- speechModel
- operatorId
- recordOnlyMode
- callTransfer
- routerURL
- Modify the invocation of the
CreateWork API to start the interaction and to pass the
AISessionID to the interaction flow. For
example:
pega.desktop.createNewWork(<Interaction Class>, "", "<Flow name>", "&AISessionID=" + sessionId..”
- If you made an override to the
PostCloseResponse HTML rule in the out-of-the-box
implementation, configure an alternate way to trigger the
Pega.cs.voiceai.endcall
function based on the call disconnection event.
Previous topic Creating training data Next topic Installing the Voice AI desktop app