Flow and API Configuration Guide for Voice AI & Contact Centre Platforms via Exotel vSIP
This guide provides a comprehensive, API-driven setup for Voice AI and Contact Center (CC) platforms to integrate with Exotel's Virtual SIP Trunking (vSIP) for compliant PSTN connectivity in India.
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 Virtual SIP Trunking (vSIP) solution.
Objectives​
- 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
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
Solution Overview​
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 u-law)
Signaling: SIP over TCP or TLS
Call Flow:
- Outbound: Partner SBC sends SIP INVITE (only from static IP) -> Exotel SIP Gateway -> Indian PSTN -> Customer Phone
- Inbound: PSTN Call -> Exotel DID -> SIP INVITE (from static IP or FQDN) to Partner SBC (for bot or agent)
For detailed SIP message format and header reference, see:
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
Onboarding & Integration​
Step 1: Exotel Account Setup & KYC​
- Create Account -- Sign up on Exotel and select Browser Calling during setup
- Complete KYC/CAF -- Upload KYC Documents
Step 2: SIP Trunk Enablement​
- Enable SIP Trunking -- Email hello@exotel.com to activate trunking & provision a Virtual Number/Exophone
- Retrieve API Credentials -- Visit API Settings to get
account_sid,key, andtoken
To configure silence ring or remove ring duration, contact your Exotel CSM or email hello@exotel.com
Step 3: Trunk Configuration via API​
Resources:
API Steps:
- Create Trunk --
POST /trunks - Map DIDs --
POST /trunks/{trunk_sid}/phone-numbers - Whitelist IPs --
POST /trunks/{trunk_sid}/whitelisted-ips - Add Destination URIs (TCP, TLS)
- Set
trunk_external_aliasfor VN-FQDN mapping if required (for VAPI, LiveKit, etc.)
Inbound Call Setup (PSTN to SIP Platform)​
- 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 destination URI and pass headers
- 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 and cannot be used as custom headers.
Connect Applet -- Dynamic URL Response Example​
{
"fetch_after_attempt": false,
"destination": { "trunk": "trunk-2134" },
"custom_params": "param1=value1¶m2=value2",
"record": true,
"recording_channels": "dual"
}
For more details, see the Connect Applet -- Dynamic URL documentation.
Outbound Call Setup (Platform to PSTN)​
Static IP Setup​
- Request IP whitelisting via Exotel Support or use the API repo above
- Once approved, initiate SIP outbound calls to Indian PSTN
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
Voicebot to Agent Handoff (vSIP Flow)​
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>)
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
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
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
Contact: hello@exotel.com or your Exotel CSM