res_pjsip/pjsip_distributor.c:676 log_failed_reque...
# ask-ai
b
res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'INVITE' from '"+XXXXXXX" <sip:+XXXXXXX@AAAAA.sip.livekit.cloud>' failed for '161.115.181.81:9000' (callid: NNNNNNNNNNNn) - Failed to authenticate Got this when trying to make an outbound call from livekit to my asterisk server
t
Thanks for reaching out, Jura. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
It looks like the error is related to an authentication issue between LiveKit and your Asterisk server. Don’t worry, I’m here to help you work through this! Here are some steps you can try: 1. First, double-check that the outbound trunk in LiveKit has the correct username and password that match what’s set up on your Asterisk server. 2. Make sure the SIP URI format is accurate. Sometimes, adding
;transport=tcp
to the URI can make a difference depending on your setup. 3. Verify that both LiveKit and Asterisk are set up for digest authentication, and that Asterisk is sending the right authentication headers. 4. Take a look at the phone number and trunk settings to confirm they align perfectly between LiveKit and your SIP provider. Also, it’s a good idea to review the call logs on your LiveKit Cloud dashboard as well as the Asterisk server logs—they often provide helpful clues. If you run into any trouble or want me to guide you through these steps, just let me know. I’m here to support you! Sources: pkg/sip/server.go | Making outbound calls | LiveKit docs | protobufs/livekit_sip.proto | Create and configure a Plivo SIP trunk | LiveKit docs
b
From livekit dashboard, got this
Copy code
callDirection: "SCD_OUTBOUND"
callStatus: "SCS_ERROR"
createdAtNs: "1763024449114673521"
endedAtNs: "1763024450282775169"
error: "max auth retry attemps reached"
t
It looks like you're seeing the error "max auth retry attempts reached," which means LiveKit tried to authenticate five times but wasn't successful. This retry limit is fixed and can't be changed. Let's work through some steps together to help resolve this: 1. First, please double-check that the SIP credentials (username and password) in LiveKit exactly match those on your Asterisk server. 2. Make sure your SIP server is reachable and set up correctly to accept connections from LiveKit. 3. Take a look at any network or firewall settings that might be blocking communication. 4. Also, reviewing the SIP logs on your Asterisk server can be really helpful—look for response codes like 401 Unauthorized or 407 Proxy Authentication Required to pinpoint why the authentication might be failing. If you run into any questions or need a hand after going through these steps, please don’t hesitate to reach out. I’m here to help! Sources: pkg/sip/server.go | Webhook & Event System | livekit/livekit_composite | DeepWiki | livekit-plugins/livekit-plugins-hedra/livekit/plugins/hedra/avatar.py
b
I've talked to the trunk provider, he said that the ip
161.115.181.81
is seen, but the contact mismatch, it's ip
3.0.xx.xx
. The
3.0.xx.xx
is the ip i registered before. I think we need to re-register the contact with ``161.115.181.81` which is livekit ip. How to proceed?
t
To update the SIP contact IP address to
161.115.181.81
, you’ll want to adjust the SIP trunk configuration in LiveKit. Here’s a simple way to do it: 1. For outbound trunks, you can use the
UpdateSIPOutboundTrunk
API to update the
address
field with the new IP address. 2. For inbound trunks, just use the
UpdateSIPInboundTrunk
API to add
161.115.181.81
to the
AllowedAddresses
field. If you’d like, I’m here to walk you through the details of using these APIs or to answer any other questions you might have. Just let me know! Sources: SIP outbound trunk | LiveKit docs | SIP inbound trunk | LiveKit docs