register twilio termination uri on livekit ?
# ask-ai
r
register twilio termination uri on livekit ?
t
Thanks for reaching out, Saurabh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you're asking how to register a Twilio termination URI (the SIP URI Twilio will send inbound calls to) with LiveKit. I can help—below are the practical steps you can follow and a few questions so I can tailor the instructions to your setup. Summary of what to do 1. Create an inbound SIP trunk in LiveKit that accepts calls for your Twilio phone number(s). 2. Add a dispatch rule that tells LiveKit how to route incoming calls (for example, create or join a room). 3. Configure your Twilio phone number to use the LiveKit SIP URI (your LiveKit SIP endpoint). 4. Make sure your LiveKit instance is reachable over the network (TLS/SIPS on the correct port) and Twilio’s IPs are allowed if you restrict sources. Step-by-step (high level) 1. Create an inbound trunk in LiveKit ◦ Define a trunk name, the phone number(s) you want LiveKit to accept, and optional authentication. ◦ Optionally restrict signaling sources with an
allowed_addresses
list (use Twilio’s SIP/Elastic IPs if you want hardening). 1. Create a dispatch rule ◦ Configure how an incoming SIP INVITE maps to LiveKit behavior. Common patterns: ▪︎ Route to a room with a prefix (e.g., incoming number -> room
call-<random>
). ▪︎ Route to a specific agent or webhook flow. ◦ The dispatch rule references the inbound trunk(s). 1. Configure Twilio ◦ In the Twilio console, set the phone number’s SIP termination / Voice “SIP URI” or SIP endpoint to your LiveKit SIP URI, e.g.: ▪︎ sip:your-subdomain@<your-livekit-domain>;transport=tls ◦ Ensure you select TLS (SIPS) if you require secure signaling. 1. Network & TLS ◦ Ensure your LiveKit instance is publicly reachable and TLS is configured. ◦ Ensure the SIP port for TLS (commonly 5061) is open & routed to LiveKit. ◦ If you used
allowed_addresses
on the trunk, include Twilio’s SIP IPs. Notes you should know • You don’t manually “register” a Twilio termination URI in LiveKit; instead you create an inbound trunk and dispatch rule that define which numbers and sources LiveKit accepts and how it routes them. • LiveKit supports TLS/SIPS for secure SIP signaling; use that when configuring Twilio. Questions to tailor the exact commands/config • Are you using a LiveKit-managed domain (cloud) or self-hosting your LiveKit instance? • Do you want each incoming call to create a new LiveKit room, or route to an existing room/agent? • Do you already have a trunk or dispatch rule created, or do you want exact API/CLI examples for creating them (language preference: Python, curl, or other)? • Do you require IP restrictions (i.e., will you provide Twilio IPs to whitelist)? If you tell me whether you’re self-hosted or cloud, and how you want calls routed (new room per call vs fixed room/webhook), I’ll provide the precise API request examples and the Twilio-side SIP URI string to use.