Is it applicable to self host the sip server only ...
# ask-ai
s
Is it applicable to self host the sip server only and connect it to livekit cloud server?
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.
Absolutely, you can self-host the SIP server and connect it to a LiveKit cloud server. Think of your self-hosted SIP server as a friendly bridge that links SIP-based telephony networks with LiveKit Cloud, making it easy for SIP calls to join LiveKit rooms. Here’s a simple way to get it going: 1. Set up the SIP server using Docker Compose or natively, making sure it’s ready to chat with LiveKit Cloud. 2. Update the SIP server’s
config.yaml
file with the LiveKit Cloud server’s WebSocket URL (
ws_url
), your API key, API secret, and the Redis address that LiveKit uses. 3. Make sure both SIP signaling (port 5060) and media (ports 10000–20000) are open and reachable over the internet. 4. Use the LiveKit API or CLI to create SIP Trunks and Dispatch Rules, which help decide how calls are handled and which LiveKit rooms they connect to. If you’d like a hand with any part of the setup, just let me know—I’m here to help! Sources: test/integration/sip_test.go | Self-hosted SIP server | LiveKit Docs | SIP overview | LiveKit Docs
s
How will Dispatch Rules be attached to my locally hosted sip server not the livekit cloud sip server
t
Hey there! If you want to attach Dispatch Rules to your locally hosted SIP server instead of the LiveKit Cloud SIP server, here’s a simple rundown to help you out: 1. Deploy the Self-Hosted SIP Server: You can use Docker Compose or run it natively. Just make sure your SIP server is set up to connect to your local LiveKit server and Redis instance. For example, in the
config.yaml
, update the
ws_url
to point to your local LiveKit server and add the Redis address. 2. Ensure Network Accessibility: Don’t forget to open UDP port
5060
for SIP signaling and UDP ports
10000–20000
for RTP media. These need to be accessible from the internet so everything runs smoothly. 3. Create an Inbound Trunk: Use the LiveKit API or CLI to set up a SIP trunk. This trunk will handle authenticating SIP traffic from your provider and let you specify allowed numbers or IPs. 4. Attach a Dispatch Rule: Again, use the LiveKit API or CLI to create a Dispatch Rule. Just make sure to specify the
TrunkIds
field to link it with your locally hosted SIP trunk. This way, the rule applies to calls that come through your local SIP server. 5. Confirm SIP URI: Your SIP URI will be based on your server’s public IP, something like
sip:+1234567890@<your-public-ip>:5060
. Share this with your SIP provider so calls get routed correctly. If you want me to walk you through any of these steps in more detail, just give me a shout! I’m here to help. Sources: sipclient.go | packages/livekit-server-sdk/src/SipClient.ts | Self-hosted SIP server | LiveKit Docs | README.md | src/main/kotlin/io/livekit/server/SipServiceClient.kt