cuddly-vr-85751
12/15/2025, 1:56 PMtall-airline-16756
12/15/2025, 1:56 PMtall-airline-16756
12/15/2025, 1:56 PMcuddly-vr-85751
12/15/2025, 1:57 PMtall-airline-16756
12/15/2025, 1:57 PMsip:<your-sip-endpoint> (or sips: for Secure Trunking).
• For outbound, create a credential list (Voice → Credential lists) and attach it under the trunk’s Termination → Authentication.
• Associate a phone number with the trunk.
(Reference: Create and configure a Twilio SIP trunk)[https://docs.livekit.io/sip/quickstarts/configuring-twilio-trunk]
1. Configure LiveKit for inbound calls
• Create an inbound trunk JSON:
{
"trunk": {
"name": "My inbound trunk",
"numbers": [
"+15105550123"
]
}
}
• Create the inbound trunk with lk sip inbound create inbound-trunk.json.
• Create a dispatch rule to route incoming calls into rooms, e.g. a rule with "roomPrefix": "call-", and apply with lk sip dispatch create dispatch-rule.json.
(Reference: SIP trunk setup)[https://docs.livekit.io/sip/quickstarts/configuring-sip-trunk]
1. Configure LiveKit for outbound calls
• Create an outbound trunk JSON with Twilio trunk address and credentials:
{
"trunk": {
"name": "My outbound trunk",
"address": "<my-trunk>.<http://pstn.twilio.com|pstn.twilio.com>",
"numbers": [
"+15105550100"
],
"authUsername": "<username>",
"authPassword": "<password>"
}
}
• Run lk sip outbound create outbound-trunk.json to create it.
(Reference: SIP outbound trunk)[https://docs.livekit.io/sip/trunk-outbound]
1. Alternative: Twilio Programmable Voice (TwiML) inbound
• Purchase a Twilio number, create a TwiML Bin that dials your SIP endpoint:
<Response>
<Dial>
<Sip username="sip_user" password="sip_pass">sip:+15105550123@<your-sip-endpoint></Sip>
</Dial>
</Response>
• Point the phone number to that TwiML Bin.
• In LiveKit, create a matching inbound trunk and dispatch rule.
• Note: TwiML approach does not support SIP REFER or outbound calls.
(Reference: Inbound calls with Twilio Voice)[https://docs.livekit.io/sip/accepting-calls-twilio-voice/]
1. Secure trunking (recommended)
• Enable Secure Trunking in Twilio (Console → Trunk → Features).
• Use sips: origination URIs and TLS.
• In LiveKit, enable media encryption via media_encryption in CreateSIPParticipant (SIP_MEDIA_ENCRYPT_ALLOW or SIP_MEDIA_ENCRYPT_REQUIRE).
(Reference: Secure trunking)[https://docs.livekit.io/sip/secure-trunking/]
1. Optional: Region pinning
• Use a region-specific LiveKit SIP endpoint and ensure Twilio termination URI targets that region.
(Reference: region pinning guide)[https://docs.livekit.io/sip/cloud/#region-pinning]
If you tell me:
• whether you want inbound, outbound, or both,
• the platform (LiveKit Cloud vs self-hosted),
• and whether you need TLS/media encryption,
I’ll provide the exact JSON/CLI commands and any Twilio CLI commands or TwiML tailored to your setup.
Sources: Create and configure a Twilio SIP trunk | LiveKit docs | SIP trunk setup | LiveKit docs | SIP outbound trunk | LiveKit docs | Inbound calls with Twilio Voice | LiveKit docs | Secure trunking | LiveKit docscuddly-vr-85751
12/15/2025, 1:58 PMtall-airline-16756
12/15/2025, 1:58 PMconfig.yaml) and startup steps
• Twilio setup: creating Elastic SIP Trunk, origination URL to your SIP server, phone number association, credential lists for termination
• LiveKit config: creating inbound/outbound trunks, dispatch rules, CreateSIPParticipant usage, example JSON/CLI commands
• Security & networking: TLS (sips), SRTP, firewall/NAT rules and required ports (5060/5061, RTP 10000–20000)
• Troubleshooting connectivity: SIP signaling failures, RTP/muted audio, or authentication problems
If you tell me the deployment method (Docker or native), your public IP or domain (or whether you’ll use TLS), and whether you need inbound, outbound, or both, I’ll provide the exact commands, JSON samples, and Twilio CLI/TwiML snippets you can run.
Sources: Self-hosted SIP server | LiveKit docs | Create and configure a Twilio SIP trunk | LiveKit docs | SIP outbound trunk | LiveKit docs | Ports and firewall | LiveKit docs | SIP overview | LiveKit docs