Telnyx Integration
This guide walks you through integrating Kallglot with Telnyx for real-time voice translation.Prerequisites
- A Telnyx account with a phone number
- A TeXML application configured
- A Kallglot API key
- A web server to receive webhooks
Architecture
Setup Steps
1. Create a TeXML Application
In the Telnyx Portal:- Go to Call Control > TeXML Applications
- Click Create TeXML Application
- Configure:
- Name: Kallglot Translation
- Voice URL:
https://your-app.com/webhooks/telnyx/voice - Voice Method: POST
- Note the Application ID
2. Assign Phone Number
- Go to Numbers > My Numbers
- Select your number
- Under Voice, select your TeXML application
- Save
3. Create the Webhook Handler
Kallglot does not currently provide official SDKs. The helper functions in these examples, such as
createKallglotSession(...), represent standard HTTP requests to the API.4. Handle Call Events
Set up status callbacks for call lifecycle events:Advanced Configurations
Outbound Calls with Call Control API
For more control, use Telnyx’s Call Control API:Using SIP Trunking
For SIP-based integration with your PBX:Recording Configuration
Configure call recording in TeXML:Telnyx vs Twilio Comparison
Error Handling
Handle API Errors
Handle Webhook Signature Verification
Telnyx signs webhooks with a signature you should verify:Best Practices
Use Call Control for complex flows
Use Call Control for complex flows
For multi-step call flows (IVR, transfers), use the Call Control API instead of TeXML for more flexibility.
Handle network issues gracefully
Handle network issues gracefully
Telnyx webhooks may timeout. Respond quickly and process asynchronously:
Use regional connections
Use regional connections
Configure Telnyx connections in regions close to your customers to minimize latency.
Troubleshooting
Calls not connecting
- Verify the TeXML application is assigned to your number
- Check webhook URL is accessible (use ngrok for testing)
- Verify TeXML syntax is valid
No audio translation
- Check
track="both_tracks"is set in Stream element - Verify Kallglot session was created successfully
- Check WebSocket connection in stream logs
High latency
- Check region configuration
- Verify network path between Telnyx and your server
- Consider using Telnyx’s edge locations closer to your users