brief-evening-79958
12/07/2025, 4:17 PMtall-airline-16756
12/07/2025, 4:17 PMtall-airline-16756
12/07/2025, 4:18 PMbrief-evening-79958
12/07/2025, 4:19 PMtall-airline-16756
12/07/2025, 4:20 PMwss://your-domain:7880 or https://your-domain).
• LIVEKIT_API_KEY — set an API key in your livekit.yaml keys section and use that value for services/clients that need it.
• LIVEKIT_API_SECRET — set the matching secret in livekit.yaml and use it where tokens or server auth is required.
• Any service-specific envs (Ingress/Egress): INGRESS_API_KEY, INGRESS_API_SECRET, INGRESS_WS_URL, EGRESS_API_KEY, EGRESS_API_SECRET, EGRESS_WS_URL if you run those services separately.
Important server config (livekit.yaml / docker)
• keys: — add your API key/secret pairs.
• port, rtc.tcp_port, `rtc.port_range_start`/`rtc.port_range_end` — configure ports for WebRTC and media.
• use_external_ip / external IP settings — if running on cloud VM, set to your public IP.
• redis.address — point to your Redis instance (required for multi-node).
• turn: — configure TURN if enabling embedded TURN (domain, tls_port, cert paths) or plan for external TURN.
• TLS/caddy config — either provide cert files or use Caddy configuration to auto-provision TLS.
Network / infra changes
• Open required ports: 443 (HTTPS/TURN-TLS), 80 (Let’s Encrypt), WebRTC ports (TCP 7881, UDP 50000–60000), TURN ports (3478 UDP), and any ingress ports (RTMP 1935, WHIP 7885) you need.
• Ensure DNS for your domain points to the server (required for TLS via Caddy/Let's Encrypt).
Deployment & tooling
• Use the provided config generator (Docker image) to produce livekit.yaml, caddy.yaml, docker-compose.yaml, and init scripts.
• Install and configure Redis (required for scaling).
• If using Ingress/Egress, configure their config files with API keys, ws_url, and Redis address; configure storage (S3/GCS/Azure) for egress uploads.
Secrets & management
• Manage `LIVEKIT_API_KEY`/`LIVEKIT_API_SECRET` securely (env or .env file).
• Ensure secrets present in livekit.yaml match values used by external services (Ingress/Egress, client server token issuers).
Quick recommended workflow
1. Own a domain and set DNS to your server.
2. Run the config generator to create docker-compose + configs.
3. Edit livekit.yaml with your keys, Redis address, ports, and TURN/TLS settings.
4. Configure Ingress/Egress files if used (set API key/secret, ws_url, Redis, storage).
5. Deploy (docker-compose / systemd service) and verify ports/TLS.
If you want, I can:
• Provide the exact fields and example snippets for livekit.yaml, Ingress, or Egress configs.
• Show the minimal .env and docker-compose changes to switch a client from Cloud to self-hosted.
Which config snippet would you like first — livekit.yaml, Ingress, or Egress?
Sources: Self-hosting the Ingress Service | LiveKit docs | Company directory phone assistant | LiveKit docs | Deploying LiveKit | LiveKit docs | Secrets management | LiveKit docs | Self-hosting the Egress Service | LiveKit docsbrief-evening-79958
12/07/2025, 4:22 PMtall-airline-16756
12/07/2025, 4:22 PMlivekit-server).
• LiveKit SIP server (bridges SIP/PSTN to LiveKit).
• Redis (required for multi-node and SIP coordination).
• Public domain/IP and DNS (needed for TLS, SIP reachability).
• Optional: TURN server (embedded or separate) if callers/clients need NAT traversal.
2) Quick deploy options
• Docker Compose (recommended): use the SIP repo's docker-compose.yaml which brings up LiveKit + SIP + Redis.
• Native: download livekit-sip binary and run with a config.yaml.
3) Essential config values to set
• In SIP config (config.yaml) and LiveKit `livekit.yaml`:
◦ api_key / api_secret — must match the keys in your LiveKit server keys: section.
◦ ws_url — WebSocket URL to your LiveKit server (e.g., ws://your-livekit:7880 or `wss://your-domain:7880`).
◦ redis.address — host:port for Redis.
◦ sip_port — usually 5060 (UDP/TCP) or 5061 for TLS.
◦ rtp_port range — e.g., 10000-20000 for RTP media.
◦ use_external_ip / external_ip — set to your public IP if behind NAT.
4) Network / firewall & TLS
• Open/forward:
◦ SIP signaling: UDP/TCP 5060 (or 5061 for TLS)
◦ RTP: configured RTP port range (e.g., UDP 10000–20000)
◦ LiveKit WebRTC media: UDP 50000–60000 and TCP 7881 (if used)
◦ HTTPS/TLS: 443 and HTTP 80 (for TLS issuance if using Caddy)
• For secure trunking enable SIP TLS and SRTP (configure certs or use Caddy for TLS).
5) Trunks & routing (how calls are handled)
• Configure inbound trunks on your SIP provider to point to your SIP server (public-ip:5060).
• Create outbound trunks in SIP config for placing calls via a PSTN provider (username/password, domain).
• Define dispatch rules to map incoming calls to LiveKit rooms, require pins, and set participant attributes.
6) Call flows & APIs
• Inbound: provider -> SIP server -> dispatch rule -> creates SIP participant in a LiveKit room.
• Outbound: use the SIP API (CreateSIPParticipant / outbound trunk) to place calls from LiveKit into PSTN/SIP.
7) Testing & validation
• Verify SIP provider/trunk can reach your public IP/port.
• Check logs on livekit-sip and livekit-server.
• Test inbound call maps to a room and media flows (audio) into LiveKit participants.
8) Helpful next steps I can provide
• Example config.yaml for livekit-sip.
• Example dispatch rule and CLI/API call to create trunks.
• Docker Compose snippet to run LiveKit + SIP + Redis.
• Guidance for securing SIP (TLS/SRTP) and recommended firewall/NAT settings.
Which of the above would you like first — a ready config.yaml example, Docker Compose snippet, or dispatch/trunk examples?
Sources: Self-hosted SIP server | LiveKit docs | SIP overview | LiveKit docs | Accepting inbound calls | LiveKit docs | SIP trunk setup | LiveKit docsbrief-evening-79958
12/08/2025, 2:38 AMtall-airline-16756
12/08/2025, 2:38 AMconfig.yaml snippet for an inbound trunk and an outbound trunk you can drop into the SIP server config.
• Example provider settings for a common provider (e.g., Twilio/Telnyx) mapped to SIP server fields.
Which example would you like first — inbound trunk config, outbound trunk config, or a complete config.yaml?brief-evening-79958
12/08/2025, 2:39 AMtall-airline-16756
12/08/2025, 2:40 AMconfig.yaml that maps provider credentials to your LiveKit dispatch rules. Which provider are you planning to use (or do you want a generic example)?brief-evening-79958
12/08/2025, 2:42 AMtall-airline-16756
12/08/2025, 2:42 AMconfig.yaml)
• Use this for local tests (replace values):
api_key: testkey
api_secret: testsecret
ws_url: ws://localhost:7880
redis:
address: localhost:6379
sip_port: 5060
rtp_port: 10000-20000
use_external_ip: false
logging:
level: debug
• Add a simple inbound mapping/dispatch rule by DID or from header if you want calls to map to a room automatically (optional). For manual testing you can create SIP participant via API when MicroSIP calls.
5) Registering MicroSIP (example account)
• In MicroSIP account settings:
◦ SIP server / domain: your-server-ip (or domain)
◦ SIP port: 5060
◦ Username: any local username you accept (depends on server auth)
◦ Password: set if you configured auth; otherwise configure server to accept unauthenticated for testing
◦ Transport: UDP (or TCP/TLS if configured)
6) Two test flows
A) Direct INVITE -> automatic room mapping
• Configure a dispatch rule in the SIP server that maps an incoming Request-URI (e.g., sip:1001@yourdomain) or DID to a LiveKit room test-room.
• Dial sip:1001@yourdomain from MicroSIP. SIP server will create SIP participant and put the call into test-room.
B) Call + API create (manual)
• From MicroSIP, call the SIP server endpoint or register and send INVITE.
• Use LiveKit SIP API CreateSIPParticipant (or server-side code) to create a participant that places an outbound call to the MicroSIP URI or binds the incoming call to a room.
7) Example dispatch rule (concept)
• match: request_uri user == "1001"
• action: create participant in room test-room, optionally require pin
8) Tips & troubleshooting
• Use sngrep / server logs to inspect SIP messages.
• Check RTP flow with Wireshark if audio absent.
• If behind NAT, set use_external_ip and forward RTP port range; enable STUN/TURN for WebRTC clients.
• For simplicity, disable strict auth for initial local tests, then enable username/password later.
If you want, I can:
• Provide a ready docker-compose.yaml for LiveKit + livekit-sip + Redis for local testing.
• Give a concrete dispatch rule snippet and the exact SIP headers MicroSIP should send.
Which would you like next?brief-evening-79958
12/08/2025, 2:44 AMtall-airline-16756
12/08/2025, 2:44 AM1001 and places the caller into room test-room without a PIN.
dispatch:
- name: "invite-1001-to-test-room"
match:
request_uri_user: "1001"
action:
type: "create_participant"
room: "test-room"
require_pin: false
participant:
name: "sip-{caller}"
metadata:
source: "sip"
2) Where to paste it
• Add this under the top-level section in your SIP server config file (commonly config.yaml for livekit-sip) so the file has a top-level dispatch: entry. Example placement:
api_key: <your_api_key>
api_secret: <your_api_secret>
ws_url: ws://localhost:7880
redis:
address: localhost:6379
sip_port: 5060
rtp_port: 10000-20000
use_external_ip: false
dispatch:
- name: "invite-1001-to-test-room"
match:
request_uri_user: "1001"
action:
type: "create_participant"
room: "test-room"
require_pin: false
participant:
name: "sip-{caller}"
metadata:
source: "sip"
3) How it works / test steps with MicroSIP
• In MicroSIP, dial sip:1001@<your-server-ip>:5060 (or set an account to register to the server and call sip:1001@yourdomain).
• The SIP server will match request_uri_user: "1001", create a SIP participant, and place the call into the LiveKit room test-room.
• If you need the caller to authenticate, add auth settings and restrict allowed source IPs in your trunk config; for quick tests you can allow unauthenticated INVITEs.
4) Troubleshooting tips
• Watch SIP logs (livekit-sip stdout) or run sngrep to verify INVITE reaches server.
• Ensure RTP port range (10000–20000) and SIP port (5060) are open/forwarded.
• If audio missing, confirm codecs match between MicroSIP and SIP server.
Would you like a version that requires a numeric PIN for entry or an example that matches based on a DID or header instead of request_uri_user?