This article provides a comprehensive overview for SIP-native voicebot partners on how to integrate their SIP infrastructure with Exotel’s Virtual SIP Trunking (vSIP) setup. It covers supported transport types (TCP, TLS - FQDN), setup best practices, media expectations, SIP header guidelines, and testing checklists. This guide helps bot providers design and deploy a reliable SIP server that supports seamless voice routing from Exotel.
1. Overview
Exotel’s vSIP integration enables bot providers to connect their SIP-based voicebot platforms directly with Exotel’s PSTN and IP network. It allows:
Receiving inbound calls from Exophone directly into the bot
SIP signaling over TCP or TLS
RTP or SRTP media handoff
Routing using either static IP or FQDN (DNS-based)
This supports scalable, secure, cloud-native bot deployments without requiring traditional contact center infrastructure.
2. Supported Use Cases
3. Supported Transport and Routing Options
See: TLS / TCP / FQDN SIP Trunking Guides
4. Architecture Flow
Inbound Call → Exophone (Exotel) → vSIP Trunk (TCP/TLS/FQDN) → SIP Bot Server → RTP Media Exchange → Bot Response
5. Pre-Integration Checklist
6. SIP INVITE Format (Exotel → Bot)
INVITE sip:+911234567890@yourbot.fqdn.com:443;transport=tls SIP/2.0
From: "+918888888888" <sip:+918888888888@exotelt.pstn.exotel.com>
To: <sip:+911234567890@yourbot.fqdn.com>
Contact: <sip:+918888888888@182.76.143.61:5060;transport=tls>
7. SDP Media Format Example
v=0
o=root 1683048786 1683048786 IN IP4 182.76.143.61
c=IN IP4 182.76.143.61
t=0 0
m=audio 37456 RTP/AVP 8 0 96
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-15
a=sendrecv
a=ptime:20
Ensure your bot:
Accepts PCMA/PCMU codecs
Handles RTP and optionally DTMF (RFC 2833)
Responds with 200 OK containing valid SDP
8. Sample TLS Configuration (Asterisk)
[general]
externip=YOUR.PUBLIC.IP
localnet=192.168.0.0/16
[exotelvsip]
type=friend
context=incoming
host=pstn.in2.exotel.com
port=443
transport=tls
disallow=all
allow=alaw
allow=ulaw
encryption=yes
canreinvite=no
nat=force_rport
insecure=port
9. Network & Firewall Settings
Ensure Exotel edge PoP IPs are whitelisted (Mumbai, KA, Singapore).
10. Bot Behavior Checklist
Accept INVITE, send 200 OK with SDP
Accept and decode RTP (PCMA or PCMU)
Handle DTMF (RFC 2833) if applicable
Return bot-generated TTS response over RTP
Respond to BYE or issue BYE on hang-up
11. Testing Checklist
12. Debugging Tools
sip set debug on (Asterisk) or trace (Freeswitch)
Wireshark: SIP ladder + RTP stream validation
sngrep: Dialogs, SDP, and DTMF traces
13. Best Practices
Use FQDN for DNS-based routing in cloud infra
TLS + SRTP for encrypted sessions
Short DNS TTL (30–60s) for fast failover
Validate PAI header integrity (Leg1 CLI)
Prefer PCMA codec (G.711 A-law)
RTP Media Guidelines:
Limit media ports to 10000–20000 (10K ports)
Each session uses 2 ports
Media infra supports 3000 concurrent calls
50% buffer ensures capacity for retries/failovers
14. Recommended SIP Clients for Bots
Ensure support for:
G.711 A-law (PCMA)
DTMF via RFC 2833
TLS + SRTP (optional but recommended)
SIP FQDN handling if hosted in cloud
15. Outbound Call Integration via Exotel Flow
When outbound calling is required from Exotel to a SIP bot:
Supported Pattern:
Use Exotel’s Make-a-Call API to dial the customer
Use a Connect Applet in the assigned Flow to bridge the call to a SIP bot (as Leg B)
API Call (Make-a-Call):
POST /v1/Accounts/<AccountSid>/Calls/connect.json
{
"From": "+919999999999",
"To": "+918888888888",
"CallerId": "+912261234567",
"Url": "https://my.exotel.com/flow-control/flow/<flow-id>"
}
In Flow:
Use Connect Applet
Configure "Dial Whom":
sip:+918888888888@sip.botplatform.com:5070;transport=tcp
Call Flow:
Exotel dials Leg A (customer)
On answer, Leg B is initiated to SIP bot
SIP INVITE goes from Exotel to the bot
This is the only supported outbound architecture (no direct SIP to Exotel supported)