how can i integrate twilio with self hosted liveki...
# ask-ai
t
how can i integrate twilio with self hosted livekit
t
Thanks for reaching out, Youssef. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd be happy to guide you through integrating Twilio with your self-hosted LiveKit instance for inbound SIP calls. Here’s a simple step-by-step process to help you get started: 1. Set Up Twilio SIP Trunk: Begin by using the Twilio API or a Node.js script to create a SIP trunk. Don’t forget to configure the origination URL (for example,
sip:your-host;transport=tcp
) and link a Twilio phone number to this trunk. 2. Create SIP Credentials: Next, manually create SIP credentials in the Twilio Console. Be sure to save these securely in your environment file as
TWILIO_SIP_USERNAME
and
TWILIO_SIP_PASSWORD
. 3. Configure LiveKit Inbound Trunk: Using the LiveKit Server SDK, set up an inbound SIP trunk along with dispatch rules to route calls to the specific LiveKit rooms you want. 4. Run the Integration: Finally, run the setup scripts (
npm run setup:twilio
and
npm run setup:livekit
) and start your application to begin handling calls smoothly. Just a quick reminder to ensure your LiveKit instance is publicly accessible, with a valid domain and TLS certificate in place. For more detailed guidance, you can always refer to the Twilio SIP trunk setup and Inbound calls with Twilio Voice documentation. If you run into any questions along the way, I’m here to help! Sources: Inbound calls with Twilio Voice | LiveKit Docs | Deploy to a VM | LiveKit docs | README.md | packages/sip--um-actually/src/setup-livekit.ts