trunk authorization error ```{ callId: "SCL_x5KtVE...
# ask-ai
n
trunk authorization error
Copy code
{
callId: "SCL_x5KtVEyJDeKG"
trunkId: "ST_auJvkMkP4Re4"
region: "ophoenix1b"
fromUri: {
user: "+1**********"
host: "10.24.8.14"
port: 50168
transport: "SIP_TRANSPORT_UDP"
}
toUri: {
user: "+1**********"
host: "x3ipaz73b35.sip.livekit.cloud"
port: 5060
transport: "SIP_TRANSPORT_UDP"
}
callDirection: "SCD_INBOUND"
callStatus: "SCS_ERROR"
createdAtNs: "1754194226270280157"
endedAtNs: "1754194226687692503"
error: "call was not authorized by trunk configuration"
}
t
Thanks for reaching out, Josh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The error "call was not authorized by trunk configuration" typically occurs when the SIP trunk configuration does not allow the call to proceed. Here are the steps to troubleshoot and resolve this issue: • Authentication Credentials: Verify that the
auth_username
and
auth_password
in your SIP trunk match the credentials provided by the SIP client or provider. • Allowed Addresses: If
allowed_addresses
is configured, ensure the source IP address of the call is included in the list. Update the list if necessary. • Allowed Numbers: If
allowed_numbers
is configured, confirm that the caller's phone number is included. Update the list as needed. • Dispatch Rules: Ensure there is a matching dispatch rule for the incoming call. If no rule matches, the call will be rejected. • Trunk Configuration: Review the trunk settings, including address, destination_country, and transport, to ensure they are correct. Additionally, check the SIP server logs for detailed error messages and ensure the SIP provider's server has the necessary permissions and firewall rules to communicate with LiveKit SIP. If you need further assistance, please provide details about your trunk configuration and any additional error logs. Sources: SIP APIs | LiveKit Docs | pkg/sip/inbound.go
n
after adding authUsername and authPassword with credentials from Twilio, the agent hangs up before ringing
t
Hey there! To get to the bottom of why the agent hangs up before the call even rings, could you share a bit more about your setup? Specifically: • How have you set up the SIP trunk in Twilio? • Are you seeing any error messages in the logs from LiveKit or Twilio? • Are you using TCP or UDP for the SIP connection? Knowing these details will really help us figure out what's going on and find the best fix for you. Sources: src/setup-twilio.ts | SIP outbound trunk | LiveKit Docs | livekit/livekit_sip.pb.go | SIP outbound trunk | LiveKit Docs | Create and configure a Twilio SIP trunk | LiveKit Docs
n
there is a dispatch rule properly configured for this
t
Since the dispatch rule is set up correctly, let’s explore a few other areas that might help fix the issue where the SIP agent hangs up before ringing: • Dispatch Rule Matching: Make sure the rule matches the incoming call details, like
roomPrefix
,
roomName
, and any optional
pin
. Also, double-check that the rule is linked to the right trunk IDs. • SIP Trunk Configuration: Take another look at the authentication info (username/password), allowed addresses, and numbers. It’s important the trunk is enabled and properly connected to the phone numbers. • Agent Implementation: Check that the agent is up and running, connected to the LiveKit room, and set to handle the dispatch rule’s room prefix or name. Also, confirm the agent can process incoming calls smoothly. • Error Logs: Have a peek at the SIP client logs for any error codes or messages like
callDropped
or
mediaFailed
. It’s worth checking for codec compatibility or encryption hiccups too. • RTP Configuration: Make sure RTP ports and IP addresses are properly configured and accessible, especially if NAT traversal is involved. If you can share any details about your SIP trunk setup, agent configuration, or error logs, I’d be happy to help you dig deeper and find a solution. Sources: src/setup-livekit.ts | pkg/sip/inbound.go | protobufs/livekit_sip.proto | Agents telephony integration | LiveKit Docs | Agents telephony integration | LiveKit Docs
n
This is my inbound trunk I added this as SIP origin URI in Twilio sip:x3ipaz73b35.sip.livekit.cloud
t
Hey there! When you're setting up the Twilio SIP origin URI for your inbound trunk to LiveKit, here are a few things to keep in mind: • Make sure your SIP URI looks like this:
sip:username:password@x3ipaz73b35.sip.livekit.cloud;transport=tcp
. Just swap out
username
and
password
with your actual login details. • Don't forget to specify the transport protocol as
transport=tcp
. • Double-check that your credentials match what you've set up in your LiveKit SIP trunk settings. If you've already done all this and things still aren't working, no worries! Just confirm which transport protocol you're using and share any error logs you have. We're here to help you get this sorted out.
n
this is part of my trunk config "allowedAddresses": [ "0.0.0.0/0" ],
t
Using
"allowedAddresses": ["0.0.0.0/0"]
in your SIP trunk configuration means it’ll accept traffic from any IPv4 address. This can be really handy when you’re troubleshooting or need to accept traffic from multiple sources without fixed IPs. That said, just a few things to keep in mind: • Make sure your authentication (username/password) is set up properly to keep things secure and avoid unauthorized access. • Double-check that your SIP client or server is configured with the right credentials and settings. • Keep an eye on your logs for any connection attempts or authentication hiccups—these can help spot any issues early. If you’re still running into problems, feel free to share more about your SIP client/server setup or any error logs you’re seeing. I’m here to help!
n
I updated auth to the right credentials and am now seeing a 503 error in the twilio
t
Hey there! A SIP 503 "Service Unavailable" error usually points to some server-side hiccups or authentication troubles. Don’t worry, here are a few friendly steps to help you troubleshoot: • Authentication: Double-check that your Twilio SIP credentials (username and password) exactly match what’s set up in LiveKit. It’s important that these credentials are properly linked to your Twilio trunk. • Network Connectivity: Make sure your LiveKit SIP URI is correctly entered in Twilio. Also, take a peek at your firewall settings and port access to ensure Twilio and LiveKit can chat smoothly. • Trunk Configuration: Verify that your Twilio trunk is configured with the right origination URI pointing to your LiveKit SIP endpoint. The SIP URI format should be spot on. • Service Availability: Check that your LiveKit server is up and running without issues. Looking at the server logs can give you clues if something’s off. A good place to start is by reviewing your Twilio credentials and LiveKit trunk setup since those are often the main culprits. If you’re still stuck, feel free to share any logs or extra details — I’m here to help you get this sorted out! Sources: CHANGELOG.md | pkg/sip/service_test.go | Create and configure a Twilio SIP trunk | LiveKit Docs | SIP Integration | livekit/livekit_composite | DeepWiki | src/setup-twilio.ts