<32202 - SIP: Bad user credentials: Authentication...
# ask-ai
l
t
Thanks for reaching out, Computer. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm sorry to hear you're encountering the error "SIP: Bad user credentials: Authentication failure - bad user credentials" during your LiveKit outbound call with Twilio. This usually happens when the credentials don’t quite match up. Let’s walk through some steps together to get this sorted out: 1. Verify Authentication Credentials: Please double-check that the
authUsername
and
authPassword
in your LiveKit outbound trunk configuration exactly match the credentials set up in your Twilio SIP trunk. Twilio needs to have a credentials list with the same username and password for this to work smoothly. 2. Check Trunk Configuration in Twilio: Make sure your SIP trunk in Twilio is pointing to the correct origination URL, which should be your LiveKit SIP URI (like
sip:<project>.pstn.twilio.com
). Don’t forget that the URI should include
;transport=tcp
. 3. Ensure Proper Environment Variables: In your
.env.local
file, verify that
TWILIO_SIP_USERNAME
and
TWILIO_SIP_PASSWORD
are set correctly, matching the credentials list in Twilio. 4. Use the Correct Address Format: When setting up the outbound trunk in LiveKit, use the right address format for Twilio:
<project>.pstn.twilio.com
. Just replace
<project>
with your actual Twilio project identifier. 5. Validate Phone Number Association: Lastly, please ensure that the Twilio phone number you want to use for outbound calls is properly linked to the SIP trunk in Twilio so calls route correctly. Following these steps should help clear up the authentication issue. If you run into any trouble or have more questions, feel free to reach out—I’m here to help! Sources: src/setup-livekit.ts | SIP outbound trunk | LiveKit docs | Create and configure a Plivo SIP trunk | LiveKit docs