How to Connect ElevenLabs with Twilio Using SIP Trunk (Not Webhooks)
When integrating voice AI agents with telephony, most tutorials point you toward the native Twilio Webhooks integration. While this works, it’s not always the most flexible or reliable option.
In this article, I’ll show you how to connect ElevenLabs with Twilio using Elastic SIP Trunking, giving you full control over call routing without relying on webhook callbacks.
Why Use SIP Trunk Instead of Webhooks?
- Lower latency: SIP trunking provides a more direct media path.
- Stability: No dependency on webhook round trips.
- Flexibility: Full control over authentication, routing, and encryption.
- Compatibility: Works like a standard VoIP trunk, so you can reuse the same setup in other systems.
Step 1: Configure Twilio Elastic SIP Trunk
Go to your Twilio Console and navigate to Elastic SIP Trunking.
General Section
- Click Create New SIP Trunk and give it a Friendly Name.
- Keep all default options except:
-
Call Transfer (SIP Refer):
Set caller ID as transferee
- Enable PSTN Transfer → enabled
-
Call Transfer (SIP Refer):
- Save and continue to Termination.
Termination Section
-
Termination SIP URI
- Set your termination domain.
- Twilio will create it as:
your-domain.pstn.twilio.com
-
IP Access Control List
- Click + to add a new list.
- Friendly Name:
elevenlabs
- Add the IP range:
34.49.132.122/32 34.49.132.122-34.49.132.122
-
Credentials List
- Click + to create a username and password.
- Save these credentials — you’ll need them in ElevenLabs.
Adjust the rest according to your case.
Origination Section
- Click + to add a new Origination URI.
- Enter: sip:sip.rtc.elevenlabs.io:5060;transport=tcp
-
Priority:
10
-
Weight:
10
Enabled: checked
Optionally enable CNAM Lookup.
Numbers Section
- Assign a phone number to your SIP trunk.
- You can buy a new one or use an existing number.
- Only numbers listed here will work under this SIP Trunk.
✅ Twilio setup is now complete. Next, let’s configure ElevenLabs.
Step 2: Configure ElevenLabs SIP Trunk
In the ElevenLabs dashboard, go to Phone Numbers → Import Number → From SIP Trunk.
Basic Information
- Label: give it a friendly name.
- Phone number: choose the same number you added in Twilio’s Numbers section.
Inbound Configuration
-
Media Encryption:
Allowed
- SIP Trunk username: the username you created in Twilio
- SIP Trunk password: the password you created in Twilio
Outbound Configuration
- Address: your Twilio termination domain, e.g.: your-domain.pstn.twilio.com
-
Transport Type:
TLS
-
Media Encryption:
Allowed
- SIP Trunk username: same as Twilio
- SIP Trunk password: same as Twilio
Step 3: Assign an Agent
- Once the number is imported, open its configuration in ElevenLabs.
- Select the AI agent that should handle calls on this number.
And that’s it! Your ElevenLabs agent is now connected to Twilio via SIP trunking. 🎉
Testing the Integration
- Place a call to your Twilio number.
- Verify that the call is routed to ElevenLabs and handled by the assigned agent.
- Check audio quality and logs to ensure SIP authentication is working.
Conclusion
By connecting ElevenLabs with Twilio using SIP trunking, you gain a more reliable, flexible, and scalable integration compared to the webhook approach. This method allows you to:
- Securely authenticate calls with SIP credentials.
- Enable encrypted media (TLS + SRTP).
- Assign numbers to specific AI agents with full control.
If you’re building production-ready AI voice agents, this SIP Trunk approach is the way to go. 🚀
💬 Have questions or ran into issues? Drop a comment below or reach out — happy to help!
Top comments (0)