gorgeous-hydrogen-44699
03/05/2026, 2:57 PMtall-airline-16756
03/05/2026, 2:57 PMtall-airline-16756
03/05/2026, 2:58 PMNODE_KEY, RTC, SIP trunk settings, or host/port settings.)
• Steps you’ve already tried (start commands, compose/k8s manifests, health checks you ran).
• Which SIP server implementation/version you’re using (e.g., Asterisk, FreeSWITCH, Kamailio, or LiveKit’s SIP gateway component).
If you prefer, paste just the most relevant error log and the small config sections for the SIP connector and LiveKit’s host/port settings — that’s often enough to spot common issues like network connectivity, authentication mismatch, or incorrect hostnames/ports.
Once you share those, I’ll suggest targeted troubleshooting steps (connectivity checks, configuration changes, and example manifests) to get the two services talking reliably.gorgeous-hydrogen-44699
03/05/2026, 2:59 PMtall-airline-16756
03/05/2026, 2:59 PMversion: "3.7"
services:
livekit-server:
image: livekit/livekit-server:latest
restart: unless-stopped
environment:
- LIVEKIT_KEYS=your_api_key:your_api_secret
- LIVEKIT_INGRESS_TLS_CERT=/certs/fullchain.pem
- LIVEKIT_INGRESS_TLS_KEY=/certs/privkey.pem
- LIVEKIT_SHOW_DEBUG=true
ports:
- "7880:7880"
- "7881:7881"
- "443:443"
- "7882:7882/udp"
volumes:
- ./certs:/certs:ro
• Replace your_api_key:your_api_secret with your LiveKit key pair.
• Put your TLS cert and key in ./certs/fullchain.pem and ./certs/privkey.pem.
1. Start:
• docker-compose up -d
1. Confirm LiveKit is running:
• curl -k https://livekit.example.com/health or check container logs:
• docker logs -f <container>
Step 2 — Deploy SIP server (Choose your SIP server; below is a generic outline)
1. Install your SIP server (e.g., Asterisk) on its VM.
2. Configure SIP transport and RTP port ranges. Example important items:
• SIP bind address (public/private IP)
• RTP port range (e.g., 10000-20000/UDP)
• TLS/SRTP if you need secure SIP
1. If using a SIP trunk provider, configure credentials/trunk pointing to their SIP endpoints.
2. Ensure NAT/firewall rules allow SIP and RTP to/from LiveKit host if they are across networks.
Step 3 — Connect SIP server and LiveKit You have two common options depending on how you want call routing to work:
Option A: LiveKit acts as SIP client/agent to your SIP server (common when self-hosting the SIP server)
• Create a LiveKit telephony agent or SIP trunk configuration that points to your SIP server’s IP/hostname and port.
• Configure authentication on the SIP server to accept connections from LiveKit (IP allowlist or credentials).
• On the SIP server, configure destination dialplan to forward calls to LiveKit’s SIP endpoint or to a SIP user LiveKit creates.
Option B: Use SIP provider trunking with LiveKit’s SIP gateway (LiveKit handles SIP with provider)
• Configure your SIP provider to route calls to LiveKit’s SIP gateway settings (if using LiveKit-hosted trunk).
• Alternatively, configure LiveKit to use outbound trunk credentials (username/password) provided by your SIP provider.
Configuration examples (conceptual)
• On LiveKit side, you will define an inbound trunk or a SIP connector that targets your SIP server:
◦ Host: sip.yoursite.example
◦ Port: 5060 (or 5061 for TLS)
◦ Credentials or IP-based auth
◦ RTP: ensure compatible codec sets and RTP port ranges
• On your SIP server dialplan:
◦ Route incoming PSTN calls to the SIP endpoint that corresponds to LiveKit (e.g., sip:agent@livekit-host)
◦ For outbound, route from LiveKit agent SIP credentials to the provider trunk.
Step 4 — Deploy and run a Telephony Agent (optional but recommended)
• A LiveKit agent bridges calls into a LiveKit room (plays prompts, processes audio).
• Deploy the agent (can be a small Node/Python service) with the LiveKit SDK, connecting to the LiveKit server using tokens.
• Configure the agent name in LiveKit telephony dispatch rules so incoming calls get routed to the correct agent/room.
Step 5 — Test the full flow
1. From the PSTN or SIP client, call the SIP number that your SIP server handles.
2. Observe SIP INVITE arriving at the SIP server and being routed to LiveKit (or LiveKit contacting your SIP server).
3. Check agent logs for participant connect events and audio streams.
4. Verify media flows (RTP) — use tcpdump or SIP/RTP logs to confirm packets traverse between SIP server and LiveKit host.
Basic connectivity checks and debugging
• From LiveKit host, test SIP reachability:
◦ nc -v sip.yourhost 5060
• From SIP host, test WebSocket/TLS reachability to LiveKit:
◦ curl -vk https://livekit.example.com/
• Use sngrep or tcpdump on SIP host to view SIP messages:
◦ sudo sngrep
◦ sudo tcpdump -i any port 5060 or port 10000-20000
• Check LiveKit logs:
◦ docker logs -f livekit-server
• Check SIP server logs (Asterisk: /var/log/asterisk/messages, FreeSWITCH: /var/log/freeswitch)
Common pitfalls
• Firewall/NAT blocking RTP — media fails even when SIP signaling connects.
• Codec mismatch — ensure both sides share one common codec (e.g., PCMU/opus) and sample rates.
• TLS/certificate issues for wss or SIPS — expired or mismatched certs will break connections.
• Authentication mismatch — username/password or IP allowlist must match.
• Wrong ports in configs — double-check signaling vs media port numbers.
Next step for me to help further
• Tell me which environment you want (Docker Compose, Kubernetes, or VMs) and which SIP server you plan to use (Asterisk, FreeSWITCH, Kamailio, or a cloud SIP provider).
• Paste any existing docker-compose, Kubernetes manifest, or SIP config you have and any error logs you’re seeing.
Once you share that, I’ll produce an exact docker-compose file or Kubernetes manifests and concrete SIP config snippets (dialplan / trunk config) you can drop into your servers.
Sources: Running LiveKit on AWS | Agents telephony integration | LiveKit Documentation | Voice AI quickstart | LiveKit Documentation | Building an Automated IVR Menu Caller | LiveKit Documentation | Understanding TLS in SIP | LiveKit