Replacing Exotel with a Self-Hosted Voice AI Gateway — 60% Cost Reduction at 500K Calls/Day
A production-grade telephony gateway that bridges PSTN networks with AI voice applications, enabling a large social-impact foundation to cut per-minute call costs by 60% while handling half a million calls daily — with zero changes to existing AI application code.
60%
Cost reduction
500K
Calls/day capacity
<200ms
One-way audio latency
WhatsApp messaging gets complicated at scale.
A large social-impact foundation running AI-powered voice surveys across India was spending over Rs 10 million per month on Exotel Voicebot at Rs 0.50 per minute. Migrating away from Exotel seemed impossible because the AI applications were tightly integrated with Exotel’s proprietary WebSocket protocol. Additionally, the cheaper BSNL SIP trunk required a Pritunl VPN that blocked the gateway’s outbound internet access — creating an impossible networking constraint.
Challenge 1
Exotel vendor lock-in at Rs 0.50/min — 60% higher than direct BSNL trunk rates
Challenge 2
AI applications hardcoded to Exotel’s WebSocket protocol — migration would require rewriting every voice bot
Challenge 3
BSNL SIP trunk requires Pritunl VPN which blocks internet access — the gateway cannot reach AI apps
Challenge 4
Need to scale from 100K to 500K calls/day (3,000–6,000 concurrent) with high availability
Challenge 5
Real-time audio quality requirements: <200ms latency, <1% packet loss across the bridge
Protocol-level compatibility eliminates migration friction — the AI apps never knew they switched providers
Network constraints (VPN conflicts) can be solved architecturally by separating concerns across servers
Custom audio codecs outperform generic libraries when latency budgets are tight (<200ms)
Pluggable provider interfaces prevent future lock-in — switching trunks is now a config change, not a code change
Built with technologies we trust.
Project Goals
The Outcome
Replaced Exotel Voicebot with a self-hosted Asterisk-based gateway that connects directly to BSNL SIP trunks. Achieved 60% cost reduction (from Rs 0.50 to Rs 0.20 per minute), 100% Exotel WebSocket protocol compatibility with zero AI code changes, and a distributed architecture that handles the BSNL VPN constraint.
Conclusion & Impact
"This project proved that enterprise telephony vendor lock-in is solvable with precise protocol engineering. By replicating Exotel’s exact WebSocket format, we eliminated the migration barrier entirely. The distributed architecture — born from a real-world VPN constraint — became a strength: it enables independent scaling of the media gateway and PBX layers."
Have a project in mind?
Let's discuss how we can help you build your next big thing.
Reach out and our team will be in touch.
Building systems that
hold up in production.
Bring up the problem others won't attempt.