---
title: Flow and API Configuration Guide for Voice AI & Contact Centre Platforms
slug: dynamic-sip-trunking/flow-and-api-configuration-guide-for-voice-ai-and-contact-centre-platforms
docTags: 
createdAt: 2025-09-29T14:37:57.951Z
---

****

## 1. Background & Objective

Voice AI and Contact Center (CC) platforms often operate robust SIP-based (vSIP) infrastructures for AI-led and agent-assisted conversations. However, they typically lack direct access to India’s PSTN (landline and mobile networks) due to licensing and regulatory restrictions.

**Exotel**, operating as a Unified License (UL) Virtual Network Operator (VNO), bridges this gap by offering compliant PSTN ingress/egress via its SIP Trunking solution.

**Objective:**
To provide a plug-and-play, regulatory-compliant PSTN connectivity layer for both Voice AI and CC platforms without disrupting their current SIP infrastructure, bot orchestration logic, or agent workflow.

- Enable Voice AI and Contact Center platforms to access Indian PSTN via Exotel’s UL VNO.
- Provide a plug-and-play SIP trunking layer without disrupting existing bot or agent logic.
- Support both inbound and outbound PSTN call flows using Exotel’s vSIP infrastructure.
- Streamline onboarding via APIs for trunk creation, DID mapping, and IP whitelisting.

**This solution is ideal for:**

- Voice AI platforms using SIP-based infrastructure (e.g., FreeSWITCH, Kamailio, Asterisk, custom SBCs)
- Contact Center platforms with on-prem or cloud SIP setups requiring PSTN termination or origination
- Companies seeking elastic and compliant PSTN connectivity without managing telco licensing
- AI-led and hybrid inbound/outbound voice workflows

## 2. Solution Overview

:::Heading{depth="3" indent="1"}
**2.1 Architecture**
:::

- **Partner Side**: Existing vSIP Endpoint / SBC / PBX (Voice AI or CC layer)
- **Exotel Side**: UL VNO SIP Gateway connected to Indian PSTN via multiple telcos

**Connectivity Options:**

- Public Internet (default)
- MPLS or VPN (optional for BFSI/secure deployments; contact CSM)

**Media:** RTP/SRTP, supporting PCMA (G.711 A-law) and PCMU (G.711 μ-law)
**Signaling:** SIP over TCP or TLS

**Call Flow:**

1. **Outbound**: Partner SBC sends SIP INVITE (only from static IP) → Exotel SIP Gateway → Indian PSTN → Customer Phone
2. **Inbound**: PSTN Call → Exotel DID → SIP INVITE (from static IP or FQDN) to Partner SBC (for bot or agent)

Exotel SIP Trunking – TCP Integration Guide
Exotel SIP Trunking – TLS Integration Guide

### 2.2 Key Capabilities

- Dynamic Channel Allocation for scale management
- Multi-Telco Failover with 100% connectivity SLA
- DID Management: Purchase & KYC compliant with Indian regulations
- Secure Interconnects: IP whitelisting, TLS support
- Regulatory Compliance: SDCA mapping, lawful interception readiness

Exotel SIP Trunking – To-Flow Guide

## 3. Onboarding & Integration

### 3.1 Exotel Account Setup & KYC

1. **Create Account** – [Sign up on Exotel](https://my.in.exotel.com) and select **Browser Calling** during setup
2. **Complete KYC/CAF** – Upload KYC Documents

### 3.2 SIP Trunk Enablement

1. **Enable SIP Trunking** – Email hello\@exotel.com to activate trunking & provision a Virtual Number/Exophone
2. **Retrieve API Credentials** – Visit API Settings to get account\_sid, key, and token

To configure silence ring or remove ring duration, contact your Exotel CSM or email hello\@exotel.com

### 3.3 Trunk Configuration via API

Use:

- [GitHub Repo](https://github.com/exotel/exotel-vsip-trunk-Configuration-API)
- [Postman Collection](https://www.postman.com/grey-star-272776/exotel-vsip-trunk-configuration-apis/collection/u3vmluu/exotel-vsip-trunk-apis)

API Steps:

- `Create Trunk (/trunks)`
- `Map DIDs (/trunks/{trunk_sid}/phone-numbers)`
- `Whitelist IPs (/trunks/{trunk_sid}/whitelisted-ips)`
- `Add Destination URIs ( TCP, TLS)`
- Set trunk\_external\_alias for VN–FQDN mapping if required (for VAPI, LiveKit,OpenAI etc.)

## 4. Inbound Call Setup (PSTN → SIP Platform)

- Create a Flow using **Connect Applet** in App Bazaar
- Use `sip:<TrunkID>` in the **Dial Whom** field



::Image[]{src="https://app.archbee.com/api/optimize/SK2urIgCC2ml99YyqWOSl/QK2UUNTg2BHO-HnMlym4I_screenshot-2025-09-29-at-82418-pm.png" size="84" width="2940" height="1382" position="center" darkWidth="2940" darkHeight="1382" showCaption="false"}

- For custom routing, use a Dynamic URL to fetch destination URI and pass headers

::Image[]{src="https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/3051119684/original/_XHPYzAXt9eUmbaRl9wyMiWWYpl-Gxt5jQ.png?1581623042" size="46" width="448" height="302" position="center" darkWidth="448" darkHeight="302" showCaption="false"}

- Supports **up to 3 custom SIP headers**, e.g., X-param1=value1 (max 200 bytes total)
- Headers prefixed with Exotel- or Veeno- are platform-reserved

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

`{`

`"fetch_after_attempt": false,`

`"destination": { "trunk": "trunk-2134" },`

`"custom_params": "param1=value1&param2=value2",`

`"record": true,`

`"recording_channels": "dual"`

`}`

Reference: Connect Applet – Dynamic URL

## 5. Outbound Call Setup (Platform → PSTN)

### 5.1 Static IP Setup

- Request IP whitelisting via Exotel Support or use above repo to get it done.
- Once approved, initiate SIP outbound calls to Indian PSTN

### 5.2 FQDN-based Setup (API-triggered)

- Configure trunk destination via API (only for FQDN-based use cases)
- Use Click-to-Call API or Connect Customer to Flow API
- Set destination as sip:\<TrunkID> in Connect Applet

## 6. Voicebot to Agent Handoff (SIP Flow)

:::Heading{depth="3" indent="1"}
**Flow:**
:::

- Voicebot runs on Connect Applet over vSIP
- Bot disconnects → Flow moves to Passthru Applet → calls webhook
- Webhook Response:
  - 200 OK: Route to Connect Applet (agent group or SIP trunk)
  - 302/404: Move to Hangup Applet

**Example:**
`User says “Talk to human” → Bot ends → Passthru Applet → webhook (200 OK) → SwitchCase → Connect Applet (sip:<TrunkID>)`

## 7. Benefits for Voice AI and CC Platforms

- Plug-and-play PSTN access via Exotel’s UL VNO
- Elastic scaling with dynamic channel allocation
- Regulatory assurance with lawful interception readiness
- TLS security for sensitive verticals
- Real-time programmable call routing

## 8. Example Use Cases

- AI-led outbound campaigns (sales/NPS)
- Inbound IVR bots or reception assistants
- Agent-bot hybrid support models
- KYC calls and OTP verification for BFSI
- Order confirmations and fraud checks for e-commerce

## 9. Next Steps

- Share SIP endpoint details: IP/FQDN, transport type, supported codecs
- Exotel team initiates CAF/KYC validation
- Integration testing with live traffic
- Commercial onboarding & production go-live

