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

# Salesforce NICE CX CTI for Outbound Calls

This document provides an overview of the setup and configuration process of the Kore Agent AI widget with NICE CX Telephony using the Salesforce NICE CX CTI package.

**Use Case**: Display voice transcripts and suggest next best actions from a configured AI Agent on the Kore Agent AI widget when agents place customer calls.

When agents place customer calls, based on the customer's phone number the CTI rule matches the corresponding Salesforce object (such as Account/Contact/Case) and displays it to the agents. The voice stream is shared with Kore Voice Gateway, which in turn generates transcripts of the voice stream and displays them on the Agent AI widget embedded into the matched Salesforce object.

## Prerequisites

* The **[NICE CX Salesforce](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3000000B4BKsEAN)** package installed in your Salesforce org.
* **NICE CX** account set up and can initiate outbound calls on the **Salesforce Service Console** softphone.
* **NICE CX Studio** installed on your device.
* **Agent Assist Hub** enabled for your NICE CX account.
* **[Kore AgentAssist](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N4V00000HSGlnUAH)** for Salesforce installed on your Salesforce account. (Salesforce AppExchange > Search for "Agent AI By Kore.ai, Inc.")
* Have the Kore AI Agent credentials saved separately. You need the Widget URL, Bot ID, Client ID, Client Secret, Account ID, and SIP URI. Read [Configure Voice Channel](/ai-for-service/channels#configure-voice-gateway) and [Chat Channel](/ai-for-service/channels#digital-channels) for a walkthrough.
* Ensure that Voice Interaction Streams are enabled via NICE.

## Shared Responsibilities

| Activity                          | CXOne Customer                                                                                                                         | Kore.ai                                 |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| **NICE One Platform**             |                                                                                                                                        |                                         |
| ACD Configuration                 | Skills creation and mapping<br />Hours of Operation<br />Campaign<br />Customization of Scripts                                        |                                         |
| CXOne Studio Script               | Import the voice script and customize (only if needed).<br />Edit the Nodes and provide the Customized AI Agent details in the script. | Provisioning the studio script template |
| Agent Assist Hub                  | Configure NICE Studio Agent Assist                                                                                                     |                                         |
| **Kore AI Agent Configuration**   | AI Agent creation<br />AI Agent Credentials generation                                                                                 |                                         |
| **Salesforce Org**                |                                                                                                                                        |                                         |
| Voice Configuration               | Enabling NICE Outbound Calls on Salesforce with proper screen pop settings                                                             |                                         |
| Installing Kore Agent AI Package  | Installing the package                                                                                                                 | Providing the package URL               |
| Configuring Kore Agent AI Package | Validate prerequisite licenses<br />Configure AI Agent Details                                                                         |                                         |
| NICE CX                           | Configure Salesforce Agent Settings, select Salesforce Object to embed Kore Agent AI widget.                                           |                                         |

## Definitions

| Section                                                      | Key                      | Definition                                                                                                                                                                                                          | Reference                                                                                                                                                                                                                            |
| ------------------------------------------------------------ | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Set up NICE AgentAssist Hub to stream voice to Kore Agent AI | Agent AI URL             | The domain of the Agent AI.                                                                                                                                                                                         | If it is legacy Agent AI, URL is [https://agentassist.kore.ai](https://agentassist.kore.ai/).<br />If it is Platform, URL is `https://platform.kore.ai`.<br />If it is on-prem, the URL is the origin where your Agent AI is hosted. |
| Kore Agent AI package setup and configuration                | AgentAssist Widget URL   | URL that points to the Agent AI widget. For example, [https://agentassist.kore.ai/koreagentassist-sdk-v3/UI/agentassist-iframe.html](https://agentassist.kore.ai/koreagentassist-sdk-v3/UI/agentassist-iframe.html) | **Channels > Chat** section of the **[Agent AI](https://agentassist.kore.ai/)** configuration portal.                                                                                                                                |
| Kore Agent AI package setup and configuration                | BotId                    | A unique identifier assigned to an AI Agent.                                                                                                                                                                        | **Channels > Chat** section of the **[Agent AI](https://agentassist.kore.ai/)** configuration portal.                                                                                                                                |
| Kore Agent AI package setup and configuration                | ClientId                 | An identifier provided to a client application.                                                                                                                                                                     | **Channels > Chat** section of the **[Agent AI](https://agentassist.kore.ai/)** configuration portal.                                                                                                                                |
| Kore Agent AI package setup and configuration                | ClientSecret             | A secret key or password associated with the ClientId.                                                                                                                                                              | **Channels > Chat** section of the **[Agent AI](https://agentassist.kore.ai/)** configuration portal.                                                                                                                                |
| Set up NICE AgentAssist Hub to stream voice to Kore Agent AI | AccountID                | A unique identifier assigned to an account.                                                                                                                                                                         | **Channels > Chat** section of the **[Agent AI](https://agentassist.kore.ai/)** configuration portal.                                                                                                                                |
| Set up NICE AgentAssist Hub to stream voice to Kore Agent AI | Kore Voice Gateway (KVG) | For SaaS in US region, value is savg-webserver.kore.ai. For on-prem, refer to the corresponding host.                                                                                                               |                                                                                                                                                                                                                                      |

**Region Specific URLs**

| Region | Agent AI URL                                                      | UXO URL                                                     | WSS URL                            | DNS                                                                     |
| ------ | ----------------------------------------------------------------- | ----------------------------------------------------------- | ---------------------------------- | ----------------------------------------------------------------------- |
| US     | [https://agentassist.kore.ai](https://agentassist.kore.ai/)       | [https://platform.kore.ai](https://platform.kore.ai/)       | wss\://savg-webserver.kore.ai      | @savg-us-prod-sbc-in-nlb-0d9a4c651955ff47.elb.us-east-1.amazonaws.com   |
| JP     | [https://agentassist-jp.kore.ai](https://agentassist-jp.kore.ai/) | [https://jp-platform.kore.ai](https://jp-platform.kore.ai/) | wss\://jp-savg-audiosocket.kore.ai | @savg-jp-prod-int-nlb-3989d946fc1ced3b.elb.ap-northeast-1.amazonaws.com |

## Set up Salesforce-NICE CTI package

Follow [this article](https://help.nice-incontact.com/content/agent/agentapplicationadministration/agentforsalesforce/installation.htm?TocPath=Agent%20Application%20Administration%7CAgent%20Application%20Administration%7CSalesforce%20Agent%20%7C_____3) to install and configure the NICE CTI package on your Salesforce account.

Topics included in the above article:

* Install Salesforce Agent
* Install the Salesforce Agent Package
* Assign Users to Your License
* Enable Salesforce Agent in Lightning Experience
* Configure Permission Sets For a Single User
* Configure Permission Sets For Multiple Users
* Configure the NICE CXone Call Center
* Assign Users to the NICE CXone Call Center
* Configure Softphone Layout
* Assign Profiles to the Softphone Layout
* Enable Click2Jack

## Set up NICE AgentAssist Hub to stream voice to Kore Agent AI

This app will be used in the studio script.

1. Sign in to your **NICE account** with the username and password provided by NICE customer support.
2. Click the **applications launcher** button. A menu opens from the left side of the page.
   <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/app-launcher-button_1.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=aef9030d850552c3cede2fbe98f29e01" alt="app-launcher-button" width="1311" height="706" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/app-launcher-button_1.png" />
3. Click **OTHERS** > **Automation & AI**.
   <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/automation-ai_2.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=bb5555582b5d3681878d50bbb6b9affe" alt="automation-ai" width="244" height="712" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/automation-ai_2.png" />
4. Click **Agent Assist Hub** > **Add Agent Assist App**.
   <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/add-agentassist-app_3.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=46afc12e61e7bcbebde0bd2ca5a66c56" alt="add-agentassist-app" width="544" height="200" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/add-agentassist-app_3.png" />
5. Enter the name of the Agent Assist App in the **AGENT ASSIST APP NAME** field.
6. Select **Custom Agent Assist Endpoints**.
7. Click **Next**.
   <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/create-new-agent-assistant_4.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=1cafabdc49b7c57340433786ee1cffa4" alt="create-new-agent-assistant" width="1225" height="480" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/create-new-agent-assistant_4.png" />
8. Add the following settings with config parameters provided by the Kore.ai representative:
   1. **Agent UI Option**: Available by default
   2. **App URL**: `{Agent AI URL}/integrations/nice/iframe/?params={scriptparams}`
   3. **App Title**: Kore Agent AI (change as needed)
   4. **Participants**: Both
      <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/config-parameters_5.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=1cfa31c7518f3d558edde6b70ef193e7" alt="config-parameters" width="1111" height="760" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/config-parameters_5.png" />
   5. **Audio Relay Endpoint**: `{Kore Voice Gateway(KVG)}/audiosocket/nice?sipuri=<Bot SIP URI>&token=<Token>&botId=<Bot ID>&accountId=<Account ID>&agentassist=true`
      1. **Bot SIP URI**: **Flows & Channels** > **Channels** > **Voice Gateway** > **SIP Numbers** > **Configure SIP Trunk** > **Agent AI** section of the **[Agent AI](https://agentassist.kore.ai/)** configuration portal.
         <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/configure-sip-trunk_6.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=cd3769a0c584ddc8c75d8cbb7431c060" alt="configure-sip-trunk" width="1022" height="868" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/configure-sip-trunk_6.png" />
      2. **Bot ID and Account ID**: **Flows & Channels** > **Channels** > **Digital** > **Web/Mobile Client** > **JWT App Details** section of the **[Agent AI](https://agentassist.kore.ai/)** configuration portal.
         <img src="https://mintcdn.com/koreai/AvronCZFwUfJW97D/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/web-mobile-client_7.png?fit=max&auto=format&n=AvronCZFwUfJW97D&q=85&s=6d9fd493547b338a4b7b11e5b2370aee" alt="web-mobile-client" width="507" height="860" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/web-mobile-client_7.png" />
      3. **Token**: Create a JSON Web Token on [jwt.io](https://www.jwt.io/) with the following details.
         1. Payload: `{"appId": "<Bot Client ID>"}`
         2. Header: `{"alg": "HS256","typ": "JWT"}`
         3. Secret: Your Kore.ai Client Secret.
9. Click **Create**.

## Kore Agent AI package setup and configuration

* Install **[Kore Agent AI](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N4V00000HSGlnUAH)** on your Salesforce account.

### Set up AgentAssist feature

1. Click the **app launcher**.
   <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/app-launcher_8.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=dec19b0249051b1ec75257409ecf0ae1" alt="app-launcher" width="791" height="449" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/app-launcher_8.png" />
2. Type "kore" in the search box and select **Kore AgentAssist Feature Configuration** from the displayed list.
   <img src="https://mintcdn.com/koreai/AvronCZFwUfJW97D/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/kore-aa-feature-configuration_9.png?fit=max&auto=format&n=AvronCZFwUfJW97D&q=85&s=975772d8c9483d23addaeee0f71acf6b" alt="kore-aa-feature-configuration" width="742" height="297" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/kore-aa-feature-configuration_9.png" />
3. Click **New** from the top-right corner of the page.
   <img src="https://mintcdn.com/koreai/AvronCZFwUfJW97D/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/kore-aa-feature-configuration-new_10.png?fit=max&auto=format&n=AvronCZFwUfJW97D&q=85&s=8ee8809156598ac10b90b7539c79231f" alt="kore-aa-feature-configuration-new" width="728" height="275" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/kore-aa-feature-configuration-new_10.png" />
4. Type **Test Configuration** in the **Configuration Name** field.
   <img src="https://mintcdn.com/koreai/AvronCZFwUfJW97D/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/test-configuration_11.png?fit=max&auto=format&n=AvronCZFwUfJW97D&q=85&s=b45fc79125940ec67a5cc1cbf5b64556" alt="test-configuration" width="300" height="188" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/test-configuration_11.png" />
5. Select **NICE inContact** in the **CTI Provider** list.
   <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/cti-provider-list_12.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=cf106111939d366338cdb910d937b3c9" alt="cti-provider-list" width="300" height="178" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/cti-provider-list_12.png" />
6. Select **Active**, and click **Save**.
   <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/active-save_13.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=99236ef241ddb657378abc08b448d7ee" alt="active-save" width="300" height="183" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/active-save_13.png" />

### Set up AgentAssist Configuration

1. Click the **app launcher**.
2. Type "config" in the search box and select **Kore AgentAssist Configuration** from the displayed list.
   <img src="https://mintcdn.com/koreai/AvronCZFwUfJW97D/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/kore-aa-configuration_14.png?fit=max&auto=format&n=AvronCZFwUfJW97D&q=85&s=7b5cdf5a2a3e41371a3afce7cde45f5f" alt="kore-aa-configuration" width="753" height="469" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/kore-aa-configuration_14.png" />
3. Click **New** from the right-top corner of the page.
4. Enter the required details. You can fetch the **AgentAssist URL**, **Bot ID**, **Client ID**, and **Client Secret** details from the **[Agent AI](https://agentassist.kore.ai/)** configuration portal.
   <img src="https://mintcdn.com/koreai/AvronCZFwUfJW97D/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/web-mobile-client_15.png?fit=max&auto=format&n=AvronCZFwUfJW97D&q=85&s=3f7d15d4543facf70ff2921e74165891" alt="web-mobile-client" width="1847" height="935" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/web-mobile-client_15.png" />
   * Select a language in the **Language** dropdown list. The selected language corresponds to the language configured in the AI Agent.
     <img src="https://mintcdn.com/koreai/AvronCZFwUfJW97D/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/kore-aa-config-page_16.png?fit=max&auto=format&n=AvronCZFwUfJW97D&q=85&s=6c0a4e00f0a414c8dc027b5047d3c14e" alt="kore-aa-config-page" width="1002" height="785" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/kore-aa-config-page_16.png" />
5. Select **Active**, and click **Save**.

   <Note>If the language parameter is missing from the layout page after saving the configuration, either uninstall and reinstall the package or manually add the parameter by following these steps:</Note>

   1. Go to the **Salesforce Setup** page > **Object Manager**.
   2. Search for and select the **Kore AgentAssist Configuration** object.
   3. On the left panel, click **Page Layouts**.
   4. Open **KoreAgentAssistConfig Layout**, and drag the **Language parameter** on to the layout screen.
      <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/aa-config-layout_17.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=655176c6c3ed057e06bb28c8bb08a0e0" alt="aa-config-layout" width="1825" height="822" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/aa-config-layout_17.png" />

### Configure NICE CTI Data in Salesforce

1. Click the **app launcher** in Salesforce, and then go to **Salesforce Agent Settings**.
2. Sign in to your **NICE CX** account.
3. Ensure the **Store Salesforce Agent Script Variables** setting is enabled in the **Data Storage** section.
4. In the dropdown list, select a Salesforce object against which the Agent AI widget needs to be configured in its page layout.
   <img src="https://mintcdn.com/koreai/AvronCZFwUfJW97D/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/salesforce-object_18.png?fit=max&auto=format&n=AvronCZFwUfJW97D&q=85&s=81467edd1facf7119cc68c11e3a9a1b6" alt="salesforce-object" width="1231" height="622" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/salesforce-object_18.png" />

### Configure Page layout to embed Kore Agent AI Widget to Salesforce object

Assuming the Account Object is mapped above, open the page layout for Account Object.

In the filter field, type "NiceCTI" and drag and drop the object onto the **Account Object** layout page.

<img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/account-object-layout_19.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=ee33a91623dcf23133de7a023bb05fbf" alt="account-object-layout" width="1848" height="933" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/account-object-layout_19.png" />

### Configure a Visualforce Page to embed Kore Agent AI Widget (If Applicable)

#### Step-1: Create a Lightning Out App

Create a Lightning Out app, a special type of standalone Aura app:

1. Open the **Developer Console** from your **Salesforce** org.
2. Navigate to **File** > **New** > **Lightning Application**.
3. Fill in the **Name** and **Description** fields, and then click **Submit**.
4. Paste the following code into the editor, and save the **Lightning Application**:

```
<aura:application access="GLOBAL" extends="ltng:outApp">

    <!-- Lightning Web Component will be loaded here from Visualforce page -->
    <aura:dependency resource="KAA:niceCTIAgentAssistVoice" />
</aura:application>
```

#### Step-2: Create/Edit Visualforce Page

1. Either create a new Visualforce Page or open an existing one.

2. To create a new Visualforce Page, navigate to the **Setup** page > **Visualforce Pages**, and click **New**.

3. In the **Visualforce Markup** code editor, add **<apex:includeLightning />** at the beginning of your Visualforce page. This component loads the JavaScript file that Lightning Components for Visualforce uses.

   Paste the following code into the **Visualforce Markup** code editor at the desired location where you want the Agent AI widget to appear:<div id="lwc-container" />

   `<script>`

   ```
   // Initialize Lightning Out with the app you created

   $Lightning.use("c:LightningApplication", function() {
   // Create the LWC component inside the div container

   $Lightning.createComponent("KAA:niceCTIAgentAssistVoice", { height: '600px', width: '500px'}, "lwc-container");
   });
   ```

   `</script>`

   <Note>Replace "LightningApplication" with the name of the Lightning Out app you created in [Step-1](#step-1-create-a-lightning-out-app). Modify the **height** and **width** of the **niceCTIAgentAssistVoice** component according to your preference - these are the height and width of the Agent AI widget.</Note>

4. Click **Save**.

**Sample Visualforce Page**:

```
<apex:page >

    <apex:includeLightning />

    <h1>Hello !</h1>

    <p>Welcome to Kore.ai Visualforce page.</p>

    <div id="lwc-container"></div>

    <script>

        // Initialize Lightning Out with the app you created

        $Lightning.use("c:Kore_Lightning_App", function() {

            // Create the LWC component inside the div container

            $Lightning.createComponent("KAA:niceCTIAgentAssistVoice", { height: '600px', width: '500px'}, "lwc-container");

        });

    </script>

</apex:page>
```

Set this Visualforce page as the screen pop in the Softphone layouts of your Salesforce org, or create a Visualforce tab by following the instructions in this [document](https://help.salesforce.com/s/articleView?id=platform.pages_tabs_create.htm\&type=5).

### Configure an Aura Component to embed Kore Agent AI widget (If Applicable)

1. Either create a new Aura Component or open an existing one.
2. To create a new Aura Component, open **Developer Console** from your Salesforce org.
3. In the **Developer Console**, navigate to **File** > **New** > **LightningComponent**.
4. Fill in the **Name** and **Description** fields, and then click **Submit**.
5. Paste the following code into the editor at the desired location where you want the Agent AI widget to appear, and save the **Lightning Application**:

```
<KAA:niceCTIAgentAssistVoice height="800px" width="500px" />
```

<Note>Modify the **height** and **width** of the **niceCTIAgentAssistVoice** component according to your preference-these are the height and width of the Agent AI widget.</Note>

**Sample Aura Component**:

```
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" access="global" >

    <h1>Hello! Kore Aura Component</h1>

    <KAA:niceCTIAgentAssistVoice height="800px" width="500px" />

    <h1>End of Aura Component</h1>

</aura:component>
```

Create a Lightning tab by following the instructions in this [document](https://help.salesforce.com/s/articleView?id=platform.creating_flexipage_tabs.htm\&type=5).

### Enabling OAuth

1. Go to **Setup** > **OAuth and OpenID Connect Settings** and enable **Allow OAuth Username-Password Flows**.
   <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/enable-allow-oauth-password-20.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=3fd1e90cd9e7720b092cde134ac12250" alt="enable-allow-oauth-password" width="1906" height="1003" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/enable-allow-oauth-password-20.png" />

2. Create a connected Salesforce app and get the **Access Key** and **Access Token**. Follow [this guide](https://help.salesforce.com/s/articleView?id=sf.connected_app_client_credentials_setup.htm\&language=en_US\&type=5) for help.

## NICE CTI Studio Script for Salesforce for Outbound Calls

Import and configure the NICE Studio Script for Salesforce Integration for Outbound Calls.

Download Script For Voice: [xml script](https://github.com/Koredotcom/docs-v2/raw/refs/heads/main/ai-for-service/assets/nicecti-aa-sf-outbound.xml) or [json script](/ai-for-service/assets/nicecti-aa-sf-outbound.json)

<img src="https://mintcdn.com/koreai/AvronCZFwUfJW97D/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/script-for-voice_21.png?fit=max&auto=format&n=AvronCZFwUfJW97D&q=85&s=11d9d9c1f286a551b2951103f0563a7a" alt="script-for-voice" width="785" height="370" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/script-for-voice_21.png" />

Open the Studio, import the above script, and customize as per the following table definition:

| Node            | Activity                                                                                                                                                                                                                                                                                                                                                                                                            | Fields Updated                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Set Credentials | Update the credentials to connect to Salesforce Org.<br />Update Kore AI Agent details.<br />You can use the customdata object in the script to pass information to the Kore AI Agent. During runtime, this custom data is accessible in the UserContext of the AI Agent. Refer to [Access Custom Data in Kore AI Agent](/ai-for-service/agentai/agent-experience/access-custom-data-in-agent-ai) for instructions. | Salesforce\_key (created in step ["Enabling OAuth"](#enabling-oauth))<br />Salesforce\_secret (created in step ["Enabling OAuth"](#enabling-oauth))<br />Salesforce\_username<br />Salesforce\_password **Note:** The password is your Salesforce password appended with your Security Token. Refer to [this guide](https://help.salesforce.com/s/articleView?id=sf.user_security_token.htm\&type=5) for help.<br />Kore AI Agent credentials (botid, clientid, clientsecret, baseurl, language). Include your data in the custom data object (one key-value pair per line). For example: `customdata.agentName="Agent"`, `customdata.agentID="{agentid}"` |
| User Auth       | Configure Salesforce org credentials and generate OAuth Token                                                                                                                                                                                                                                                                                                                                                       | salesforceBaseURI **Note:** You can get it by running the following curl: `curl -location -request POST 'https://login.salesforce.com/services/oauth2/token?grant_type=password&client_id=<Salesforce Client ID>&client_secret=<Salesforce Client_Secret>&username=<Salesforce_Username>&password=<Salesforce Password + Salesforce Security Token>'`                                                                                                                                                                                                                                                                                                      |
| ReqAgent        | Update Skill for Agent Routing                                                                                                                                                                                                                                                                                                                                                                                      | Skill and other attributes as needed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| AgentAssist     | Map the AgentAssist Hub Instance                                                                                                                                                                                                                                                                                                                                                                                    | Select the AgentAssist Hub app created in the above step.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

**AgentAssist Hub Reference**:

Click the checkbox on the specific instance. Only one can be active.

<img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/agent-assist-hub-reference-22.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=1ee7b2aa4560612d251215c67035b743" alt="agent-assist-hub-reference" width="983" height="552" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/agent-assist-hub-reference-22.png" />

After selecting the AgentAssist app, click the **Close** button on the bottom-right corner of the page.

<Note>Do not click the "X" button to close the window as this will not save the changes.</Note>

Save the **Studio Script** and make sure there are no errors on Save.

## NICE Account setup for Outbound Call

On the **NICE Incontact** home page, click the **application launcher** button and select **ACD**.

**Create a Campaign**

<img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/create-campaign-23.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=b71602873aaf92eda4e0f0bc9418f187" alt="create-campaign" width="774" height="217" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/create-campaign-23.png" />

**Create a Skill**

<img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/create-a-skill_24.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=217db433f686f9282c4a89d5dfae4576" alt="create-a-skill" width="949" height="579" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/create-a-skill_24.png" />

For Custom Script, select the NICE Studio Script created in the previous step.

**Create a Disposition**

<img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/create-disposition-25.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=93180503541d6e7dbab1cfc61a316370" alt="create-disposition" width="783" height="208" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/create-disposition-25.png" />

## Important Notes

* If the Agent AI widget is embedded within the Salesforce popup page configured in Softphone Layout, **Agent AI Initiated Transcription** must be disabled for transcription to work correctly. This is because the widget loads before the customer accepts the call, and the audio stream is sent to Kore only after the call is accepted.

  <img src="https://mintcdn.com/koreai/AvronCZFwUfJW97D/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/speech-recognition_26.png?fit=max&auto=format&n=AvronCZFwUfJW97D&q=85&s=fdcb5bc61cf322a05e58d7ec76d008f8" alt="speech-recognition" width="1848" height="968" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/speech-recognition_26.png" />

  However, if the Agent AI widget is embedded in a separate page that opens after the customer accepts the call, transcription will work even if **Agent AI Initiated Transcription** is disabled as the widget is being rendered after the customer accepts the call.

* Custom Data configured in the NICE Studio Script will be passed to the Agent AI widget only if the widget is embedded in a separate page that opens after the customer accepts the call. This is because the NICE Studio Script is triggered only once the call is accepted. Therefore, Custom Data will not work if the Agent AI widget is embedded within the Salesforce popup page configured in the Softphone layout.

## Test an Outbound Call

1. Sign in to the **Kore Agent AI** account and prepare an AI Agent to handle agents' queries.

2. Validate the AI Agent credentials are correctly mapped in the above settings.

3. Validate the AgentAssist URL is correctly mapped in the above settings.

4. Sign in to the **NICE-Incontact** account, and check if the outbound skill is created properly.

5. Sign in to your **Salesforce** org.

6. From the **app launcher**, select **Service Console**.

7. Sign in with **NICE CX** credentials for the agent.
   <img src="https://mintcdn.com/koreai/AvronCZFwUfJW97D/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/install-softphone-extension_27.png?fit=max&auto=format&n=AvronCZFwUfJW97D&q=85&s=6cf8cef4bd51551095bc44949c327fa5" alt="install-softphone-extension" width="482" height="783" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/install-softphone-extension_27.png" />

8. Install the softphone: [https://help.nice-incontact.com/content/agent/cxoneagent/addcxawebrtcext.htm](https://help.nice-incontact.com/content/agent/cxoneagent/addcxawebrtcext.htm)
   <img src="https://mintcdn.com/koreai/AvronCZFwUfJW97D/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/install-softphone_28.png?fit=max&auto=format&n=AvronCZFwUfJW97D&q=85&s=70bb179dc21eae228f351a6b6f80dcec" alt="install-softphone" width="300" height="134" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/install-softphone_28.png" />

9. Refresh the screen, and click the **phone** icon on the status bar.

10. Select **Integrated Softphone**, and click **Connect**.
    <img src="https://mintcdn.com/koreai/AvronCZFwUfJW97D/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/integrated-softphone-connect-29.png?fit=max&auto=format&n=AvronCZFwUfJW97D&q=85&s=d7c9f4e2626910ab109833457f77452e" alt="integrated-softphone-connect" width="477" height="865" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/integrated-softphone-connect-29.png" />

11. Change the status to **Available**.

    <img src="https://mintcdn.com/koreai/AvronCZFwUfJW97D/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/status-available-30.png?fit=max&auto=format&n=AvronCZFwUfJW97D&q=85&s=76bbd3a34819e67f381daf0fa44f41e5" alt="status-available" width="453" height="737" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/status-available-30.png" />

    <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/available-status_31.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=28f0ee05ef80aaede9c79cbef196bd25" alt="available-status" width="358" height="599" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/available-status_31.png" />

12. Click **New**, and select **Call**.

    <img src="https://mintcdn.com/koreai/AvronCZFwUfJW97D/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/new-call_32.png?fit=max&auto=format&n=AvronCZFwUfJW97D&q=85&s=5245e1ad2cbd39f733f5d9370997332b" alt="new-call" width="357" height="601" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/new-call_32.png" />

    <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/call-dialer_33.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=ce81e2c09064d38a979ebbaf6d61e691" alt="call-dialer" width="355" height="598" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/call-dialer_33.png" />

13. The NICE Studio Script configured for outbound calls will be selected by default. If needed, you can manually select a different script from the dropdown menu.

14. Enter the phone number you wish to call, then click the **Call** button to initiate the call.
    <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/call-button_34.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=1bea1354d5fc7b7568ff6d210044930b" alt="call-button" width="358" height="597" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/call-button_34.png" />

15. The Salesforce popup page configured in the Softphone layout will open automatically—for example, a Contact page.
    <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/contact-page_35.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=5ac010e58a023d4bdc9cd7782850d461" alt="contact-page" width="1847" height="931" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/contact-page_35.png" />

16. Once the customer accepts the call, transcription will begin automatically and will be displayed under the **Transcripts** tab in the Agent AI widget.
    <img src="https://mintcdn.com/koreai/AvronCZFwUfJW97D/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/transcripts-tab_36.png?fit=max&auto=format&n=AvronCZFwUfJW97D&q=85&s=0c6a9a06179472e9cad6593e0c4d5c70" alt="transcripts-tab" width="1847" height="932" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/transcripts-tab_36.png" />

17. When the **End** button is clicked, **Summary** is generated and displayed on the Agent AI widget.
    <img src="https://mintcdn.com/koreai/AvronCZFwUfJW97D/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/summary_37.png?fit=max&auto=format&n=AvronCZFwUfJW97D&q=85&s=29a90066883bf88985538a91717ba870" alt="summary" width="1849" height="932" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/summary_37.png" />

18. Upon clicking the **Submit** button on the Agent AI widget, Summary is stored in the Kore Agent AI Conversation Summaries.
    <img src="https://mintcdn.com/koreai/AvronCZFwUfJW97D/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/kore-agentai-conv-summaries_38.png?fit=max&auto=format&n=AvronCZFwUfJW97D&q=85&s=3ce4b6f8acf376a2d85f56246101c6e2" alt="kore-agentai-conv-summaries" width="1849" height="932" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/kore-agentai-conv-summaries_38.png" />

## FAQ

**Q: Why are the transcripts not working in Agent AI widget?**

**A**: If the Agent AI widget is embedded within the Salesforce popup page configured in Softphone Layout, **Agent AI Initiated Transcription** must be disabled for transcription to work correctly.

<img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/disable-agent-ai-transcription_39.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=2f6ae6cacae68313fc7e9f44a7a81287" alt="disable-agent-ai-transcription" width="1848" height="968" data-path="ai-for-service/agentai/integration/salesforce-nice-cx-cti-outbound-calls/images/disable-agent-ai-transcription_39.png" />

**Q: Why is the custom data passing not working?**

**A**: Custom Data configured in the NICE Studio Script will be passed to the Agent AI widget only if the widget is embedded in a separate page that opens after the customer accepts the call. Custom Data will not work if the Agent AI widget is embedded within the Salesforce popup page configured in the Softphone layout.

***
