I’m currently integrating LiveKit’s SIP trunking f...
# ask-ai
i
I’m currently integrating LiveKit’s SIP trunking for inbound and outbound calls with Twilio. While outbound calls work smoothly, inbound calls to our LiveKit SIP trunk are disconnecting immediately after the greeting message from Twilio. Background: • Our Twilio number is configured to forward inbound calls to a Flask webhook, which responds with TwiML dialing the LiveKit SIP URI. • Our webhook returns the SIP URI in the following format (tried variations): ◦
sip:neurality-health.sip.livekit.cloud
sip:ST_T7gHYjRydHx9.pstn.livekit.cloud
sip:ST_T7gHYjRydHx9.sip.livekit.cloud
sip:neurality-health.pstn.livekit.cloud
• Despite these attempts, inbound calls are not being routed correctly. The calls disconnect immediately after the greeting, and we do not see any inbound call logs or sessions starting on LiveKit. What we suspect: • The SIP URI configured or expected by LiveKit for inbound trunking may differ from what we are using. • There might be a configuration or routing issue on the LiveKit trunk that prevents inbound calls from reaching the agent. Request: • Could you please confirm the exact SIP URI format we should use for our inbound trunk? • Could you check if inbound calls from Twilio are reaching LiveKit and if any errors or rejections are occurring? • Please advise on any additional configuration steps or common pitfalls for inbound call routing in LiveKit’s SIP trunk setup. Thank you very much for your support.
t
Thanks for reaching out, Gursimar. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thank you for providing detailed information about your setup. Based on the documentation, here are some steps and clarifications to help resolve the issue: • Ensure that the SIP URI you are using matches the one provided in your LiveKit project settings. You can find this in the LiveKit dashboard under your project settings. The exact format of the SIP URI is not specified in the documentation, so it is crucial to use the one directly from your LiveKit account. • Verify that you have created an inbound trunk in LiveKit and associated it with your phone number. This involves creating a JSON configuration file for the trunk and registering it using the LiveKit CLI. • Check if you have set up a dispatch rule in LiveKit to direct incoming calls to the appropriate LiveKit rooms. Without a dispatch rule, inbound calls may not be routed correctly. • Ensure that your SIP provider (Twilio in this case) is correctly forwarding calls to the LiveKit SIP URI and that the trunk credentials are authenticated properly. If you have already completed these steps and the issue persists, there might be a configuration or routing issue. Please confirm if you have set up the inbound trunk and dispatch rule as described, and let us know if you need further assistance or clarification. Sources: Create and configure SIP trunk | LiveKit Docs | Accepting inbound calls | LiveKit Docs
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!