Why does LiveKit Cloud return 503 when Twilio send...
# ask-ai
p
Why does LiveKit Cloud return 503 when Twilio sends sip:+phonenumber@domain format? Is there a specific configuration or account setting needed to accept this format?
t
Thanks for reaching out, Marius. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! The 503 Service Unavailable error usually pops up because of a little hiccup with the
address
field in your outbound trunk settings. For example, if you’ve got a subdomain in there like
<http://myproject.sip.telnyx.com|myproject.sip.telnyx.com>
instead of just
<http://sip.telnyx.com|sip.telnyx.com>
, that might be what's causing the trouble. Could you double-check that you’re using the right SIP endpoint in the
address
field? If you’re still running into issues, just give me a shout—I’m here to help! Sources: SIP troubleshooting guide | LiveKit Docs
p
This is for an inbound trunk with a Twilio SIP Trunk. Twilio seems to add the phone number to the SIP URI. May this be an issue?
t
LiveKit Cloud does support inbound Twilio SIP trunks, but the specific format
sip:+phonenumber@domain
might need a bit of extra setup. Twilio tends to add the phone number to the SIP URI, and sometimes this can cause hiccups if your LiveKit trunk isn’t ready to handle that format. Here’s what you can do: • Make sure your LiveKit inbound trunk is set up to accept calls with the
+phonenumber
format in the SIP URI. • Double-check the dispatch rules in LiveKit to confirm they’re routing calls correctly based on the incoming SIP URI. • See if Twilio needs any tweaks on its end to adjust or normalize the SIP URI format before it sends calls over to LiveKit. If you’d like, I’m here to help walk you through configuring the trunk or the dispatch rules—just let me know! Sources: SIP inbound trunk | LiveKit Docs | protobufs/livekit_sip.proto | Accepting incoming calls | LiveKit Docs | packages/livekit-server-sdk/src/SipClient.ts | Create and configure a Twilio SIP trunk | LiveKit Docs
p
How do I configure the inbound trunk to acceppt the +phonenumber?
t
Hey there! If you want to set up an inbound trunk in LiveKit Cloud to accept SIP URIs with the
+phonenumber
format, here’s a simple way to do it: 1. Start by creating a JSON configuration file for your inbound trunk. Here’s an example:
Copy code
{
  "trunk": {
    "name": "My inbound trunk",
    "numbers": [
      "+15105550100"
    ]
  }
}
1. Next, use the LiveKit CLI to create your inbound trunk with this command:
Copy code
lk sip inbound create inbound-trunk.json
1. Make sure your SIP trunking provider (like Twilio) is set up to send calls to your LiveKit SIP endpoint. Just a heads-up, Twilio expects numbers in E.164 format with a leading
+
. 2. Then, set up a dispatch rule in LiveKit to route those incoming calls to the right room or agent. If you run into any questions or want to explore other options like authentication or access controls, just give me a shout—I’m here to help! Sources: Accepting incoming calls | LiveKit Docs | SIP trunk setup | LiveKit Docs | SIP inbound trunk | LiveKit Docs | SIP inbound trunk | LiveKit Docs | Create and configure Telnyx SIP trunk | LiveKit Docs
m
What to do if this happens with telnyx outbound calls setup?
t
Hey there! If you're running into issues with Telnyx outbound calls in LiveKit Cloud, no worries—let’s walk through some steps together to get things sorted: 1. First, double-check that your SIP endpoint in the LiveKit setup is set exactly to
<http://sip.telnyx.com|sip.telnyx.com>
. Using subdomains like
<http://myproject.sip.telnyx.com|myproject.sip.telnyx.com>
can cause a 503 error, so it’s best to avoid those. 2. Make sure the
auth_username
and
auth_password
in your outbound trunk config match the credentials Telnyx gave you. That little detail can make a big difference! 3. Don’t forget to link the phone number you want to use for outbound calls with your Telnyx SIP trunk. You can do this easily through the Telnyx API or their UI. 4. Create an FQDN connection in Telnyx using your LiveKit SIP endpoint, and set the caller’s number format to
+E.164
so everything shows up correctly. 5. Double-check the
destination_country
parameter in your outbound trunk config to make sure it matches where you’re trying to call. 6. Then, use the LiveKit CLI to set up the outbound trunk with the right configuration like this:
Copy code
lk sip outbound create outbound-trunk.json
1. Finally, test it out by making an outbound call with the
CreateSIPParticipant
API. If you hit any snags along the way, take a peek at the Telnyx SIP logs and double-check your settings. And hey, if you want me to walk you through any of these steps in more detail, just give me a shout—I’m here to help! Sources: Making outbound calls | LiveKit Docs | SIP troubleshooting guide | LiveKit Docs | SIP outbound trunk | LiveKit Docs | Create and configure Telnyx SIP trunk | LiveKit Docs | Create and configure Telnyx SIP trunk | LiveKit Docs
m
How do I check the telnyx SIP logs? And where do I get the auth username and password