Live Agent Handoff Snippet

The information on this help page applies to both CXone Studio and Desktop Studio.

Use this snippet after the Voicebot Conversation action for integrations that use a SIP backchannel connection.

This snippet allows the virtual agent to transfer a call back to CXone so the contact can speak with a live agent. The signaling mechanism sends the returncustompayloadjson and returnintentinfojson responses from the virtual agent to CXone. The snippet code creates dynamic data objects from the REST responses. For Google Dialogflow CX, the signaling mechanism is Google PubSub. For CXone SmartAssist and IBM Watson, it's the CXone Signal API. The IF action checks the returncustompayloadjson response to see if a live agent has been requested.

The following image shows a live agent handoff configuration in a script with the Voicebot Conversation action: 

]An example of live agent handoff in a script with the Voicebot Conversation action.

  1. In Studio, open the virtual agent script you want to modify.

  2. Add a Snippet action after the Voicebot Conversation action and copy in the following code:

    DYNAMIC returnIntentInformation FROM returnintentinfojson
    DYNAMIC returnCustomPayload FROM returncustompayloadjson
  3. Use the BotSessionComplete branch condition to connect Voicebot Conversation to the Snippet action containing the Live Agent Handoff snippet code.
  4. Add an If action after the Live Agent Handoff Snippet action and connect them using the Default branch condition.
  5. Configure the Expression property of If with this expression:

    returncustompayloadjson = "liveAgentHandoff"	
  6. Add branches from the If action for the True and False branch conditions. The True branch should include the Reqagent action. The False branch should end the script with a Hangup action.