feat: add Telnyx as telephony provider for voice assistants#2046
feat: add Telnyx as telephony provider for voice assistants#2046plutoless merged 3 commits intoTEN-framework:mainfrom
Conversation
PR #2046 Code Review: Telnyx Telephony Provider IntegrationThank you for this comprehensive integration! The implementation follows the existing Twilio pattern well and provides a solid foundation. I've reviewed the code and have feedback across several areas. ✅ StrengthsArchitecture & Code Quality:
Documentation:
🔴 Critical Issues (Should Fix Before Merge)1. CORS Misconfiguration (Security Risk)Files: Issue: Fix: Use Note: This same issue exists in the Twilio implementation and should be fixed there as well. 2. Missing Webhook Signature Verification (Security Risk)File: Issue: Telnyx sends Recommendation: Implement webhook signature verification using Telnyx's signing secret. 3. API Key Exposure in LogsIssue: Config logging may expose API keys. Mask sensitive fields before logging. 4. Missing Input Validation on Phone NumbersFile: Issue: Phone numbers are used directly in API calls without E.164 format validation. 🟡 High Priority Issues5. Race Condition in Call CleanupIssue: No synchronization when accessing/modifying 6. Memory Leak - Audio Dump FilesIssue: Audio dump files in Recommendation: Implement background cleanup task with TTL or disable audio dumps by default in production. 7. Unvalidated WebSocket Message SizeIssue: No max message size validation. Malicious clients could send massive messages causing server to hang or run out of memory. 8. Missing Required Configuration ValidationIssue: No validation that 🟠 Medium Priority Issues9. Code Duplication with TwilioAudio processing methods ( 10. Hardcoded Magic Numbers
11. Inconsistent Error ResponsesSome error responses return 📋 Production Recommendations
📝 Documentation Suggestions
SummaryThis is a solid implementation that follows good patterns from the existing Twilio integration. The main concerns are security-related (CORS, webhook verification, input validation) which should be addressed before merging. Recommendation: Address the critical security issues, then this is ready to merge. Medium/low priority issues can be addressed in follow-up PRs. Great work on this integration! 🚀 |
|
Thank you for the PR! merged. |
Add Telnyx as a Telephony Provider Integration
Summary
This PR adds Telnyx as a telephony provider for the TEN Framework, enabling inbound and outbound voice calls via Telnyx SIP trunking. The integration follows the existing Twilio SIP pattern, providing a complete voice assistant pipeline (STT → LLM → TTS) over Telnyx's programmable voice infrastructure.
Type of Change
Motivation and Context
Telnyx is a CPaaS provider offering SIP trunking, programmable voice, and AI voice capabilities. Adding Telnyx as a provider:
How Has This Been Tested?
Checklist
Documentation
The README includes:
Breaking Changes
None. This is an additive feature following existing patterns.
Related Issues
None.
Additional Context
This integration uses Telnyx's Media Streams feature for real-time audio processing, similar to Twilio's Media Streams API. The architecture consists of:
main_python): Handles call control, audio forwarding, and TEN Framework integrationThe implementation leverages Telnyx's Python SDK for call management and their XML Connection API for establishing media streams.
Files Changed
Environment Variables