Phase 6: Real-Time Transport & Telephony · 40 min · Python
Telephony Provider Comparison and Selection
Twilio is default. Telnyx is SIP-native. Vonage is alternative. AWS Connect is enterprise. Choose wisely.
Hiring signal: Telephony provider selection reasoning shows production deployment experience and cost awareness.
What you will learn
- Compare Twilio, Telnyx, Vonage, and AWS Connect for voice agent deployments
- Evaluate providers on pricing, SIP support, international coverage, compliance tools
- Provision phone numbers: local, toll-free, short codes
- Plan number porting from existing providers
The Problem
Your voice agent needs a telephony provider to connect to phone calls. There are dozens of providers, each with different pricing, features, audio quality, and compliance support. Choosing wrong means overpaying, hitting scaling limits, or failing compliance.
The Concept
Provider Comparison Matrix
| Provider | Cost/min | Audio Quality | Scale | Compliance | Best For |
|---|
| Twilio | $0.005-0.015 | μ-law 8kHz default | Unlimited | STIR-SHAKEN, A2P | Startups, prototypes |
| Vonage | $0.003-0.010 | μ-law 8kHz | High | STIR-SHAKEN | Mid-market |
| Bandwidth | $0.002-0.008 | G.711, G.722 | Very High | Full STIR-SHAKEN | Enterprise, high volume |
| SignalWire | $0.002-0.005 | μ-law, Opus | Medium | STIR-SHAKEN | Cost-conscious |
| Telnyx | $0.002-0.006 | μ-law, Opus | High | STIR-SHAKEN | Modern stack |
Selection Criteria
| Criterion | Weight | Why It Matters |
|---|
| Cost per minute | High | At 1M min/month, $0.005 vs $0.015 = $10K/month difference |
| Audio quality | High | Better audio = better ASR accuracy |
| STIR-SHAKEN support | High | Without it, calls get blocked |
| WebSocket streaming | High | For Media Streams integration |
| SIP support | Medium | For enterprise integration |
| WebRTC support | Medium | For browser-based agents |
| Scaling limits | Medium | Need headroom for growth |
| Number porting | Medium | Keep existing numbers |
| International coverage | Low-Medium | Depends on use case |
| Documentation quality | Low | Affects dev speed |
You're building a voice agent that will handle 500K minutes/month. Twilio costs $0.012/min and Bandwidth costs $0.005/min. What's the monthly cost difference?
$2,500/month
Provider Deep Dive
Twilio
- Pros: Best documentation, largest ecosystem, auto-scaling, Studio (visual flows), Functions (serverless)
- Cons: Most expensive, μ-law 8kHz default (lower ASR accuracy), vendor lock-in
- Best for: Startups, prototypes, low-volume (<200K min/month)
Bandwidth
- Pros: Direct carrier (owns the network), best pricing, G.722 wideband, full STIR-SHAKEN
- Cons: Less documentation, fewer SDKs, more setup work
- Best for: Enterprise, high-volume (>200K min/month), cost-sensitive
Vonage (Nexmo)
- Pros: Good pricing, global coverage, SIP support
- Cons: Documentation not as good as Twilio, smaller community
- Best for: International calls, mid-market
SignalWire
- Pros: Lowest cost, FreeSWITCH-based (flexible), Opus support
- Cons: Smaller company, limited scaling history
- Best for: Cost-conscious, FreeSWITCH users
Telnyx
- Pros: Modern API, good pricing, Opus support, SIP + WebSocket
- Cons: Newer provider, smaller ecosystem
- Best for: Modern tech stack, cost + quality balance
Provider Selection Flow
Cost Calculator
class TelephonyCostCalculator:
def __init__(self, provider_rates):
self.rates = provider_rates # {"twilio": 0.012, "bandwidth": 0.005, ...}
def calculate_monthly_cost(self, provider, minutes_per_month):
"""Calculate monthly cost for a provider."""
rate = self.rates[provider]
return rate * minutes_per_month
def compare_providers(self, minutes_per_month):
"""Compare all providers for given volume."""
costs = {}
for provider, rate in self.rates.items():
monthly = rate * minutes_per_month
annual = monthly * 12
costs[provider] = {
"monthly": monthly,
"annual": annual,
"rate": rate,
}
return costs
def find_break_even(self, provider_a, provider_b, migration_cost):
"""Find break-even minutes for switching providers."""
rate_diff = self.rates[provider_a] - self.rates[provider_b]
if rate_diff <= 0:
return None # No savings
return migration_cost / rate_diff # Minutes to break even
Multi-Provider Strategy
For production systems, use multiple providers:
class MultiProviderRouter:
def __init__(self):
self.providers = {
"primary": {"name": "bandwidth", "priority": 1, "health": "healthy"},
"secondary": {"name": "twilio", "priority": 2, "health": "healthy"},
"fallback": {"name": "telnyx", "priority": 3, "health": "healthy"},
}
def select_provider(self, call_type="outbound"):
"""Select best available provider."""
available = sorted(
[p for p in self.providers.values() if p["health"] == "healthy"],
key=lambda x: x["priority"]
)
return available[0]["name"] if available else None
Unlock the full lesson
You've read the first 2 sections. The rest of this lesson covers Build It, Use It, Ship It, Evaluation, Key Terms, Common Pitfalls, Interview Framing — plus a hands-on lab, quiz, and project artifact.
Create a free account to unlock Phase 0 and Phase 1 of every course — no credit card.
Browse all courses · View pricing · DeVenture Academy