SIP registration failed: what 401, 403 and 408 mean

Reviewed

When a SIP registration failed, the phone or the trunk got an answer code back, or no answer at all, and the code says where to look. A 401 means the server wants credentials, and it is normal the first time. A 403 means the server refuses, whatever the credentials. A 404 means it does not know the extension. A 408 means nothing answered in time. This guide says what each code means and takes the checks in the order that finds the fault fastest.

What a registration is, and how it should go

A phone registers to tell the phone system where to reach it. It sends a REGISTER request with an expiry, and sends another before the expiry runs out, for as long as it wants to take calls. The server proves who is asking by sending a challenge, which is the first 401, and the phone answers it with credentials.

PhonePhone system

  1. Phone to phone system: REGISTER, with no credentials yet
  2. Phone system to phone: 401 Unauthorized. This is a challenge, not a failure
  3. Phone to phone system: REGISTER again, with credentials that answer the challenge
  4. Phone system to phone: 200 OK. The phone is registered
A normal registration. The first 401 is part of it. A fault is a 401 that comes again after the credentials were sent, or a 403, a 404, a 408 or silence.

So a 401 on the first REGISTER is part of the exchange and not a fault. The fault is a 401 that comes back after the credentials were sent, or one of the other codes below.

Why a SIP registration failed: what each code means

Code What it means Usual causes
401 Unauthorized The server wants credentials, or the ones sent were not accepted Normal the first time. If it repeats: the wrong password, the wrong authentication username (it may differ from the extension number), the wrong realm or domain
403 Forbidden The server understood and refuses, whatever the credentials An account that is disabled, a source address that is not allowed or has been banned after failed attempts, a limit on registrations that has been reached, or a server that answers a wrong password this way on purpose
404 Not Found The server does not know the extension or the domain A wrong number, a wrong domain or realm on the phone, an extension that has been deleted
407 Proxy Authentication Required The same as 401, from a proxy in front of the server The same causes as a repeated 401
408 Request Timeout Nothing answered in time A network path that is blocked, the wrong server address or port, the wrong transport, a name that does not resolve, a failed TLS handshake
423 Interval Too Brief The server wants a longer expiry than the phone asked for A registration interval that is shorter than the server's minimum
500 or 503 The server failed or is not available A phone system that is restarting, overloaded or cannot reach its database

These are the codes defined in RFC 3261. A server may give the same answer for a wrong password and for an unknown extension, so that an attacker learns nothing, which means the phone's screen can say less than the server's log does.

The checks, in order

  1. Is the REGISTER reaching the server? Capture on the phone system. If nothing arrives, it is a network fault: the server address, the port, the transport, the name lookup or the firewall, and the code at the phone will be a 408 or nothing.
  2. Is it the right server, port and transport? A phone set to TLS against a server that listens for UDP, or the reverse, gets silence or a reset.
  3. Are the credentials right? Compare the username, the authentication username and the password in the phone with the extension on the server, and the realm or domain. If the phone is provisioned, check that it fetched its settings (see phone will not provision).
  4. Is the phone's address allowed? Look for a ban after failed attempts, an allow-list that does not include the phone's network, or a rule that blocks a country or a range. A phone that was fine until someone typed a password wrongly several times may be banned.
  5. Does it register, then stop? The registration is expiring and not being renewed. A firewall or router that closes the mapping for the phone sooner than the phone refreshes it is the usual cause, and so is a SIP ALG (see SIP ALG). Shorten the registration interval or turn on the phone's NAT keep-alive.
  6. If you use TLS, check the certificate. An expired certificate on the server takes every encrypted phone off at once, which looks like a total outage and not a certificate problem. Check the dates and that the phones trust the issuer.
  7. Check any limit. A phone system can limit how many devices register for one extension, or lock a device out after repeated failures.

Questions people ask

Is a 401 a failure?

Not the first time. The server answers an unauthenticated REGISTER with a 401 and a challenge, and the phone sends it again with credentials. It is a fault only if the 401 comes back after that, and then the credentials are wrong.

Why does a wrong password give a 403 on some systems?

Some servers answer a failed attempt with a 403 instead of another 401, and some give the same answer for a wrong password as for an unknown extension. It is a deliberate choice, to give an attacker no hint about which half was wrong, so look in the server's log and not at the phone.

Why does my phone register and then drop?

Because the registration expires and the refresh does not get through. Check the firewall's timeout for the phone's mapping, any SIP ALG, and the phone's keep-alive and registration interval.

In Wafflr

Wafflr is a phone system in development, and it has not launched, so this section describes its console as it is being built. Its dashboard lists which extensions have a device registered. A registration for something the dial plan does not know is shown and not hidden, so that the counts add up, and that is often the clue to a typo in the extension on the handset. Its own troubleshooting guide says that a wrong password and an unknown extension deliberately look the same to the telephone, so the log is the place to look. By default a challenge carries a SHA-256 digest and an MD5 digest, in that order, which is what RFC 8760 asks for, so a phone that does not know the stronger hash answers the second. Wafflr's guide also says that an expired SIP TLS certificate takes every encrypted handset off at once.