Skip to main content
Back to Integrations List Integrate Kore with NICE CXOne using studio scripting to dispatch SIP headers, transfer calls from the bot, and transition to NICE CXOne after the app flow concludes. This approach does not require a VAH (Virtual Agent Hub) license or proxy.

Architecture

Architecture Diagram

Reference Documentation

DocumentLink
SIP HeadersSIP headers
Voicebot ConversationVoicebot Conversation
Signal APIAdmin API

Shared Responsibilities

ActivityCXOne CustomerKore
NICE SIP Trunk ConfigurationNANA
DID Number ProcurementDID numbers from NICE
ACD ConfigurationSkills creation and mapping, Hours of Operation, Points of Contact, Campaign, Script customization (2)Minimal functionality voice call scripts (2): Main Script (accept call on DID), Spawn Script (SIP trunk the call to Kore)
CXOne Studio ScriptCustomize Main and Spawn Scripts: add SIP headers, add DIDShare sample scripts: SIP Main Script, SIP Spawn Script
Setup AuthenticationConfigure CXOne Authentication for Signal API access
Setup Kore IVRCreate an AI for Service account
SIP Trunk ConfigurationNetwork IPs, DID number, Transport Type: TLS, Inbound forward-to-phone-numberSIP URI (pre-filled)
SIP Trunk Attach FlowCreate a flow, attach SIP config to Experience Flow
AI for Service App FlowCreate an AI Agent flow; read SIP headers from CXOne Studio script
Signal API to return callGet CXOne auth in Kore Bot; trigger Signal API (domain must match NICE account domain)

CXOne Channel Specifications

ACD configuration requires:
  • 1 skill (created and mapped)
  • 1 Hours of Operation
  • 1 Point of Contact (Phone)
  • 1 Campaign
  • 2 minimal functionality voice call scripts

Kore Bot Platform Requirements

Telephony Gateway

  • DID or TFN phone number to receive calls.
  • All SIP header information.
  • Signal API configuration to return control to NICE CXOne.

SIP Trunk Configuration

  1. SIP Trunk Setup
  2. Attach Flow

CXOne Studio Configuration

  1. Download the SIP Main Script and SIP Spawn Script and save locally.
  2. Import the Studio Script:
    1. Log in to NICE CXOne Studio.
    2. Go to File > Import from File. Import from File
    3. Open the saved studio script. Save Studio Script Entry Script Flow Spawn Place Call
    4. In the SIP Main Script, select the SIP Spawn Script in the Spawn action. Choose Script
    5. Add SIP headers in the Sipputheader actions:
      • headerName: Key starting with X-*
      • headerValue: The header value
      SIP Put Header
    6. Add the SIP phone number in the Placecall action. Enter the SIP DID number configured in the AI for Service SIP Trunk. Place Calls SIP Number

AI for Service Configuration

Configure a flow with an app on AI for Service. In the Script Task window, add the following code before the Run Automation action to pass SIP headers to the AI Agent:
setCallFlowVariable('sipHeaders', context.BotUserSession.channels[0].handle.sipHeaders);
var headers = getCallFlowVariable('sipHeaders');
userSessionUtils.put('sipHeaders', headers);
Flow Script Task

NICE CXOne Authentication

Required parameters:
  • Authentication API URL from NICE CXOne
  • Access Key ID
  • Access Key Secret
Steps:
  1. Log in to the NICE Cluster.
  2. Click your profile (top right) and select My Profile. My Profile
  3. Go to the ACCESS KEYS tab and click Add access key. Access Keys
  4. Copy the Access Key ID and Access Key Secret.
  5. Send a POST request to the authentication URL (adjust the base URL for your region, for example na1.nice-incontact.com):
    POST https://{region}.nice-incontact.com/authentication/v1/token/access-key
    
    Request body:
    {
      "accessKeyId": "<Your Access Key ID>",
      "accessKeySecret": "<Your Access Key Secret>"
    }
    
  6. The response returns an access_token used to authenticate the Signal API.

Bot Configuration

Configure a dialog task to transition to NICE CXOne when the customer requests an agent transfer.

Fetch the NICE Authentication Access Token

  1. Add a bot action with a Service Node to get the access_token. Rest API Call
  2. Set Service Type to Custom Service and Sub Type to REST. Edit Request
  3. Click Edit Request, select POST, and enter the authentication URL. POST Method
  4. On the Headers tab, add Content-Type: application/json. Content Type
  5. On the Body tab, add the request body. Body
  6. Click Test, then Save as Sample Response. Save as Sample Response

Fetch SIP Headers in the AI Agent

Use a Script Node in a bot action to extract headers: Bot Action Script Node Script Node
const headers = context.session.UserSession.sipHeaders;
if (headers) {
  let contactId = headers.find(o => o.name === 'X-ExternalCallId');
  if (contactId && contactId.value) {
    koreDebugger.log('Inbound SIP Contact ID: ' + contactId.value);
    BotUserSession.put("ContactId", contactId.value);
  }
}
Save the SIP header value as ContactId in BotUserSession to use when triggering the Signal API.
If the AI Agent triggers the Signal API to transfer to a live agent or end the conversation, the call must end from Kore, or the user must be disconnected from the Kore AI Agent and CCAI flow.

Trigger the Signal API

  1. Add a bot action with a Service Node to trigger the Signal API. Signal API
  2. Set Service Type to Custom Service and Sub Type to REST. Signal API Edit Request
  3. Click Edit Request, select POST, and enter the Signal API URL (replace {cluster} with your NICE cluster, for example api-b32):
    POST https://api-{cluster}.nice-incontact.com/incontactapi/services/v28.0/interactions/{{context.session.BotUserSession.ContactId}}/signal?p1=AgentHandoff&p3={{context.session.BotUserSession.conversationSessionId}}
    
    ContactId is extracted from SIP headers and stored in BotUserSession. The p1=AgentHandoff parameter triggers the agent transfer.
    Post Signal API
  4. On the Headers tab, add:
    • Key: Authorization
    • Value: Bearer {{context.RestAPICall.response.body.access_token}}
    Authorization Header
  5. Click Save.

Code Snippets