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

# Kore AI Agent Integration with Talkdesk

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

Integrate Kore Voice Automation with Talkdesk using a WebSocket-based approach to enable AI-powered voice automation within Talkdesk's contact center.

## Architecture

<img src="https://mintcdn.com/koreai/B__c1sU0_ct7qmza/ai-for-service/contact-center/integrations/talkdesk/images/architecture-diagram-1.png?fit=max&auto=format&n=B__c1sU0_ct7qmza&q=85&s=5d792d6492eca65049086b7e84678b36" alt="Architecture Diagram" width="1106" height="589" data-path="ai-for-service/contact-center/integrations/talkdesk/images/architecture-diagram-1.png" />

***

## Prerequisites

* Talkdesk account with a voice automation studio flow.
* A Kore voice bot trained with use cases.

***

## How It Works

| Step               | Description                                                                                                                       |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
| **Setup**          | Kore configures bot details and voice stream URLs in Talkdesk's "Connect to Autopilot - Voice" flow.                              |
| **Interaction**    | Customer audio streams to Kore via the Conversation Orchestrator node. Kore handles automation and returns responses to Talkdesk. |
| **Agent Handover** | If a transfer is requested, control returns to Talkdesk for human agent handling.                                                 |

***

## Voice Automation Process

After a call is established between a user and Talkdesk:

1. User audio is sent to the Conversation Orchestrator through the **Connect to Virtual Agent Voice** block.
2. Audio is forwarded to the Voice Gateway (VG).
3. VG transfers WSS traffic to Contact Center AI using SIP over TLS or UDP.
4. CCAI converts speech to text and sends it to the Bots Platform.
5. The Bots Platform generates a response; CCAI converts it to speech.
6. CCAI returns the synthesized speech to VG via SIP. Talkdesk receives it through the **Connect to Virtual Agent Voice** block.
7. The response is delivered to the user.
8. If an agent transfer is required, Talkdesk Studio Flow handles it (optional).

***

## Configuration

### Step 1: Create and Attach a Flow to a Phone Number

Create a flow using the Flow Designer and attach a phone number to it. See [Create Flows](/ai-for-service/flows/create-and-manage-flows#create-a-start-flow).

<img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/talkdesk/images/flows-and-channels-phone-number-2.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=1533176bfc50fdc1b3403f833963581f" alt="Flows and Channels Phone Number" width="2048" height="499" data-path="ai-for-service/contact-center/integrations/talkdesk/images/flows-and-channels-phone-number-2.png" />

<Note>This phone number is encrypted and used in the WSS URL for audio streaming.</Note>

### Step 2: Create a WSS URL

When a customer calls the Talkdesk number, audio streams to the audiosocket and a call is initiated to the bot based on the number in the URL.

**WSS URL format:**

```
wss://korevg-np.kore.ai/audiosocket/talkdesk/?sipuri=<encoded-phone>&token=<jwt-token>&botId=<bot-id>&accountId=<account-id>&agentassist=false
```

| Parameter   | Description                                                                                                                                    |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `sipuri`    | URL-encoded phone number associated with the bot (for example, `%2B1234456xxxx`). Use [urlencoder.org](https://www.urlencoder.org/) to encode. |
| `token`     | JWT encrypted with the bot's client secret. Payload: `{"appId":"<Client ID>"}`. Get the Client ID from Bot details.                            |
| `botId`     | Bot ID (for example, `st-xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx`).                                                                                   |
| `accountId` | Account ID of the bot owner.                                                                                                                   |

### Step 3: Configure Audio Streaming in Talkdesk Studio

<img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/talkdesk/images/talkdesk-studio-basic-flow-3.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=f9802c3dbad597f160d385bd1b78cc60" alt="Talkdesk Studio Basic Flow" width="528" height="667" data-path="ai-for-service/contact-center/integrations/talkdesk/images/talkdesk-studio-basic-flow-3.png" />

1. Download the [Studio Flow](/ai-for-service/assets/voice-automation.json) and import it into Talkdesk Studio. See [Import a Flow](https://studio.talkdesk.com/docs/importing-and-exporting-flows#importing-a-flow).
2. Click the **Connect to Autopilot Voice** block.
3. Enter the WSS URL from Step 2 in the **Voice Stream URL** field.
4. Save and publish the flow.

### Step 4: Configure Agent Escalation

#### Kore Side

Go to **Settings > Integrations > Agent Transfer > Voice > SIP Transfer > Configuration** and configure **SIP BYE**.

<img src="https://mintcdn.com/koreai/8xQ4O9aPwClT1yU0/ai-for-service/contact-center/integrations/talkdesk/images/sip-bye-settings.png?fit=max&auto=format&n=8xQ4O9aPwClT1yU0&q=85&s=0d0c68d65d2d1d1fb68f9f88109d1a9b" alt="SIP BYE Settings" width="1910" height="825" data-path="ai-for-service/contact-center/integrations/talkdesk/images/sip-bye-settings.png" />

#### Talkdesk Side

Kore uses the **Connect to Autopilot Voice** node for voice automation. On agent escalation, Kore populates variables into **Ring Groups > Variables** in the flow context.

<img src="https://mintcdn.com/koreai/B__c1sU0_ct7qmza/ai-for-service/contact-center/integrations/talkdesk/images/agent-escalation-node-exits-tab-4.png?fit=max&auto=format&n=B__c1sU0_ct7qmza&q=85&s=de786c7cf9c0d7995642b3459b68f671" alt="Agent Escalation Node - Exits Tab" width="2048" height="1125" data-path="ai-for-service/contact-center/integrations/talkdesk/images/agent-escalation-node-exits-tab-4.png" />

<img src="https://mintcdn.com/koreai/B__c1sU0_ct7qmza/ai-for-service/contact-center/integrations/talkdesk/images/agent-escalation-node-preferences-tab-5.png?fit=max&auto=format&n=B__c1sU0_ct7qmza&q=85&s=884495969b3f1c15aeb79775bd40d1c3" alt="Agent Escalation Node - Preferences Tab" width="2048" height="1125" data-path="ai-for-service/contact-center/integrations/talkdesk/images/agent-escalation-node-preferences-tab-5.png" />

<img src="https://mintcdn.com/koreai/B__c1sU0_ct7qmza/ai-for-service/contact-center/integrations/talkdesk/images/agent-escalation-node-preferences-ring-group-6.png?fit=max&auto=format&n=B__c1sU0_ct7qmza&q=85&s=7d170ed577e4f4298b54a2c049cb8860" alt="Agent Escalation Node - Ring Group" width="2048" height="1125" data-path="ai-for-service/contact-center/integrations/talkdesk/images/agent-escalation-node-preferences-ring-group-6.png" />

<Note>Kore does not pass header information on Voice Automation Agent transfer. For escalation to human agents, Kore uses the "Agent Escalation" node in Talkdesk. See [Talkdesk documentation](https://support.talkdesk.com/hc/en-us/articles/9484798498587) for details.</Note>

### Step 5: Test the Studio Flow

Assign the published flow to one or more phone numbers and make a test call to verify automation. A phone number can only be assigned to one incoming call flow. See [Assign a Flow to a Number](https://studio.talkdesk.com/docs/assigning-a-flow-to-a-number).
