SIP

SIP 202 Accepted vs 401 Unauthorized

SIP 202 (Accepted) is a 2xx Success response, while 401 (Unauthorized) is a 4xx Client Failure response. 202 indicates that the request has been accepted for processing but the processing has not been completed. Used primarily for REFER requests. In contrast, 401 means that the request requires user authentication. The response includes a WWW-Authenticate header with a challenge for the realm.

描述

The request has been accepted for processing but the processing has not been completed. Used primarily for REFER requests.

何时出现

After sending a REFER request for call transfer. The transfer target acknowledges receipt but hasn't completed the transfer yet.

如何修复

Wait for a NOTIFY to learn the outcome of the referred action. If no NOTIFY arrives, check subscription state and network connectivity.

描述

The request requires user authentication. The response includes a WWW-Authenticate header with a challenge for the realm.

何时出现

When making a request that requires Digest authentication. Common for REGISTER and INVITE requests to authenticated SIP trunks.

如何修复

Resend the request with proper Authorization header containing valid credentials (Digest authentication).

主要区别

1.

202 is a 2xx Success response, while 401 is a 4xx Client Failure response.

2.

SIP 202: The request has been accepted for processing but the processing has not been completed. Used primarily for REFER requests.

3.

SIP 401: The request requires user authentication. The response includes a WWW-Authenticate header with a challenge for the realm.

4.

You encounter 202 when after sending a REFER request for call transfer. The transfer target acknowledges receipt but hasn't completed the transfer yet.

5.

You encounter 401 when when making a request that requires Digest authentication. Common for REGISTER and INVITE requests to authenticated SIP trunks.

何时使用哪个

For 202 (Accepted): Wait for a NOTIFY to learn the outcome of the referred action. If no NOTIFY arrives, check subscription state and network connectivity. For 401 (Unauthorized): Resend the request with proper Authorization header containing valid credentials (Digest authentication).

了解更多