cuddly-vr-85751
12/15/2025, 2:58 PMtall-airline-16756
12/15/2025, 2:58 PMtall-airline-16756
12/15/2025, 2:58 PMcuddly-vr-85751
12/15/2025, 2:59 PMtall-airline-16756
12/15/2025, 2:59 PMsip-config.yaml
• A docker run command or Docker Compose snippet that fits your existing setup (network-shared or bridge+published ports)
• Checklist of firewall and DNS settings
Which option do you prefer?
Sources: Ports and firewall | LiveKit docs | Self-hosted SIP server | LiveKit docs | SIP inbound trunk | LiveKit docs | Deploy to a VM | LiveKit docs | SIP overview | LiveKit docscuddly-vr-85751
12/15/2025, 3:06 PMtall-airline-16756
12/15/2025, 3:06 PMlksdezyitcom-livekit-1, lksdezyitcom-redis-1, lksdezyitcom-caddy-1). It includes a sip-config.yaml, required ports, network options, and verification steps.
1) Create a sip-config.yaml on the host (e.g., /opt/livekit/sip-config.yaml) and fill in your API keys/secrets:
api_key: YOUR_LIVEKIT_API_KEY
api_secret: YOUR_LIVEKIT_API_SECRET
ws_url: <ws://lksdezyitcom-livekit-1:7880>
redis:
address: lksdezyitcom-redis-1:6379
sip_port: 5060
rtp_port_range: 10000-20000
use_external_ip: true
external_ip: YOUR_SERVER_PUBLIC_IP
logging:
level: info
2) Docker Compose snippet to add to your existing docker-compose.yml (or a new one that uses the same network):
services:
sip:
image: livekit/sip:latest
container_name: lksdezyitcom-sip-1
restart: unless-stopped
volumes:
- /opt/livekit/sip-config.yaml:/sip-config.yaml:ro
environment:
- SIP_CONFIG_FILE=/sip-config.yaml
# Option A: share network namespace with LiveKit server (recommended)
network_mode: "service:lksdezyitcom-livekit-1"
# Option B: run on bridge network and publish ports (uncomment if using this option)
# networks:
# - lksnet
# ports:
# - "5060:5060/udp"
# - "5060:5060/tcp"
# - "10000-20000:10000-20000/udp"
# networks:
# - lksnet
# If you use a custom bridge network, ensure it's declared (only if using Option B)
#networks:
# lksnet:
# external: true
# name: your_existing_network_name
Notes on the two network options:
• Option A (network_mode: service:…): Shares the LiveKit server’s network namespace and IP. Simplifies connectivity and avoids port publishing conflicts. Use this if your LiveKit server is already reachable on the host IP.
• Option B (bridge + ports): Publishes SIP and RTP ports to the host. Use this if you prefer isolation or cannot share network namespaces.
3) Host firewall / ports
• Open on the host: 5060 TCP and UDP, and the RTP UDP range (e.g., 10000–20000). Ensure NAT/firewall forwards these if behind a NAT.
4) Deploy
• If adding to an existing compose file: run docker compose up -d sip
• If using a standalone compose for SIP with Option A not available, docker compose up -d for the file that includes the SIP service.
5) Verify
• Check logs: docker logs -f lksdezyitcom-sip-1 — look for successful connection to Redis and LiveKit.
• Confirm ports listening (if using Option B): ss -upln | grep 5060 and ss -upln | grep 10000
• Make a test SIP call or register a SIP client to the server’s IP:5060.
6) Create SIP trunks / routing in LiveKit
• Use the LiveKit CLI or server SDKs to create inbound/outbound SIP trunks and dispatch rules so calls are routed into rooms.
If you want, I can:
• Produce a ready-to-use docker-compose.yml merged with your current services (paste your current compose file here), or
• Customize the sip-config.yaml with your API key/secret and public IP.tall-airline-16756
12/15/2025, 3:24 PMss -upln | grep 5060 and ss -upln | grep 10000
1. Confirm SIP connectivity from outside
• From another machine, try registering a SIP client (e.g., Zoiper, Linphone) to sipUsername@sipServerIP:5060 or simply point client to your server IP and port 5060.
• For a quick UDP check: sipsak -s sip:your_server_ip:5060 or use an online SIP tester.
1. Create SIP trunks / routing in LiveKit
• Use the LiveKit CLI or your server SDK to create inbound/outbound SIP trunks and dispatch rules so calls map to rooms. Example CLI command pattern:
◦ Create inbound trunk with a phone number, then add a dispatch rule to route incoming calls to a LiveKit room.
1. Test a call flow
• Register one SIP client and call another SIP endpoint or a PSTN number (if you’ve configured a trunk). Confirm audio flows and that a LiveKit room is created/connected when routed.
1. Check logs & troubleshooting
• Monitor SIP logs: docker logs -f lksdezyitcom-sip-1 — look for registrations, invites, RTP errors.
• If audio is one-way or missing, verify RTP ports are reachable (NAT/firewall) and external_ip in sip-config.yaml is correct.
• If registration fails, confirm credentials, SIP port reachability, and that Redis connection logs show healthy connection (your logs show Redis connected).
If you want, I can:
• Provide the exact LiveKit CLI commands to create a trunk and dispatch rule.
• Help craft a test sip-config.yaml with your external IP and RTP range.
Which would you like next?cuddly-vr-85751
12/15/2025, 3:25 PMtall-airline-16756
12/15/2025, 3:25 PMsip-config.yaml?
Pick one of the options above and I’ll give step-by-step instructions.cuddly-vr-85751
12/15/2025, 3:26 PMtall-airline-16756
12/15/2025, 3:26 PMcuddly-vr-85751
12/15/2025, 3:29 PMtall-airline-16756
12/15/2025, 3:30 PMcuddly-vr-85751
12/15/2025, 3:30 PMtall-airline-16756
12/15/2025, 3:30 PM{
"name": "twilio-outbound",
"address": "<http://your-trunk.pstn.twilio.com|your-trunk.pstn.twilio.com>",
"port": 5060,
"transport": "udp",
"authUsername": "TWILIO_USERNAME",
"authPassword": "TWILIO_PASSWORD",
"numbers": []
}
1. Create trunk with CLI or API (replace placeholders as needed):
• CLI: lk sip outbound create --file twilio-outbound.json
• Or call your server API endpoint to register the trunk.
4) LiveKit: trigger an outbound call from an agent
• From your server-side code or agent app, create a SIP participant (dial-out) that uses the configured outbound trunk and the destination phone number.
Example flow (conceptual):
• Call the LiveKit server API endpoint to CreateSIPParticipant / initiate an outbound call:
◦ Provide to as the phone number (E.164, e.g., +15105550100)
◦ Set trunkId or trunk name to the Twilio outbound trunk you created
◦ Optionally include from number (a Twilio number you own) and caller metadata
If using CLI/SDK, use the equivalent command or API method to dial out via the outbound trunk. (I can provide concrete SDK or HTTP examples if you tell me which language or SDK you use.)
5) Verification and troubleshooting
• Watch LiveKit SIP logs: docker logs -f lksdezyitcom-sip-1 — look for INVITE, 200 OK, and ACK sequences when dialing.
• Check Twilio logs: Console -> Monitor -> Logs -> Voice -> see termination/requests and auth results.
• If calls fail to connect:
◦ Confirm Twilio credentials on the LiveKit trunk (username/password) are correct.
◦ Ensure LiveKit can resolve and reach <http://your-trunk.pstn.twilio.com:5060|your-trunk.pstn.twilio.com:5060> (ping/ss/telnet from host).
◦ Check NAT/firewall egress allows UDP/TCP 5060 and RTP UDP range (e.g., 10000–20000).
◦ If you see 401/407 on Twilio, re-check authentication setup and credential list association.
6) Optional: SIP auth from LiveKit to Twilio (if Twilio requires IP ACL)
• If Twilio requires IP ACL or other settings, ensure your server IP is allowed in Twilio or use the credential-based auth you created.
Would you like:
• A ready-to-use sample twilio-outbound.json with your specific values filled in?
• SDK example in Node, Go, or Python to call the LiveKit API to place the outbound call?