Raleigh, NC · Remote supportRemote support by appointment

September 12, 2026 · Vel

SIP 403 vs 401: Read the Challenge Before Changing Settings

SIP 403 vs 401 illustrated through a phone, PBX, authentication challenge loop, and separate carrier policy refusal gate

Understanding SIP 403 vs 401 starts with the exchange, not the error label. A 401 Unauthorized response often begins normal authentication. A 403 Forbidden response signals refusal, but it does not prove that the password was correct. Before changing settings, identify the request, the responding system, and what happened next.

SIP 403 vs 401 illustrated through a phone, PBX, authentication challenge loop, and separate carrier policy refusal gate

SIP, the Session Initiation Protocol, handles call setup and device registration. This guide focuses on reading authentication exchanges and collecting evidence. It does not treat every rejected call as a routing fault.

What SIP 401 and 403 Actually Mean

A SIP 401 means the request needs authentication for the receiving server. The response includes a WWW-Authenticate header that describes the challenge. A capable client can answer with a new request containing an Authorization header.

A SIP 403 means the server understood the request but refuses to fulfill it. Under the standard definition, authorization will not help, and the client should not repeat the unchanged request.

However, implementations do not always reveal their exact reason. Some systems return 403 for invalid credentials, unknown accounts, or security restrictions. Therefore, a 403 alone does not establish successful authentication.

The IETF SIP specification defines these responses in sections 21.4.2 and 21.4.4. Use those meanings as your starting point, then confirm local behavior through logs.

  • 401: Inspect the challenge and the client’s next request.
  • 403: Inspect the refusal source and its account or policy decision.
  • Either code: Avoid diagnosing the whole exchange from one packet.

Recognize a Healthy Authentication Challenge

Many clients send an initial request without authentication details. The server challenges that request, and the client calculates a response using its configured secret.

A simplified registration exchange looks like this:

  1. The phone sends REGISTER without an Authorization header.
  2. The registrar replies with 401 Unauthorized and a challenge.
  3. Next, the phone sends a new REGISTER with Authorization and an increased CSeq number.
  4. The registrar accepts it with 200 OK.

A registrar maintains device contact information. A CSeq header identifies the request method and its sequence number. In this example, the 401 is expected, not an outage.

An INVITE, which starts a call, can also receive a challenge. Unlike REGISTER, an INVITE rejection requires an ACK acknowledgment before the authenticated retry. Do not mistake that ACK for the retry itself.

A proxy can instead send 407 Proxy Authentication Required. That exchange uses Proxy-Authenticate and Proxy-Authorization. Check the header pair rather than assuming every challenge uses 401.

Compare Authentication Headers Across the Retry

For SIP 403 vs 401 diagnosis, the retry carries more evidence than the first response. Read the challenge and the answer together.

  • Realm: The authentication domain supplied by the server. Check whether the client selects credentials for that realm.
  • Nonce: A server-generated challenge value. The retry must answer the relevant challenge.
  • Username: The authentication identity. It may differ from the extension, account number, or caller ID.
  • Algorithm and qop: The digest calculation method and quality-of-protection options. Confirm that both systems support the offered choices.
  • URI: The resource identifier used in the digest calculation. Check it against the request target and server expectations.
  • Response: The calculated digest answer, not a plain-text password.

A repeated 401 can indicate missing credentials, a wrong secret, or unsupported authentication options. It can also reflect challenge handling problems.

Look for stale=true in a fresh challenge. That flag means the previous nonce has expired; it does not necessarily mean the secret is wrong. If the client sends no retry, inspect its account selection and authentication configuration first.

Find Which System Issued the 403

Draw the signaling path before editing the phone or trunk: phone, PBX, provider edge, and upstream service. A PBX is the phone system that manages extensions and call routing.

Record the source and destination addresses for the response. Those addresses identify the adjacent sender, not always the system that made the original decision. A proxy may relay a response from another server.

Correlate Call-ID, CSeq, and the top Via branch value. Call-ID groups related signaling, while the Via branch helps distinguish transactions. A transaction links a request with its responses.

A PBX may create separate call legs with different Call-ID values. Use its channel or linked-call identifiers to connect those legs. Do not expect the phone’s Call-ID to appear unchanged at the carrier.

Treat the response phrase, Server header, and optional Reason or Warning headers as clues. They can provide context, but they do not replace the rejecting system’s logs.

Separate Credential Failure From Policy Refusal

A 403 after an authenticated retry narrows the investigation, but it does not settle it. The server may reject the credentials or deny the requested action.

Ask the rejecting system’s administrator to distinguish these outcomes:

  • No matching account or endpoint.
  • Digest verification failed.
  • Authentication succeeded, but the account lacks permission.
  • The source IP address does not match an allowlist.
  • The account status, destination, or presented calling number violates policy.

Compare the Request-URI, which identifies the destination, with the provider’s required format. Then inspect From and any P-Asserted-Identity header against the provider’s identity rules. These fields serve different roles; they need not match the authentication username.

Registration success does not prove permission to place every call. A provider may authorize REGISTER and INVITE differently. Likewise, an IP-authenticated trunk may not use a digest challenge at all.

Change caller identity only to a number the business may legitimately present. Never disable authentication or broadly allow unknown sources to test a refusal.

Collect a Short, Controlled PBX Trace

Start with one approved test and an exact timestamp, including the time zone. Record the affected extension, destination, trunk, and whether the failure affects registration or calling.

On an Asterisk system using PJSIP, an authorized administrator can enable SIP message logging from the Asterisk console:

pjsip set logger on
pjsip set logger off

Enable logging immediately before the test, then disable it afterward. These commands can produce substantial output and expose sensitive signaling. Confirm operational approval, available storage, and the active SIP driver first.

Consult the official Asterisk documentation for the installed release and available filtering options. FreePBX installations differ in log destinations and retention settings.

Collect the SIP trace alongside authentication, endpoint matching, and call-routing log entries. Ordinary call records often omit the challenge headers that explain the failure.

TLS encrypts SIP traffic in transit. A network capture may therefore hide message contents. Prefer authorized application-level logging rather than disabling encryption.

Test One Explanation at a Time

Turn the evidence into a specific hypothesis. For example, a missing Authorization header suggests a different next step than a documented caller-ID restriction.

  1. Save the relevant settings securely and define a rollback.
  2. Select one change that directly addresses the evidence.
  3. Run one controlled test through the same path.
  4. Compare the challenge, retry, and final response.
  5. Restore the prior setting if the change does not help.

Keep test volume low. Repeated authentication attempts can trigger account lockouts or automated blocking. Avoid emergency numbers and destinations that could incur unexpected charges.

Once signaling succeeds, verify the intended outcome. REGISTER acceptance confirms registration, not completed calling. For an answered call with persistent silence, switch to media-path diagnostics rather than continuing to change authentication settings.

Send Evidence That Supports a Clear Answer

A useful escalation includes the timestamp, affected method, response source, and relevant Call-ID values. Add the challenge-to-retry sequence and any explicit server-side rejection reason.

Share traces through an approved secure channel. Digest headers do not expose the password directly, but they remain sensitive. Redact personal numbers and identifiers consistently while preserving the relationships needed for diagnosis. Never post full authentication exchanges publicly.

The practical lesson in SIP 403 vs 401 is simple: distinguish a challenge from a refusal, then verify the decision. Neither response justifies guessing at passwords or weakening access controls.

Professional remote assistance may help when call legs obscure the source or provider logs require coordination. Tech Rescue Ops LLC offers VoIP and PBX support for controlled tracing, configuration review, and evidence-based escalation.

Need help applying this to your business?

Tell us about your systems and what you are trying to solve.

Start AI Support
Start AI Support