SIP 302 Moved Temporarily vs 401 Unauthorized
SIP 302 (Moved Temporarily) is a 3xx Redirection response, while 401 (Unauthorized) is a 4xx Client Failure response. 302 indicates that the callee has temporarily moved to a different address. The client should retry the request at the Contact address but continue using the original URI for future 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 callee has temporarily moved to a different address. The client should retry the request at the Contact address but continue using the original URI for future requests.
何时出现
When a user is temporarily reachable at a different location, such as when traveling or using a different device.
如何修复
Redirect the current call to the Contact URI provided, but keep the original URI for future requests.
描述
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).
主要区别
302 is a 3xx Redirection response, while 401 is a 4xx Client Failure response.
SIP 302: The callee has temporarily moved to a different address. The client should retry the request at the Contact address but continue using the original URI for future requests.
SIP 401: The request requires user authentication. The response includes a WWW-Authenticate header with a challenge for the realm.
You encounter 302 when when a user is temporarily reachable at a different location, such as when traveling or using a different device.
You encounter 401 when when making a request that requires Digest authentication. Common for REGISTER and INVITE requests to authenticated SIP trunks.
何时使用哪个
For 302 (Moved Temporarily): Redirect the current call to the Contact URI provided, but keep the original URI for future requests. For 401 (Unauthorized): Resend the request with proper Authorization header containing valid credentials (Digest authentication).