LinkedSIP opens soon. Sign-up, payments and calling are not open yet, and the rates shown are examples.
401
4xx Client error, RFC 3261

SIP 401 Unauthorized

SIP 401 Unauthorized means the server wants your username and password. One 401 is normal; a 401 that keeps coming back means the login is wrong.

Who sends it
The SIP trunk
When
Logging in (REGISTER)
Retry?
Your phone retries on its own with the password. If 401 repeats, fix the details before trying again.
The caller hears
Nothing, because no call is made. The phone or PBX shows the account as not registered or failed.
PBXYour phone or PBX
SIPThe SIP trunksends 401
☎The called side
FIX

What causes 401, and how to fix it

A single 401 is part of normal SIP digest authentication: the server challenges, your system answers with a hashed password, and the request goes through. A loop of 401s means the answer is wrong.

  1. 1
    Most common

    The password or username is wrong, often a typo or a space pasted at the end.

    Paste the username and password again from your account, with no spaces before or after.

  2. 2
    Most common

    The authentication username field is empty or different from the SIP username.

    Where your app has a separate auth username or login field, put the same SIP username in it.

  3. 3
    Sometimes

    The server or domain field does not match the one in your account, so the realm does not match.

    Use the server exactly as shown in your account, in both the server and the domain fields.

  4. 4
    Sometimes

    Several devices use the same login, and one still has an old password saved.

    Update every phone and app that uses this login, or give each device its own login.

  5. 5
    Rare

    Many failed attempts got your address blocked for a while, so you now see 403 or no reply.

    Stop the retries, correct the details, then wait before registering again.

LOG

What 401 looks like in a SIP log

SIP/2.0 401 Unauthorized

Capturing one: reading the SIP log.

SIP response
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 203.0.113.10:5060;branch=z9hG4bK-74bf9
Call-ID: [email protected]
WWW-Authenticate: Digest realm="sip.linkedsip.com", nonce="5f2b9c1e", algorithm=MD5
≠

Not to be confused with

401, 407 or 403?

407

Proxy Authentication Required

The same challenge, but from a proxy and usually on calls (INVITE) rather than registration.

403

Forbidden

The server knows who you are and refuses anyway. 401 means it still needs your credentials.

FAQ

SIP 401 questions

Is a SIP 401 always a problem?
No. Digest authentication starts with a 401 challenge, and the phone then sends the same request again with an answer computed from your password. A single 401 followed by 200 OK is normal.
Why do I get 401 again and again?
The answer your phone computes does not match, because the username, password, auth username or domain is wrong. Fix the details rather than letting the phone keep retrying.
What is digest authentication?
A challenge and response method: the server sends a random nonce, and your phone proves it knows the password without sending it. The SIP authentication guide explains it step by step.

Not 401? Look up another code.

The full list: SIP response codes. 401 again and again? Check your SIP trunk configuration.