Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
understanding-SIP.pdf
Скачиваний:
118
Добавлен:
01.03.2016
Размер:
4 Мб
Скачать
☆

116

SIP: Understanding the Session Initiation Protocol

5.3.2301 Moved Permanently

This redirection response contains a Contact header field with the new permanent URI of the called party. The address can be saved and used in future INVITE requests.

5.3.3302 Moved Temporarily

This redirection response contains a URI that is currently valid but is not permanent. As a result, the Contact header field should not be cached across calls unless an Expires header field is present, in which case the location is valid for the duration of the time specified.

5.3.4305 Use Proxy

This redirection response contains a URI that points to a proxy server who has authoritative information about the calling party. The caller should resend the request to the proxy for forwarding. This response could be sent by a UAS that is using a proxy for incoming call screening. Because the proxy makes the decisions for the UAS on acceptance of the call, the UAS will only respond to INVITE requests that come from the screening proxy. Any INVITE request received directly would automatically receive this response without user intervention.

5.3.5380 Alternative Service

This response returns a URI that indicates the type of service the called party would like. An example might be a redirect to a voicemail server.

5.4 Client Error

This class of response is used by a server or UAS to indicate that the request cannot be fulfilled as it was submitted. The specific client error response or the presence of certain header fields should indicate to the UAC the nature of the error and how the request can be reformulated. The UAC should not resubmit the request without modifying it based on the response. The same request, however, can be tried in other locations. A forking proxy receipt of a 4xx response does not terminate the search. Typically, client error responses will require user intervention before a new request can be generated.

5.4.1400 Bad Request

This response indicates that the request was not understood by the server. An example might be a request that is missing required header fields such as To, From,

SIP Response Messages

117

Call-ID, or CSeq. This response is also used if a UAS receives multiple INVITE requests (not retransmissions) for the same Call-ID.

5.4.2401 Unauthorized

This response indicates that the request requires the user to perform authentication. This response is generally sent by a user agent, since the 407 Proxy Authentication Required (Section 5.4.8) is sent by a proxy that requires authentication. The exception is a registrar server, which sends a 401 Unauthorized response to a REGISTER message that does not contain the proper credentials. An example of this response is:

SIP/2.0 401 Unauthorized

Via: SIP/2.0/UDP proxy.globe.org:5060;branch=z9hG4bK2311ff5d.1 ;received=192.0.2.1;rport=3213

Via: SIP/2.0/UDP 173.23.43.1:5060;branch=z9hG4bK4545 From: <sip:explorer@geographic.org>;tag=341323 To: <sip:printer@maps-r-us.com>;tag=19424103

From: Copernicus <sip:copernicus@globe.org>;tag=34kdilsp3 Call-ID: 1g23hj45m678a7

CSeq: 1 INVITE

WWW-Authenticate: Digest realm=”globe.org”, nonce=”8eff88df84f1cec4341ae6e5a359”, qop=”auth”, opaque=””, stale=FALSE, algorithm=MD5 Content-Length: 0

The presence of the required WWW-Authenticate header field is required to give the calling user agent a chance to respond with the correct credentials. A typical authentication exchange using SIP digest is shown in Figure 14.6. Note that the follow-up INVITE request should use the same Call-ID as the original request; the authentication may fail in some cases if the Call-ID is changed from the initial request to the retried request.

5.4.3402 Payment Required

This response is a placeholder for future definitions in the SIP protocol. It could be used to negotiate call completion charges.

5.4.4403 Forbidden

This response is used to deny a request without giving the caller any recourse. It is sent when the server has understood the request, found the request to be correctly formulated, but will not service the request. This response is not used when authorization is required.

118

SIP: Understanding the Session Initiation Protocol

5.4.5404 Not Found

This response indicates that the user identified by the sip or sips URI in the Request-URI cannot be located by the server, or that the user is not currently signed on with the user agent.

5.4.6405 Method Not Allowed

This response indicates that the server or user agent has received and understood a request but is not willing to fulfill the request. An example might be a REGISTER request sent to a user agent. An Allow header field (Section 6.1.2) must be present to inform the UAC as to what methods are acceptable. This is different from the case of an unknown method, in which a 501 Not Implemented response is returned. Note that a proxy will forward request types it does not understand unless the request is targeted to the proxy server (i.e., the Request-URI is the URI of the proxy server).

5.4.7406 Not Acceptable

This response indicates that the request cannot be processed due to a requirement in the request message. The Accept header field in the request did not contain any options supported by the UAS.

5.4.8407 Proxy Authentication Required

This request sent by a proxy indicates that the UAC must first authenticate itself with the proxy before the request can be processed. The response should contain information about the type of credentials required by the proxy in a ProxyAuthenticate header field. The request can be resubmitted with the proper credentials in a Proxy-Authorization header field. Unlike in HTTP, this response may not be used by a proxy to authenticate another proxy.

SIP/2.0 407 Proxy Authorization Required

Via: SIP/2.0/UDP discrete.sampling.org:5060;branch=z9hG4bK6563 ;received=65.64.140.198;rport=17234

From: Shannon <sip:shannon@sampling.org>;tag=59204 To: Schockley <sip:shockley@transistor.com>;tag=142334 Call-ID: adf8gasdd7fld

CSeq: 1 INVITE

Proxy-Authenticate: Digest realm=”sampling.org”, qop=”auth”, nonce=”9c8e88df84df1cec4341ae6cbe5a359”,

opaque=””, stale=FALSE, algorithm=MD5 Content-Length: 0

SIP Response Messages

119

5.4.9408 Request Timeout

This response is sent when an Expires header field is present in an INVITE request and the specified time period has passed. This response could be sent by a forking proxy or a user agent. The request can be retried at any time by the UAC, perhaps with a longer time period in the Expires header field or no Expires header field at all. Alternatively, a stateful proxy can send this response after the request transaction times out without receiving a final response.

5.4.10 409 Conflict

This response code has been removed from RFC 3261 but is defined in RFC 2543. It indicates that the request cannot be processed due to a conflict in the request. This response is used by registrars to reject a registration with a conflicting action parameter.

5.4.11 410 Gone

This response is similar to the 404 Not Found response but contains the hint that the requested user will not be available at this location in the future. This response could be used by a service provider when a user cancels their service.

5.4.12 411 Length Required

This response code has been removed from RFC 3261 but is defined in RFC 2543. This response can be used by a proxy to reject a request containing a message body but no Content-Length header field. A proxy that takes a UDP request and forwards it as a TCP request could generate this response, since the use of Content-Length is more critical in TCP requests. However, the response code is not very useful since a proxy can easily calculate the length of a message body in a UDP request (it is until the end of the UDP packet) but cannot with a streamoriented transport such as TCP. In this case, a missing Content-Length header field would cause the message body to go on indefinitely, which would generate

a 513 Message Too Large response instead of a 411 Length Required.

5.4.13 412 Conditional Request Failed

This response code was added to deal with conditional SIP publications. A 2xx response to a PUBLISH request will contain an entity tag in a SIP-ETag header field. A subsequent publish to update this information will contain this entity tag in a SIP-If-Match header field. Should the entity tag stored by the event state compositor not match the entity tag in the SIP-If-Match header field, the

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]