---
title: StreamKit Cloud
slug: exotel-agentstream/streamkit-cloud
docTags: 
createdAt: 2025-10-12T13:05:34.392Z
---



# StreamKit Developer Quickstart Guide

### *Bridge your Contact Centre (SIP) and Voicebot (WSS) using Exotel StreamKit Cloud Connector*

## 1. Overview

StreamKit is Exotel’s cloud-based SIP ↔ WSS connector that allows you to connect any SIP-based contact centre (like Avaya, Genesys, Ameyo, or custom PBX) with any WSS-based AI platform (Dialogflow CX, OpenAI, AWS Lex, etc.) in real time.

This document will help you set up an end-to-end integration using:

- **Exotel Dynamic SIP Trunking APIs**
- **AgentStream Applets (Stream and Voicebot / Passthru)**
- **Custom SIP header and routing configuration**
- **Voicebot and Agent Assist integration flows**

## 2. Prerequisites

| **Requirement**                | **Description**                                                                                                                                                                                                          |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Exotel Account                 | Sign up for an Exotel account by selecting browser calling and get your `Account SID, Auth Key,` and `Auth Token.`                                                                                                       |
| Virtual Number                 | Buy or provision a virtual number/Exophone (DID) from Exotel by reaching out to <u>Hello\@exotel.com</u> and requesting for VoIP Exophone<br />In case, you need the IP\<>PSTN Intermix request for Veeno Exophone<br /> |
| SIP/IVR System                 | A contact centre or PBX that supports SIP INVITE routing.                                                                                                                                                                |
| Voicebot Endpoint              | WSS server endpoint or AI provider URL (e.g., WebSocket URL\:ws\://127.0.0.1:5001/media).                                                                                                                                |
| IP Whitelisting                | Your Contact Centre PBX/Server  IPs must be whitelisted on Exotel.                                                                                                                                                       |
| Exotel Singaling and Media Ips | Your Contact Centre firewall must whitelist Exotel IPs and Ports                                                                                                                                                         |
| Test                           | Do test calls, routing, and in case any support is required, reach out to <u>Exotel Phone System</u>                                                                                                                     |



## 3. Step-by-Step Setup

### Step 1: Create an Account and Virtual Number

Signup on Exotel <u>[Link](https://my.in.exotel.com/auth/register?_gl=1*13suwt5*_gcl_au*Mzg5MDk1MTU1LjE3NjAyNzMxNzk.*_ga*MTAwMTQ1MzcxLjE3NjAyNzMxNzk.*_ga_VGJ56BFYBZ*czE3NjAyNzMxNzkkbzEkZzAkdDE3NjAyNzMxNzkkajYwJGwwJGgxMDczNDM4NTI5)</u> and select browser calling while signing up

Reach out to <u>hello\@exotel.com</u> to procure the VoIP Exophone

Once done, note:

- **API Settings&#x20;**<u>**[Link](https://my.in.exotel.com/apisettings/site#api-credentials)**</u>
  - **Account SID**
  - **Subdomain**
  - **Auth Key**
  - **Auth Token**
- **Virtual Number/Exophone&#x20;**<u>**[Link](https://my.in.exotel.com/numbers)**</u>

### Step 2: [StreamKit Cloud SIP trunking Setup](docId\:StieDY03r5qWfLIjAxLsf)&#x20;

Whitelisting ensures Exotel can securely send/receive SIP traffic from your servers.

- You can add multiple IPs.
- for more details refer [Detailed SIP Trunking API Reference](docId:2OdDTEDmmf64scwjhGVkT)&#x20;

### Step 3: Set Up Your Call Flow

Use Exotel **Flow Builder** to define how the call moves from PSTN → SIP → WSS.

1. Log into Exotel Dashboard → <u>**[Create a Flow](https://my.in.exotel.com/apps#installed-apps)**</u>
2. Add **Voicebot Applet** to connect SIP calls to your Voicebot.

![](https://api.archbee.com/api/optimize/SK2urIgCC2ml99YyqWOSl/XPAryPHfhFhCT7DXCHpKH_screenshot-2026-01-24-at-33905apm.png)

&#x20;Reference: <u>[AgentStream Applets](docId\:UwzovqAVqzWBq0IuQlS0U)</u>

3. If you plan to integrate **Agent Assist**, use Stream Applet.
4.   **Passthru Applet**.

![](https://api.archbee.com/api/optimize/SK2urIgCC2ml99YyqWOSl/a1c2hoYuAuOHc7lSb-amp_screenshot-2026-01-24-at-33911apm.png)


&#x20;Reference: <u>[Passthru Applet](https://docs.exotel.com/exotel-agentstream/passthru-applet)</u>

5. <u>[Programmable Connect: Working with Connect Applet (Dynamic URL)](docId\:Ey4PwUOJAkmXMCzUxNDIS)</u> in case you want to route a call back to the contact centre
6. We have to add the greeting applet as the first applet with text as …
   - Note: if we don't add this, in that case, we will observe the voice blank issue, and the call will get disconnected in around 20 to 23 seconds
7. Map VoIP Exophone to the flow [Using Existing Phone Number](docId\:teQtX9bV-OPhrWzY-fYHN) (for VoIP exophone procurement reachout to support)

### Step 4: Send SIP INVITE at the Right Stage

From your Contact Centre or PBX, trigger a **SIP INVITE** to the Exotel SIP domain with required headers. Please do followthe  mandatory headers as per the setup guide

Refer aswell [Network & Firewall Configuration](docId\:qi8949Q_mZWt0daKM4zQH)&#x20;

Use this flow:

:::BlockQuote
`Customer → Contact Center (SIP PBX) → SIP INVITE → Exotel StreamKit → Voicebot (WSS)`
:::

**Please do send X-Exotel-AccountSid:(Account\_SID) for correct routing and CLI capture- Mandate**

### Step 5: Add Custom Headers

In SIP invite Contact center can pass custom headers ,

Custom headers help StreamKit voicebot applet decide which bot or campaign to route the call to.

Sample headers supported:

:::BlockQuote
X-Custom-Header: SalesBot
:::

:::BlockQuote
X-UUI: XXXXXX
:::

:::BlockQuote
X-User-to-User: SalesBot
:::

:::BlockQuote
X-Campaign-ID: XXXXXX
:::

:::BlockQuote
X-Customer-ID: SalesBot
:::

:::BlockQuote
X-JWT: XXXXXX
:::

:::BlockQuote
X-Cert-Obj: XXXXXX
:::

Supports 800 bytes per header and overall 4KB total



Note: Currently, additional custom headers above are supported on VoIP Exophone only.

### Step 6: Talk to the Voicebot (WSS)

Once the SIP INVITE is accepted:

- StreamKit opens a WSS connection to your voicebot.
- The SIP custom headers(X-UUI and X-Custom-Headers) are supported in two ways
  - It is received as part of the start event custom\_parameters of the Voicebot/Stream Applet
- **custom\_parameters&#x20;**&#x4B;ey1 value is fetched from wss query params and passed at start event&#x20;

:::BlockQuote
Start Message received: \{"event":"start","stream\_sid":"b6c581dXXXXXX67a2199q","sequence\_number":"1","start":\{"stream\_sid":"b6c581xxxxxxxxxbfe027a2199q","call\_sid":"2449xxxxx1a64fbxxxx199q","account\_sid":"Tenant-ID","from":"sip:0806xxxx509","to":"015xxxx0321",**"custom\_parameters":\{"Custom-Header":**"Salesbot"**,"UUI":"**&#x58;XXXXXX",**"User-to-User":"**&#x58;XXXXXX",**"Campaign**-**ID":"**&#x58;XXXXXX",**"Customer**-**ID":"**&#x58;XXXXXX",**"JWT":"**&#x58;XXXXXX",**"Cert**-**Obj":"**&#x58;XXXXXX","key1":"value1"},"media\_format":\{"encoding":"base64","sample\_rate":"8000","bit\_rate":"128kbps"}
:::

:::Paragraph{listStyleType="disc" indent="2"}
Received as additional SIPCustomHeader Query parameters in https `GET` request of programmable applets: Passthru ,Voicebot, Stream and Connect.
:::



:::CodeblockTabs
GET

```javascript
GET /your-voicebot-url?CallSid={call_sid}
    &CallFrom=073XXXXXXX
    &CallTo={destination}
    &Direction=incoming
    &SIPCustomHeader[Custom-Header]=salesbot
    &SIPCustomHeader[UUI]=handoff-token-up-to-800-bytes
    &SIPCustomHeader[User-to-User]=XXXXXXXXXXXXX...
    &SIPCustomHeader[Campaign-ID]=outbound-camp-42
    &SIPCustomHeader[Customer-ID]=CUST-556677
    &SIPCustomHeader[JWT]=eyJhbGciOiJIUzI1NiJ9...
    &SIPCustomHeader[Cert-Obj]=eyJhbGciOiJIUzI1NiJ9...
```
:::

- RTP ↔ PCM16 media is exchanged.
- Bot starts real-time ASR/TTS  or speech-to-speech conversation.

 Reference Doc: <u>[Voicebot Applet and bidirectional Integration Guide](https://docs.exotel.com/exotel-agentstream/voicebot-applet)</u>

### Step 7: Notify or Escalate via Passthru Applet

Use **Passthru Applet** to notify your contact center or escalate to an agent.

Supported modes:

1. **Notification Mode:** Bot triggers webhook via <u>[Passthru Applet.](https://docs.exotel.com/exotel-agentstream/passthru-applet)</u>
2. **Transfer Mode:** Bot requests SIP Transfer to transfer call to agent by creating another trunk at Exotel

API Steps to create a Trunk

- [Detailed SIP Trunking API Reference](docId:2OdDTEDmmf64scwjhGVkT) for Inbound call
- Create a Flow using **Connect Applet** in App Bazaar
- Use `sip:<TrunkID>` in the **Dial Whom** field
- For custom routing, use a Dynamic URL to fetch the destination URI and pass headers

![](https://api.archbee.com/api/optimize/SK2urIgCC2ml99YyqWOSl/3FlGiMpxcYj6jLMTa6pcv_.blob)

- Supports **up to 10 custom SIP headers**, e.g.,X-\*=value, X-param1=value1 (max 800 bytes each)- max 4000 bytes total
- Headers prefixed with Exotel- or Veeno- are platform-reserved

**Connect Applet – Dynamic URL Response Example:**

```json
{
"fetch_after_attempt": false,
"destination": { "trunk": "trunk-2134" },
"custom_params": "param1=value1&param2=value2",
"record": true,
"recording_channels": "dual"
}
```

Reference: [Programmable Connect: Working with Connect Applet (Dynamic URL)](docId\:Ey4PwUOJAkmXMCzUxNDIS)

Docs:
[ Passthru Applet (AgentStream)](https://docs.exotel.com/exotel-agentstream/passthru-applet)

## 4. Special Scenarios

| **Scenario**            | **Description**                                                                                                  |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------- |
| **Voicebot Mode**       | SIP ↔ WSS full-duplex. Bot handles ASR + TTS or speech-to-speech using Voicebot applet                           |
| **Agent Assist Mode**   | Unidirectional WSS stream from caller to AI (for analysis, not speech output) using Stream start and stop applet |
| **Agent Monitored Bot** | Hybrid – bot monitors conversation and provides insights.                                                        |
| **Post-Call Notify**    | StreamKit triggers the Passthru Applet after call completion for analytics or CRM updates.                       |



## 5. Example Flow

**Voicebot Scenario**

:::BlockQuote
PSTN Call → CC (SIP PBX) → Exotel StreamKit → WSS Voicebot
:::

**Agent Assist Scenario**

:::BlockQuote
PSTN Call → CC → Exotel StreamKit (Passthru) → WSS Bot (listen only)
:::

:::BlockQuote
Bot → Notify API → CRM / Dashboard
:::

![](https://app.archbee.com/api/optimize/SK2urIgCC2ml99YyqWOSl/bjJ9Y67gGUpjpPT4MTUHz_.blob)



:::Heading{depth="3" indent="1"}
**6. Compliance & Data Localization**
:::

- All media and logs stay within India (Local PoPs).
- DoT and TRAI voice compliance is ready.
- Optional encrypted call recording with region-specific storage.

## 7. Quick Links

| **Resource**                    | **URL**                                                                                                                         |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| Dynamic SIP Trunking            | <u>https\://docs.exotel.com/dynamic-sip-trunking</u>                                                                            |
| Virtual SIP Trunk to Flow Guide | <u>https\://docs.exotel.com/dynamic-sip-trunking/exotel-virtual-sip-trunking-to-flow-integration-guide</u>                      |
| AgentStream Applet              | <u>https\://docs.exotel.com/exotel-agentstream/agentstream-applets</u>                                                          |
| Passthru Applet                 | <u>https\://docs.exotel.com/exotel-agentstream/passthru-applet</u>                                                              |
| Flow & API Config               | <u>https\://docs.exotel.com/dynamic-sip-trunking/flow-and-api-configuration-guide-for-voice-ai-and-contact-centre-platforms</u> |



