For running livekit in self hosted setup, how can ...
# ask-ai
c
For running livekit in self hosted setup, how can i setup the sip server? I mean how do I add outbound and inbound trunks
t
Thanks for reaching out, Subham. 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 setting up a SIP server for LiveKit in a self-hosted setup. Here’s a simple step-by-step to get you started: 1. Set Up Inbound Trunk: You’ll want to use the
CreateSIPInboundTrunk
API to configure your inbound trunk. Just provide details like
name
,
numbers
(the phone numbers for your trunk), and any authentication info if needed. This step helps LiveKit receive calls from your SIP provider smoothly. 2. Create a Dispatch Rule: Next, define how incoming calls should be routed into LiveKit rooms. You have options here—either direct dispatch to a specific room or individual dispatch to create a new room for each call. Choose what fits your needs best! 3. Set Up Outbound Trunk: Then, use the
CreateSIPOutboundTrunk
API to set up your outbound trunk. You’ll provide things like
name
,
address
(your SIP provider’s hostname), and authentication details. This lets LiveKit make outbound calls on your behalf. 4. Make Outbound Calls: Finally, with the
CreateSIPParticipant
API, you can initiate calls through your outbound trunk and link them to a LiveKit room. If you’d like, I can share detailed examples or help you with any specific step. Also, the LiveKit SIP documentation is a great resource, but feel free to reach out anytime—I’m here to help you through this! Sources: SIP outbound trunk | LiveKit docs | lib/livekit/sip_service_client.rb | examples/warm-transfer/README.md | Create and configure a Plivo SIP trunk | LiveKit docs | livekit-api/livekit/api/sip_service.py
c
So basically I can setup the whole room and sip setup using the livekit framework and host it on my cloud and it will work the same?
t
Absolutely, you can fully host LiveKit yourself, including SIP and room setup, right on your own cloud infrastructure. The self-hosted setup offers the same core features as the managed LiveKit Cloud service, like SIP integration, room management, and API support. That said, there are a few differences to keep in mind: • Self-hosted: You’ll be in charge of managing the infrastructure, scaling, failover, and monitoring. It uses a single-home SFU architecture and supports up to around 3,000 users per room. • LiveKit Cloud: Provides a global mesh architecture with multi-region servers, unlimited room scale, automatic failover, and built-in analytics. While the core functionality stays the same, the operational responsibilities and scalability options do vary. If you'd like, I’m here to help guide you through setting up your self-hosted environment—just let me know! Sources: README.md | Self-hosted SIP server | LiveKit docs | LiveKit Pricing | Intro to LiveKit | LiveKit docs | LiveKit Cloud | LiveKit Docs
c
Understood, basically livekit allows global edge deployments which makes it easy to host and function?
t
I understand you're looking into global edge deployment with LiveKit, and I’m here to help! Currently, LiveKit doesn’t come with built-in global edge deployment for self-hosted setups, but don’t worry—you can absolutely set up a distributed, multi-region architecture yourself to achieve great geographic distribution and reduce latency. For a self-hosted setup, here are some helpful options you can consider: • Geo-aware DNS: This helps direct your users to the region closest to them. • Region-aware node selector: It makes sure rooms are created on nodes nearest to the user, improving their experience. • Redis: This keeps the state synchronized across regions, so everything runs smoothly together. While this approach does require a bit of manual management, it gives you full control over your data residency and infrastructure. If you’re looking for a more hands-off solution, LiveKit Cloud offers built-in global edge routing with automatic scaling, failover, and seamless connections to the nearest data center. Please feel free to reach out if you’d like any guidance or support setting up a multi-region self-hosted deployment—I’m happy to walk you through it! Sources: LiveKit Cloud | LiveKit Docs | livekit/livekit_composite | DeepWiki | livekit/livekit_composite | DeepWiki | Deploying to custom environments | LiveKit docs | delay-handling/raw_data.txt