> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Voice Automation with NICE CXOne - SIP Integration

<Badge icon="arrow-left" color="gray">[Back to Integrations List](/ai-for-service/contact-center/integrations/overview)</Badge>

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 doesn't require a VAH (Virtual Agent Hub) license or proxy.

## Architecture

<img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/architecture.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=e4210dadbdd95a35c55903eb78bdfddf" alt="Architecture Diagram" width="852" height="362" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/architecture.png" />

***

## Reference Documentation

| Document              | Link                                                                                                                           |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| SIP Headers           | [SIP headers](https://help.incontact.com/Content/Studio/Actions/SIPPutHeader/SIPPutHeader.htm)                                 |
| Voicebot Conversation | [Voicebot Conversation](https://help.incontact.com/Content/Studio/Actions/VoiceBot%20Conversation/VoiceBot%20Conversation.htm) |
| Signal API            | [Admin API](https://developer.niceincontact.com/API/AdminAPI#/Contacts/Signal%20a%20Contact)                                   |

***

## Shared Responsibilities

| Activity                     | CXOne Customer                                                                                         | Kore                                                                                                                                                                                                                                                                                                                                                                                                       |
| ---------------------------- | ------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| NICE SIP Trunk Configuration | NA                                                                                                     | NA                                                                                                                                                                                                                                                                                                                                                                                                         |
| DID Number Procurement       | DID numbers from NICE                                                                                  | —                                                                                                                                                                                                                                                                                                                                                                                                          |
| ACD Configuration            | Skills 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 Script          | Customize Main and Spawn Scripts: add SIP headers, add DID                                             | Share sample scripts: [SIP Main Script](https://github.com/Koredotcom/docs-v2/raw/refs/heads/main/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/scripts/sip-main.pdf), [SIP Spawn Script](https://github.com/Koredotcom/docs-v2/raw/refs/heads/main/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/scripts/sip-spawn.pdf) |
| Setup Authentication         | Configure CXOne Authentication for Signal API access                                                   | —                                                                                                                                                                                                                                                                                                                                                                                                          |
| Setup Kore IVR               | Create an AI for Service account                                                                       | —                                                                                                                                                                                                                                                                                                                                                                                                          |
| SIP Trunk Configuration      | Network IPs, DID number, Transport Type: TLS, Inbound forward-to-phone-number                          | SIP URI (pre-filled)                                                                                                                                                                                                                                                                                                                                                                                       |
| SIP Trunk Attach Flow        | Create a flow, attach SIP config to Experience Flow                                                    | —                                                                                                                                                                                                                                                                                                                                                                                                          |
| AI for Service App Flow      | Create an AI Agent flow; read SIP headers from CXOne Studio script                                     | —                                                                                                                                                                                                                                                                                                                                                                                                          |
| Signal API to return call    | Get 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](https://developer.niceincontact.com/API/AdminAPI#/Contacts/Signal%20a%20Contact) configuration to return control to NICE CXOne.

### SIP Trunk Configuration

1. [SIP Trunk Setup](/ai-for-service/channels/voice-gateway/configure-voice-gateway#sip-trunk-setup)
2. [Attach Flow](/ai-for-service/channels/voice-gateway/configure-voice-gateway#attach-flow)

***

## CXOne Studio Configuration

1. Download the [SIP Main Script](https://github.com/Koredotcom/docs-v2/raw/refs/heads/main/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/scripts/sip-main.pdf) and [SIP Spawn Script](https://github.com/Koredotcom/docs-v2/raw/refs/heads/main/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/scripts/sip-spawn.pdf) and save locally.
2. Import the Studio Script:
   1. Log in to NICE CXOne Studio.

   2. Go to **File > Import from File**.

      <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/cxone-file-open.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=5d907e00a4d6fe8d7f557dda9a0e507a" alt="Import from File" width="994" height="510" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/cxone-file-open.png" />

   3. Open the saved studio script.

      <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/save-studio-script.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=68893a84c941f65f46f6d8d45b685869" alt="Save Studio Script" width="990" height="528" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/save-studio-script.png" />

      <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/entry-script.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=1848fd1079bee0d1275b253f3aa78b7a" alt="Entry Script Flow" width="734" height="534" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/entry-script.png" />

      <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/spawn-place-call.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=1c0d812e503ebb6e526a8298413f7af4" alt="Spawn Place Call" width="830" height="572" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/spawn-place-call.png" />

   4. In the SIP Main Script, select the **SIP Spawn Script** in the **Spawn** action.

      <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/choose-script.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=2657a95c87a63ffc540f97a612a37a0c" alt="Choose Script" width="567" height="554" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/choose-script.png" />

   5. Add SIP headers in the **Sipputheader** actions:

      * **headerName**: Key starting with `X-*`
      * **headerValue**: The header value

      <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/sip-put-header.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=5d942ff586ce9108bee68b4e3450365a" alt="SIP Put Header" width="564" height="509" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/sip-put-header.png" />

   6. Add the SIP phone number in the **Placecall** action. Enter the SIP DID number configured in the AI for Service SIP Trunk.

      <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/place-calls.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=99c1c3dcaa2b952394ee7baee4c1c11d" alt="Place Calls" width="289" height="344" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/place-calls.png" />

      <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/sip-number.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=7387df95f7fdc8ebed14bf51bb82e2bd" alt="SIP Number" width="900" height="258" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/sip-number.png" />

***

## 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:

```js theme={null}
setCallFlowVariable('sipHeaders', context.BotUserSession.channels[0].handle.sipHeaders);
var headers = getCallFlowVariable('sipHeaders');
userSessionUtils.put('sipHeaders', headers);
```

<img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/start-flow.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=6df7322038505c2b030162b292aee67a" alt="Flow" width="1368" height="844" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/start-flow.png" />

<img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/flow-script.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=b39cbf3a05bfbf250b97fd34f0cc0053" alt="Script Task" width="434" height="530" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/flow-script.png" />

***

## 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**.

   <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/nice-login.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=0608f637a2ee471d8e8fa1dea5e052ed" alt="My Profile" width="562" height="397" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/nice-login.png" />

3. Go to the **ACCESS KEYS** tab and click **Add access key**.

   <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/access-keys.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=6659308107ff687a2be81a333ce067c8" alt="Access Keys" width="825" height="485" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/access-keys.png" />

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:

   ```json theme={null}
   {
     "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`.

   <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/bot-action-restapi-call.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=611ab82fe0d7c4f20892d22e4c00f03a" alt="Rest API Call" width="622" height="288" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/bot-action-restapi-call.png" />

2. Set **Service Type** to **Custom Service** and **Sub Type** to **REST**.

   <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/edit-request.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=642050e296c208672e40a1c1dd304280" alt="Edit Request" width="384" height="909" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/edit-request.png" />

3. Click **Edit Request**, select **POST**, and enter the authentication URL.

   <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/post-method.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=0f0931222bcacc96e31bfaa26e4d6211" alt="POST Method" width="1929" height="195" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/post-method.png" />

4. On the **Headers** tab, add `Content-Type: application/json`.

   <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/content-type.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=a1116155406ba6d33509d86dcd0524a5" alt="Content Type" width="1917" height="137" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/content-type.png" />

5. On the **Body** tab, add the request body.

   <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/body.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=adaba29740f8992f5dea9d8f65dc5515" alt="Body" width="1917" height="316" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/body.png" />

6. Click **Test**, then **Save as Sample Response**.

   <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/save-as-sample-response.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=c8fd2b2062dab121960360dcd123565e" alt="Save as Sample Response" width="1906" height="171" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/save-as-sample-response.png" />

### Fetch SIP Headers in the AI Agent

Use a **Script Node** in a bot action to extract headers:

<img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/bot-action-script.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=04b8026b68057b59c246921521c345fd" alt="Bot Action Script Node" width="794" height="358" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/bot-action-script.png" />

<img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/script.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=ab5895c9b8f398b4efa791a49b181fe9" alt="Script Node" width="382" height="908" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/script.png" />

```js theme={null}
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.

<Note>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.</Note>

### Trigger the Signal API

1. Add a bot action with a **Service Node** to trigger the Signal API.

   <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/signal-api.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=ee8a35346b62b539f1ed82558d3715e7" alt="Signal API" width="555" height="218" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/signal-api.png" />

2. Set **Service Type** to **Custom Service** and **Sub Type** to **REST**.

   <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/edit-request-signal-api.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=4b0ce2b4a0105b8a2aa918564263d206" alt="Signal API Edit Request" width="339" height="907" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/edit-request-signal-api.png" />

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}}
   ```

   <Note>`ContactId` is extracted from SIP headers and stored in `BotUserSession`. The `p1=AgentHandoff` parameter triggers the agent transfer.</Note>

   <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/post-signal-api.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=4f6e03f6459eabda6230001d0a03f466" alt="Post Signal API" width="1917" height="112" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/post-signal-api.png" />

4. On the **Headers** tab, add:

   * **Key**: `Authorization`
   * **Value**: `Bearer {{context.RestAPICall.response.body.access_token}}`

   <img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/header-signal-api.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=8b84081b6a172efd599b202cff47f191" alt="Authorization Header" width="1917" height="129" data-path="ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/images/header-signal-api.png" />

5. Click **Save**.

***

## Code Snippets

* [Main Script](https://github.com/Koredotcom/docs-v2/raw/refs/heads/main/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/scripts/sip-main.pdf)
* [Spawn Script](https://github.com/Koredotcom/docs-v2/raw/refs/heads/main/ai-for-service/contact-center/integrations/voice-automation-nice-cxone-sip-integration/scripts/sip-spawn.pdf)
