IBM Cloud Docs
Integrating with phone and NICE CXone contact center

Integrating with phone and NICE CXone contact center Plus or higher plans only

IBM Cloud

This feature is currently not available in the AI assistant builder of IBM watsonx Orchestrate.

Connect your assistant to a NICE CXone contact center with live agents.

Transfer customers from a chat with your assistant to live agents who can help them by phone. If customers ask to speak to someone, your assistant can forward them directly to customer support with the conversation history.

This integration creates a connection between your assistant and a contact center with NICE CXone.

You need a Plus or Enterprise Plan to use this feature.

Before you begin

You must have a NICE CXone account and phone numbers that are allocated for this integration.

  1. Go to the NICE website.
  2. Create an account.
  3. Follow the instructions to get phone numbers or select existing phone numbers.

Generate NICE CXone access keys

Access keys are used for authentication and consist of two parts: an access key ID and a secret access key.

To generate NICE CXone access keys to use with your assistant:

  1. Log in to the NICE CXone console.

  2. Click the app selector and select Admin.

  3. Click Users, and then locate and click the user account that you want to use for the integration.

  4. Click the Access Keys tab.

  5. Click Generate New Access Key.

  6. Click Show Secret Key, and copy the secret key to a secure location.

    You cannot retrieve the secret key again after you complete the next step and Save. You must generate a new key if the current one is lost or forgotten.

  7. Click Save.

Set up the integration

To complete setup, you must have an assistant ready to deploy, your NICE CXone access keys, and phone numbers allocated for this integration.

To integrate your assistant with NICE CXone:

  1. In the Integrations section on the main page for your assistant under Essential Channels, you see a tile for Phone.

  2. On the Phone tile, click Add.

  3. On the pop-up window, click Add again.

  4. Select NICE CXone on the Select contact center page.

    Click Next.

  5. On the Connect to contact center page, specify the following values: - the Access key ID - the Access key secret.

    Click Test connection to verify the credentials.

    Click Next.

  6. On the Phone number page, enter a phone number that you allocated for the NICE CXone integration. You can add more phone numbers later.

    Click Next.

  7. On the Speech to Text page, select the instance of the Speech to Text service that you want to use.

    • If you have existing Speech to Text instances, select the instance from the list.

    • If you do not have any existing Speech to Text instances, click Create new instance to create a new Plus or Enterprise instance.

  8. In the Choose your Speech to Text language model field, select the language that you want to use.

    The list of language models is automatically filtered to use the same language as your assistant. To see all language models, toggle the Filter models based on assistant language switch to Off.

    If you created specialized custom models that you want your assistant to use, choose the Speech to Text service instance that hosts the custom models now, and you can configure your assistant to use them later. The Speech to Text service instance must be hosted in the same location as your watsonx Assistant service instance. For more information, see Using a custom language model.

    For more information about language models, see Languages and models in the Speech to Text documentation.

    Click Next.

  9. On the Text to Speech page, select the instance of the Text to Speech service that you want to use.

    • If you have existing Text to Speech instances, select the instance from the list.

    • If you do not have any existing Text to Speech instances, click Create new instance to create a new Standard instance.

    Click Next.

  10. On the Contact center integrations page, click Test connection near the setup information you entered.

    • If Invalid, check your credentials and enter each again.

    • If the credentials are correct, the Save and exit button becomes clickable.

    Click Save and exit.

The connection between your assistant and NICE CXone is complete.

For security reasons, the authentication fields are removed from view after initial setup. If a field required for authentication is changed, then all entries in related fields must be filled and validated again.

Configuring the NICE CXone script

NICE CXone provides a scripting tool that allows workflow developers to define routing flows for their contact centers in CXone.

The following actions and settings in the workflow are necessary for integration to work properly.

Connecting a caller to your assistant

Use the Sipputheader action. In the headerName property, enter the name of the SIP header field that contains the Contact ID. This header field is included in outgoing SIP INVITE messages to watsonx Assistant.

  • headerName X-ContactID
  • headerValue {ContactId}

Sipputheader must be executed before Placecall.

Use a Placecall action to initiate an outbound call to watsonx Assistant. In the PhoneNumber property, enter the phone number that you allocated for this integration.

The phone number must match the number that you configured in Use an existing phone number with an external provider in the watsonx Assistant user interface.

Image of the outbound call flow

Transferring a caller to a live agent

You can configure your assistant to transfer a customer to a NICE CXone live agent.

The phone integration uses the signal REST API. The p1 attribute is preserved for the session history key. The key can be used to fetch the conversation history and present it to a live agent.

  1. Use Onsignal to process the signal event.

  2. Save the value of the p1 attribute:

sessionKey = "{p1}"

For example, you can use the Snippet action:

ASSIGN sessionKey = "{p1}"

Use Reqagent to transfer a call to a live agent.

Image of call transfer to a live agent

Displaying conversation history to a live agent

Configure your script to provide a transcript of the assistant conversation to a live agent in a pop-out window, so the agent can better understand and address a customer's needs.

  1. Add an Onanswer event to your script. The Onanswer event is triggered when an agent answers the call.

  2. Use Assign to store the link to the conversation history into a variable. Variable watson_url Value https://web-chat.global.assistant.watson.appdomain.cloud/loadAgentAppFrame.html?session_history_key={sessionKey}

  3. Use the PopURL action to display the conversation transcript to a live agent. URL {watson_url}

Image of the conversation history window

Disconnecting a call

The phone integration uses the same signal REST API for disconnecting a call.

The p1 attribute is set to hangup. You need to design your script so it can distinguish between transferring a call to a live agent and disconnecting a call. If p1 is set to hangup when an Onsignal event is triggered, use Hangup to terminate a script.

Image of call hangup

Transferring to a live agent when an error occurs

If an error occurs during a conversation, the phone integration disconnects the call by sending a SIP BYE request.

Use Onrelease to process the BYE request and transfer a call to a live agent.

In this example, when Onrelease is triggered, the script verifies whether the call was already transferred. If not, it calls the Signal action and sets an indication that the call is being transferred to a live agent. The indication is set using the Assign action.

  • Variable transferred
  • Value true

Image of call disconnect on failure

If the Hangup action is executed and an Onrelease event action is present, CXone hangs up on the caller, and the script jumps to the OnRelease action. Design your script so it can distinguish whether the OnRelease event is triggered due to a transfer or hangup.

Adding transfer support to your assistant

Use the Connect To Agent response_type to configure your assistant to transfer calls to an agent. For instructions, see Transferring a call to a live agent.

Use the following format:

{
  "generic": [
    {
      "response_type": "connect_to_agent",
      "transfer_info": {
        "target": {
          "nice_cxone": {
            "custom_data": {
              "p2": "test"
            }
          }
        }
      },
      "agent_available": {
        "message": "Ok, I'm transferring you to an agent."
      },
      "agent_unavailable": {
        "message": "Agent is unavailable."
      }
    }
  ]
}

Parameters listed in the custom_data object are transferred to the signal REST API.

Supported parameters are p2, p3, ... p9. p1 is preserved and used by the phone integration for passing the session history key into the NICE CXone script.