echoing-lamp-18687
11/26/2025, 9:55 AMtall-airline-16756
11/26/2025, 9:55 AMtall-airline-16756
11/26/2025, 9:55 AMechoing-lamp-18687
11/26/2025, 9:57 AMlivekit_connector_twilio.proto with the ConnectTwilioCallRequest and ConnectTwilioCallResponse messages livekit_connector_twilio.proto:25-64 . The response specifically returns a WebSocket URL for Twilio's media stream connection.
Service Interface
The Connector interface includes the ConnectTwilioCall method that handles the WebSocket-based connection livekit_connector.twirp.go:29-39 .
WebSocket URL Response
The ConnectTwilioCallResponse struct contains the ConnectUrl field which is "The websocket URL which twilio media stream will connect to" livekit_connector_twilio.pb.go:195-201 .
RPC Service Definition
The internal RPC service ConnectorInternal exposes the ConnectTwilioCall method for handling Twilio connections connector.proto:35-37 .
Key Features
• Direct WebSocket Connection: No SIP server required - uses Twilio's media stream WebSocket directly
• Bidirectional Support: Handles both inbound and outbound calls via TwilioCallDirection enum livekit_connector_twilio.proto:27-32
• Room Integration: Connects Twilio calls to specific LiveKit rooms with configurable participant details
• Country-based Routing: Supports call routing based on destination country code livekit_connector_twilio.proto:57-58tall-airline-16756
11/26/2025, 9:58 AMConnectTwilioCall, ConnectUrl, etc.) exists in your codebase or a branch, it may be an internal/newer connector not yet documented publicly.
• If you can share the repository path, branch, or the specific files/snippets you found, I can review those lines and tell you exactly how the connector is intended to work and whether it requires SIP in practice.
Would you like me to review the specific files you found (paste snippets or repo paths), or would you prefer help setting up the documented SIP-based Twilio → LiveKit flow?
Sources: Inbound calls with Twilio Voice | LiveKit docs | Create and configure a Twilio SIP trunk | LiveKit docs | Introducing LiveKit Phone Numbers: Zero to Ringing in 60 Secondsechoing-lamp-18687
11/26/2025, 10:01 AMtall-airline-16756
11/26/2025, 10:01 AMechoing-lamp-18687
11/26/2025, 10:04 AMtall-airline-16756
11/26/2025, 10:04 AM{your-subdomain}.india.sip.livekit.cloud.
• Any SIP URIs for India must use that India endpoint to comply with local regulations.
3) Configure Plivo — Inbound trunk
• In Plivo Console → Zentrunk → Inbound Trunks → Create New Inbound Trunk.
• Name: e.g., “LiveKit India Inbound”.
• Primary URI: {your-subdomain}.india.sip.livekit.cloud;transport=tls (use ;transport=tls).
• Save the trunk.
• Assign your Indian phone number: Phone Numbers → select number → Application Type = Zentrunk → choose the new trunk → Update.
4) Configure LiveKit — Inbound trunk
• Create an inbound trunk in LiveKit (Dashboard / CLI / API). Example body:
{
"name": "India inbound trunk",
"numbers": [
"+91XXXXXXXXXX"
],
"krispEnabled": true
}
• CLI example:
lk sip inbound create inbound-trunk.json
• Create a dispatch rule to route inbound calls into rooms (example: per-call rooms with prefix call-):
{
"name": "India dispatch rule",
"rule": {
"dispatchRuleIndividual": {
"roomPrefix": "call-"
}
},
"roomConfig": {
"agents": [
{
"agentName": "my-telephony-agent"
}
]
}
}
• CLI:
lk sip dispatch create dispatch-rule.json
5) Configure Plivo — Outbound trunk (termination)
• Plivo Console → Zentrunk → Outbound Trunks → Create New Outbound Trunk.
• Enable Secure Trunking and add credentials (username/password).
• Note the termination SIP domain (e.g., dst-plivo.pstnhub.com).
6) Configure LiveKit — Outbound trunk
• Create outbound trunk in LiveKit with destination_country: "in" and TLS transport. Example:
{
"name": "Plivo outbound trunk",
"address": "dst-plivo.pstnhub.com",
"numbers": [
"*"
],
"authUsername": "<plivo-username>",
"authPassword": "<plivo-password>",
"transport": "SIP_TRANSPORT_TLS",
"destination_country": "in"
}
• This ensures LiveKit uses the India region for origination.
7) Place outbound calls from LiveKit
• Use LiveKit’s CreateSIPParticipant (or equivalent API) to create a SIP participant/participant call:
{
"sip_trunk_id": "<trunk-id>",
"sip_call_to": "+91YYYYYYYYYY",
"sip_number": "+91XXXXXXXXXX",
"room_name": "outbound-call",
"participant_identity": "outbound-agent",
"wait_until_answered": true
}
8) Testing
• Inbound: Call your Plivo India number — it should route to LiveKit and create a room/participant per your dispatch rule.
• Outbound: Trigger an outbound call from LiveKit to an Indian destination number and confirm the call completes.
9) Troubleshooting checklist
• Ensure both Plivo and LiveKit use TLS (;transport=tls / SIP_TRANSPORT_TLS).
• Confirm destination_country: "in" for outbound trunks and use the .india.sip.livekit.cloud endpoint for inbound.
• Verify credentials (username/password) match on both sides.
• Check Plivo call logs and LiveKit telephony logs for SIP status and SDP negotiation details.
• If calls fail, confirm DNS/port connectivity from Plivo to the LiveKit SIP endpoint and that any firewall allows TLS SIP traffic.
10) Helpful docs (reference)
• Plivo quickstart guide for LiveKit: https://docs.livekit.io/sip/quickstarts/configuring-plivo-trunk
• SIP cloud & region pinning: https://docs.livekit.io/sip/cloud/
• Inbound trunk: https://docs.livekit.io/sip/trunk-inbound
• Outbound trunk: https://docs.livekit.io/sip/trunk-outbound
• Secure trunking: https://docs.livekit.io/sip/secure-trunking
Would you like a concrete example using your actual subdomain/phone numbers (paste them here), or do you want me to walk through any specific step in your environment?
Sources: Create and configure a Plivo SIP trunk | LiveKit docs | SIP cloud and region pinning | LiveKit docs | SIP outbound trunk | LiveKit docs | SIP inbound trunk | LiveKit docs | sip | livekit/livekit_composite | DeepWiki