fresh-telephone-307
12/07/2025, 9:03 AMtall-airline-16756
12/07/2025, 9:03 AMtall-airline-16756
12/07/2025, 9:03 AMws_url to point at your LiveKit Cloud project (e.g., wss://your-project.livekit.cloud) and provide valid API keys.
• Ensure SIP signaling (5060) and media ports (10000–20000) are publicly reachable if the SIP server is on‑premises.
Would you like the docker-compose example or the exact config snippet for ws_url and API key placement?
Sources: SIP overview | LiveKit docs | sip | livekit/livekit_composite | DeepWiki | Self-hosted SIP server | LiveKit docsfresh-telephone-307
12/07/2025, 9:04 AMtall-airline-16756
12/07/2025, 9:04 AMssh root@DROPLET_IP
3) Install Docker and Docker Compose
# update
apt update && apt upgrade -y
# install basics
apt install -y ca-certificates curl gnupg lsb-release
# add Docker repo and install Docker
mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# enable and start docker
systemctl enable docker
systemctl start docker
4) Clone LiveKit SIP repo and prepare docker-compose
apt install -y git
git clone https://github.com/livekit/sip.git
cd sip
5) Create a configuration file Copy the example docker compose and create an env file. Replace the placeholders with your LiveKit Cloud project ws_url (example: wss://your-project.livekit.cloud) and API key/secret.
# copy example compose (if present) or create a simple docker-compose.yaml
cp docker-compose.yaml docker-compose.local.yaml || true
# create .env
cat > .env <<EOF
# LiveKit Cloud websocket URL (replace with your project URL)
LIVEKIT_WS_URL=wss://your-project.livekit.cloud
# API key and secret with permissions to create participants (replace with your keys)
LIVEKIT_API_KEY=your_api_key
LIVEKIT_API_SECRET=your_api_secret
# SIP server external IP or hostname
SIP_PUBLIC_IP=YOUR_DROPLET_PUBLIC_IP
# SIP listening port (default 5060)
SIP_PORT=5060
# RTP port range
RTP_MIN_PORT=10000
RTP_MAX_PORT=20000
EOF
If the repository's docker-compose expects a different env key names, set them accordingly using the same values above.
6) Edit docker-compose if needed Open docker-compose.local.yaml (or docker-compose.yaml) and ensure:
• The SIP container uses the above environment variables
• Ports map 5060:5060/udp (or tcp as required) and 10000-20000:10000-20000/udp
If the repository already exposes these ports, no change needed.
Example snippet to verify:
services:
sip:
image: livekit/sip:latest
env_file: .env
ports:
- "5060:5060/udp"
- "10000-20000:10000-20000/udp"
7) Start the SIP server
docker compose -f docker-compose.local.yaml up -d
8) Verify the container and logs
docker ps
docker logs -f $(docker ps -q -f ancestor=livekit/sip:latest)
9) Confirm connectivity with LiveKit Cloud
• Ensure your LIVEKIT_WS_URL is correct (wss://your-project.livekit.cloud).
• Ensure API key/secret are valid.
• Ensure firewall/DO networking allows inbound UDP 10000–20000 and UDP/TCP 5060 to the Droplet.
• Check logs for successful websocket connection messages.
10) SIP provider / PBX config
• Point your SIP trunk or PBX to the droplet IP and port 5060.
• Use the SIP server logs to debug incoming calls bridging to LiveKit rooms.
Notes and troubleshooting pointers
• Ensure NAT and firewall allow RTP ports; otherwise media will fail even if signaling connects.
• If using a hostname and TLS is required for SIP over WebSocket, ensure DNS and certificates are in place and ws_url uses wss://.
• If the repo’s compose or env variable names differ, adapt the .env names and docker-compose accordingly.
Would you like me to output a ready-to-run docker-compose.yaml and .env with placeholders filled for your droplet IP and your LiveKit project URL?fresh-telephone-307
12/07/2025, 9:05 AMtall-airline-16756
12/07/2025, 9:05 AM;transport=tls for TLS if required.)
• Save the trunk.
3) Attach your Plivo phone number to the trunk
• Plivo Console → Phone Numbers → Your Numbers → Select number → Application Type = Zentrunk → choose the trunk → Update.
4) Create an inbound trunk in LiveKit (so LiveKit accepts calls for that number) Option A — CLI:
• Create inbound-trunk.json:
{
"trunk": {
"name": "Plivo Inbound",
"numbers": [
"+15105550100"
]
}
}
• Run:
lk sip inbound create inbound-trunk.json
Option B — Cloud Dashboard:
• Go to LiveKit Cloud → Telephony → Configuration → Create new → Trunk → choose Inbound → add the Plivo number in E.164 format → Create.
5) Create a dispatch rule (how calls map to rooms) Example to create unique rooms per call:
• dispatch-rule.json:
{
"dispatch_rule": {
"rule": {
"dispatchRuleIndividual": {
"roomPrefix": "call-"
}
}
}
}
• Run:
lk sip dispatch create dispatch-rule.json
This produces rooms like call-xxxxx and joins a participant for the caller.
6) Verify connectivity & test
• Ensure Plivo’s Primary URI matches the LiveKit SIP endpoint and Plivo number is linked to that trunk.
• Place a call to your Plivo phone number. The call should be routed to LiveKit and a room created per your dispatch rule.
• Check logs:
◦ Plivo call logs in Plivo Console.
◦ LiveKit Telephony logs in Cloud Dashboard or lk CLI.
7) Optional settings & tips
• Use E.164 format (with +) for numbers in LiveKit.
• Enable krispEnabled in trunk config to turn on noise cancellation.
• Map SIP headers to participant attributes using headers_to_attributes if you need metadata.
• If self-hosting the SIP server: ensure ports (5060 signaling, UDP 10000–20000 RTP) are reachable; ws_url must point to your LiveKit Cloud project if bridging to Cloud.
• If you want incoming calls to route to specific agents or a static room, adjust dispatch rule to use roomName or agent dispatch configuration.
Would you like a ready-to-run example lk CLI JSON set (inbound trunk + dispatch) prefilled with your Plivo number so you can run the commands directly?
Sources: Create and configure a Plivo SIP trunk | LiveKit docs | SIP trunk setup | LiveKit docs | SIP participant | LiveKit docs | Agents telephony integration | LiveKit docs | Accepting inbound calls | LiveKit docs