view Side-By-Side changes
Internet Engineering Task Force SIP WG Internet Draft Handley/Schulzrinne/Schooler/Rosenbergdraft-ietf-sip-rfc2543bis-02.txtdraft-ietf-sip-rfc2543bis-03.txt ACIRI/Columbia U./Caltech/dynamicsoftNovember 24, 2000May 29, 2001 Expires:AprilNovember 2001 SIP: Session Initiation Protocol STATUS OF THIS MEMO This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet- Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress". The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt To view the list Internet-Draft Shadow Directories, see http://www.ietf.org/shadow.html. Abstract The Session Initiation Protocol (SIP) is an application-layer control (signaling) protocol for creating, modifying and terminating sessions with one or more participants. These sessions include Internet multimedia conferences, Internet telephone calls and multimedia distribution. Members in a session can communicate via multicast or via a mesh of unicast relations, or a combination of these. SIP invitations used to create sessions carry session descriptions which allow participants to agree on a set of compatible media types. SIP supports user mobility by proxying and redirecting requests to the user's current location. Users can register their current location. SIP is not tied to any particular conference control protocol. SIP is designed to be independent of the lower-layer transport protocol and can be extended with additional capabilities. Handley/Schulzrinne/Schooler/Rosenberg [Page 1] Internet Draft SIPNovember 24, 2000May 29, 2001 1 Introduction 1.1 Overview of SIP Functionality The Session Initiation Protocol (SIP) is an application-layer control protocol that can establish, modify and terminate multimedia sessions (conferences) or Internet telephony calls. SIP can invite participants to unicast and multicast sessions; the initiator does not necessarily have to be a member of the session to which it is inviting. Media and participants can be added to an existing session. SIP transparently supports name mapping and redirection services, allowing the implementation of ISDN and Intelligent Network telephony subscriber services. These facilities also enable personal mobility. In the parlance of telecommunications intelligent network services, this is defined as: "Personal mobility is the ability of end users to originate and receive calls and access subscribed telecommunication services on any terminal in any location, and the ability of the network to identify end users as they move. Personal mobility is based on the use of a unique personal identity (i.e., personal number)." [1]. Personal mobility complements terminal mobility, i.e., the ability to maintain communications when moving a single end system from one subnet to another. SIP supports five facets of establishing and terminating multimedia communications: User location: determination of the end system to be used for communication; User capabilities: determination of the media and media parameters to be used; User availability: determination of the willingness of the called party to engage in communications; Call setup: "ringing", establishment of call parameters at both called and calling party; Call handling: including transfer and termination of calls. SIP is designed as part of the overall IETF multimedia data and control architecture currently incorporating protocols such as RSVP (RFC 2205 [2]) for reserving network resources, the real-time transport protocol (RTP) (RFC 1889 [3]) for transporting real-time data and providing QOS feedback, the real-time streaming protocol (RTSP) (RFC 2326 [4]) for controlling delivery of streaming media, the session announcement protocol (SAP) [5] for advertising Handley/Schulzrinne/Schooler/Rosenberg [Page 2] Internet Draft SIPNovember 24, 2000May 29, 2001 multimedia sessions via multicast and the session description protocol (SDP) (RFC 2327 [6]) for describing multimedia sessions. However, the functionality and operation of SIP does not depend on any of these protocols. SIP does not offer conference control services such as floor control or voting and does not prescribe how a conference is to be managed, but SIP can be used to introduce conference control protocols. SIP does not allocate multicast addresses and does not reserve network resources. 1.2 Terminology In this document, the key words "MUST","MUSTNOT","MUST NOT", "REQUIRED", "SHALL", "SHALLNOT", "SHOULD","SHOULDNOT","SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" are to be interpreted as described in RFC 2119 [7] and indicate requirement levels for compliant SIP implementations. 1.3 Overview of SIP Operation This section explains the basic protocol functionality and operation. Terms are defined more precisely in Section 1.4. In SIP, protocol participants are identified by SIP URLs, described in Section 1.4.1. SIP is a request-response protocol, with requests sent by clients and received by servers. A single implementation typically combines both client and server functionality. SIP requests can be sent using any reliable or unreliable protocol, including UDP, SCTP and TCP. Protocol operation is largely independent of the lower-layer transport protocol. This specification defines six SIP request methods: INVITE (Section4.2.1)5.1) initiates sessions, ACK (Section4.2.2)5.1.1) confirms session establishment, OPTIONS (Section4.2.3)8) requests information about capabilities, BYE (Section4.2.4)6) terminates a sessions, CANCEL (Section4.2.5)5.2) cancels a pending session and REGISTER (Section4.2.6)7) allows a client to bind a permanent SIP URL to a temporary SIP URL reflecting the current network location. SIP requests and responses consists of a request (or status) line, a number of header lines and a message body (Section 3). SIP requests can be sent directly from a user agent client to a user agent server, or they can traverse one or more proxy servers along the way. Often, proxy servers are associated with DNS domains, similar to SMTP MTAs. User agents send requests either directly to the address indicated in the SIP URI or to a designated proxy ("outbound proxy"), independent Handley/Schulzrinne/Schooler/Rosenberg [Page 3] Internet Draft SIPNovember 24, 2000May 29, 2001 of the destination address. The current destination address is carried in the Request-URI. Each proxy can forward the request based on local policy and information contained in the SIP request. The proxy MAY rewrite the request URI. A proxy MAY also forward the request to another designated proxy regardless of the request URI. For example, a departmental proxy could forward all authorized requests to a corporate-wide proxy which then forwards it to the proxy operated by the Internet service provider, which finally routes the request based on the request URI. Proxies MAY modify any part of the SIP message that are not integrity-protected, except those needed to identify call legs. Proxies generally do not modify the session description, but MAY do so. For example, if the user agent wants to contact the user sip:alice@example.com, it sends the request to the server handling the example.com domain (Section 1.4.2). If that host acts as a proxy server, it looks up whether it has a mapping from alice@example.com to another address. If so, it substitutes that address, say alice@sales.example.com, into the Request-URI and then sends the request to the server for the sales.example.com domain. Any server can also return a response indicating a different destination to be tried by the upstream client or indicating that the request cannot be forwarded. Typically, only the first request within a call traverses all proxies, while subsequent requests are exchanged directly between user agents. However, a proxy can indicate that it wants to remain in the request path via a Record-Route (Section6.35)10.34) header field. 1.4 Definitions This specification uses a number of terms to refer to the roles played by participants in SIP communications. The definitions of client, server and proxy are similar to those used by the Hypertext Transport Protocol (HTTP) (RFC 2616 [8]). The terms and generic syntax of URI and URL are defined in RFC 2396 [9]. The following terms have special significance for SIP. Back-To-Back User Agent: Also known as a B2BUA, this is a logical entity that receives an invitation, and acts as a UAS to process it. In order to determine how the request should be answered, it acts as a UAC and initiates a call outwards. A B2BUA appears like a proxy, but differs in that it maintains complete call state and must remain in a call. Since it is nothing more than a concatenation of other logical functions, no explicit definitions are needed for Handley/Schulzrinne/Schooler/Rosenberg [Page 4] Internet Draft SIP May 29, 2001 its behavior. Call: A call consists of all participants in aconferencesession invited by a common source. A SIP call is identified by a globally unique call-id (Section6.13). Thus,10.12), and is created when a user agent sends an INVITE request. This INVITE request may generate multiple acceptances, each of which are part of the same call (but different call legs). Furthermore, if a useris, for example,is invited to the same multicast session by several people, each of these invitations will be a unique call.A point-to-point Internet telephony conversation maps into a single SIP call.In a multiparty conference unit (MCU) based call-in conference, each participant uses a separate call to invite himself to the MCU. Call leg: A call leg is a pairwise signaling relationship between two SUP usage agents. A call leg is established when a call invitation results in a successful response. It is identified by the combination of the Call-ID headerfieldfield, the local address of the participant, and theaddr-specremote address of the other participant. For the caller, the local address is the From field of the INVITE, andtagthe remote address is the To field of the 200 class response. For the callee, the local address is the To field of the 200 class response to the INVITE, and the remote address is the Fromheader fields.field of the INVITE. SIP URIs are compared according toHandley/Schulzrinne/Schooler/Rosenberg [Page 4] Internet Draft SIP November 24, 2000Section 2.1, non-SIP URIs according to Section 2.2. Within the same Call-ID, requests with From A and To value B belong to the same call leg as the requests in the opposite direction, i.e., From B and To A. Call Stateful: A proxy is said to be call stateful when it retains state that persists for the duration of a call initiated through it. To properly manage that state, the proxy will normally need to receive the BYE requests that terminate the call. Client: An application program that sends SIP requests. Clients may or may not interact directly with a human user. User agents and proxies contain clients (and servers). Conference: A multimedia session (see below), identified by a common session description. A conference can have zero or more members and includes the cases of a multicast conference, a full-mesh conference and a two-party "telephone call", as well as combinations of these. Any number of calls can be used to create a conference. Downstream: Requests sent in the direction from the caller to Handley/Schulzrinne/Schooler/Rosenberg [Page 5] Internet Draft SIP May 29, 2001 the callee (i.e., user agent client to user agent server). Final response: A response that terminates a SIP transaction, as opposed to a provisional response that does not. All 2xx, 3xx, 4xx, 5xx and 6xx responses are final. Initiator, calling party, caller: The party initiating a session invitation. Note that the calling party does not have to be the same as the one creating the conference. A caller retains this role for the duration of a call. Invitation: A request sent to a user (or service) requesting participation in a session. A successful SIP invitation consists of two transactions: an INVITE request followed by an ACK request. Invitee, invited user, called party, callee: The person or service that the calling party is trying to invite to a conference. A callee retains this role for the duration of a call. Isomorphic request or response: Two requests or responses are defined to be isomorphic for the purposes of this document if they have the same values for the Call-ID, To, From and CSeq header fields. In addition, isomorphic requests have to have the same Request-URI and the samebranch parameter in theirtop-most Via header. Location server: See location service. Location service: A location service is used by a SIP redirect or proxy server to obtain information about a callee's possible location(s). Examples of sources of locationHandley/Schulzrinne/Schooler/Rosenberg [Page 5] Internet Draft SIP November 24, 2000information include SIP registrars, databases or mobility registration protocols. Location services are offered by location servers. Location servers MAY be part of a SIP server, but the manner in which a SIP server requests location services is beyond the scope of this document. Outbound proxy: A proxy that is located near the originator of requests. It receives all outgoing requests from a particular UAC, including those requests whose Request-URLs identify a host other than the outbound proxy. The outbound proxy sends these requests, after any local processing, to the address indicated in therequest-URI.Request-URI. (All other proxy servers are simply referred as proxies, not inbound proxies.) Handley/Schulzrinne/Schooler/Rosenberg [Page 6] Internet Draft SIP May 29, 2001 Parallel search: In a parallel search, a proxy issues several requests to possible user locations upon receiving an incoming request. Rather than issuing one request and then waiting for the final response before issuing the next request as in a sequential search , a parallel search issues requests without waiting for the result of previous requests. Provisional response: A response used by the server to indicate progress, but that does not terminate a SIP transaction. 1xx responses are provisional, other responses are considered final. Proxy, proxy server: An intermediary program that acts as both a server and a client for the purpose of making requests on behalf of other clients. Requests are serviced internally or by passing them on, possibly after translation, to other servers. A proxy interprets, and, if necessary, rewrites a request message before forwarding it. Proxy servers are, for example, used to route requests, enforce policies, control firewalls. Redirect server: A redirect server is a server that accepts a SIP request, maps the address into zero or more new addresses and returns these addresses to the client. Unlike a proxy server , it does not initiate its own SIP request. Unlike a user agent server , it does not accept calls. Registrar: A registrar is a server that accepts REGISTER requests. A registrar is typically co-located with a proxy or redirect server and MAY make its information availableHandley/Schulzrinne/Schooler/Rosenberg [Page 6] Internet Draft SIP November 24, 2000through the location server. Regular Transaction: A regular transaction is any transaction with a method other than INVITE, ACK, or CANCEL. Ringback: Ringback is the signaling tone produced by the calling client's application indicating that a called party is being alerted (ringing). Server: A server is an application program that accepts requests in order to service requests and sends back responses to those requests. Servers are either proxy, redirect or user agent servers or registrars. Session: From the SDP specification: "A multimedia session is a Handley/Schulzrinne/Schooler/Rosenberg [Page 7] Internet Draft SIP May 29, 2001 set of multimedia senders and receivers and the data streams flowing from senders to receivers. A multimedia conference is an example of a multimedia session." (RFC 2327 [6]) (A session as defined for SDP can comprise one or more RTP sessions.) As defined, a callee can be invited several times, by different calls, to the same session. If SDP is used, a session is defined by the concatenation of the user name , session id , network type , address type and address elements in the origin field. (SIP) transaction: A SIP transaction occurs between a client and a server and comprises all messages from the first request sent from the client to the server up to a final (non-1xx) response sent from the server to the client. A transaction is identified by the CSeq sequence number (Section6.21)10.20) within a single call leg. The ACK request has the same CSeq number as the corresponding INVITE request, but comprises a transaction of its own. Spiral: A spiral is a SIP request which is routed to a proxy, forwarded onwards, and arrives once again at that proxy, but this time, with a Request-URI that differs from the previous arrival. A spiral is not an error condition, unlike a loop. Stateless Proxy: A logical entity that does not maintain state for a SIP transaction. A stateless proxy forwards every request it receives downstream and every response it receives upstream. Stateful Proxy: A logical entity that maintains state informationat leastfor the duration of a SIP transaction. Also known as a transaction stateful proxy. The behavior of a stateful proxy is further defined in Section12.3.17.3. A stateful proxy is not the same as a call stateful proxy. Upstream: Responses sent in the direction from the user agent server to the user agent client. URL-encoded: A character string encoded according to RFC 1738, Section 2.2 [10]. User agent client (UAC): A user agent client is aclient Handley/Schulzrinne/Schooler/Rosenberg [Page 7] Internet Draft SIP November 24, 2000 applicationlogical entity that initiates a SIPrequest. User agent server (UAS): A user agent server istransaction with aserver application that contactsrequest. This role lasts only for theuser when a SIP request is received andduration of thatreturnstransaction. In other words, if aresponse on behalfpiece of software initiates a request, it acts as a UAC for theuser. The response accepts, rejects or redirects theduration of that request. If it receives a request later on, it takes on the role of a User Agent Handley/Schulzrinne/Schooler/Rosenberg [Page 8] Internet Draft SIP May 29, 2001 Server for the processing of that transaction. User agent server (UAS): A user agent server is a logical entity that responds to a SIP request, generally acting on behalf of some user. The response accepts, rejects or redirects the request. This role lasts only for the duration of that transaction. In other words, if a piece of software responds to a request, it acts as a UAS for the duration of that request. If it generates a request later on, it takes on the role of a User Agent Client for the processing of that transaction. User agent (UA):An applicationA logical entity whichcan act bothacts as both a user agent client and user agentserver.server for the duration of a call. An application program MAY be capable of acting both as a client and a server. For example, a typical multimedia conference control application would act as a user agent client to initiate calls or to invite others to conferences and as a user agent server to accept invitations. The role of UAC and UAS as well as proxy and redirect servers are defined on a request-by-request basis. For example, the user agent initiating a call acts as a UAC when sending the initial INVITE request and as a UAS when receiving a BYE request from the callee. Similarly, the same software can act as a proxy server for one request and as a redirect server for the next request. Proxy, redirect, location and registrar servers defined above are logical entities; implementations MAY combine them into a single application program. The properties of the different SIP server types are summarized in Table 1. property redirect proxy user agent registrar server server server __________________________________________________________________ also acts as a SIP client no yes no noreturns 1xx status yes yes yes yes returns 2xx status no yes yes yes returns 3xx status yes yes yes yes returns 4xx status yes yes yes yes returns 5xx status yes yes yes yes returns 6xx status no yes yes yesinserts Via header no yes no no accepts ACK yes yes yes no Table 1: Properties of the different SIP server types 1.4.1 SIP Addressing The "objects" addressed by SIP are users at hosts, identified by a SIP URL. The SIP URL takes a form similar to a mailto or telnet URL, i.e., user@host. The user part is a user name or a telephone number. Handley/Schulzrinne/Schooler/Rosenberg [Page8]9] Internet Draft SIPNovember 24, 2000May 29, 2001 The host part is either a domain name or a numeric network address. See section 2 for a detailed discussion of SIP URL's. A user's SIP address can be obtained out-of-band, can be learned via existing media agents, can be included in some mailers' message headers, or can be recorded during previous invitation interactions. In many cases, a user's SIP URL can be guessed from their email address. A SIP URL address can designate an individual (possibly located at one of several end systems), the first available person from a group of individuals or a whole group. The form of the address, for example, sip:sales@example.com , is not sufficient, in general, to determine the intent of the caller. If a user or service chooses to be reachable at an address that is guessable from the person's name and organizational affiliation, the traditional method of ensuring privacy by having an unlisted "phone" number is compromised. However, unlike traditional telephony, SIP offers authentication and access control mechanisms and can avail itself of lower-layer security mechanisms, so that client software can reject unauthorized or undesired call attempts. 1.4.2 Locating a SIP Server The Request-URI is determined according to the rules in Section 16 and can be derived from either the Route, Contact or To header fields. When a client wishes to send a request, the client either sends it to a locally configured SIP proxy server, the so-called outbound proxy , independent of the Request-URI, or sends it to the IP address and port corresponding to the Request-URI. The outbound proxy can be configured by any mechanism, including DHCP[11].[11] and can be specified either as a set of parameters such as network address or host name, protocol port and transport protocol, or as a SIP URI. If the Request-URI is used, the client needs to determine the protocol, port and IP address of a server to which to send the request. A client SHOULD follow the steps below to obtain this information.AtClients MUST re-run the above selection algorithm, re-drawing any random numbers involved, once per transaction rather than for eachstep, unless stated otherwise,request, i.e., requests within theclient SHOULD trysame transaction MUST be sent tocontact a server attheport number listed insame network address. Thus, theRequest-URI. If no port numbersame address ispresent inused for theRequest-URI,request, any retransmissions, any associated CANCEL requests and ACK requests for non-2xx responses. However, ACKs for 2xx responses use Handley/Schulzrinne/Schooler/Rosenberg [Page 10] Internet Draft SIP May 29, 2001 another iteration of theclient uses port 5060. Ifselection algorithm. (Indeed, in many cases, they may have different request URIs.) A stateless proxy can accomplish this, for example, by using theRequest-URI specifiesmodulo N of aprotocol,hash of theclient contactsCall-ID value or some other combination of transaction-identifying headers as theserver using that protocol. If no protocol is specified,uniform random number described in theclient tries UDP (if UDPweighting algorithm of RFC 2782. Here, N issupported). Iftheattempt fails, or ifsum of weights within theclient doesn't support UDP but supports other protocols, it tries those protocols in some unspecified order.priority class. A client SHOULD be able to interpret explicit network notifications (such as ICMP messages) which indicate that a server is not reachable, rather than relying solely on timeouts. (For socket-basedHandley/Schulzrinne/Schooler/Rosenberg [Page 9] Internet Draft SIP November 24, 2000programs: For TCP, connect() returns ECONNREFUSED if the client could not connect to a server at that address. For UDP, the socket needs to be bound to the destination address using connect() rather than sendto() or similar so that a second write() or send() fails with ECONNREFUSED if there is no server listening) If the client finds the server is not reachable at a particular address, it SHOULD behave as if it had received a 400-class error response to that request. The client tries to find one or more addresses for the SIP server by querying DNS. If a step elicits no addresses, the client continues to the next step. However if a step elicits one or more addresses, but no SIP server at any of those addresses responds, then the client concludes the server is down and does not continue on to the next step.The service identifier for DNS SRV records [12]If the client is"_sip". 1.configured with the address of an outbound proxy, the parameters of the outbound proxy, including transport protocol and port, become the destination used below. If there is no outbound proxy, themaddr parameter exists, it becomesdestination is the Request-URI. The destination addressused below;is the maddr parameter ifnot,it exists and the host elementin the Request-URIif not. The transport protocol is thedestination address. 2.transport parameter. The service identifier for DNS SRV records [12] is "_sip". 1. If the destination address isana numeric IP address, the client contacts the server at the given address and the port number specified in theRequest-URI or the default port and ignoresSIP-URI or, if not specified, theremaining steps. 3. The Request-URIdefault port (5060). If the destination specifies a protocol, the client contacts the server using that protocol. If no protocol isexamined.specified, the client first tries UDP. If attempt fails, or if the client does not support UDP but supports other Handley/Schulzrinne/Schooler/Rosenberg [Page 11] Internet Draft SIP May 29, 2001 protocols, itcontainstries those protocols in some implementation-defined order. The client then skips the remaining steps. 2. If the destination specifies no port number or port number 5060, the transportparameter is inspected: 1.protocol determines the use of one of the following three rules: - If theRequest-URIdestination does not specify a transport protocol, DNS SRV records are retrieved according to RFC 2782 [12]. The results of the query or queries are merged and ordered based on priority, keeping only records with transport protocols that the client supports. Then, the searching technique outlined in RFC 2782 [12] is used to select servers in order. Server selection across requests is independent of previous choices, except as notedbelowabove for stateless proxies. Message length or other request properties do not influence the server selection. The client attempts to contact each server in the order listed, at the port number specified in the SRV record. If none of the servers can be contacted, the client gives up. If there are no SRV records (with any transport protocol), DNS address records are used, as described below. - Ifthe Request-URI specifiesa transport protocol is specified andthe transportthis protocol is supported by the client, theHandley/Schulzrinne/Schooler/Rosenberg [Page 10] Internet Draft SIP November 24, 2000procedure in the paragraph above is used, limited to DNS resource records with the transport protocol specified in theRequest-URI.SIP-URI. - If theRequest-URI specifies atransport protocolthatspecified is not supported by the client, the client gives up. If there are no SRV records, theRequest-URI containsnext step applies. 3. If the destination specifies a port number other than 5060 or if there are no SRV records, the client queries the DNS server for address records for the destination address. Address records include A RR's, AAAA RR's, or other similar records, chosen according to the client's network protocol capabilities. If the DNS server returns no address records, the client gives up.Within a transaction, a stateless proxy MUST always select the same destination within the set of hosts withIf there are address records, the samepriority. This can be accomplished, for example, by using the modulo N of a hash of the Call-ID value or some other combination of transaction-identifying headers as the uniform random number described in the weighting algorithm of RFC 2782. Here, N is the sum of weights within the priority class. There are no mandatoryruleson how to select a host name for a SIP server. Users are encouraged to name their SIP servers using the sip.domainname (e.g., sip.example.com ) convention,asspecifiedinRFC 2219 [13]. Users may only know an email address instead of a full SIP URL for a callee, however. In that case, implementations may be able to increase the likelihood of reaching a SIP server for that domain by constructing a SIP URL from that email address by prefixing the domain name with "sip.". In the future, this mechanism is likely to become unnecessary as SRV records, described above, become widely available. A client MAYstep 2 apply. Clients MUST NOT cachethe list of DNSquery resultsif one of the addresses was contacted successfully. Request for the same transaction SHOULD be sent to the same network address. Other requests from the same client select a server from the list of addresses cached, using the SRV load-balancing mechanism if applicable. The client must invalidate this list and retry the DNS queryexcept according to the rules inRFC1035 [14]. A client MAY omit attempting to reach a server which it had failed to reach for a previous request.Handley/Schulzrinne/Schooler/Rosenberg [Page 12] Internet Draft SIP May 29, 2001 RFC 1035 [13]. The results of the DNS lookup operation do not, in general, lead to a modification of the Request-URI.Handley/Schulzrinne/Schooler/Rosenberg [Page 11] Internet Draft SIP November 24, 2000A proxy is free to modify the Request-URI to any value desired, but the DNS lookups are usually based on the Request-URI obtained from a location server. If the DNS time-to-live value exceeds a few minutes, servers generating a large number of requests are probably well advised to retry failed servers every few minutes. 1.4.3 SIP Transaction Once the host part has been resolved to a SIP server, the client sends one or more SIP requests to that server and receives one or more responses from the server. A request (and its retransmissions) together with the responses triggered by that request make up a SIP transaction. All responses to a request contain the same values in the Call-ID, CSeq, To, and From fields (with the possible addition of a tag in the To field (section6.44)).10.43)). This allows responses to be matched with requests. The ACK request confirming the receipt of an INVITE response is not part of the transaction since it may traverse a different set of hosts. If a reliable stream protocol is used, request and responses within a single SIP transaction are carried over the same connection (see Section10).14). Several SIP requests from the same client to the same server MAY use the same connection or MAY use a new connection for each request. If a client sends the request via a unicast datagram protocol such as UDP, the receiving user agent directs the response according to the information contained in the Via header fields (Section6.47).10.46). Each proxy server in the forward path of the request forwards the response using these Via header fields, as described in detail in Sections6.47.310.46.3 and6.47.4.10.46.4. For datagram protocols, reliability is achieved using retransmission (Section10).14). 1.4.4 Initiating a Session A session is initiated with the INVITE request. A successful SIP invitation consists of two requests, INVITE followed by ACK. The INVITE (Section4.2.1)5.1) request asks the callee to join a particular conference or establish a two-party conversation. After the callee has agreed to participate in the call, the caller confirms that it Handley/Schulzrinne/Schooler/Rosenberg [Page 13] Internet Draft SIP May 29, 2001 has received that response by sending an ACK (Section4.2.2)5.1.1) request. The INVITE request typically contains a session description, for example written in SDP (RFC 2327 [6]) format, that provides the called party with enough information to join the session. ForHandley/Schulzrinne/Schooler/Rosenberg [Page 12] Internet Draft SIP November 24, 2000multicast sessions, the session description enumerates the media types and formats that are allowed to be distributed to that session. For a unicast session, the session description enumerates the media types and formats that the caller is willing to use and where it wishes the media data to be sent. In either case, if the callee wishes to accept the call, it responds to the invitation by returning a similar description listing the media it wishes to use. For a multicast session, the callee SHOULD only return a session description if it is unable to receive the media indicated in the caller's description or wants to receive data via unicast. The protocol exchanges for the INVITE method are shown in Fig. 1 for a proxy server and in Fig. 2 for a redirect server. (Note that the messages shown in the figures have been abbreviated slightly.) In Fig. 1, the proxy server accepts the INVITE request (step 1), contacts the location service with all or parts of the address (step 2) and obtains a more precise location (step 3). The proxy server then issues a SIP INVITE request to the address(es) returned by the location service (step 4). The user agent server alerts the user (step 5) and returns a success indication to the proxy server (step 6). The proxy server then returns the success result to the original caller (step 7). The receipt of this message is confirmed by the caller using an ACK request, which is forwarded to the callee (steps 8 and 9). Note that an ACK can also be sent directly to the callee, bypassing the proxy. All requests and responses have the same Call- ID. The redirect server shown in Fig. 2 accepts the INVITE request (step 1), contacts the location service as before (steps 2 and 3) and, instead of contacting the newly found address itself, returns the address to the caller (step 4), which is then acknowledged via an ACK request (step 5). The caller issues a new request, with the same call-ID but a higher CSeq, to the address returned by the first server (step 6). In the example, the call succeeds (step 7). The caller and callee complete the handshake with an ACK (step 8). The next section discusses what happens if the location service returns more than one possible alternative. 1.4.5 Locating a UserA callee may move between a number of different end systems over time. These locations can be dynamically registered with the SIP server (Sections 1.4.7, 4.2.6). A location server MAY also use one or more other protocols, such as finger (RFC 1288 [15]), rwhois (RFC 2167 [16]), LDAP (RFC 1777 [17]), multicast-based protocols [18] orHandley/Schulzrinne/Schooler/Rosenberg [Page13]14] Internet Draft SIPNovember 24, 2000May 29, 2001 +....... cs.columbia.edu .......+ : : : (~~~~~~~~~~) : : ( location ) : : ( service ) : : (~~~~~~~~~~) : : ^ | : : | hgs@lab : : 2| 3| : : | | : : henning | : +.. cs.tu-berlin.de ..+ 1: INVITE : | | : : : henning@cs.col: | \/ 4: INVITE 5: ring : : cz@cs.tu-berlin.de ========================>(~~~~~~)=========>(~~~~~~) : : <........................( )<.........( ) : : : 7: 200 OK : ( )6: 200 OK ( ) : : : : ( work ) ( lab ) : : : 8: ACK : ( )9: ACK ( ) : : ========================>(~~~~~~)=========>(~~~~~~) : +.....................+ +...............................+ ====> SIP request ....> SIP response ^ | non-SIP protocols | Figure 1: Example of SIP proxy serveroperating-system dependent mechanisms to actively determine the end system whereA callee may move between auser mightnumber of different end systems over time. These locations can bereachable. A location server MAYdynamically registered with the SIP server (Sections 1.4.7, 7). A location server MAY also use one or more other protocols, such as finger (RFC 1288 [14]), rwhois (RFC 2167 [15]), LDAP (RFC 1777 [16]), multicast-based protocols [17] or operating-system dependent mechanisms to actively determine the end system where a user might be reachable. A location server MAY return several locations because the user is logged in at several hosts simultaneously or because the location server has (temporarily) inaccurate information. The SIP server combines the results to yield a list of a zero or more locations.The action taken on receiving a list of locations varies with the type of SIP server. A SIP redirect server returns the list to the client as Contact headers (Section 6.15). A SIP proxy server can sequentially or in parallel try the addresses until the call is successful (2xx response) or the callee has declined the call (6xxHandley/Schulzrinne/Schooler/Rosenberg [Page14]15] Internet Draft SIPNovember 24, 2000May 29, 2001 +....... cs.columbia.edu .......+ : : : (~~~~~~~~~~) : : ( location ) : : ( service ) : : (~~~~~~~~~~) : : ^ | : : | hgs@lab : : 2| 3| : : | | : : henning| : +.. cs.tu-berlin.de ..+ 1: INVITE : | | : : : henning@cs.col: | \/ : : cz@cs.tu-berlin.de =======================>(~~~~~~) : : | ^ | <.......................( ) : : | . | : 4: 302 Moved : ( ) : : | . | : hgs@lab : ( work ) : : | . | : : ( ) : : | . | : 5: ACK : ( ) : : | . | =======================>(~~~~~~) : : | . | : : : +.......|...|.........+ : : | . | : : | . | : : | . | : : | . | : : | . | 6: INVITE hgs@lab.cs.columbia.edu (~~~~~~) : | . ==================================================> ( ) : | ..................................................... ( ) : | 7: 200 OK : ( lab ) : | : ( ) : | 8: ACK : ( ) : ======================================================> (~~~~~~) : +...............................+ ====> SIP request ....> SIP response ^ | non-SIP protocols | Figure 2: Example of SIP redirect server Handley/Schulzrinne/Schooler/Rosenberg [Page15]16] Internet Draft SIPNovember 24, 2000May 29, 2001 The action taken on receiving a list of locations varies with the type of SIP server. A SIP redirect server returns the list to the client as Contact headers (Section 10.14). A SIP proxy server can sequentially or in parallel try the addresses until the call is successful (2xx response) or the callee has declined the call (6xx response). With sequential attempts, a proxy server can implement an "anycast" service. If a proxy server forwards a SIP request, it MUST add itself to the beginning of the list of forwarders noted in the Via (Section6.47)10.46) headers. The Via trace ensures that replies can take the same path back, ensuring correct operation through compliant firewalls and avoiding request loops. On the response path, each host MUST remove its Via, so that routing internal information is hidden from the callee and outside networks. A SIP invitation may traverse more than one SIP proxy server. If one of these "forks" the request, i.e., issues more than one request in response to receiving the invitation request, it is possible that a client is reached, independently, by more than one copy of the invitation request. Each of these copies bears the same Call-ID, but a different topmost Via header branch parameter (see Section6.47).10.46). The user agent MAY choose which final response to return for each such request, typically returning a 200 (OK) for only one of them. 1.4.6 Changing an Existing Session In some circumstances, it is desirable to change the parameters of an existing session. This is done by re-issuing the INVITE within the same call leg, but within a new or different body or header fields to convey the new information. This re INVITE MUST have a higher CSeq than any previous request from the client to the server. For example, two parties may have been conversing and then want to add a third party, switching to multicast for efficiency. One of the participants invites the third party with the new multicast address and simultaneously sends an INVITE to the second party, with the new multicast session description, but with the old call identifier. 1.4.7 Registration Services The REGISTER request allows a client to let a proxy or redirect server know at which address(es) it can be reached. A client MAY also use it to install call handling features at the server. 1.5 Protocol Properties 1.5.1 Minimal State Handley/Schulzrinne/Schooler/Rosenberg [Page 17] Internet Draft SIP May 29, 2001 A single conference session or call involves one or more SIP request-response transactions. Proxy servers do not have to keep state for a particular call, however, they MAY maintain state for a single SIP transaction, as discussed in Section12.17. For efficiency, aHandley/Schulzrinne/Schooler/Rosenberg [Page 16] Internet Draft SIP November 24, 2000server MAY cache the results of location service requests. 1.5.2 Lower-Layer-Protocol Neutral SIP makes minimal assumptions about the underlying transport and network-layer protocols. The lower-layer can provide either a packet or a byte stream service, with reliable or unreliable service. In an Internet context, SIP is able to utilize both UDP and TCP as transport protocols, among others. UDP allows the application to more carefully control the timing of messages and their retransmission, to perform parallel searches without requiring TCP connection state for each outstanding request, and to use multicast. Routers can more readily snoop SIP UDP packets. TCP allows easier passage through existing firewalls. When TCP is used, SIP can use one or more connections to attempt to contact a user or to modify parameters of an existing conference. Different SIP requests for the same SIP call MAY use different TCP connections or a single persistent connection, as appropriate. For concreteness, this document will only refer to Internet protocols. However, SIP MAY also be used directly with protocols such as ATM AAL5, IPX, frame relay or X.25. The necessary naming conventions are beyond the scope of this document. User agents SHOULD implement both UDP and TCP transport. Proxy, registrar, and redirect servers MUST implement both UDP and TCP transport. 1.5.3 Text-Based SIP is text-based, using ISO 10646 in UTF-8 encoding throughout. This allows easy implementation in languages such as Java, Tcl and Perl, allows easy debugging, and most importantly, makes SIP flexible and extensible. As SIP is used for initiating multimedia conferences rather than delivering media data, it is believed that the additional overhead of using a text-based protocol is not significant. 2 SIP Uniform Resource Locators SIP URLs are used within SIP messages to indicate the originator (From), current destination (Request-URI) and final recipient (To) of a SIP request, and to specify redirection addresses (Contact). A SIP URL can also be embedded in web pages or other hyperlinks to indicate that a particular user or service can be called via SIP. When used as Handley/Schulzrinne/Schooler/Rosenberg [Page 18] Internet Draft SIP May 29, 2001 a hyperlink, the SIP URL indicates the use of the INVITE method. The SIP URL scheme is defined to allow setting SIP request-header fields and the SIP message-body.Handley/Schulzrinne/Schooler/Rosenberg [Page 17] Internet Draft SIP November 24, 2000This corresponds to the use of mailto: URLs. It makes it possible, for example, to specify the subject, urgency or media types of calls initiated through a web page or as part of an email message. A SIP URL follows the guidelines of RFC 2396 [9] and has the syntax shown in Fig. 3. The syntax is described using Augmented Backus-Naur Form (see Section C).Note thatAlthough the ABNF described in Section C uses implicit whitespace, unescaped whitespace MUST NOT be present within a SIP URL. Any reserved characters have to be escaped and that the "set of characters reserved within any given URI component is defined by that component. In general, a character is reserved if the semantics of the URI changes if the character is replaced with its escaped US-ASCII encoding" [9]. Excluded US-ASCII characters [9], such as space and control characters and characters used as URL delimiters, also MUST be escaped. URLsMUSTNOTMUST NOT contain unescaped space and control characters. The URI character classes referenced above are described in Appendix C. The components of the SIP URI have the following meanings. user: The name of the user addressed. Note that this field MAY be empty where the destination host does not have a notion of users, e.g., for embedded devices. telephone-subscriber: If the host is an Internet telephony gateway, a telephone-subscriber field MAY be used instead of a user field. The telephone-subscriber field uses the notation of RFC 2806[19].[18]. Any characters of the un-escaped "telephone-subscriber" that are not either in the set "unreserved" or "user-unreserved" MUST be escaped. The set of characters not reserved in the RFC 2806 description of telephone-subscriber contains a number of characters in various syntax elements that need to be escaped when used in SIP URLs, for example quotation marks (%22), hash (%23), colon (%3a), at-sign (%40) and the "unwise" characters, i.e., punctuation of %5b and above. The telephone number is a special case of a user name andcannot be distinguished by a BNF. Thus, a URL parameter, user, is added to distinguish telephone numbers from user names. The user parameter value "phone" indicates that the user part contains a telephone number. Even without this parameter, recipients of SIP URLs MAY interpret the pre-@ part as a telephone number if local restrictions on theHandley/Schulzrinne/Schooler/Rosenberg [Page18]19] Internet Draft SIPNovember 24, 2000May 29, 2001 SIP-URL = "sip:" [ userinfo "@" ] hostport url-parameters [ headers ] userinfo =[user| telephone-subscriber ][ ":" password ] user = *( unreserved | escaped | "&" | "=" | "+" | "$" | ","| ";" | "?" | "/") password = *( unreserved | escaped | "&" | "=" | "+" | "$" | "," ) hostport = host [ ":" port ] host = hostname | IPv4address| IPv6referencehostname = *( domainlabel "." ) toplabel [ "." ] domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum toplabel = alpha | alpha *( alphanum | "-" ) alphanum IPv4address =1*3DIGIT1*digit "."1*3DIGIT1*digit "."1*3DIGIT1*digit "."1*3DIGIT IPv6reference = "[" IPv6address "]" IPv6address = hexpart [ ":" IPv4address ] hexpart = hexseq | hexseq "::" [ hexseq ] | "::" [ hexseq ] hexseq = hex4 *( ":" hex4) hex4 = 1*4HEX1*digit port =1*DIGIT*digit url-parameters = *( ";" url-parameter ) url-parameter = transport-param | user-param | method-param | ttl-param | maddr-param | other-param transport-param = "transport=" ( "udp" | "tcp"| "sctp" | "tls" | other-transport)other-transport = tokenttl-param = "ttl=" ttl ttl = 1*3DIGIT ; 0 to 255 maddr-param = "maddr=" host user-param = "user=" ( "phone" | "ip"| other-user)other-user = tokenmethod-param = "method=" Methodother-param = pname [ "=" pvalue ] pname = 1*paramchar pvaluetag-param =1*paramchar paramchar"tag=" UUID UUID =param-reserved | unreserved1*( hex |escaped param-reserved"-" ) other-param ="[" | "]" | "/" | "?" | ":" | "&"( token |"+"( token "=" ( token |"$"quoted-string ))) headers = "?" header *( "&" header ) header = hname "=" hvalue hname =1*( hnv-unreserved | unreserved | escaped )1*uric hvalue =*( hnv-unreserved*uric uric = reserved | unreserved | escaped) hnv-unreservedreserved ="[" | "]"";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | "," digits = 1*DIGIT Figure 3: SIP URL syntax cannot be distinguished by a BNF. Thus, a URL parameter, user, is added to distinguish telephone numbers from user names. The user parameter value "phone" indicates that the user part contains a telephone number. Even without this parameter, recipients of SIP URLs MAY interpret the pre-@ Handley/Schulzrinne/Schooler/Rosenberg [Page 20] Internet Draft SIP May 29, 2001 part as a telephone number if local restrictions on the name space for user name allow it. password: The SIP scheme MAY use the format "user:password" inHandley/Schulzrinne/Schooler/Rosenberg [Page 19] Internet Draft SIP November 24, 2000the userinfo field. The use of passwords in the userinfo is NOT RECOMMENDED, because the passing of authentication information in clear text (such as URIs) has proven to be a security risk in almost every case where it has been used. host: The host part SHOULD be a fully-qualified domain name or numeric IP address. The mailto: URL and RFC 822 email addresses require that numeric host addresses ("host numbers") are enclosed in square brackets (presumably, since host names might be numeric), while host numbers without brackets are used for all other URLs. The SIP URL requires the latter form, without brackets. port: The port number to send a request to. If not present, the procedures outlined in Section 1.4.2 are used to determine the port number to send a request to. URL parameters: SIP URLs can define specific parameters of the request. URL parameters are added after the host component and are separated by semi-colons. The transport parameter determines the the transport mechanism to be used for sending SIP requests and responses. SIP can use any network transport protocol; parameter names are defined for UDP[20],[19], TCP[21],[20], TLS[22],[21], and SCTP. UDP is to be assumed when no explicit transport parameter is included. The maddr parameter indicates the server address to be contacted for this user, overriding the address supplied in the host field. This address is typically, but not necessarily, a multicast address. The maddr field can be used to force requests from traveling users to visit a home proxy even if an outbound proxy is used. The ttl parameter determines the time-to-live value of the UDP multicast packet and MUST only be used if maddr is a multicast address and the transport protocol is UDP. The user parameter was described above. For example, to specify to call j.doe@big.com using multicast to 239.255.255.1 with a ttl of 15, the following URL would be used: Handley/Schulzrinne/Schooler/Rosenberg [Page 21] Internet Draft SIP May 29, 2001 sip:j.doe@big.com;maddr=239.255.255.1;ttl=15 The transport, maddr, and ttl parametersMUSTNOTMUST NOT be used inHandley/Schulzrinne/Schooler/Rosenberg [Page 20] Internet Draft SIP November 24, 2000the From and To header fields; they are ignored if present. For Request-URIs, these parameters are useful primarily for outbound proxies. Receivers MUST silently ignore any URI parameters that they do not understand. Headers: Headers of the SIP request can be defined with the "?" mechanism within a SIP URL. The special hname "body" indicates that the associated hvalue is the message-body of the SIP INVITE request. HeadersMUSTNOTMUST NOT be used in the From and To header fields and the Request-URI; they are ignored if present. hname and hvalue are encodings of a SIP header name and value, respectively. All URL reserved characters in the header names and values MUST be escaped. Method: The method of the SIP request can be specified with the method parameter. This parameterMUSTNOTMUST NOT be used in the From and To header fields and the Request-URI; they are ignored if present. Table 2 summarizes where the components of the SIP URL can be used. Entries marked "m" are mandatory, those marked "o" are optional, and those marked "-" are not allowed. For optional elements, the second column indicates the default value if the element is not present.default Req.-URI To FromExamples of SIP URLs are: sip:j.doe@big.com sip:j.doe:secret@big.com;transport=tcp sip:j.doe@big.com?subject=project sip:+1-212-555-1212:1234@gateway.com;user=phone sip:1212@gateway.com sip:alice@10.1.2.3 sip:alice@example.com sip:alice sip:alice@registrar.com;method=REGISTER Handley/Schulzrinne/Schooler/Rosenberg [Page 22] Internet Draft SIP May 29, 2001 default Req.-URI To From Contact Rec.-Route external user -- o o o o o o password -- o o - o o o host mandatory m m m m m m port 5060 o o o o o o user-param ip o o o o o o method INVITE - - - o - o maddr-param -- o - - o m o ttl-param 1 o - - o - o transp.-param udp o - - o - o other-paramo-- o o o o o o headers -- - - - o - o Table 2: Use and default values of URL components for SIP headers, Request-URI and referencesExamples of SIP URLs are: Handley/Schulzrinne/Schooler/Rosenberg [Page 21] Internet Draft SIP November 24, 2000 sip:j.doe@big.com sip:j.doe:secret@big.com;transport=tcp sip:j.doe@big.com?subject=project sip:+1-212-555-1212:1234@gateway.com;user=phone sip:1212@gateway.com sip:alice@10.1.2.3 sip:alice@example.com sip:alice sip:alice@registrar.com;method=REGISTER2.1 SIP URL Comparison SIP URLs are compared for equality according to the following rules: o Comparisons of scheme name ("sip"), domain names, parameter names and header names are case-insensitive, all other comparisons are case-sensitive. o The ordering of parameters and headers is not significant in comparing SIP URLs. o user or telephone-subscriber, password, host, port and any url-parameter parameters of the URI must match. If a component is omitted, it matches based on its default value. (For example, otherwise equivalent URLs without a port specification and with port 5060 match.) Components not found in both URLs beingcomparedcompared, for which there is no default value, are ignored. o Characters other than those in the "reserved" and "unsafe" sets (see RFC 2396 [9]) are equivalent to their ""%" HEX HEX" encoding. o An IP address that is the result of a DNS lookup of a host name does not match that host name. o URL parameters that have no default value are compared only if they are present in both URLs. Thus, the following URLs are equivalent:sip:juser@ sip:juser@ExAmPlE.CoM;Transport=udp while SIP:JUSER@ExAmPlE.CoM;Transport=udp sip:juser@ExAmPlE.CoM;Transport=UDPHandley/Schulzrinne/Schooler/Rosenberg [Page22]23] Internet Draft SIPNovember 24, 2000May 29, 2001 sip:juser@ sip:juser@ExAmPlE.CoM;Transport=udp while SIP:JUSER@ExAmPlE.CoM;Transport=udp sip:juser@ExAmPlE.CoM;Transport=UDP are not. Header fields such as Contact, From and To are equal if and only if their URIs match under the rules above and if their header parameters (such as contact-param, from-param and to-param) match in name and parameter value, where parameter names and token parameter values are compared ignoring case and quoted-string parameter values are case- sensitive. 2.2 Non-SIP URLs SIP header fields and the Request-URI MAY contain non-SIP URLs, with the exceptions noted below. As an example, if a call from a telephone is relayed to the Internet via SIP, the SIP From header field might contain a tel: URL[19].[18]. In the following locations, only SIP URLs are allowed: o Request-URI in a REGISTER request; o Contact header field in INVITE, OPTIONS andBYEand 2xxresponses.responses to INVITE and OPTIONS. Implementations MAY compare non-SIP URLs by treating them as generic URIs [9] or, alternatively, compare them byte-by-byte. 3 SIP Message Overview SIP is a text-based protocol and uses the ISO 10646 character set in UTF-8 encoding (RFC 2279[23]).[22]). Senders MUST terminate lines with a CRLF, but receivers MUST also interpret CR and LF by themselves as line terminators. Only the combinations CR CR, LF LF and CRLF CRLF terminate the message header. Implementations MUST only send CRLF CRLF. CR and LF instead of CRLF is for backwards-compatibility; their use is deprecated. Handley/Schulzrinne/Schooler/Rosenberg [Page 24] Internet Draft SIP May 29, 2001 Except for the above difference in character sets and line termination, much of the message syntax is and header fields are identical to HTTP/1.1; rather than repeating the syntax and semantics here we use [HX.Y] to refer to Section X.Y of the current HTTP/1.1 specification (RFC 2616 [8]). In addition, we describe SIP in both prose and an augmented Backus-Naur form (ABNF). See section C for an overview of ABNF. Note, however, that SIP is not an extension of HTTP.Handley/Schulzrinne/Schooler/Rosenberg [Page 23] Internet Draft SIP November 24, 2000Unlike HTTP, SIP MAY use UDP or other unreliable datagram protocols. Each such datagram carries one request or response. Datagrams, including all headers,SHOULDNOTSHOULD NOT be larger than the path maximum transmission unit (MTU) if the MTU is known, or 1500 bytes if the MTU is unknown. However, implementations MUST be able to handle messages up to the maximum datagram packet size. For UDP, this size is 65,535 bytes, including headers. The MTU of 1500 bytes accommodates encapsulation within the "typical" ethernet MTU without IP fragmentation. Recent studies[24][23] indicate that an MTU of 1500 bytes is a reasonable assumption. The next lower common MTU values are 1006 bytes for SLIP and 296 for low-delay PPP (RFC 1191[25]).[24]). Thus, another reasonable value would be a message size of 950 bytes, to accommodate packet headers within the SLIP MTU without fragmentation. A SIP message is either a request from a client to a server, or a response from a server to a client. SIP-message = Request | Response Both Request (section 4) and Response (section5)9) messages use the generic-message format of RFC 822[26][25] for transferring entities (the body of the message). Both types of messages consist of a start-line, one or more header fields (also known as "headers"), an empty line (i.e., a line with nothing preceding the carriage-return line-feed (CRLF)) indicating the end of the header fields, and an optional message-body. To avoid confusion with similar-named headers in HTTP, we refer to the headers describing the message body as entity headers. These components are described in detail in the upcoming sections. Handley/Schulzrinne/Schooler/Rosenberg [Page 25] Internet Draft SIP May 29, 2001 generic-message = start-line *message-header CRLF [ message-body ] start-line = Request-Line | ;Section 4.1 Status-Line ;Section5.1 Handley/Schulzrinne/Schooler/Rosenberg [Page 24] Internet Draft SIP November 24, 20009.1 message-header = ( general-header | request-header | response-header | entity-header ) In the interest of robustness, any leading empty line(s) MUST be ignored. In other words, if the Request or Response message begins with one or more CRLF, CR, or LFs, these characters MUST be ignored. 4 Request The Request message format is shown below: Request = Request-Line ; Section 4.1 *( general-header | request-header | entity-header ) CRLF [ message-body ] ; Section812 4.1 Request-Line The Request-Line begins with a method token, followed by the Request-URI and the protocol version, and ending with CRLF. The elements are separated by SP characters. No CR or LF are allowed except in the final CRLF sequence. No LWS is allowed in any of the elements. The Request-URIMUSTNOTMUST NOT be enclosed in "<>". absoluteURI is defined in [H3.2.1]. Request-Line = Method SP Request-URI SP SIP-Version CRLF Handley/Schulzrinne/Schooler/Rosenberg [Page 26] Internet Draft SIP May 29, 2001 Request-URI = SIP-URL | absoluteURI SIP-Version = "SIP/2.0" 4.2 Methods The methods aredefined below.described in detail below: REGISTER 7 for registering contact information, INVITE, ACK and CANCEL (Section 5.1) for setting up sessions, BYE (Section 6) for terminating sessions and OPTIONS (Section 8) for querying servers about their capabilities. SIP extensions may define additional methods ("extension-method"). Proxy and redirect servers treat all methods other than INVITE andCANCELCANCEL, whether the method is defined in this specification or elsewhere, in the sameway, by forwarding them accordingly.way. Thus, no method-specific support is required in these servers for methods other than INVITE and CANCEL. Methods that are not supported by a user agent server or registrar cause a 501Handley/Schulzrinne/Schooler/Rosenberg [Page 25] Internet Draft SIP November 24, 2000(Not Implemented) response to be returned (Section7).11). As in HTTP, the Method token is case-sensitive. Method = "INVITE" | "ACK" | "OPTIONS" | "BYE" | "CANCEL" | "REGISTER" | extension-method extension-method = token4.2.1 INVITE4.3 Request-URI TheINVITE method indicates that the user or serviceRequest-URI isbeing invited to participatea SIP URL as described in Section 2 or asession. The message body MAYgeneral URI (RFC 2396 [9]). In particular, it MUST NOT containa description ofunescaped spaces or control characters. It indicates thesessionuser or service to whichthe calleethis request is beinginvited. For two-party calls,addressed. Unlike thecaller indicatesTo field, thetype of media it is able to receive and possiblyRequest-URI MAY be re-written by proxies. As shown in Table 2, themedia it is willing to sendRequest-URI MAY contain the user-param parameter as well astheir parameters such as network destination.transport-related parameters. Asuccess response MUST indicate in its message body which media the callee wishes to receive and MAY indicate the media the callee is going to send. Not all session description formats have the ability to indicate sending media. The caller MAY choose to omit the request body (i.e., not send a session description) or send a session description that does not list any media types. This indicatesserver thatthe caller does not know its desired media characteristics until the call has been accepted. In this case, the UAS SHOULD still returnreceives asession description in its informational (1xx) or success (2xx) response, containing those media streams and codecs it supports. If the INVITE request did not containSIP-URL with illegal elements removes them before further processing. Transport-related parameters are needed when acomplete session description, the caller MUST include one in the ACK request. AUACMUSTNOT send an updated session description in an ACK request if it had already sentproxies all requests to acomplete session description indefault proxy, which would then need this information to generate theINVITEappropriate request.IfTypically, the UACwishes to modifysets thesession after the call setup has begun, it MUST use another INVITE request instead. Delaying the session description until the ACK request is useful for gateways from H.323v1 to SIP, where the H.323 media characteristics are not known until the call is established. A server MAY automatically respond to an invitation for a conference the user is already participating in, identified either byRequest-URI and To to the same SIP URL, presumed to remain unchanged over long time Handley/Schulzrinne/Schooler/Rosenberg [Page26]27] Internet Draft SIPNovember 24, 2000May 29, 2001 general-header = Accept ; Section6.610.6 | Accept-Encoding ; Section6.710.7 | Accept-Language ; Section6.810.8 | Call-ID ; Section6.1310.12 | Call-Info ; Section6.1410.13 | Contact ; Section6.1510.14 | CSeq ; Section6.2110.20 | Date ; Section6.2210.21 | Encryption ; Section6.2310.22 | From ; Section6.2610.25 | MIME-Version ; Section6.2910.28 | Organization ; Section6.3010.29 | Record-Route ; Section6.3510.34 | Require ; Section6.3610.35 | Supported ; Section6.4210.41 | Timestamp ; Section6.4310.42 | To ; Section6.4410.43 | User-Agent ; Section6.4610.45 | Via ; Section6.4710.46 entity-header = Allow ; Section6.1010.10 | Content-Disposition ; Section6.1610.15 | Content-Encoding ; Section6.1710.16 | Content-Language ; Section6.1810.17 | Content-Length ; Section6.1910.18 | Content-Type ; Section6.2010.19 | Expires ; Section6.2510.24 request-header = Alert-Info ; Section6.910.9 | Authorization ; Section6.1210.11 | In-Reply-To ; Section6.2710.26 | Max-Forwards ; Section6.2810.27 | Priority ; Section6.3110.30 | Proxy-Authorization ; Section6.3310.32 | Proxy-Require ; Section6.3410.33 | Route ; Section6.3910.38 | Response-Key ; Section6.3710.36 | Subject ; Section6.4110.40 response-header = Error-Info ; Section6.2410.23 | Proxy-Authenticate ; Section6.3210.31 | Retry-After ; Section6.3810.37 | Server ; Section6.4010.39 | Unsupported ; Section6.4510.44 | Warning ; Section6.4810.47 | WWW-Authenticate ; Section6.4910.48 Table 3: SIP headers Handley/Schulzrinne/Schooler/Rosenberg [Page27]28] Internet Draft SIPNovember 24, 2000 The behavior of UAS depend on whether they are Internet telephony gatewaysMay 29, 2001 response tothe PSTN. A UAS not acting as a gateway which receives an INVITE witha previous request, the To would still contain the long-term, "public" address, while the Request-URIthat does not correspondwould be set toone of its configured addresses, MUST respond with 404 (Not Found). A UAS acting as a gateway translatestheINVITEcached address. Proxy and redirect servers MAY use the information in the Request-URI and requestinto a telephony signaling message. Ifheader fields to handle theINVITE has a Call-ID value that matchesrequest and possibly rewrite the Request-URI. For example, arecent call,request addressed to theUAS comparesgeneric address sip:sales@acme.com is proxied to theRequest-URIparticular person, e.g., sip:bob@ny.acme.com , with the To field remaining as sip:sales@acme.com. At ny.acme.com , Bob then designates Alice as the temporary substitute. The host part of the Request-URI typically agrees with one of theprevious INVITE request forhost names of thesame Call-ID.receiving server. If it does not, theRequest-URI contains additional digits in the "user" part, the UAS treatsserver SHOULD proxy theINVITE as adding additional digitsrequest to theoriginal dialed string. Thisaddress indicated or return a 404 (Not Found) response if it isknown as overlap dialing. Ifunwilling or unable to do so. For example, thegateway knows thatRequest-URI and server host name can disagree in thetelephone number is incomplete, it returns a 484 (Address Incomplete) status response. Ifcase of auser agent receives an INVITE request for an existing call legfirewall proxy that handles outgoing calls. This mode of operation is similar to that of HTTP proxies. SIP servers MAY support Request-URIs witha higher CSeq sequence numberschemes other thanany previous INVITE"sip", for example thesame Call-ID, it MUST check any version identifiers in the session description or, if there are no version identifiers, the content of the session description to see if it has changed."tel" URI scheme [18]. ItMUST also inspectMAY translate non-SIP URIs using any mechanism at its disposal, resulting in either a SIP URI or some otherheader fields for changes.scheme. Ifthere isachange, the user agent MUST update any internal state or information generated asSIP server receives aresult of that header. Ifrequest with a URI indicating a scheme thesession description has changed,server does not understand, theuser agentserver MUSTadjust the session parameters accordingly, possibly after askingreturn a 400 (Bad Request) response. It MUST do this even if theuserTo header field contains a scheme it does understand, since proxies are responsible forconfirmation. (Versioning ofprocessing thesession description can be usedRequest-URI. (The To field is only of interest toaccommodatethecapabilities of new arrivals to a conference, add or delete media or change from a unicast to a multicast conference.) If an INVITEUAS.) 4.3.1 SIP Version Both requestfor an existing session fails, the session description agreed upon inand response messages include thelast successful INVITE transaction remainsversion of SIP inforce. A UAC MUSTNOT issue another INVITE request for the same call leg before the previous transaction has completed. A UAS that receives an INVITE before it sent the final response to an INVITE with a lower CSeq number MUST return a 400 (Bad Request) responseuse, and follow [H3.1] (with HTTP replaced by SIP, and HTTP/1.1 replaced by SIP/2.0) regarding version ordering, compliance requirements, and upgrading of version numbers. To be compliant with this specification, applications sending SIP messages MUST include aRetry-After header field with a randomly chosen valueSIP- Version ofbetween 0 and 10 seconds. If a UA A sends an INVITE request to B and receives an INVITE request from B before it has received"SIP/2.0". The string is case-insensitive, but implementations MUST use upper-case. Unlike HTTP/1.1, SIP treats theresponse to its request from B, A MAY return a 500 (Internal Server Error), which SHOULD includeversion number as aRetry-After header field specifying when the requestliteral string. In practice, this shouldbe resubmitted.make no difference. 4.4 Option Tags Option tags are unique identifiers used to designate new options in Handley/Schulzrinne/Schooler/Rosenberg [Page28]29] Internet Draft SIPNovember 24, 2000 In most cases, a UA can assume thatMay 29, 2001 SIP. These tags are used in Require (Section 10.35), Supported (Section 10.41) and Unsupported (Section 10.44) header fields. Syntax: option-tag = token See Section C for theorderdefinition ofmessages received corresponds to the order they were sent. In rare circumstances,token. The creator of a new SIP option MUST either prefix theresponse from B andoption with their reverse domain name or register therequest from B may be reordered onnew option with thewire. In addition, if A or B change multicast addresses, strict transaction orderingInternet Assigned Numbers Authority (IANA). An example of a reverse-domain-name option isnecessary so"com.foo.mynewfeature", whose inventor can be reached at "foo.com". For these features, individual organizations are responsible for ensuring thatboth sides agree onoption names do not collide within thefinal result. A UACsame domain. The host name part of the option MUSTbe prepared to receive media data according touse lower-case; thesession description as soon as it sends an INVITE (or re-INVITE)option name is case-sensitive. Options registered with IANA do not contain periods andcan start sending media data when it receives a provisional or final response containingare globally unique. IANA option tags are case-sensitive. 4.4.1 Registering New Option Tags with IANA When registering asession description. The initial INVITE from the UAC SHOULD containnew SIP option, theAllowfollowing information MUST be provided: o Name andSupporteddescription of option. The name MAY be of any length, but SHOULD be no more than twenty characters long. The name MUST consist of alphanum (See Figure 3) characters only; o A listing of any new SIP header fields,and MAY contain the Acceptheaderfield. A 200 (OK) response to the initial INVITE for a call SHOULD contain the Allow and Supported header fields, and MAY contain the Accept header field. Including theseparameter fields or parameter values defined by this option. A SIP option MUST NOT redefine header fieldsallows the UACor parameters defined in either RFC 2543, any standards-track extensions todetermine the features andRFC 2543, or other extensionssupported byregistered through IANA. o Indication of who has change control over theUASoption (for example, IETF, ISO, ITU-T, other international standardization bodies, a consortium or a particular company or group of companies); o A reference to a further description, if available, forthe durationexample (in order ofthe call, without probing. This method MUST be supported bypreference) an RFC, a published paper, a patent filing, a technical report, documented source code or a computer manual; Handley/Schulzrinne/Schooler/Rosenberg [Page 30] Internet Draft SIPproxy, redirectMay 29, 2001 o Contact information (postal anduser agent servers as well as clients. 4.2.2email address). Registrations should be sent to iana@iana.org This procedure has been borrowed from RTSP [4] and the RTP AVP [26]. 5 INVITE, ACK and CANCEL 5.1 INVITE TheACK request confirmsINVITE method indicates that theclient has received a final response to an INVITE request. (ACK is used only with INVITE requests.) 2xx responses are acknowledged by clientuseragents, all other final responses by the first proxyorclient user agent to receive the response. The Viaservice isalways initializedbeing invited to participate in a session. The message body MAY contain a description of thehost that originatessession to which theACK request, i.e.,callee is being invited. For two-party calls, theclient user agent after a 2xx response orcaller indicates thefirst proxytype of media it is able to receivea non-2xx final response. The ACK requestand possibly the media it isforwardedwilling to send asthe corresponding INVITE request, based onwell as their parameters such as network destination. A success response MUST indicate in itsRequest-URI and thus MAY take a different path thanmessage body which media theoriginal INVITE request,callee wishes to receive and MAYeven cause a new transport connectionindicate the media the callee is going tobe opened in ordersend. Not all session description formats have the ability tosend it.indicate sending media. TheACKcaller MAY choose to omit the requestdoesbody (i.e., notgenerate responses for any transport protocol. The ACK request MAY containsend a session description) or send amessage body with the finalsession descriptionto be used by the callee. Ifthat does not list any media types. This indicates that theACK message body is empty,caller does not know its desired media characteristics until thecallee usescall has been accepted. In this case, the UAS SHOULD still return a session description in its informational (1xx) or success (2xx) response, containing those media streams and codecs it supports. If the INVITErequest. See Section 4.2.1 for further details on the relationship between Handley/Schulzrinne/Schooler/Rosenberg [Page 29] Internet Draft SIP November 24, 2000request did not contain a complete sessiondescriptionsdescription, the caller MUST include one inINVITE andthe ACKrequests.request. Aproxy server receivingUAC MUST NOT send an updated session description in an ACK requestafter havingif it had already sent a3xx, 4xx, 5xx, or 6xx response must make a determination about whether the ACK is for it, or for some user agent or proxy server further downstream. This determination is made by examining the tagsession description in theTo field.INVITE request. If thetag in the ACK To header field matches the tag in the To header field ofUAC wishes to modify theresponse, andsession after theFrom, CSeq and Call-ID header fields incall setup has begun, it MUST initiate another INVITE transaction after theresponse match those incurrent one has completed. Delaying theACK,session description until the ACK request ismeantuseful for gateways from H.323v1 to SIP, where theproxy server. Otherwise,H.323 media characteristics are not known until theACK SHOULD be proxied downstream as any other request. Itcall ispossibleestablished. A server MAY automatically respond to an invitation for a conference Handley/Schulzrinne/Schooler/Rosenberg [Page 31] Internet Draft SIP May 29, 2001 the useragent clientis already participating in, identified either by the SIP Call-ID orproxy server to receive multiple 3xx, 4xx, 5xx, and 6xx responses toarequest along a single branch. This can happen under various error conditions, typically whenglobally unique identifier within the session description, with aforking proxy transitions from stateful to stateless before receiving all responses.200 (OK) response. Thevarious responses will all be identical, except for the tag inbehavior of UAS depend on whether they are Internet telephony gateways to theTo field, which is different for each one. It can therefore be usedPSTN. A UAS not acting as ameans to disambiguate them. This method MUST be supported by SIP user agents. 4.2.3 OPTIONS The server is being queried asgateway which receives an INVITE with a Request-URI that does not correspond to one of itscapabilities.configured addresses, MUST respond with 404 (Not Found). Aserver that believes it can contact the user, suchUAS acting as auser agent wheregateway translates theuser is logged in and has been recently active, MAY respond to thisINVITE requestwithinto acapability set. A called user agent MAY returntelephony signaling message. If the INVITE has astatus reflecting how it would have responded to an invitation, e.g., 600 (Busy). A server SHOULD return Allow, Accept, Accept-Encoding, Accept-Language and Supported header fields. The response MAY containCall-ID value that matches amessage body indicatingrecent call, thecapabilities ofUAS compares theend system (rather than properties of any existing call). The useRequest-URI with the Request-URI of theCall-ID header field is discussed in Section 6.13. An OPTIONS requestsprevious INVITE request foran existing call-id has no impact on that call. This method MUST be supported by SIP user agents and registrars. 4.2.4 BYE The user agent client uses BYE to indicatethe same Call-ID. If the Request-URI contains additional digits in the "user" part, the UAS treats the INVITE as adding additional digits to theserveroriginal dialed string. This is known as overlap dialing. If the gateway knows thatit wishes to releasethecall. A BYE requesttelephone number isforwarded likeincomplete, it returns a 484 (Address Incomplete) status response. If a user agent receives an INVITE requestand MAY be issued by either caller or callee. A party to afor an existing callSHOULD issue a BYE request before releasing a call ("hanging Handley/Schulzrinne/Schooler/Rosenberg [Page 30] Internet Draft SIP November 24, 2000 up"). A party receivingleg with aBYE requesthigher CSeq sequence number than any previous INVITE for the same Call-ID, it MUSTcease transmitting media streams specifically directed atcheck any version identifiers in theparty issuingsession description or, if there are no version identifiers, theBYE request. A BYE request from either called or calling party terminates any pending INVITE at a UA, butcontent of theINVITE request transactionsession description to see if it has changed. It MUSTbe completed with a final response and ACK.also inspect any other header fields for changes. Ifthe INVITE request containedthere is aContact header,change, thecallee SHOULD senduser agent MUST update any internal state or information generated as aBYE request toresult of thataddress rather thanheader. If the session description has changed, theFrom address. This method SHOULD be supported byuser agentservers. 4.2.5 CANCEL The CANCEL request cancels a pending request withserver MUST adjust thesame Call-ID, To, From and CSeq (sequence number only) header field values, but does not affect a completed request or existing calls. (A request is considered completed ifsession parameters accordingly, possibly after asking theserver has returned a final status response.) The UACuser for confirmation. (Versioning of the session description canuse a BYE requestbe used toterminate a call ifaccommodate theCANCEL arrived too late. A user agent clientcapabilities of new arrivals to a conference, add orproxy client MAY issuedelete media or change from aCANCEL request at any time. A proxy client generatesunicast to aCANCELmulticast conference.) If an INVITE request forbranches without a final response after it has forked a request and receives a 2xx or 6xx response from one ofan existing session fails, thebranches. A UAC or proxy client also sends a CANCEL ifsession description agreed upon in thetime notedlast successful INVITE transaction remains in force. A UAC MUST NOT issue another INVITE request for theExpires header ofsame call leg before therequestprevious INVITE transaction haselapsed or no provisional or final response was received after a client-determined timeout interval. Finally, internal logic such as scripts, can trigger CANCEL requests.completed. AproxyUAS that receivesa CANCEL request forwardsan INVITE before it sent therequestfinal response toall destinationsan INVITE withpending requests. The Call-ID, To, the numeric part ofa lower CSeq number on the same call leg MUST return a 400 (Bad Request) response andFromMUST include a Retry-After headerfields in the CANCEL request are identical to those in the original request. This allowsfield with aCANCELrandomly chosen value of between 0 and 10 seconds. If a UA A sends an INVITE request tobe matched with theB and receives an INVITE request from B before itcancels. However, to allowhas received theclient to distinguish responsesresponse tothe CANCELits request fromthose to the original request, the CSeq Method component is set to CANCEL. The ViaB, A MAY return a 500 (Internal Server Error), which SHOULD include a Handley/Schulzrinne/Schooler/Rosenberg [Page 32] Internet Draft SIP May 29, 2001 Retry-After header fieldis initialized to the proxy issuingspecifying when theCANCEL request. (Thus, responses to this CANCELrequestonly reachshould be resubmitted. In most cases, a UA can assume that theissuing proxy.) The behaviororder of messages received corresponds to theuser agent or redirect server on receiving a CANCEL request depends on whetherorder they were sent. In rare circumstances, theserver has already sent a finalresponsefor the original request. If it has,from B and theCANCELrequesthas no effectfrom B may be reordered on theoriginal request, any call state andwire. In addition, if A or B change multicast addresses, strict transaction ordering is necessary so that both sides agree on theresponses generated for the original request. If the server has not issued afinalresponse for the original request, it immediately Handley/Schulzrinne/Schooler/Rosenberg [Page 31] Internet Draft SIP November 24, 2000 sends a 487 (Request Terminated) for the original request. For INVITE requests, theresult. A UAC MUST be prepared to receive media data according to the session description asusualsoon as it sends anACK request to confirm receipt of any final response. The CANCEL request itself is answered withINVITE (or re-INVITE) and can start sending media data when it receives a200 (OK) response in either case. A proxy clientprovisional orUAC cannot rely on receiving a 487 (Request Terminated) response, as a RFC 2543-compliant UAS will not generate such a response. If there has been nofinal responseafter 32 seconds,containing a session description. The initial INVITE from theclientUAC SHOULD contain the Allow and Supported header fields, and MAYconsidercontain theoriginal transaction to have been cancelled. The BYE request cannot be usedAccept header field. A 200 (OK) response tocancel branches ofthe initial INVITE for aparallel search, since several branches may, through intermediate proxies, findcall SHOULD contain thesame user agent serverAllow andthen terminateSupported header fields, and MAY contain thecall. To terminate a call instead of just pending searches,Accept header field. Including these header fields allows the UACmust use BYE instead of or in addition to CANCEL. While CANCEL can terminate any pending request other than ACK or CANCEL, it is typically useful only for INVITE. 200 responsestoINVITEdetermine the features and200 responses to CANCEL can be distinguishedextensions supported by themethod inUAS for theCseq header field.duration of the call, without probing. This method MUST be supported byproxy serversSIP proxy, redirect andSHOULD be supporteduser agent servers as well as clients. 5.1.1 ACK The ACK request confirms that the client has received a final response to an INVITE request. (ACK is used only with INVITE requests.) Treatment of ACK for a 200 class response differs significantly from that of a non-200 class response. 2xx responses are acknowledged by client user agents, all otherSIP server types. 4.2.6 REGISTER Afinal responses by the first stateful proxy or clientusesuser agent to receive theREGISTER methodresponse. The Via is always initialized tobindtheaddress listed inhost that originates theTo header field with a SIP server to one or more URIs whereACK request, i.e., the clientcan be reached, contained inuser agent after a 2xx response or theContact header fields. These URIs may use any URI scheme, not limited to SIP. It is particularly important that REGISTER requests are authenticated since they allow to redirect future requests (see Section 13.2). 4.2.6.1 Where to Register A user agent SHOULD attempt to register periodically accordingfirst proxy or UAC to receive a non-2xx final response. For a non-200 class response, therules below. A UA is said to be "visiting" if its From address domain differs fromVia in thecurrent network domain andACK that issaid toconstructed MUST be"at home" ifthetwo aresame as thesame. Local server: If an outbound proxy is configured,request being acknowledged. The ACK for a 200 class response will contain Route headers if Record-Route headers were present in theUA SHOULD sendresponse. An ACK for aREGISTERnon-200 class response never contains Route headers. The ACK requestto it. If the UAfor a 200 class response isvisiting, it uses the From address consisting of the URL-escaped user identity at the visited domain, e.g., the user identified as alice@wonderland.com would registerforwarded as the corresponding INVITE request, based on Handley/Schulzrinne/Schooler/Rosenberg [Page32]33] Internet Draft SIPNovember 24, 2000 alice%40wonderland.com@example.com if she is visiting the example.com domain. Multicast: If no local outbound proxy is configured, multicast registrations are addressed to the well-known "all SIP servers" multicast address "sip.mcast.net" (224.0.1.75). This request SHOULD be scoped to ensure it is not forwarded beyond the boundaries of the administrative system. This MAY be done with either TTLMay 29, 2001 its Request-URI oradministrative scopes [27], depending on what is implemented inRoute headers, and thus MAY take a different path than thenetwork. SIP user agentsoriginal INVITE request, and MAYlisteneven cause a new transport connection tothat address and use itbe opened in order tobecome aware ofsend it. The Request-URI for thelocation of other local users [18]; however, they do not respondACK is set to therequest. Multicast registration may be inappropriatetop entry insome environments,the route set forexample, if multiple businesses sharea 200 class response (see Section 16). For a non-200 class response, the Request-URI MUST be the samelocal area network. Home server: Ifas theUA is visiting, it SHOULD also sendRequest-URI in the request being acknowledged. The ACK request does not generate responses for any transport protocol. The ACK request for aregistration to its home SIP server, identified by its home address. For example, alice@wonderland.com would send200 class response MAY contain aregistrationmessage body with the final session description to be used by theSIP servercallee. See Section 5.1 for further details on thedomain wonderland.com when she is visiting another network. TBD: What Contact should be used?relationship between session descriptions in INVITE and ACK requests. A proxy server receiving an ACK request after having sent a 3xx, 4xx, 5xx, or 6xx response must make a determination about whether the ACK is for it, or for some user agentSHOULD register with a localor proxy serveron startup and periodically thereafter by sending a REGISTER request. The periodfurther downstream. This determination isgivenmade by examining theexpiration time indicatedtag in theregistration response. It is RECOMMENDED thatTo field. If theUA registers via multicast and send a registration to its "home" address, i.e.,tag in theserver forACK To header field matches thedomain that it uses as its From addresstag inoutgoing requests. 4.2.6.2 REGISTER Header Fields Request-URI: The Request-URI namesthedestinationTo header field of theregistration request, i.e., the domain ofresponse, and theregistrar. The user name MUST be empty. Generally,From, CSeq and Call-ID header fields in thedomainsresponse match those in theRequest-URI andACK, theTo header field haveACK is meant for thesame value; however, itproxy server. Otherwise, the ACK SHOULD be proxied downstream as any other request. However, an ACK not destined for the proxy SHOULD NOT be retransmitted. It is possible for a user agent client or proxy server to receive multiple 3xx, 4xx, 5xx, and 6xx responses toregister asa"visitor", while maintaining one's name. For example,request along atraveler sip:alice@acme.com (To) might registersingle branch. This can happen under various error conditions, typically when a forking proxy transitions from stateful to stateless before receiving all responses. The various responses will all be identical, except for theRequest- URI sip:atlanta.hiayh.org , withtag in theformerTo field, which is different for each one. It can therefore be used as a means to disambiguate them. This method MUST be supported by SIP user agents. 5.2 CANCEL The CANCEL request cancels a pending request with theTosame Call-ID, To, From, top Via headerfieldandthe latter as the Request-URI. The REGISTERRequest-URI and CSeq (sequence number only) header field values, but does not affect a completed request or existing calls. (A request isno longer forwarded once it has reachedconsidered completed if the serverwhose authoritative domain is the one listed inhas returned a final status response.) The UAC can use a BYE request to terminate a call if theRequest-URI.CANCEL arrived too late. Handley/Schulzrinne/Schooler/Rosenberg [Page33]34] Internet Draft SIPNovember 24, 2000 Call-ID: All registrations fromMay 29, 2001 A user agent client or proxy client MAY issue a CANCEL request at any time. A proxy clientSHOULD usegenerates a CANCEL request for branches without a final response after it has forked a request and receives a 2xx or 6xx response from one of thesame Call-ID header value, at least withinbranches. A UAC or proxy client also sends a CANCEL if thesame reboot cycle. Cseq: Registrations withtime noted in thesame Call-ID MUST have increasing CSeqExpires headervalues. However,of theserver does not reject out-of-orderrequest has elapsed or no provisional or final response was received after a client-determined timeout interval. Finally, internal logic such as scripts, can trigger CANCEL requests.4.2.6.3 Registering Contact Locations REGISTER requests are processed in the order received. Clients SHOULD avoid sendingA stateful proxy that receives a CANCEL request immediately responds with a 200 class response. It then generates a newregistration (as opposedCANCEL, and forwards the request to all destinations with pending requests. A stateless proxy, or aretransmission) until they have received the response from the serverstateful proxy with no transaction state for theprevious one. Clients may register from different locations, by necessity using different Call-ID values. Thus,cancelled request, proxies theCSeq value cannot be usedCANCEL request toenforce ordering. Since registrations are additive, ordering is lessthe same set ofa problem than if each REGISTER request completely replaced all earlier ones. We define "address-of-record" asdestinations theSIP address that the registry knowsoriginal request was proxied to. The Request-URI, topmost Via, Call-ID, To, theregistrand, typicallynumeric part of CSeq and From header fields in theform "user@domain" rather than "user@host". In third-party registration,CANCEL request are identical to those in theentity issuingoriginal request being cancelled, including tags. This allows a CANCEL request to be matched with the requestis differentit cancels. However, to allow the client to distinguish responses to the CANCEL from those to theentity being registered. To: The To header field containsoriginal request, theaddress-of-record whose registrationCSeq Method component is set tobe created or updated. From:CANCEL. TheFromVia header fieldcontains the address-of-record ofis initialized to theperson responsible forproxy issuing theregistration. For first- party registration, it is identicalCANCEL request. (Thus, responses to this CANCEL request only reach theTo header field value. Contact:issuing proxy.) The behavior of the user agent or redirect server on receiving a CANCEL requestMAY containdepends on whether the server has already sent aContact header field. Future non-REGISTER requestsfinal response for theURI given inoriginal request. If it has, theTo header field SHOULD be directed toCANCEL request has no effect on theaddress(es) given inoriginal request, any call state and on theContact header.responses generated for the original request. If therequest doesserver has notcontainissued aContact header,final response for theregistration remains unchanged. This is usefuloriginal request, it immediately responds toobtainthecurrent listoriginal request with a 487 (Request Terminated), following normal rules for response retransmissions defined in Section 14. For INVITE requests, the UAC as usual sends an ACK request to confirm receipt ofregistrationsany final response. The CANCEL request itself is answered with a 200 (OK) response in either case. If the UAS or redirect server has no record of the request being cancelled, the CANCEL is responded to with a 481. A proxy client or UAC cannot rely on receiving a 487 (Request Terminated) response, asdescribed below. IfaSIP URI inRFC 2543-compliant UAS will not generate such aregistration Contact header field differs from existing registrations according toresponse. If there has been no final response after 32 seconds, therules inclient MAY consider the original transaction to have been cancelled. The BYE request cannot be used to cancel branches of a Handley/Schulzrinne/Schooler/Rosenberg [Page34]35] Internet Draft SIPNovember 24, 2000 Section 2.1, it is added toMay 29, 2001 parallel search, since several branches may, through intermediate proxies, find thelistsame user agent server and then terminate the call. To terminate a call instead ofregistration. Ifjust pending searches, the UAC must use BYE instead of or in addition to CANCEL. While CANCEL can terminate any pending request other than ACK or CANCEL, it isequivalent, accordingtypically useful only for INVITE. 200 responses tothese rules,INVITE and 200 responses toan existing registration, all ContactCANCEL can be distinguished by the method in the Cseq headerfield parameters for this entry are updated accordingly. URIsfield. This method MUST be supported by proxy servers and SHOULD be supported by all otherthanSIPURIs are compared accordingserver types. 6 BYE The user agent client uses BYE to indicate to thestandard URI equivalency rules forserver that it wishes to release theURI schema. All current registrations MUST share the same action value. Registrations that have a different action than current registrations for the same user MUST be rejected with status of 409 (Conflict).call leg. Aproxy server ignores the q parameter when processing non-REGISTER requests, while a redirect server simply returns that parameter in its Contact response header field. Having the proxy server interpret the q parameterBYE request isnot sufficientforwarded like an INVITE request and MAY be issued by either caller or callee. A BYE request SHOULD NOT be sent toguide proxy behavior, as it isterminate a pending call request which has notclear, for example, how long it is supposed to wait between trying addresses. If the registration is changed whilegenerated either auser agentfinal response orproxy server processes an invitation, the new informationa provisional response containing a To tag. A party to a call SHOULDbe used. This allowsissue aservice known as "directed pick-up". In the telephone network, directed pickup permitsBYE request before releasing ausercall ("hanging up"). A party receiving a BYE request MUST cease transmitting media streams specifically directed at the party issuing the BYE request. A UAS receiving aremote station who hears his own phone ringingBYE request MUST respond topick up atany pending requests received for thatstation, dial an access code, andcall, including INVITE. It is RECOMMENDED that a 487 response is generated. This method SHOULD beconnected to the callingsupported by useras if he had answered his own phone. 4.2.6.4 Registration Expiration An optional "expires" Contact parameter indicatesagent servers. 7 Registrars, Registrations and thedesired expiration time ofREGISTER Method A client uses theregistration. If a Contact entry does not have an "expires" parameter,REGISTER method to bind theExpiresaddress listed in the To header fieldis used as the default value. If neither of these mechanisms is used,with a SIPURIs are assumedserver toexpire afteronehour. Other URI schemes have no expiration times. Registrations not refreshed after this amount of time SHOULDor more URIs where the client can besilently discarded. A registrar SHOULDNOT use a longer lifetime thanreached, contained in theone requested, but MAYContact header fields. These URIs may usea shorter one. Registration refreshesany URI scheme, not limited to SIP. It is particularly important that REGISTER requests are authenticated since they allow to redirect future requests (see Section 18.2). 7.1 Where to Register A user agent SHOULDbe sentattempt to register periodically according to thesamerules below. A UA is said to be "visiting" if its From addressasdomain differs from theoriginal registration, unless redirected. 4.2.6.5 List of Current Registrationscurrent network domain and is said to be "at home" if the two are the same. Handley/Schulzrinne/Schooler/Rosenberg [Page35]36] Internet Draft SIPNovember 24, 2000 2xx REGISTER responsesMay 29, 2001 Local server: If an outbound proxy is configured, the UA SHOULDlist all current registration insend a REGISTER request to it. If theContact header field. An "expires" parameter MUST indicateUA is visiting, it uses theexpiration timeFrom address consisting of theregistration. 4.2.6.6 Removing Registrations Registrations expire as described above or may be removed explicitly by settingURL-escaped user identity at theexpires parameter for an existing registration to zero or including an Expires: 0 header field. Registrations are matched based onvisited domain, e.g., theuser, host, port and maddr parameters. A client can remove alluser identified as alice@wonderland.com would register as alice%40wonderland.com@example.com if she is visiting the example.com domain. Multicast: If no local outbound proxy is configured, multicast registrationsby including a single Contact header field withare addressed to thewildcardwell-known "all SIP servers" multicast address"*". Support of this method is RECOMMENDED; registrars"sip.mcast.net" (224.0.1.75). This request MUSTsupport it. 4.3 Request-URI The Request-URI is a SIP URL as described in Section 2 or a general URI (RFC 2396 [9]). In particular, it MUSTNOT contain unescaped spaces or control characters. It indicates the user or servicebe scoped towhich this requestensure it isbeing addressed. Unlikenot forwarded beyond theTo field,boundaries of theRequest-URIadministrative system. This MAY bere-written by proxies. As showndone with either TTL or administrative scopes [27], depending on what is implemented inTable 2,theRequest-URInetwork. SIP user agents MAYcontain the user-param parameter as well as transport-related parameters. A serverlisten to thatreceives a SIP-URL with illegal elements removes them before further processing. Transport-related parameters are needed when a UAC proxies all requestsaddress and use it toa default proxy, which would then need this informationbecome aware of the location of other local users [17]; however, they do not respond togeneratetheappropriaterequest.Typically,Multicast registration may be inappropriate in some environments, for example, if multiple businesses share theUAC setssame local area network. Home server: If theRequest-URI and ToUA is visiting, it SHOULD also send a registration tothe sameits home SIPURL, presumed to remain unchanged over long time periods. However, if the UAC has cachedserver, identified by its home address. For example, alice@wonderland.com would send amore direct pathregistration to thecallee, e.g., fromSIP server for the domain wonderland.com when she is visiting another network. TBD: What Contactheader field ofshould be used? A user agent SHOULD register with aresponse tolocal server on startup and periodically thereafter by sending aprevious request,REGISTER request. The period is given by theTo would still containexpiration time indicated in thelong-term, "public"registration response. It is RECOMMENDED that the UA registers via multicast and send a registration to its "home" address,whilei.e., the server for the domain that it uses as its From address in outgoing requests. 7.2 REGISTER Header Fields Request-URI: The Request-URIwould be set tonames thecached address. Proxy and redirect servers MAY usedestination of theinformationregistration request, i.e., the domain of the registrar. The user name MUST be empty. Generally, the domains in the Request-URI andrequest header fields to handletherequest and possibly rewriteTo header field have theRequest-URI.same value; however, it is possible to register as a "visitor", while maintaining one's name. For example, arequest addressed to the generic address sip:sales@acme.com is proxied totraveler sip:alice@acme.com (To) might register under theparticular person, e.g., sip:bob@ny.acme.comRequest- URI sip:atlanta.hiayh.org , with theTo field remaining as sip:sales@acme.com. At ny.acme.com , Bob then designates Aliceformer as the To Handley/Schulzrinne/Schooler/Rosenberg [Page36]37] Internet Draft SIPNovember 24, 2000 the temporary substitute. The host part ofMay 29, 2001 header field and theRequest-URI typically agrees with one oflatter as thehost names of the receiving server. IfRequest-URI. The REGISTER request is no longer forwarded once itdoes not,has reached the serverSHOULD proxy the request to the address indicated or return a 404 (Not Found) response if itwhose authoritative domain isunwilling or unable to do so. For example,theRequest-URI and server host name can disagreeone listed in thecase ofRequest-URI. Call-ID: All registrations from afirewall proxy that handles outgoing calls. This mode of operation is similar to that of HTTP proxies. SIP servers MAY support Request-URIs with schemes other than "sip", for exampleclient SHOULD use the"tel" URI scheme [19]. It MAY translate non-SIP URIs using any mechanismsame Call-ID header value, atits disposal, resulting in either a SIP URI or some other scheme. If a SIP server receives a requestleast within the same reboot cycle. Cseq: Registrations witha URI indicating a schemethe same Call-ID MUST have increasing CSeq header values. However, the server does notunderstand,reject out-of-order requests. 7.3 Registering Contact Locations REGISTER requests are processed in the order received. Clients SHOULD avoid sending a new registration (as opposed to a retransmission) until they have received the response from the serverMUST returnfor the previous one. Clients may register from different locations, by necessity using different Call-ID values. Thus, the CSeq value cannot be used to enforce ordering. Since registrations are additive, ordering is less of a400 (Bad Request) response. It MUST do this evenproblem than if each REGISTER request completely replaced all earlier ones. We define "address-of-record" as the SIP address that the registry knows the registrand, typically of the form "user@domain" rather than "user@host". In third-party registration, the entity issuing the request is different from the entity being registered. To: The To header field containsa scheme it does understand, since proxies arethe address-of-record whose registration is to be created or updated. From: The From header field contains the address-of-record of the person responsible forprocessingtheRequest-URI. (Theregistration. For first- party registration, it is identical to the To header field value. It isonly of interestRECOMMENDED that registrars authorize whether the entity in the From field is allowed to register addresses for theUAS.) 4.3.1 SIP Version Bothaddress-of-record in the To field. Contact: The requestand response messages includeMAY contain a Contact header field. Future non-REGISTER requests for theversion of SIPURI given inuse, and follow [H3.1] (with HTTP replaced by SIP, and HTTP/1.1 replaced by SIP/2.0) regarding version ordering, compliance requirements, and upgrading of version numbers.the To header field SHOULD becompliant with this specification, applications sending SIP messages MUST include a SIP- Version of "SIP/2.0". The string is case-insensitive, but implementations MUST use upper-case. Unlike HTTP/1.1, SIP treats the version number as a literal string. In practice, this should make no difference. 4.4 Option Tags Option tags are unique identifiers useddirected todesignate new options in SIP. These tags are usedthe address(es) given inRequire (Section 6.36), Supported (Section 6.42) and Unsupported (Section 6.45) header fields. Syntax: option-tag = token See Section C forthedefinition of token. The creator ofContact header. If the request does not contain anew SIPContact header, the Handley/Schulzrinne/Schooler/Rosenberg [Page37]38] Internet Draft SIPNovember 24, 2000 option MUST either prefix the option with their reverse domain name or register the new option withMay 29, 2001 registration remains unchanged. This is useful to obtain theInternet Assigned Numbers Authority (IANA). An examplecurrent list of registrations in the response, as described below. If areverse-domain-name optionSIP URI in a registration Contact header field differs from existing registrations according to the rules in Section 2.1, it is"com.foo.mynewfeature", whose inventor can be reached at "foo.com". Foradded to the list of registration. If it is equivalent, according to thesefeatures, individual organizations are responsiblerules, to an existing registration, all Contact header field parameters forensuring that option names do not collide withinthis entry are updated accordingly. URIs other than SIP URIs are compared according to thesame domain. The host name part ofstandard URI equivalency rules for theoptionURI schema. All current registrations MUSTuse lower-case;share theoption name is case-sensitive. Options registered with IANA do not contain periods and are globally unique. IANA option tags are case-sensitive. 4.4.1 Registering New Option Tags with IANA When registeringsame action value. Registrations that have anew SIP option,different action than current registrations for thefollowing informationsame user MUST beprovided: o Name and description of option. The name MAY be of any length, but SHOULD be no more than twenty characters long. The name MUST consistrejected with status ofalphanum (See Figure 3) characters only; o409 (Conflict). Alisting of any new SIP header fields, headerproxy server ignores the q parameterfields orwhen processing non-REGISTER requests, while a redirect server simply returns that parametervalues defined by this option. A SIP option MUSTNOT redefine header fields or parameters definedineither RFC 2543, any standards-track extensions to RFC 2543, or other extensions registered through IANA. o Indication of who has change control overits Contact response header field. Having theoption (for example, IETF, ISO, ITU-T, other international standardization bodies, a consortium or a particular company or group of companies); o A referenceproxy server interpret the q parameter is not sufficient toa further description, if available,guide proxy behavior, as it is not clear, forexample (in order of preference) an RFC, a published paper, a patent filing,example, how long it is supposed to wait between trying addresses. If the registration is changed while atechnical report, documented source codeuser agent ora computer manual; o Contactproxy server processes an invitation, the new information(postal and email address). Registrations shouldSHOULD besent to iana@iana.org This procedure has been borrowed from RTSP [4] andused. 7.4 Registration Expiration An optional "expires" Contact parameter indicates theRTP AVP [28]. 5 Response Handley/Schulzrinne/Schooler/Rosenberg [Page 38] Internet Draft SIP November 24, 2000 After receiving and interpreting a request message,desired expiration time of therecipient responds withregistration. If aSIP response message. TheContact entry does not have an "expires" parameter, the Expires request and responsemessage formatheader field isshown below: Response = Status-Line ; Section 5.1 *( general-header | response-header | entity-header ) CRLF [ message-body ] ; Section 8 SIP's structureused as the default value. If neither ofresponsesthese mechanisms issimilarused, SIP URIs are assumed to[H6], but is defined explicitly here. 5.1 Status-Line The first lineexpire after one hour. Other URI schemes have no expiration times. Registrations not refreshed after this amount of time SHOULD be silently discarded. In aResponse message isREGISTER request, theStatus-Line, consisting ofclient indicates how long it wishes theprotocol version (Section 4.3.1) followed by a numeric Status-Code and its associated textual phrase, with each element separated by SP characters. No CR or LF is allowed except inregistration to be valid. In thefinal CRLF sequence. Status-Line = SIP-version SP Status-Code SP Reason-Phrase CRLF 5.1.1 Status Codes and Reason Phrases The Status-Code is a 3-digit integer result code thatresponse, the server indicates theoutcomeearliest expiration time ofthe attempt to understand and satisfy the request. The Reason-Phrase is intended to giveall registrations. If ashort textual description ofregistration updates an existing registration, theStatus-Code. The Status-Code is intended for use by automata, whereasExpires value of theReason-Phrasemost recent registration isintended for the human user. The clientused, even if it isnot required to examine or displayshorter than theReason-Phrase. Status-Code = Informational ;Fig. 4 | Success ;Fig. 4 | Redirection ;Fig. 5 | Client-Error ;Fig. 6 | Server-Error ;Fig. 7 | Global-Failure ;Fig. 8 | extension-codeearlier Handley/Schulzrinne/Schooler/Rosenberg [Page 39] Internet Draft SIPNovember 24, 2000 extension-code = 3DIGIT Reason-Phrase = *<TEXT-UTF8, excluding CR, LF> We provide an overview of the Status-Code below, and provide full definitions in Section 7.May 29, 2001 registration. Thefirst digit ofregistrar determines theStatus-Code definesexpiration time; it may be longer or shorter than theclass of response. The last two digits do not have any categorization role. SIP/2.0 allows 6 values forone requested by thefirst digit: 1xx: Informational -- request received, continuing to processregistrand. The REGISTER response contains therequest; 2xx: Success --actual registration lifetime; theaction was successfully received, understood,client MUST refresh at least as often andaccepted; 3xx: Redirection -- further action needs to be taken in order to completeSHOULD NOT refresh more frequently. In general, therequest; 4xx: Client Error --server SHOULD honor therequest contains bad syntax or cannot be fulfilled at this server; 5xx: Server Error --expiration time offered by the user agent. A serverfailedMAY decide tofulfill an apparently valid request; 6xx: Global Failure --lengthen therequest cannot be fulfilled at any server. Figures 4 through 8 presentexpiration interval if, for example, theindividual valuesrefresh rate of a particular client exceeds a threshold. This behavior is different from RFC 2543, which only allowed registrars to decrease, but not increase, thenumeric response codes, and an exampleinterval. Allowing the registrar to setof corresponding reason phrases for SIP/2.0. These reason phrases are only recommended; they may be replaced by local equivalents without affectingtheprotocol. Note that SIP adopts many HTTP/1.1 response codes. SIP/2.0 adds response codes inregistration interval protects it against excessively frequent registration refreshes while limiting therange starting at x80state that it needs toavoid conflicts with newly defined HTTP response codes,maintain andadds a new class, 6xx, of response codes. SIP response codes are extensible. SIP applications are not required to understanddecreasing themeaning of all registered response codes, though such understanding is obviously desirable. However, applications MUST understandchance for stale registrations that require proxying effort. Registration refreshes SHOULD be sent to theclass of any response code,same address asindicated bythefirst digit, and treat any unrecognized responseoriginal registration, unless redirected. 7.5 List of Current Registrations 2xx REGISTER responses SHOULD list all current registration in the Contact header field. An "expires" parameter MUST indicate the expiration time of the registration. 7.6 Removing Registrations Registrations expire asbeing equivalentdescribed above or may be removed explicitly by setting the expires parameter for an existing registration to zero or including an Expires: 0 header field. Registrations are matched based on thex00 response code of that class,user, host, port and maddr parameters. A client can remove all registrations by including a single Contact header field with theexception that an unrecognized response MUSTNOT be cached. For example, ifwildcard address "*". This usage is only allowed in REGISTER requests when aclient receives an unrecognized response codeExpires header with value of431,zero is present. Support of this method is RECOMMENDED; registrars MUST support it. 8 OPTIONS The OPTIONS method is used to query a server as to its capabilities. A server that believes it cansafely assume that there was something wrong with its request and treatcontact theresponseuser, such asif it had receiveda400 (Bad Request) response code. In such cases,useragents SHOULD present toagent where the userthe message body returned with the response, since that message bodyislikelylogged in and has been recently active, MAY respond to this request with a capability set. A called user agent MAY return Handley/Schulzrinne/Schooler/Rosenberg [Page 40] Internet Draft SIPNovember 24, 2000 include human-readable information which will explain the unusual status. Informational = "100" ; Trying | "180" ; Ringing | "181" ; Call Is Being Forwarded | "182" ; Queued | "183" ; Session Progress Success = "200" ; OK Figure 4: Informational and success status codes Redirection = "300" ; Multiple Choices | "301" ; Moved Permanently | "302" ; Moved Temporarily | "305" ; Use Proxy | "380" ; Alternative Service Figure 5: RedirectionMay 29, 2001 a statuscodes 6 Header Field Definitions SIP header fields are similarreflecting how it would have responded toHTTP header fields in both syntaxan invitation, e.g., 600 (Busy). A server SHOULD return Allow, Accept, Accept- Encoding, Accept-Language andsemantics. In particular, SIPSupported headerfields follow the syntax for message-header as described in [H4.2].fields. Therules for extending header fields over multiple lines, and use of multiple message-header fields withresponse MAY contain a message body indicating thesame field-name, described in [H4.2] also apply to SIP. The rules in [H4.2] regarding orderingcapabilities ofheader fields apply to SIP, withtheexceptionend system (rather than properties ofVia fields, see below, whose order matters.any existing call). The use of the Call-ID headerfields required, optional and not applicablefield is discussed in Section 10.12. An OPTIONS requests foreachan existing call-id has no impact on that call. This methodare listed in Table 4MUST be supported by SIP user agents andTable 5. The table uses "o" to indicate optional, "m" mandatoryregistrars. 9 Response After receiving and"-" for not applicable. "Optional" means that a UA MAY include the header field ininterpreting a requestor response, and a UA MAY ignore the header field if present inmessage, theHandley/Schulzrinne/Schooler/Rosenberg [Page 41] Internet Draftrecipient responds with a SIPNovember 24, 2000 Client-Error = "400" ; Bad Request | "401" ; Unauthorized | "402" ; Payment Required | "403" ; Forbidden | "404" ; Not Found | "405" ; Method Not Allowed | "406" ; Not Acceptable | "407" ; Proxy Authentication Required | "408" ; Request Timeout | "409" ; Conflict | "410" ; Gone | "411" ; Length Required | "413" ; Request Entity Too Large | "414" ; Request-URI Too Large | "415" ; Unsupported Media Type | "420" ; Bad Extension | "480" ; Temporarily not available | "481" ; Call Leg/Transaction Does Not Exist | "482" ; Loop Detected | "483" ; Too Many Hops | "484" ; Address Incomplete | "485" ; Ambiguous | "486" ; Busy Here | "487" ; Request Cancelled | "488" ; Not Acceptable Here Figure 6: Client error status codes Server-Errorresponse message. The response message format is shown below: Response ="500" ; Internal Server Error | "501" ; Not Implemented | "502" ; Bad Gateway | "503"Status-Line ;Service UnavailableSection 9.1 *( general-header |"504" ; Gateway Time-outresponse-header |"505"entity-header ) CRLF [ message-body ] ;SIP Version not supported Figure 7: Server error status codes request or response. A "mandatory" request header field MUST be present inSection 12 SIP's structure of responses is similar to [H6], but is defined explicitly here. 9.1 Status-Line The first line of arequest,Response message is the Status-Line, consisting of the protocol version (Section 4.3.1) followed by a numeric Status-Code andMUST be understoodits associated textual phrase, with each element separated by SP characters. No CR or LF is allowed except in theUAS receivingfinal CRLF sequence. Status-Line = SIP-version SP Status-Code SP Reason-Phrase CRLF 9.1.1 Status Codes and Reason Phrases The Status-Code is a 3-digit integer result code that indicates the outcome of the attempt to understand and satisfy the request.A mandatory response header field MUST be present inThe Reason-Phrase is intended to give a short textual description of the Handley/Schulzrinne/Schooler/Rosenberg [Page42]41] Internet Draft SIPNovember 24, 2000 Global-FailureMay 29, 2001 Status-Code. The Status-Code is intended for use by automata, whereas the Reason-Phrase is intended for the human user. The client is not required to examine or display the Reason-Phrase. Status-Code ="600" ; Busy EverywhereInformational ;Fig. 4 |"603" ; DeclineSuccess ;Fig. 4 |"604" ; Does not exist anywhereRedirection ;Fig. 5 |"606" ; Not Acceptable Figure 8: Global failure status codes response, andClient-Error ;Fig. 6 | Server-Error ;Fig. 7 | Global-Failure ;Fig. 8 | extension-code extension-code = 3DIGIT Reason-Phrase = *<TEXT-UTF8, excluding CR, LF> We provide an overview of theheader field MUST be understood byStatus-Code below, and provide full definitions in Section 11. The first digit of theUAC processingStatus-Code defines the class of response."Not applicable" meansThe last two digits do not have any categorization role. SIP/2.0 allows 6 values forrequest header fields thattheheader field MUSTNOT be present in a request. If one is placed in afirst digit: 1xx: Informational -- requestby mistake, it MUST be ignored byreceived, continuing to process theUAS receivingrequest; 2xx: Success -- therequest. Similarly, a header field labeled "not applicable" for a response means that the UAS MUSTNOT place the header in the response,action was successfully received, understood, andthe UAC MUST ignore the header in the response. "m*" indicates a header that SHOULD be sent, but servers needaccepted; 3xx: Redirection -- further action needs to bepreparedtaken in order toreceive requests without that header field. A "*" indicates thatcomplete theheader fields are needed only if message body is not empty. See sections 6.19, 6.20 and 8 for details. The "where" column describesrequest; 4xx: Client Error -- the requestand response types with which the header field cancontains bad syntax or cannot beused. "R" refersfulfilled at this server; 5xx: Server Error -- the server failed toheader fields that can be used in requests (that is,fulfill an apparently valid request; 6xx: Global Failure -- the requestand general header fields). "r" designates a response or general-header field as applicable to all responses, while a listcannot be fulfilled at any server. Figures 4 through 8 present the individual values of the numericvalues indicatesresponse codes, and an example set of corresponding reason phrases for SIP/2.0. These reason phrases are only recommended; they may be replaced by local equivalents without affecting thestatusprotocol. Note that SIP adopts many HTTP/1.1 response codes. SIP/2.0 adds response codeswith whichin theheader field can be used. "g" and "e" designate general (Section 6.1)range starting at x80 to avoid conflicts with newly defined HTTP response codes, andentity header (Section 6.2) fields, respectively. Ifadds aheader field is marked "c", it is copied from the requestnew class, 6xx, of response codes. Handley/Schulzrinne/Schooler/Rosenberg [Page 42] Internet Draft SIP May 29, 2001 SIP response codes are extensible. SIP applications are not required to understand theresponse. The "proxy" column describes whether proxies can add comma-separated elements to headers ("c", for concatenate or comma), can modifymeaning of all registered response codes, though such understanding is obviously desirable. However, applications MUST understand theheader ("m"), can addclass of any response code, as indicated by theheader if not present ("a") or needfirst digit, and treat any unrecognized response as being equivalent toreadtheheader ("r"). Headersx00 response code of thatneed to be read cannotclass. However, proxies SHOULD distinguish 100 from other 1xx responses. (The former SHOULD NOT beencrypted. Proxies MUSTNOT alter any fields that are authenticated (seeforwarded, while the latter MUST be. See Section13.2), but MAY add copies17.3.) For example, if a client receives an unrecognized response code offields431, it can safely assume thatwere authenticated bythere was something wrong with its request and treat theUAresponse as ifindicated init had received a 400 (Bad Request) response code. In such cases, user agents SHOULD present to thetable. Depending on local policy, proxies MAY inspect any non-encrypted header fields and MAY modify any non- authenticated header field, but proxies cannot rely on fields other thanuser theones indicated inmessage body returned with thetable to be readable or modifiable. If authenticationresponse, since that message body isused,likely to include human-readable information which will explain therules in Section 13.2 apply. Proxies SHOULDNOT re-order header fields. Handley/Schulzrinne/Schooler/Rosenberg [Page 43] Internet Draftunusual status. Informational = "100" ; Trying | "180" ; Ringing | "181" ; Call Is Being Forwarded | "182" ; Queued | "183" ; Session Progress Success = "200" ; OK Figure 4: Informational and success status codes Redirection = "300" ; Multiple Choices | "301" ; Moved Permanently | "302" ; Moved Temporarily | "305" ; Use Proxy | "380" ; Alternative Service Figure 5: Redirection status codes 10 Header Field Definitions Handley/Schulzrinne/Schooler/Rosenberg [Page 43] Internet Draft SIP May 29, 2001 Client-Error = "400" ; Bad Request | "401" ; Unauthorized | "402" ; Payment Required | "403" ; Forbidden | "404" ; Not Found | "405" ; Method Not Allowed | "406" ; Not Acceptable | "407" ; Proxy Authentication Required | "408" ; Request Timeout | "409" ; Conflict | "410" ; Gone | "411" ; Length Required | "413" ; Request Entity Too Large | "414" ; Request-URI Too Large | "415" ; Unsupported Media Type | "420" ; Bad Extension | "480" ; Temporarily not available | "481" ; Call Leg/Transaction Does Not Exist | "482" ; Loop Detected | "483" ; Too Many Hops | "484" ; Address Incomplete | "485" ; Ambiguous | "486" ; Busy Here | "487" ; Request Terminated | "488" ; Not Acceptable Here Figure 6: Client error status codes Server-Error = "500" ; Internal Server Error | "501" ; Not Implemented | "502" ; Bad Gateway | "503" ; Service Unavailable | "504" ; Server Time-out | "505" ; SIP Version not supported Figure 7: Server error status codes SIP header fields are similar to HTTP header fields in both syntax and semantics. In particular, SIP header fields follow the syntax for message-header as described in [H4.2]. The rules for extending header Handley/Schulzrinne/Schooler/Rosenberg [Page 44] Internet Draft SIP May 29, 2001 Global-Failure = "600" ; Busy Everywhere | "603" ; Decline | "604" ; Does not exist anywhere | "606" ; Not Acceptable Figure 8: Global failure status codes fields over multiple lines, and use of multiple message-header fields with the same field-name, described in [H4.2] also apply to SIP. The rules in [H4.2] regarding ordering of header fields apply to SIP, with the exception of Via fields, see below, whose order matters. The header fields required, optional and not applicable for each method are listed in Table 4 and Table 5. The table uses "o" to indicate optional, "m" mandatory and "-" for not applicable. "Optional" means that a UA MAY include the header field in a request or response, and a UA MAY ignore the header field if present in the request or response. A "mandatory" request header field MUST be present in a request, and MUST be understood by the UAS receiving the request. A mandatory response header field MUST be present in the response, and the header field MUST be understood by the UAC processing the response. "Not applicable" means for request header fields that the header field MUST NOT be present in a request. If one is placed in a request by mistake, it MUST be ignored by the UAS receiving the request. Similarly, a header field labeled "not applicable" for a response means that the UAS MUST NOT place the header in the response, and the UAC MUST ignore the header in the response. "m*" indicates a header that SHOULD be sent, but servers need to be prepared to receive requests without that header field. A "*" indicates that the header fields are required if the message body is not empty. See sections 10.18, 10.19 and 12 for details. The "where" column describes the request and response types with which the header field can be used. "R" refers to header fields that can be used in requests (that is, request and general header fields). "r" designates a response or general-header field as applicable to all responses, while a list of numeric values indicates the status codes with which the header field can be used. "g" and "e" designate general (Section 10.1) and entity header (Section 10.2) fields, respectively. If a header field is marked "c", it is copied from the request to the response. The "proxy" column describes whether proxies can add comma-separated elements to headers ("c", for concatenate or comma), can modify the Handley/Schulzrinne/Schooler/Rosenberg [Page 45] Internet Draft SIP May 29, 2001 header ("m"), can add the header if not present ("a") or need to read the header ("r"). Headers that need to be read cannot be encrypted. Proxies MUST NOT alter any fields that are authenticated (see Section 18.2), but MAY add copies of fields that were authenticated by the UA if indicated in the table. Depending on local policy, proxies MAY inspect any non-encrypted header fields and MAY modify any non- authenticated header field, but proxies cannot rely on fields other than the ones indicated in the table to be readable or modifiable. If authentication is used, the rules in Section 18.2 apply. Proxies SHOULD NOT re-order header fields. Other header fields can be added as required; a server MUST ignore header fields not defined in this specification that it does not understand. A proxy MUST NOT remove or modify header fields not defined in this specification that it does not understand. A compact form of these header fields is also defined in Section 13 for use over UDP when the request has to fit into a single packet and size is an issue. Table 6 in Appendix A lists those header fields that different client and server types MUST be able to parse. 10.1 General Header Fields General header fields apply to both request and response messages. The "general-header" field names can be extended reliably only in combination with a change in the protocol version. However, new or experimental header fields MAY be given the semantics of general header fields if all parties in the communication recognize them to be "general-header" fields. Unrecognized header fields are treated as "entity-header" fields. 10.2 Entity Header Fields The "entity-header" fields define meta-information about the message-body or, if no body is present, about the resource identified by the request. The term "entity header" is an HTTP 1.1 term where the response body can contain a transformed version of the message body. The original message body is referred to as the "entity". We retain the same terminology for header fields but usually refer to the "message body" rather then the entity as the two are the same in SIP. 10.3 Request Header Fields Handley/Schulzrinne/Schooler/Rosenberg [Page 46] Internet Draft SIP May 29, 2001 Header field where proxy ACK BYE CAN INV OPT REG __________________________________________________________ Accept R - o o o o o Accept 415 - o o o o o Accept 2xx - - - o o o Accept-Encoding R - o o o o o Accept-Encoding 2xx - - - o o o Accept-Encoding 415 - o o o o o Accept-Language R - o o o o o Accept-Language 2xx - - - o o o Accept-Language 415 - o o o o o Alert-Info R am - - - o - - Allow R o o o o o o Allow 200 - - - o o o Allow 405 m m m m m m Authorization R o o o o o o Authorization r o o o o o o Call-ID gc r m m m m m m Call-Info g am - - - o o o Contact R o - - m o o Contact 1xx - - - o o - Contact 2xx - - - m o o Contact 3xx - o - o o o Contact 485 - o - o o o Content-Disposition e o o - o o o Content-Encoding e o o - o o o Content-Language e o o - o o o Content-Length e r m* m* m* m* m* m* Content-Type e * * - * * * CSeq gc r m m m m m m Date g a o o o o o o Encryption g r o o o o o o Error-Info R o o o o o o Expires g - - - o - o From gc r m m m m m m In-Reply-To R - - - o - - Max-Forwards R rm o o o o o o MIME-Version g o o o o o o Organization g am - - - o o o Table 4: Summary of header fields, A--O The "request-header" fields allow the client to pass additional information about the request, and about the client itself, to the server. These fields act as request modifiers, with semantics equivalent to the parameters of a programming language method invocation. Handley/Schulzrinne/Schooler/Rosenberg [Page 47] Internet Draft SIP May 29, 2001 Header field where proxy ACK BYE CAN INV OPT REG ___________________________________________________________________ Priority R a - - - o - - Proxy-Authenticate 401,407 o o o o o o Proxy-Authorization R r o o o o o o Proxy-Require R r o o o o o o Record-Route R amr o o o o o o Record-Route 2xx,401,484 o o o o o o Require g acr o o o o o o Response-Key R - o o o o o Retry-After 404,413,480,486 o o o o o o 500,503 o o o o o o 600,603 o o o o o o Route R r o o o o o o Server r o o o o o o Subject R - - - o - - Supported g - o o o o o Timestamp g o o o o o o To gc(1) r m m m m m m Unsupported R o o o o o o Unsupported 420 o o o o o o User-Agent g o o o o o o Via gc acmr m m m m m m Warning r o o o o o o WWW-Authenticate R o o o o o o WWW-Authenticate 401 o o o o o o Table 5: Summary of header fields, P--Z; (1): copied with possible addition of tag The "request-header" field names can be extended reliably only in combination with a change in the protocol version. However, new or experimental header fields MAY be given the semantics of "request- header" fields if all parties in the communication recognize them to be request-header fields. Unrecognized header fields are treated as "entity-header" fields. 10.4 Response Header Fields The "response-header" fields allow the server to pass additional information about the response which cannot be placed in the Status- Line. These header fields give information about the server and about further access to the resource identified by the Request-URI. Response-header field names can be extended reliably only in combination with a change in the protocol version. However, new or experimental header fields MAY be given the semantics of "response- Handley/Schulzrinne/Schooler/Rosenberg [Page 48] Internet Draft SIP May 29, 2001 header" fields if all parties in the communication recognize them to be "response-header" fields. Unrecognized header fields are treated as "entity-header" fields. 10.5 Header Field Format Header fields ("general-header", "request-header", "response-header", and "entity-header") follow the same generic header format as that given in Section 3.1 of RFC 822 [25]. Each header field consists of a name followed by a colon (":") and the field value. Field names are case-insensitive. The field value MAY be preceded by any amount of leading white space (LWS), though a single space (SP) is preferred. Header fields can be extended over multiple lines by preceding each extra line with at least one SP or horizontal tab (HT). Applications MUST follow HTTP "common form" when generating these constructs, since there might exist some implementations that fail to accept anything beyond the common forms. message-header = field-name ":" [ field-value ] CRLF field-name = token field-value = *( field-content | LWS ) field-content = < the OCTETs making up the field-value and consisting of either *TEXT-UTF8 or combinations of token, separators, and quoted-string> The relative order of header fields with different field names is not significant. Multiple header fields with the same field-name may be present in a message if and only if the entire field-value for that header field is defined as a comma-separated list (i.e., #(values)). It MUST be possible to combine the multiple header fields into one "field-name: field-value" pair, without changing the semantics of the message, by appending each subsequent field-value to the first, each separated by a comma. The order in which header fields with the same field-name are received is therefore significant to the interpretation of the combined field value, and thus a proxy MUST NOT change the order of these field values when a message is forwarded. Unless otherwise stated, parameter names, parameter values and tokens are case-insensitive. Values expressed as quoted strings are case- sensitive. The Contact, From and To header fields contain a URL. If the URL contains a comma, question mark or semicolon, the URL MUST be enclosed in angle brackets (< and >). Any URL parameters are Handley/Schulzrinne/Schooler/Rosenberg [Page 49] Internet Draft SIP May 29, 2001 contained within these brackets. If the URL is not enclosed in angle brackets, any semicolon-delimited parameters are header-parameters, not URL parameters. 10.6 Accept The Accept header follows the syntax defined in [H14.1]. The semantics are also identical, with the exception that if no Accept header is present, the server SHOULD assume a default value of application/sdp As a request-header field, it is used only with those methods that take message bodies. In a 415 (Unsupported Media Type) response, it indicates which content types are acceptable in requests. In 200 (OK) responses for INVITE, it lists the content types acceptable for future requests in this call. Example: Accept: application/sdp;level=1, application/x-private, text/html 10.7 Accept-Encoding The Accept-Encoding general-header field is similar to Accept, but restricts the content-codings [H3.5] that are acceptable in the response. See [H14.3]. The syntax of this header is defined in [H14.3]. The semantics in SIP are identical to those defined in [H14.3]. Note: An empty Accept-Encoding header field is permissible, even though the syntax in [H14.3] does not provide for it. It is equivalent to Accept-Encoding: identity, i.e., only the identity encoding, meaning no encoding, is permissible. If no Accept-Encoding header field is present in a request, the server MUST use the "identity" encoding. HTTP/1.1 [H14.3] states that the server SHOULD use the "identity" encoding unless it has additional information about the capabilities of the client. This is needed for backwards-compatibility with old HTTP clients and does not affect SIP. Handley/Schulzrinne/Schooler/Rosenberg [Page 50] Internet Draft SIP May 29, 2001 10.8 Accept-Language The Accept-Language general-header follows the syntax defined in [H14.4]. The rules for ordering the languages based on the q parameter apply to SIP as well. When used in SIP, the Accept-Language general-header field can be used to allow the client to indicate to the server in which language it would prefer to receive reason phrases, session descriptions or status responses carried as message bodies. A proxy MAY use this field to help select the destination for the call, for example, a human operator conversant in a language spoken by the caller. Example: Accept-Language: da, en-gb;q=0.8, en;q=0.7 10.9 Alert-Info The Alert-Info header field indicates that the content indicated in the URLs should be rendered instead of ring tone. A user SHOULD be able to disable this feature selectively to prevent unauthorized disruptions. Alert-Info = "Alert-Info" ":" # ( "<" URI ">" *( ";" generic-param )) generic-param = token [ "=" ( token | host | quoted-string ) ] Example: Alert-Info: <http://wwww.example.com/sounds/moo.wav> 10.10 Allow The Allow header field lists the set of methods supported by the resource identified by the Request-URI. The purpose of this field is strictly to inform the recipient of valid methods associated with the resource. An Allow header field MUST be present in a 405 (Method Not Allowed) response, SHOULD be present in an OPTIONS response SHOULD be present in the 200 (OK) response to the initial INVITE for a call and MAY be present in final responses for other methods. All methods, including ACK and CANCEL, understood by the UAS are included. Handley/Schulzrinne/Schooler/Rosenberg [Page 51] Internet Draft SIP May 29, 2001 The Allow header field MAY also be included in requests, to indicate the requestor's capabilities for this Call-ID. Supplying an Allow header in responses to methods other than OPTIONS cuts down on the number of messages needed. Allow = "Allow" ":" 1#Method 10.11 Authorization A user agent that wishes to authenticate itself with a UAS or registrar -- usually, but not necessarily, after receiving a 401 response -- MAY do so by including an Authorization header field with the request. The Authorization field value consists of credentials containing the authentication information of the user agent for the realm of the resource being requested. Section 18.2 overviews the use of the Authorization header field, and Section 19 describes the syntax and semantics when used with HTTP Basic and Digest authentication. 10.12 Call-ID The Call-ID general-header field uniquely identifies a particular invitation or all registrations of a particular client. Note that a single multimedia conference can give rise to several calls with different Call-IDs, e.g., if a user invites a single individual several times to the same (long-running) conference. For an INVITE request, a callee user agent server SHOULD NOT alert the user if the user has responded previously to the Call-ID in the INVITE request. If the user is already a member of the conference and the conference parameters contained in the session description have not changed, a callee user agent server MAY silently accept the call, regardless of the Call-ID. An invitation for an existing Call-ID or session can change the parameters of the conference. A client application MAY decide to simply indicate to the user that the conference parameters have been changed and accept the invitation automatically or it MAY require user confirmation. A user may be invited to the same conference or call using several different Call-IDs. If desired, the client MAY use identifiers within the session description to detect this duplication. For example, SDP contains a session id and version number in the origin (o) field. Handley/Schulzrinne/Schooler/Rosenberg [Page 52] Internet Draft SIPNovember 24, 2000 HeaderMay 29, 2001 The REGISTER and OPTIONS methods use the Call-ID value (in addition to the CSeq value) to unambiguously match requests and responses. All REGISTER requests issued by a single client SHOULD use the same Call-ID, at least within the same boot cycle. For these requests, it makes no difference whether the Call-ID value matches an existing call or not. Since the Call-ID is generated by and for SIP, there is no reason to deal with the complexity of URL-encoding and case-ignoring string comparison. callid = token [ "@" token ] Call-ID = ( "Call-ID" | "i" ) ":" callid The callid MUST be a globally unique identifier and MUST NOT be reused for later calls. Use of cryptographically random identifiers [28] is RECOMMENDED. Implementations MAY use the form "localid@host". Call-IDs are case-sensitive and are simply compared byte-by-byte. Using cryptographically random identifiers provides some protection against session hijacking. Call-ID, To and From are needed to identify a call leg. The distinction between call and call leg matters in calls with third-party control. For systems which have tight bandwidth constraints, many of the mandatory SIP headers have a compact form, as discussed in Section 13. These are alternate names for the headers which occupy less space in the message. In the case of Call-ID, the compact form is i. For example, both of the following are valid: Call-ID: f81d4fae-7dec-11d0-a765-00a0c91e6bf6@foo.bar.com or i:f81d4fae-7dec-11d0-a765-00a0c91e6bf6@foo.bar.com 10.13 Call-Info Handley/Schulzrinne/Schooler/Rosenberg [Page 53] Internet Draft SIP May 29, 2001 The Call-Info general header field provides additional information about the caller or callee, depending on whether it is found in a request or response. The purpose of the URI is described by the "purpose" parameter. "icon" designates an image suitable as an iconic representation of the caller or callee; "info" describes the caller or callee in general, e.g., through a web page; "card" provides a business card (e.g., in vCard [29] or LDIF [30] formats). Call-Info = "Call-Info" ":" # ( "<" URI ">" *( ";" info-param) ) info-param = "purpose" "=" ( "icon" | "info" | "card" | token ) | generic-param Example: Call-Info: <http://wwww.example.com/alice/photo.jpg> ;purpose=icon, <http://www.example.com/alice/> ;purpose=info 10.14 Contact Among the methods discussed in this specification, the Contact general-header field can appear in INVITE, OPTIONS, ACK, and REGISTER requests, and in 1xx, 2xx, 3xx, and 485 responses. Other methods defined elsewhere may allow or require the use of the Contact header field. This is generally necessary if the recipient of this method needs to send requests to the originator. In general, it provides a URL where the user can be reached for further communications. In some of the cases below, the client uses information from the Contact header field in Request-URI of future requests. In these cases, the client copies all but the "method-param" and "header" elements of the addr-spec part of the Contact header fieldwhereinto the Request-URI of the request. It uses the "header" parameters to create headers for the request, replacing any default headers normally used. Unless the client is configured to use a default proxy for all outgoing requests, it then directs the request to the address and port specified by the "maddr" and "port" parameters, using the transport protocol given in the "transport" parameter. If "maddr" is a multicast address, the value of "ttl" is used as the time-to-live value. INVITE, OPTIONS and ACKBYE CAN INV OPT REG __________________________________________________________ Accept R - o o o o o Accept 415 - o o o o o Accept r - - - o o o Accept-Encoding R - o o o o o Accept-Encoding 415 - o o o o o Accept-Language R - o o o o o Accept-Language 415 - o o o o o Alert-Info R am - - - o - - Allow R o o o o o o Allow 200 - - - o o o Allow 405 m m m m m m Also R - o - - - - Authorization R o o o o o o Authorization r o o o o o o Call-ID gc r m m m m m m Call-Info g am - - - o o orequests: INVITE requests MUST, and ACK requests MAY contain a single ContactR o - - m o oheader indicating a single URI from which location the request is originating. Handley/Schulzrinne/Schooler/Rosenberg [Page 54] Internet Draft SIP May 29, 2001 The URI SHOULD contain the address of the client itself (i.e., its IP address, or a FQDN for the host, or an SRV record with the highest priority entry beingan FQDN of that host). See Section 16 for usage of the Contact header for routing subsequent requests. For OPTIONS, Contact provides a hint where future SIP requests can be sent or the user can be contacted via non-SIP means. This allows the callee to send future requests, such as BYE, directly to the caller instead of through a series of proxies. The Via header is not sufficient since the desired address may be that of a proxy. INVITE 1xx responses: A UAS sending a provisional response (1xx) MAY insert a Contact response header. It has the same semantics in a 1xx response as a 2xx INVITE response. Note that CANCEL requests MUST NOT be sent to that address, but rather follow the same path as the original request. INVITE and OPTIONS 2xx responses: A user agent server sending a definitive, positive response (2xx) MUST insert a single Contact response header field indicating a single SIP URI under which it is reachable most directly for future SIP requests, such as ACK, within the same call leg. The URI SHOULD contain the address of the server itself (i.e., its IP address, or a FQDN for the host, or an SRV record with the highest priority entry beingan FQDN of that host). See Section 16 for usage of the Contact header for routing subsequent requests. If a UA supports both UDP and TCP, it SHOULD NOT indicate a transport parameter in the URI. The Contact1xx - - - o o -value SHOULD NOT be cached across calls, as it may not represent the most desirable location for a particular destination address. REGISTER requests and responses: See Section 7. The Contact2xx - - - m o oheader value of "*" is only used in REGISTER requests. 3xx and 485 responses: The Contact response-header field can be used with a 3xx- o - o o oor 485 (Ambiguous) response codes to indicate one or more alternate addresses to try. It can appear in responses to BYE, INVITE and OPTIONS methods. The Contact header field contains URIs giving the new locations or user names to try, or may simply specify additional Handley/Schulzrinne/Schooler/Rosenberg [Page 55] Internet Draft SIP May 29, 2001 transport parameters. A 300 (Multiple Choices), 301 (Moved Permanently), 302 (Moved Temporarily) or 485- o - o o o Content-Disposition e o o - o o o Content-Encoding e o o - o o o Content-Language e o o o o o o Content-Length e r m* m* m* m* m* m* Content-Type e * * - * * * CSeq gc r m m m m m m Date g(Ambiguous) response SHOULD contain a Contact field containing URIs of new addresses to be tried. A 301 or 302 response may also give the same location and username that was being tried but specify additional transport parameters such as a different server or multicast address to try or a change of SIP transport from UDP to TCP or vice versa. The client copies information from the Contact header field into the Request-URI as described above. 4xx, 5xx and 6xx responses: The Contact response-header field can be used with a 4xx, 5xx or 6xx response to indicate the location where additional information about the error can be found. Note that the Contact header field MAY also refer to a different entity than the one originally called. For example, a SIP call connected to GSTN gateway may need to deliver a special information announcement such as "The number you have dialed has been changed." A Contact response header field can contain any suitable URI indicating where the called party can be reached, not limited to SIP URLs. For example, it could contain URL's for phones, fax, or irc (if they were defined) or a mailto: (RFC 2368, [31]) URL. The following parameters are defined. Additional parameters may be defined in other specifications. q: The "qvalue" indicates the relative preference among the locations given. "qvalue" values are decimal numbers from 0 to 1, with higher values indicating higher preference. The default value is 0.5. action: The "action" parameter is used only when registering with the REGISTER request. It indicates whether the client wishes that the server proxy or redirect future requests intended for the client. If this parameter is not specified the action taken depends on server configuration. In its response, the registrar SHOULD indicate the mode used. This parameter is ignored for other requests. expires: The "expires" parameter indicates how long the URI is valid. The parameter is either ao o o o o o Encryption g r o o o o o o Error-Info R o o o o o o Expires g - - - o - o From gc r m m m m m m In-Reply-To R - - - o - - Max-Forwards R rm o o o o o o MIME-Version g o o o o o o Organization g am - - - o o o Table 4: Summarynumber indicating seconds or a quoted string containing a SIP-date. If this parameter is not provided, the value of the Expires headerfields, A--O Otherfield determines how long the URI is valid. Implementations MAY treat values larger than 2**32-1 (4294967295 seconds or 136 Handley/Schulzrinne/Schooler/Rosenberg [Page 56] Internet Draft SIP May 29, 2001 years) as equivalent to 2**32-1. Contact = ( "Contact" | "m" ) ":" ("*" | (1# (( name-addr | addr-spec ) [ *( ";" contact-params ) ] [ comment ] ))) name-addr = [ display-name ] "<" addr-spec ">" addr-spec = SIP-URL | URI display-name = *token | quoted-string contact-params = "q" "=" qvalue | "action" "=" "proxy" | "redirect" | "expires" "=" delta-seconds | <"> SIP-date <"> | extension-attribute extension-attribute = extension-name [ "=" extension-value ] Even if the "display-name" is empty, the "name-addr" form MUST be used if the "addr-spec" contains a comma, semicolon or question mark. Note that there may or may not be LWS between the display-name and the "<". The Contact headerfieldsfield fulfills functionality similar to the Location header field in HTTP. However, the HTTP header only allows one address, unquoted. Since URIs canbe addedcontain commas and semicolons asrequired;reserved characters, they can be mistaken for header or parameter delimiters, respectively. The current syntax corresponds to that for the To and From header, which also allows the use of display names. Example: Contact: "Mr. Watson" <sip:watson@worcester.bell-telephone.com> ;q=0.7; expires=3600, "Mr. Watson" <mailto:watson@bell-telephone.com> ;q=0.1 10.15 Content-Disposition Content-Disposition = "Content-Disposition" ":" Handley/Schulzrinne/Schooler/Rosenberg [Page 57] Internet Draft SIP May 29, 2001 disposition-type *( ";" disposition-param ) disposition-type = "render" | "session" | "icon" | "alert" | disp-extension-token disposition-param = "handling" "=" ( "optional" | "required" | other-handling ) | generic-param other-handling = token disp-extension-token = token The Content-Disposition header field describes how the message body or, in the case of multipart messages, aserver MUST ignoremessage body part is to be interpreted by the UAC or UAS. The SIP headerfieldsextends the MIME Content-Type (RFC 1806 [32]). The value "session" indicates that the body part describes a session, for either calls or early (pre-call) media. The value "render" indicates that the body part should be displayed or otherwise rendered to the user. For backward-compatibility, if the Content- Disposition header is notdefined in this specificationmissing, bodies of Content-Type application/sdp imply the disposition "session", while other content types imply "render". The disposition type "icon" indicates that the body part contains an image suitable as an iconic representation of the caller or callee. The value "alert" indicates that the body part contains information, such as an audio clip, that should be rendered instead of ring tone. The handling parameter, handling-parm, describes how the UAS should react if itdoes not understand. A proxy MUSTNOT removereceives a message body whose content type ormodify header fields not defined in this specification thatdisposition type it does not understand.A compact form of theseIf the parameter has the value "optional", the UAS MUST ignore the message body; if it has the value "required", the UAS MUST return 415 (Unsupported Media Type). If the handling parameter is missing, the value "required" is to be assumed. If this headerfieldsfield isalso defined in Section 9 for use overmissing, the MIME type determines the default content disposition. If there is none, "render" is assumed. 10.16 Content-Encoding Content-Encoding = ( "Content-Encoding" | "e" ) ":" 1#content-coding The Content-Encoding entity-header field is used as a modifier to the "media-type". When present, its value indicates what additional Handley/Schulzrinne/Schooler/Rosenberg [Page44]58] Internet Draft SIPNovember 24, 2000 Header field where proxy ACK BYE CAN INV OPT REG ___________________________________________________________________ Priority RMay 29, 2001 content codings have been applied to the entity-body, and thus what decoding mechanisms MUST be applied in order to obtain the media-type referenced by the Content-Type header field. Content-Encoding is primarily used to allow a- - - o - - Proxy-Authenticate 401,407 o o o o o o Proxy-Authorization R r o o o o o o Proxy-Require R r o o o o o o Record-Route R amr o o o o o o Record-Route 2xx,401,484 o o o o o o Require g acr o o o o o o Response-Key R - o o o o o Retry-After R - - - - - o Retry-After 404,413,480,486 o o o o o o 500,503 o o o o o o 600,603 o o o o o o Route R r o o o o o o Server r o o o o o o Subject R - - - o - - Supported g - o o o o o Timestamp g o o o o o o To gc(1) r m m m m m m Unsupported R o o o o o o Unsupported 420 o o o o o o User-Agent g o o o o o o Via gc acmr m m m m m m Warning r o o o o o o WWW-Authenticate R o o o o o o WWW-Authenticate 401 o o o o o o Table 5: Summarybody to be compressed without losing the identity of its underlying media type. If multiple encodings have been applied to an entity, the content codings MUST be listed in the order in which they were applied. All content-coding values are case-insensitive. The Internet Assigned Numbers Authority (IANA) acts as a registry for content-coding value tokens. See [H3.5] for a definition of the syntax for content-coding. Clients MAY apply content encodings to the body in requests. If the server is not capable of decoding the body, or does not recognize any of the content-coding values, it MUST send a 415 "Unsupported Media Type" response, listing acceptable encodings in the Accept-Encoding header. A server MAY apply content encodings to the bodies in responses. The server MUST only use encodings listed in the Accept- Encoding headerfields, P--Z; (1): copied with possible additionin the request. 10.17 Content-Language See [H14.12]. 10.18 Content-Length The Content-Length entity-header field indicates the size oftag UDP whentherequest hasmessage-body, in decimal number of octets, sent tofit into a single packet andthe recipient. Content-Length = ( "Content-Length" | "l" ) ":" 1*DIGIT An example is Content-Length: 3495 Applications SHOULD use this field to indicate the size of the message-body to be transferred, regardless of the media type of the entity. (The size of the message-body does not include the CRLF separating headers and body.) Any Content-Length greater than or equal to zero isan issue. Table 6a valid value. If no body is present inAppendix A lists thosea message, then the Content-Length headerfields that different client and server typesfield MUST beable to parse. 6.1 General Header Fields General header fields applyset tobothzero. If a server receives a datagram request without Content-Length, it MUST Handley/Schulzrinne/Schooler/Rosenberg [Page 59] Internet Draft SIP May 29, 2001 assume that the request encompasses the remainder of the packet. If a server receives a datagram requestand response messages. The "general-header" field names can be extended reliably only in combinationwith achangeContent-Length, but the value differs from the size of the body sent in theprotocol version. However, newrequest, the server SHOULD return a 400 (Bad Request) response. If a response does not contain a Content-Length, the client assumes that it encompasses the remainder of the datagram packet orexperimentalthe data until the stream connection is closed, as applicable. Section 12 describes how to determine the length of the message body. The ability to omit Content-Length simplifies the creation of cgi-like scripts that dynamically generate responses. 10.19 Content-Type The Content-Type entity-header field indicates the media type of the message-body sent to the recipient. The "media-type" element is defined in [H3.7]. The Content-Type headerfields MAYMUST begivenpresent if thesemantics of generalbody is not empty. If the body is empty, and a Content-Length headerfieldsis present, it indicates that the body of the specific type has zero length (for example, ifall parties init is an emtpy audio file). Content-Type = ( "Content-Type" | "c" ) ":" media-type Examples of this header field are Content-Type: application/sdp Content-Type: text/html; charset=ISO-8859-4 10.20 CSeq Clients MUST add thecommunication recognize themCSeq (command sequence) general-header field tobe "general-header" fields. Unrecognizedevery request. A CSeq headerfields are treatedfield in a request contains the request method and a single decimal sequence number. The sequence number MUST be expressible as"entity-header" fields.a 32-bit unsigned integer. A server MUST echo the CSeq value from the request in its response. The CSeq header serves to order transactions within a call leg, and to provide a means to uniquely identify transactions. CSeq = "CSeq" ":" 1*DIGIT Method Handley/Schulzrinne/Schooler/Rosenberg [Page45]60] Internet Draft SIPNovember 24, 2000 6.2 Entity Header Fields The "entity-header" fields define meta-information about the message-body or, if no body is present, aboutMay 29, 2001 For requests that are outside of a call leg, or for a request that initiates a session, theresource identified byvalue of therequest. The term "entity header"sequence number is arbitrary, but MUST be less than 2**31. For requests which are subsequent ones within anHTTP 1.1 term whereexisting call leg (such as a re-INVITE or BYE), theresponse body canCSeq header MUST contain strictly monotonically increasing and contiguous (increasing-by-one) sequence numbers; sequence numbers do not wrap around. Retransmissions of the same request carry the same CSeq value. For requests outside of atransformed versioncall leg, ordering is irrelevant, and so the value of themessage body.CSeq number in requests received by a UAS is not important. For requests within a call leg, ordering is important. Therefore, a UAS MUST remember the highest sequence number for any request received within a call leg. Theoriginal message bodyserver MUST reject, using a 400 class response, any request within a call leg with a lower sequence number. Any request that isreferred to asreceived with a sequence number higher than the"entity". We retainhighest received so far (even it is higher by more than one), SHOULD be accepted. If a client initiates a session, and receives multiple 200 class responses, each establishes a separate call leg. For subsequent requests within each of those call legs (each of which differs only by thesame terminology for header fields but usually refer totag in the"message body" rather thenTo field), theentity asCSeq numbers increment independently from thetwo areother call legs. Furthermore, thesameCSeq numbering space is unique inSIP. 6.3 Request Header Fields The "request-header" fields alloweach direction. That is, theclientCSeq values in requests from A topass additional information about the request, and aboutB are independent of theclient itself,values in requests from B to A. The ACK request MUST contain theserver. These fields actsame CSeq numeric value as the INVITE requestmodifiers,that it refers to, but withsemantics equivalent to the parameters ofaprogramming language method invocation.Method of "ACK". The"request-header" field names can be extended reliably only in combination with a change inCANCEL request MUST contain theprotocol version. However, new or experimental header fields MAY be givensame CSeq numeric value as thesemanticsrequest it cancels, but with a Method of"request- header" fields if all parties in the communication recognize them to be request-header fields. Unrecognized header fields are treated as "entity-header" fields. 6.4 Response Header Fields"CANCEL". The"response-header" fields allowMethod value allows theserverclient topass additional information aboutdistinguish the responsewhich cannot be placed in the Status- Line. These header fields give information about the server and about further accessto a CANCEL request from that of theresource identified by the Request-URI. Response-header field namesrequest it is cancelling. CANCEL requests can beextended reliably only in combinationgenerated by proxies; if they were to increase the sequence number, it might conflict with achange in the protocol version. However, new or experimental header fields MAY be given the semantics of "response- header" fields if all parties inlater request issued by thecommunication recognize them to be "response-header" fields. Unrecognized header fields are treated as "entity-header" fields. 6.5 Header Field Format Header fields ("general-header", "request-header", "response-header", and "entity-header") followuser agent for the samegeneric header format as that given in Section 3.1 of RFC 822 [26]. Each header field consistscall. With a length of 32 bits, aname followed byserver could generate, within acolon (":") and the field value. Field names are case-insensitive.single call, one request a second for about 136 years before needing to wrap around. Thefieldinitial valueMAY be preceded by any amountofleading white space (LWS), though a single space (SP)the sequence number ispreferred.chosen so that subsequent requests within the same call will not wrap around. A non-zero initial value allows to use a time-based initial sequence number, if the client desires. A client could, for example, choose the 31 most significant bits of a 32-bit second clock as an initial sequence number. Example: Handley/Schulzrinne/Schooler/Rosenberg [Page46]61] Internet Draft SIPNovember 24, 2000 Header fields can be extended over multiple lines by preceding each extra line with at least one SP or horizontal tab (HT). Applications MUST follow HTTP "common form" when generating these constructs, since there might exist some implementations that fail to accept anything beyond the common forms. message-headerMay 29, 2001 CSeq: 4711 INVITE 10.21 Date Date is a general-header field. Its syntax is: Date =field-name"Date" ":"[ field-value ] CRLF field-name = token field-value = *( field-content | LWS ) field-contentSIP-date SIP-date =<rfc1123-date See [H14.18] for a definition of rfc1123-date. Note that unlike HTTP/1.1, SIP only supports theOCTETs making upmost recent RFC 1123 [33] formatting for dates. As in [H3.3], SIP restricts thefield-valuetimezone in SIP-date to "GMT", while RFC 1123 allows any timezone. The consistent use of GMT between Date, Expires andconsistingRetry- After headers allows implementation ofeither *TEXT-UTF8 or combinationssimple clients that do not have a notion oftoken, separators, and quoted-string>absolute time. Note that rfc1123- date is case-sensitive. Therelative order ofDate headerfields with differentfieldnamesreflects the time when the request or response isnot significant. Multiple header fields withfirst sent. Thus, retransmissions have the samefield-name may be presentDate header field value as the original. Registrars MUST include this header ina messageREGISTER responses if they use absolute expiration times andonly if the entire field-valueSHOULD include it forthatall responses. The Date header fieldis defined as a comma-separated list (i.e., #(values)). It MUSTcan bepossible to combine the multiple header fields into one "field-name: field-value" pair, without changing the semantics of the message,used byappending each subsequent field-valuesimple end systems without a battery-backed clock tothe first, each separated byacquire acomma. The ordernotion of current time. However, inwhich header fields with the same field-name are received is therefore significantits GMT-form, it requires clients to know their offset from GMT. 10.22 Encryption The Encryption general-header field specifies that theinterpretation ofcontent has been encrypted. Section 18 describes thecombined field value,overall SIP security architecture andthus a proxy MUSTNOT change the order of thesealgorithms. This header fieldvalues when a messageisforwarded. Unless otherwise stated, parameter names, parameter values and tokens are case-insensitive. Values expressed as quoted strings are case- sensitive. The Contact, From and To header fields contain a URL. If the URL contains a comma, question mark or semicolon, the URL MUST be enclosed in angle brackets (<intended for end- to-end encryption of requests and>). Any URL parametersresponses. Requests arecontained within these brackets. Ifencrypted based on theURL is not enclosedpublic key belonging to the entity named inangle brackets, any semicolon-delimited parameters are header-parameters, not URL parameters. 6.6 Accept The Acceptthe To headerfollowsfield. Responses are encrypted based on thesyntax definedpublic key conveyed in[H14.1]. The semantics are also identical, withtheexception that if no AcceptResponse-Key headeris present,field. Note that theserver SHOULD assume a default value of application/sdp As a request-header field, it ispublic keys themselves may not be usedonly with those methods thatfor the encryption. This depends on the particular algorithms used. Handley/Schulzrinne/Schooler/Rosenberg [Page47]62] Internet Draft SIPNovember 24, 2000 take message bodies. In a 415 (Unsupported Media Type) response, it indicates which content types are acceptable in requests. In 200 (OK) responses for INVITE, it lists the content types acceptable for future requests in this call. Example: Accept: application/sdp;level=1, application/x-private, text/html 6.7 Accept-Encoding The Accept-Encoding general-header field is similar to Accept, but restricts the content-codings [H3.4.1] that are acceptable inMay 29, 2001 For any encrypted message, at least theresponse. See [H14.3]. The syntax of thismessage body and possibly other message headeris defined in [H14.3]. The semantics in SIPfields areidentical to those defined in [H14.3]. Note:encrypted. Anempty Accept-Encodingapplication receiving a request or response containing an Encryption header fieldis permissible, even thoughdecrypts thesyntax in [H14.3] does not provide for it. It is equivalentbody and then concatenates the plaintext toAccept-Encoding: identity, i.e., onlytheidentity encoding, meaning no encoding, is permissible. If no Accept-Encoding header field is present in a request,request line and headers of theserver MUST useoriginal message. Message headers in the"identity" encoding. HTTP/1.1 [H14.3] states thatdecrypted part completely replace those with theserver SHOULD usesame field name in the"identity" encoding unless it has additional information aboutplaintext part. (Note: If only thecapabilitiesbody of theclient. Thismessage isneeded for backwards-compatibilityto be encrypted, the body has to be prefixed withold HTTP clientsCRLF to allow proper concatenation.) Note that the request method anddoes not affect SIP. 6.8 Accept-Language The Accept-Language general-header followsRequest-URI cannot be encrypted. Encryption only provides privacy; thesyntax definedrecipient has no guarantee that the request or response came from the party listed in[H14.4]. The rules for orderingthelanguages based onFrom message header, only that theq parameter apply to SIP as well. Whensender usedin SIP,theAccept-Language general-header field canrecipient's public key. However, proxies will not beusedable toallowmodify theclient to indicate torequest or response. Encryption = "Encryption" ":" encryption-scheme 1*SP #encryption-params encryption-scheme = token encryption-params = generic-param The token indicates theserver in which languageform of encryption used; itwould prefer to receive reason phrases, session descriptions or status responses carried as message bodies. A proxy MAY use this field to help selectis described in Section 18. Since proxies can base their forwarding decision on any combination of SIP header fields, there is no guarantee that an encrypted request "hiding" header fields will reach the same destinationfor the call, for example, a human operator conversant inas an otherwise identical un-encrypted request. 10.23 Error-Info The Error-Info response header provides alanguage spoken bypointer to additional information about thecaller. Handley/Schulzrinne/Schooler/Rosenberg [Page 48] Internet Draft SIP November 24, 2000 Example: Accept-Language: da, en-gb;q=0.8, en;q=0.7 6.9 Alert-Info The Alert-Infoerror status response. This header fieldindicates that the content indicatedis only contained inthe URLs should be rendered instead of ring tone. A user SHOULD be able to disable this feature selectively to prevent unauthorized disruptions. Alert-Info3xx, 4xx, 5xx and 6xx responses. Error-Info ="Alert-Info""Error-Info" ":" # ( "<" URI ">" *( ";" generic-param ))generic-param = token [ "=" ( token | host | quoted-string ) ] Example: Alert-Info: <http://wwww.example.com/sounds/moo.wav> 6.10 Allow The Allow header field lists the set of methods supported by the resource identified by the Request-URI.10.24 Expires Thepurpose of this field is strictly to inform the recipient of valid methods associated with the resource. An Allow headerExpires entity-header fieldMUST be present in a 405 (Method Not Allowed) response, SHOULD be present in an OPTIONS response SHOULD be present in the 200 (OK) response togives theinitial INVITE for a call and MAY be present in final responses for other methods. All methods, including ACKdate andCANCEL, understood by the UAS are included. The Allow header field MAY also be included in requests, to indicate the requestor's capabilities for this Call-ID. Supplying an Allow header in responses to methods other than OPTIONS cuts down on the number of messages needed. Allow = "Allow" ":" 1#Methodtime after which Handley/Schulzrinne/Schooler/Rosenberg [Page49]63] Internet Draft SIPNovember 24, 2000 6.11 Also The AlsoMay 29, 2001 the message content expires. This header field isusedcurrently defined onlyin BYE requests. It indicates tofor thereceiving UA that it should initiate anREGISTER, as described in Section 7, and INVITErequest to the addresses indicated. The BYE request takes effect regardless of whether themethods. For INVITEsucceeds andrequests, it isresponded to immediately. This mechanism allows unsupervised call transfer. Also = "Also" ":" 1# (( name-addr | addr-spec ) 6.12 Authorization A user agent that wishes to authenticate itself withaUAS or registrar -- usually, but not necessarily, after receivingrequest and response-header field. In a401 response -- MAY do so by including an Authorization header field withrequest, therequest. For PGP, Authorizationcaller canalso protect responses. The Authorization field value consists of credentials containinglimit theauthentication informationvalidity ofthe user agentan invitation, for example, if a client wants to limit therealm of the resource being requested. Section 13.2 overviews the usetime duration ofthe Authorization header field, and Section 15 describes the syntax and semantics when used with PGP- based authentication. 6.13 Call-ID The Call-ID general-header field uniquely identifiesaparticular invitationsearch orall registrations of a particular client. Note thatasingle multimediaconferencecan give rise to several calls with different Call-IDs, e.g., if ainvitation. A userinvitesinterface MAY take this as asingle individual several timeshint to leave thesame (long-running) conference. For an INVITE request, a callee user agent server SHOULDNOT alertinvitation window on theuserscreen even if the userhas responded previously tois not currently at theCall-ID inworkstation. This also limits the duration of a search. If the request expires before the search completes, the proxy returns a 408 (Request Timeout) status. In a 302 (Moved Temporarily) response, a server can advise theINVITE request. Ifclient of theuser is already a membermaximal duration of theconference andredirection. Note that theconference parameters contained inexpiration time does not affect the duration of the actual session that may result from the invitation. Session descriptionhave not changed, a callee user agent server MAY silently acceptprotocols may offer thecall, regardless ofability to express time limits on theCall-ID. An invitation for an existing Call-ID orsession duration, however. The value of this field canchangebe either a SIP-date or an integer number of seconds (in decimal), measured from theparametersreceipt of theconference. A client applicationrequest. The latter approach is preferable for short durations, as it does not depend on clients and servers sharing a synchronized clock. Implementations MAYdecide to simply indicatetreat values larger than 2**32-1 (4294967295 or 136 years) as equivalent tothe user that the conference parameters have been changed2**32-1. Expires = "Expires" ":" ( SIP-date | delta-seconds ) Two examples of its use are Expires: Thu, 01 Dec 1994 16:00:00 GMT Expires: 5 10.25 From Requests andacceptresponses MUST contain a From general-header field, indicating theinvitation automatically or it MAY require user confirmation. Handley/Schulzrinne/Schooler/Rosenberg [Page 50] Internet Draft SIP November 24, 2000 A userinitiator of the request. (Note that this may beinvited todifferent from the initiator of thesame conference orcallusing several different Call-IDs. If desired,leg. Requests sent by theclient MAYcallee to the caller useidentifiers withinthesession descriptioncallee's address in the From header field.) The From field MUST contain the "tag" parameter. However, a server MUST be prepared todetect this duplication. For example, SDP containsreceive asession id and version numberrequest without a tag, in which Handley/Schulzrinne/Schooler/Rosenberg [Page 64] Internet Draft SIP May 29, 2001 case theorigin (o) field.tag is considered to effectively have a value of zero. This is to maintain backwards compatibility with RFC2543, which did not mandate From tags. . TheREGISTER and OPTIONS methods useserver copies theCall-ID value (in additionFrom header field from the request to theCSeq value)response. The optional "display-name" is meant tounambiguously match requests and responses. All REGISTER requests issuedbe rendered by asingle clienthuman-user interface. A system SHOULD use thesame Call-ID, at least within the same boot cycle. For these requests, it makes no difference whetherdisplay name "Anonymous" if theCall-ID value matches an existing call or not. Sinceidentity of theCall-ID is generated by and for SIP, thereclient isno reasontodealremain hidden. The SIP-URL MUST NOT contain the "transport-param", "maddr-param", "ttl-param", or "headers" elements. A server that receives a SIP-URL with these elements ignores them. Even if thecomplexity of URL-encoding and case-ignoring string comparison. callid = token [ "@" token ] Call-ID"display-name" is empty, the "name-addr" form MUST be used if the "addr-spec" contains a comma, question mark, or semicolon. Syntax issues are discussed in Section 10.5. From = ("Call-ID""From" |"i""f" ) ":"callid( name-addr | addr-spec ) *( ";" from-param ) from-param = tag-param | generic-param tag-param = "tag" "=" token Examples: From: "A. G. Bell" <sip:agb@bell-telephone.com> ;tag=a48s From: sip:+12125551212@server.phone2net.com;tag=887s From: Anonymous <sip:c8oqz84zk7z@privacy.org>;tag=hyh8 Thecallid"tag" value MUST beaglobally uniqueidentifierandMUSTNOT be reusedcryptographically random with at least 32 bits of randomness. It SHOULD differ forlater calls. Useeach call leg. For the purpose ofcryptographically random identifiers [29]identifying call legs, two From or To header fields are equal if and only if: o The addr-spec component isRECOMMENDED. Implementations MAY useequal, according to theform "localid@host". Call- IDs are case-sensitiverules in Section 2.1. o Any "tag" and "generic-param" parameters aresimplyequal, comparedbyte-by-byte. Using cryptographically random identifiers provides some protection against session hijacking.according to the case-sensitivity rules in Section 10. Only parameters that appear in both header fields are compared. Handley/Schulzrinne/Schooler/Rosenberg [Page 65] Internet Draft SIP May 29, 2001 Call-ID, To and From are needed to identify a call leg. The distinction between call and call leg matters in calls withthird-party control. Formultiple responses to a forked request. The format is similar to the equivalent RFC 822 [25] header, but with a URI instead of just an email address. 10.26 In-Reply-To The In-Reply-To request header field enumerates the call-IDs that this call references or returns. This allows automatic call distribution systemswhich have tight bandwidth constraints, manyto route return calls to the originator of themandatory SIP headersfirst call and allows callees to filter calls, so that only calls that return calls they have originated will be accepted. This field is not acompact form, as discussed in Section 9. These are alternate namessubstitute for request authentication. In-Reply-To = "In-Reply-To" ":" 1# callid Example: In-Reply-To: 70710@saturn.bell-tel.com, 17320@saturn.bell-tel.com 10.27 Max-Forwards The Max-Forwards request-header field may be used with any SIP method to limit theheadersnumber of proxies or gateways that can forward the request to the next downstream server. This can also be useful when the client is attempting to trace a request chain whichoccupy less spaceappears to be failing or looping in mid-chain. Max-Forwards = "Max-Forwards" ":" 1*DIGIT The Max-Forwards value is a decimal integer indicating themessage. In the caseremaining number ofCall-ID, the compact formtimes this request message isi. For example, bothallowed to be forwarded. Each proxy or gateway recipient of a request containing a Max- Forwards header field MUST check and update its value prior to forwarding the request. If the received value is zero (0), thefollowing are valid: Call-ID: f81d4fae-7dec-11d0-a765-00a0c91e6bf6@foo.bar.com or i:f81d4fae-7dec-11d0-a765-00a0c91e6bf6@foo.bar.comHandley/Schulzrinne/Schooler/Rosenberg [Page51]66] Internet Draft SIPNovember 24, 2000 6.14 Call-Info The Call-Info general header field provides additional information aboutMay 29, 2001 recipient MUST NOT forward thecaller or callee, depending on whether itrequest and returns 483 (Too many hops). Instead, a server MAY act as a final recipient for OPTIONS requests. It isfoundRECOMMENDED that the server include Supported, Server and Allow header fields ina request orthe response.The purpose ofIf theURIreceived Max-Forwards value isdescribed bygreater than zero, then the"purpose" parameter. "icon" designates an image suitable asforwarded message MUST contain aniconic representationupdated Max-Forwards field with a value decremented by one (1). Example: Max-Forwards: 6 10.28 MIME-Version See [H19.4.1]. 10.29 Organization The Organization general-header field conveys the name of thecaller or callee; "info" describesorganization to which thecaller or callee in general, e.g., through a web page; "card" provides a business card (e.g., in vCard [30]entity issuing the request orLDIF [31] formats). Call-Inforesponse belongs. It MAY also be inserted by proxies at the boundary of an organization. The field MAY be used by client software to filter calls. Organization = "Organization" ":" TEXT-UTF8-TRIM 10.30 Priority The Priority request-header field indicates the urgency of the request as perceived by the client. Priority ="Call-Info""Priority" ":"# ( "<" URI ">" *( ";" info-param) ) info-parampriority-value priority-value ="purpose" "=" ( "icon""emergency" |"info""urgent" |"card""normal" |token )"non-urgent" |generic-param Example: Call-Info: <http://wwww.example.com/alice/photo.jpg> ;purpose=icon, <http://www.example.com/alice/> ;purpose=info 6.15 Contactother-priority other-priority = token It is RECOMMENDED that the value of "emergency" only be used when Handley/Schulzrinne/Schooler/Rosenberg [Page 67] Internet Draft SIP May 29, 2001 life, limb or property are in imminent danger. Examples: Subject: A tornado is heading our way! Priority: emergency Subject: Weekend plans Priority: non-urgent These are the values of RFC 2076 [34], with the addition of "emergency". 10.31 Proxy-Authenticate TheContact general-headerProxy-Authenticate response-header fieldcan appear in INVITE, OPTIONS, ACK, and REGISTER requests, andMUST be included as part of a 407 (Proxy Authentication Required) response. It may also occur in1xx, 2xx, 3xx, and 485 responses. In general, it providesaURL where401 (Unauthorized) response if theuser can be reached for further communications. In somerequest was forked. The field value consists of a challenge that indicates thecases below,authentication scheme and parameters applicable to theclient uses information fromproxy for this Request-URI. Unlike its usage within HTTP, theContactProxy-Authenticate headerfieldMUST be passed upstream inRequest-URI of future requests. In these cases,the response to the UAC. In SIP, only UAC's can authenticate themselves to proxies. The syntax for this header is defined in [H14.33]. See 19 for further details on its usage. A clientcopies all butSHOULD cache the"method-param"credentials used for a particular proxy server and"header" elements ofrealm for theaddr-spec partnext request to that server. Credentials are, in general, valid for a specific value of theContact header field into theRequest-URIofat a particular proxy server. If a client contacts a proxy server that has required authentication in therequest. It usespast, but the"header" parameters to create headersclient does not have credentials for therequest, replacing any default headers normally used. Unlessparticular Request-URI, it MAY attempt to use the most-recently used credential. The server responds with 401 (Unauthorized) if the client guessed wrong. This suggested caching behavior isconfiguredmotivated by proxies restricting phone calls to authenticated users. It seems likely that in most cases, all destinations require the same password. Note that end-to-end authentication is likely to be destination-specific. Handley/Schulzrinne/Schooler/Rosenberg [Page 68] Internet Draft SIP May 29, 2001 10.32 Proxy-Authorization The Proxy-Authorization request-header field allows the client to identify itself (or its user) touseadefaultproxy which requires authentication. The Proxy-Authorization field value consists of credentials containing the authentication information of the user agent forall outgoing requests, it then directstherequest toproxy and/or realm of theaddress and port specified byresource being requested. Unlike Authorization, the"maddr" and "port" parameters,Proxy-Authorization header field applies only to the next outbound proxy that demanded authentication using thetransport protocol givenProxy- Authenticate field. When multiple proxies are used inthe "transport" parameter. If "maddr" isamulticast address,chain, thevalue of "ttl"Proxy-Authorization header field isused asconsumed by thetime-to-live value. INVITE, OPTIONS and ACK requests: INVITE requests MUST and ACK requestsfirst outbound proxy that was expecting to receive credentials. A proxy MAYcontain Contact headers indicatingrelay the credentials fromwhich locationthe client requestis originating. The URL into theContact header fieldnext proxy if that isthen usedthe mechanism bysubsequent requests fromwhich theHandley/Schulzrinne/Schooler/Rosenberg [Page 52] Internet Draft SIP November 24, 2000 callee. For OPTIONS, Contact providesproxies cooperatively authenticate ahint where future SIP requests can be sent or the user can be contacted via non-SIP means. This allows the callee to send future requests, such as BYE, directly to the caller insteadgiven request. See [H14.34] for a definition ofthroughthe syntax, and section 19 for aseriesdiscussion ofproxies.its usage. 10.33 Proxy-Require TheViaProxy-Require header field isnot sufficient since the desired address may beused to indicate proxy-sensitive features thatof aMUST be supported by the proxy.INVITE 1xx responses: A UAS sending a provisional response (1xx) MAY insertIf aContact response header. It hasproxy server does not understand thesame semanticsoption, it MUST respond by returning status code 420 (Bad Extension) and list those options it does not understand ina 1xx response as a 2xx INVITE response. Note that CANCEL requests MUSTNOT be sentthe Unsupported header. A UAC SHOULD attempt tothat address, but rather followretry thesame path asrequest, without using theoriginal request. INVITEfeatures listed in the Unsupported header. See Section 10.35 for more details on the mechanics of this message andOPTIONS 2xx responses: A user agent server sending a definitive, positive response (2xx) MUST insertaContact responseusage example. Proxy-Require = "Proxy-Require" ":" 1#option-tag 10.34 Record-Route The Record-Route header fieldindicatinghas the following syntax: Record-Route = "Record-Route" ":" 1# ( name-addr *( ";" rr-param )) rr-param = generic-param Details of its use are described in Section 16. Handley/Schulzrinne/Schooler/Rosenberg [Page 69] Internet Draft SIPaddress under which it is reachable most directly for future SIP requests, such as ACK, within the same Call-ID.May 29, 2001 10.35 Require TheContact headerRequire general-header fieldcontainsis used by clients to tell user agent servers about options that theaddress ofclient expects the serveritself or that of a proxy, e.g., ifto support in order to properly process thehost is behindrequest. If afirewall. The value of this Contact header is copied into the Request-URI of subsequent requests for this call ifserver does not understand theresponse didoption, it MUST respond by returning status code 420 (Bad Extension) and list those options it does notalso contain a Record-Routeunderstand in the Unsupported header.IfA UAC SHOULD attempt to retry theresponse also contains a Record-Route header field,request, without using theaddressfeatures listed in theContact header fieldUnsupported header. Require = "Require" ":" 1#option-tag Example: C->S: INVITE sip:watson@bell-telephone.com SIP/2.0 Require: com.example.billing Payment: sheep_skins, conch_shells S->C: SIP/2.0 420 Bad Extension Unsupported: com.example.billing This isadded asto make sure that thelast itemclient-server interaction will proceed without delay when all options are understood by both sides, and only slow down if options are not understood (as in theRoute header field. See Section 6.35 for details. Ifexample above). For aUA supports both UDPwell-matched client-server pair, the interaction proceeds quickly, saving a round-trip often required by negotiation mechanisms. In addition, it also removes ambiguity when the client requires features that the server does not understand. Some features, such as call handling fields, are only of interest to end systems. Proxy andTCP, it SHOULDNOT indicateredirect servers MUST ignore features that are not understood. If atransport parameter inparticular extension requires that intermediate devices support it, theURI. The Contact value SHOULDNOTextension MUST becached across calls, as it may not representtagged in themost desirable location for a particular destination address. REGISTER requests and responses: SeeProxy-Require field as well (see Section4.2.6. 3xx and 485 responses:10.33). 10.36 Response-Key TheContact response-headerResponse-Key request-header field can be usedwithby a3xx or 485 (Ambiguous) response codes to indicate one or more alternate addresses to try. It can appear in responsesclient toBYE, INVITE and OPTIONS methods. The Contact header field contains URIs givingrequest thenew locations orkey that the called usernamesagent SHOULD use totry, or may simply specify additional transport parameters. A 300 (Multiple Choices), 301 (Movedencrypt the response with. The syntax is: Handley/Schulzrinne/Schooler/Rosenberg [Page53]70] Internet Draft SIPNovember 24, 2000 Permanently), 302 (Moved Temporarily) or 485 (Ambiguous) response SHOULD contain a Contact field containing URIsMay 29, 2001 Response-Key = "Response-Key" ":" key-scheme 1*SP #key-param key-scheme = token key-param = generic-param The "key-scheme" gives the type ofnew addressesencryption to betried. A 301 or 302 response may also giveused for thesame location and usernameresponse. Section 18 describes security schemes. If the client insists thatwas being tried but specify additional transport parameters such as a differentthe serveror multicast address to try orreturn an encrypted response, it includes achange of SIP transport from UDP to TCP or vice versa. The client copies information from the ContactRequire: org.ietf.sip.encrypt-response header fieldintoin its request. If theRequest-URI as described above. 4xx, 5xxserver cannot encrypt for whatever reason, it MUST follow normal Require header field procedures and6xx responses:return a 420 (Bad Extension) response. If this Require header field is not present, a server SHOULD still encrypt if it can. 10.37 Retry-After TheContactRetry-After response-header field can be used with a4xx, 5xx or 6xx503 (Service Unavailable) response to indicate how long thelocation where additional information about the error canservice is expected to befound. Note that the Contact header field MAY also referunavailable toa different entity thantheone originally called. For example, a SIP call connected to GSTN gateway may need to deliverrequesting client and with aspecial information announcement such as "The number you have dialed has been changed." A Contact404 (Not Found), 600 (Busy), or 603 (Decline) responseheader field can contain any suitable URI indicating whereto indicate when the called partycan be reached, not limited to SIP URLs. For example, it could contain URL's for phones, fax, or irc (if they were defined) or a mailto: (RFC 2368, [32]) URL. The following parameters are defined. Additional parameters may be defined in other specifications. q: The "qvalue" indicates the relative preference among the locations given. "qvalue" values are decimal numbers from 0 to 1, with higher values indicating higher preference.anticipates being available again. Thedefaultvalueis 0.5. action: The "action" parameter is used only when registering with the REGISTER request. It indicates whether the client wishes that the server proxy or redirect future requests intended for the client. Ifof thisparameter is not specifiedfield can be either an SIP-date or an integer number of seconds (in decimal) after theaction taken depends on server configuration. In its response,time of theregistrar SHOULDresponse. An optional comment can be used to indicate additional information about themode used. This parameter is ignored for other requests. expires: The "expires"time of callback. An optional "duration" parameter indicates how long theURI is valid. The parameter is either a number indicating seconds or a quoted string containing a SIP-date.called party will be reachable starting at the initial time of availability. Ifthisno duration parameter isnot provided, the value of the Expires header field determines how longgiven, theURIservice isvalid. Implementations MAY treat values larger than 2**32-1 (4294967295 seconds or 136 years) as equivalentassumed to2**32-1. Handley/Schulzrinne/Schooler/Rosenberg [Page 54] Internet Draft SIP November 24, 2000 Contactbe available indefinitely. Retry-After =( "Contact" | "m" )"Retry-After" ":"("*" | (1# (( name-addr( SIP-date |addr-specdelta-seconds ) [ comment ] *( ";"contact-paramsretry-param )))) name-addr = [ display-name ] "<" addr-spec ">" addr-spec = SIP-URL | URI display-name = *token | quoted-string contact-paramsretry-param ="q" "=" qvalue | "action" "=" "proxy" | "redirect" | "expires""duration" "=" delta-seconds |<"> SIP-date <"> | contact-extension contact-extension =generic-paramqvalue = ( "0" [ "." 0*3DIGIT ] ) | ( "1" [ "." 0*3("0") ] ) Even if the "display-name" is empty,Examples of its use are Retry-After: Mon, 21 Jul 1997 18:48:34 GMT (I'm in a meeting) Retry-After: Mon, 01 Jan 9999 00:00:00 GMT (Dear John: Don't call me back, ever) Retry-After: Fri, 26 Sep 1997 21:00:00 GMT;duration=3600 Handley/Schulzrinne/Schooler/Rosenberg [Page 71] Internet Draft SIP May 29, 2001 Retry-After: 120 In the"name-addr" form MUST be used ifthird example, the"addr-spec" contains a comma, semicolon or question mark. Note that there may or may not be LWS betweencallee is reachable for one hour starting at 21:00 GMT. In thedisplay-name andlast example, the"<".delay is 2 minutes. 10.38 Route TheContactRoute header fieldfulfills functionality similar tohas theLocation header fieldfollowing syntax: Route = "Route" ":" 1# ( name-addr *( ";" rr-param )) Details of its use are described inHTTP. However,Section 16. 10.39 Server The Server response-header field contains information about theHTTP header only allows one address, unquoted. Since URIs can contain commas and semicolons as reserved characters, they can be mistakensoftware used by the user agent server to handle the request. The syntax for this field is defined in [H14.38]. 10.40 Subject This header field provides a summary orparameter delimiters, respectively. The current syntax correspondsindicates the nature of the call, allowing call filtering without having tothat forparse theTo and From header, which also allowssession description. (Note that the session description does not have to useof display names. Example: Contact: "Mr. Watson" <sip:watson@worcester.bell-telephone.com> ;q=0.7; expires=3600, "Mr. Watson" <mailto:watson@bell-telephone.com> ;q=0.1 6.16 Content-Disposition Content-Disposition = "Content-Disposition" ":" disposition-type *( ";" disposition-param ) disposition-typethe same subject indication as the invitation.) Subject ="render" | "session" | "icon"( "Subject" |"alert""s" ) ":" TEXT-UTF8-TRIM Example: Subject: Tune in - they are talking about your work! 10.41 Supported The Supported general-header field enumerates all the capabilities of the client or server. This header field SHOULD be included in all requests (except ACK) and in all responses. Handley/Schulzrinne/Schooler/Rosenberg [Page55]72] Internet Draft SIPNovember 24, 2000 | disp-extension-token disposition-paramMay 29, 2001 Including the header field in all responses greatly simplifies the use of extensions for call control in subsequent transactions with the same server. Syntax: Supported ="handling" "="("optional" | "required""Supported" |other-handling"k" )| generic-param other-handling = token disp-extension-token = token":" 1#option-tag 10.42 Timestamp TheContent-Disposition headerTimestamp general-header field describeshowwhen themessage body or, inclient sent thecase of multipart messages, a message body part isrequest tobe interpreted bytheUAC or UAS.server. TheSIP header extendsclient uses theMIME Content-Type (RFC 1806 [33]). Thecurrent time value"session" indicates thatat thebody part describestime of transmission, i.e., each retransmission of asession, for either calls or early (pre-call) media.request is likely to have a different timestamp value. The value"render" indicates that the body part should be displayed or otherwise rendered to the user. For backward-compatibility, ifof theContent- Disposition headertimestamp isnot missing, bodiesofContent-Type application/sdp implysignificance only to thedisposition "session", while other content types imply "render".client and it MAY use any timescale. Thedisposition type "icon" indicates that the body part contains an image suitable as an iconic representation ofserver MUST echo thecaller or callee. Theexact same value"alert" indicates that the body part contains information, such as an audio clip, that should be rendered instead of ring tone. The handling parameter, handling-parm, describes how the UAS should reactin all provisional and final responses and MAY, if itreceiveshas accurate information about this, add amessage body whose content type or disposition type it does not understand. Iffloating point number indicating theparameternumber of seconds that have elapsed since it has received thevalue "optional",request. The timestamp is used by theUAS MUST ignoreclient to compute themessage body; ifround- trip time to the server so that ithascan adjust the timeout value"required",for retransmissions. Timestamp = "Timestamp" ":" *(DIGIT) [ "." *(DIGIT) ] [ delay ] delay = *(DIGIT) [ "." *(DIGIT) ] Note that there MUST NOT be any LWS between a DIGIT and theUASdecimal point. 10.43 To The To general-header field specifies the "logical" recipient of the request. To = ( "To" | "t" ) ":" ( name-addr | addr-spec ) *( ";" to-param ) to-param = tag-param | generic-param Requests and responses MUSTreturn 415 (Unsupported Media Type). Ifcontain a To general-header field, Handley/Schulzrinne/Schooler/Rosenberg [Page 73] Internet Draft SIP May 29, 2001 indicating thehandling parameter is missing,desired recipient of thevalue "required"request. The optional "display-name" is meant to beassumed. If thisrendered by a human-user interface. The UAS or redirect server copies the To header fieldis missing, the MIME type determines the default content disposition.into its response, and MUST add a "tag" parameter. If there was more than one Via header field, the request was handled by at least one proxy server. Since the receiver cannot know whether any of the proxy servers forked the request, it isnone, "render" is assumed. 6.17 Content-Encoding Content-Encoding = ( "Content-Encoding" | "e" ) ":" 1#content-codingsafest to assume that they might have. The SIP-URL MUST NOT contain the "transport-param", "maddr-param", "ttl-param", or "headers" elements. A server that receives a SIP-URL with these elements removes them before further processing. TheContent-Encoding entity-header field is used"tag" parameter serves as amodifier to the "media-type". When present, its value indicates what additional content codings have been appliedgeneral mechanism to distinguish multiple instances of a user identified by a single SIP URL. As proxies can fork requests, theentity-body,same request can reach multiple instances of a user (mobile andthus what decoding mechanisms MUSThome phones, for example). As each can respond, there needs to beapplied in ordera means toobtaindistinguish themedia-type Handley/Schulzrinne/Schooler/Rosenberg [Page 56] Internet Draft SIP November 24, 2000 referenced byresponses from each at theContent-Typecaller. The situation also arises with multicast requests. The tag in the To headerfield. Content-Encoding is primarily used to allow a bodyfield serves to distinguish responses at the UAC. It MUST becompressed without losingplaced in theidentityTo field ofits underlying media type. If multiple encodings have been applied to an entity,thecontent codingsresponse by user agent, registrar and redirect servers, but MUST NOT belisted in the order in which they were applied. All content-coding values are case-insensitive. The Internet Assigned Numbers Authority (IANA) acts asinserted into responses forwarded upstream by proxies. However, responses generated locally by aregistryproxy, and then sent upstream, MUST contain a tag. A UAS or redirect server MUST add a "tag" parameter forcontent-coding value tokens. See [H3.5]all final responses for all transactions within adefinition ofcall leg. All such parameters have thesyntaxsame value within the same call leg. These servers SHOULD add the tag forcontent-coding. Clients MAY apply content encodingsinformational responses during the initial INVITE transaction, but MUST add a tag to informational responses for all subsequent transactions. See Section 10.25 for details of thebody"tag" parameter. The "tag" parameter inrequests. If the serverTo headers is ignored when matching responses to requests that did notcapable of decoding the body, or does not recognize any of the content-coding values, it MUST sendcontain a415 "Unsupported Media Type" response, listing acceptable encodings"tag" inthe Accept-Encodingtheir To header.A server MAY apply content encodings toSection 15 describes when thebodies"tag" parameter MUST appear inresponses. The serversubsequent requests. Note that if a request already contained a tag, this tag MUSTonly use encodings listedbe mirrored in theAccept- Encodingresponse; a new tag MUST NOT be inserted. Section 10.25 describes how To and From headerin the request. 6.18 Content-Language See [H14.12]. 6.19 Content-Length The Content-Length entity-header field indicates the size offields are compared for themessage-body, in decimal numberpurpose ofoctets, sentmatching requests tothe recipient. Content-Length = ( "Content-Length" | "l" ) ":" 1*DIGIT An example is Content-Length: 3495 Applicationscall legs. Handley/Schulzrinne/Schooler/Rosenberg [Page 74] Internet Draft SIP May 29, 2001 UAS SHOULDuse this field to indicateaccept requests even if they do not recognize thesize ofURI scheme (e.g., a tel: URI) or if themessage-bodyTo header does not address the user. Only Request-URI that do not match the recipient should cause requests to betransferred, regardless ofrejected. Even if themedia type of"display-name" is empty, theentity. (The size of"name-addr" form MUST be used if themessage-body does"addr-spec" contains a comma, question mark, or semicolon. Note that LWS is common, but notincludemandatory between theCRLF separating headersdisplay-name andbody.) Any Content-Length greater than or equalthe "<". The following are examples of valid To headers: To: The Operator <sip:operator@cs.columbia.edu>;tag=287447 To: sip:+12125551212@server.phone2net.com Call-ID, To and From are needed tozero isidentify avalid value. If no body is presentcall leg. The distinction between call and call leg matters in calls with multiple responses from amessage, thenforked request. The "tag" is added to theContent-LengthTo header fieldMUST be setin the response tozero. If a server receives a datagram request without Content-Length, it MUST assume thatallow forking of future requests for therequest encompassessame call by proxies, while addressing only one of theremainderpossibly several responding user agent servers. It also allows several instances of thepacket. If a server receives a datagram request withcallee to send requests that can be distinguished. 10.44 Unsupported The Unsupported response-header field lists the features not supported by the server. See Section 10.35 for aContent-Length, butusage example and motivation. Syntax: Unsupported = "Unsupported" ":" 1#option-tag 10.45 User-Agent The User-Agent general-header field contains information about the client user agent originating the request. The syntax and semantics are defined in [H14.43]. 10.46 Via Handley/Schulzrinne/Schooler/Rosenberg [Page57]75] Internet Draft SIPNovember 24, 2000 value differs fromMay 29, 2001 The Via field indicates thesize ofpath taken by thebody sentrequest so far. This prevents request looping and ensures replies take the same path as the requests, which assists in firewall traversal and other unusual routing situations. 10.46.1 Requests The client originating therequest,request MUST insert into theserver SHOULD return a 400 (Bad Request) response. If a response does not containrequest aContent-Length,Via field containing theclient assumes that it encompassestransport protocol used to send theremainder ofmessage, thedatagram packetclient's host name or network address and, if not thedata until the stream connection is closed, as applicable. Section 8 describes how to determine the length ofdefault port number, themessage body. The abilityport number at which it wishes toomit Content-Length simplifies the creation of cgi-like scripts that dynamically generatereceive responses.6.20 Content-Type The Content-Type entity-header field indicates(Note that this port number can differ from themedia typeUDP source port number of themessage-body sent to the recipient. The "media-type" element is defined in [H3.7]. The Content-Type header fieldrequest.) A fully-qualified domain name isignored ifRECOMMENDED. Each subsequent proxy server that sends themessage body is empty. Content-Type = ( "Content-Type" | "c" ) ":" media-type Examples of this header field are Content-Type: application/sdp Content-Type: text/html; charset=ISO-8859-4 6.21 CSeq Clientsrequest onwards MUST addthe CSeq (command sequence) general-headerits own additional Via fieldto every request.before any existing Via fields. ACSeq header field inproxy that receives arequest contains the request methodredirection (3xx) response anda single decimal sequence number chosen by the requesting client, unique within a single call leg. The sequence numberthen searches recursively, MUSTbe expressibleuse the same Via headers asa 32-bit unsigned integer. The initial value ofon thesequence number is arbitrary, but MUST be less than 2**31. Consecutive requestsoriginal proxied request. A client thatdiffer insends a requestmethod, headers or body, but have the same Call-IDto a multicast address MUSTcontain strictly monotonically increasingadd the "maddr" parameter to its Via header field, andcontiguous sequence numbers; sequence numbers do not wrap around. Retransmissions ofSHOULD add thesame request carry"ttl" parameter. (In that case, thesame sequence number, but an INVITE withmaddr parameter SHOULD contain the destination multicast address, although under exceptional circumstances it MAY contain adifferent message body or different header fields (a "re-invitation") acquiresunicast address.) If anew, higher sequence number. AserverMUST echoreceives a request which contained an "maddr" parameter in theCSeq value fromtopmost Via field, it SHOULD send therequestresponse to the address listed inits response. IftheMethod value"maddr" parameter. Loop detection ismissingdescribed in Section 17.3.1. 10.46.2 Receiver-tagged Via Header Fields A proxy or UAS receiving a request SHOULD check thereceived CSeqfirst Via headerfield, the server fillsfield to ensure that itin appropriately. Handley/Schulzrinne/Schooler/Rosenberg [Page 58] Internet Draft SIP November 24, 2000 The ACK and CANCEL requests MUST containcontains thesame CSeq valuesender's correct network address, asthe INVITE requestseen from thatit refers to, whileproxy. If the Via header contains aBYE request cancellingdomain name or if it contains aninvitation MUST have a higher sequence number. A BYE request withIP address that differs from the packet source address, the proxy or UAS SHOULD add aCSeq"received" attribute to thatisVia header field. A multi-homed host may nothigher should cause a 400 responsebe able to insert a network address into the Via header field that can begenerated. A user agent server MUST rememberreached by thehighest sequence numbernext hop, forany INVITE request withexample because if one of thesame Call-ID value.networks is private. Theserver MUST respond to, and then discard, any INVITE request with a lower sequence number. All requests spawned in a parallel search have the same CSeq value as the request triggeringaddress placed into theparallel search. CSeq = "CSeq" ":" 1*DIGIT Method Strictly speaking, CSeqVia headerfields are needed for any SIP requestmay differ from the interface actually used, as thatcan be cancelledinterface is selected only at packet sending time by the IP layer. Similarly, aBYE or CANCELrequestor wheretraversing aclient can issue several requests fornetwork address translator (NAT) will also cause thesame Call-ID in close succession. Without a sequence number,sending address to Handley/Schulzrinne/Schooler/Rosenberg [Page 76] Internet Draft SIP May 29, 2001 differ from theresponseaddress seen by the next hop. The mechanism described here is unlikely toan INVITE couldbemistakensufficient, however, forthe responseallowing packets to traverse a NAT in thecancellation (BYE or CANCEL). Also, ifreverse direction. An example is: Via: SIP/2.0/UDP erlang.bell-telephone.com:5060 Via: SIP/2.0/UDP 128.59.16.1:5060 ;received=128.59.19.3 In this example, the message originated from a multi-homed host with two addresses, 128.59.16.1 and 128.59.19.3. The sender guessed wrong as to which networkduplicates packets or if an ACK is delayed untilinterface would be used. Erlang.bell- telephone.com noticed theserver has sent an additional response,mismatch, and added a parameter to theclient could interpret an old response asprevious hop's Via header field, containing theresponse to a re- invitation issued shortly thereafter. Using CSeq also makes it easy foraddress that theserver to distinguish different versions of an invitation, without comparingpacket actually came from. 10.46.3 Receiving Responses Via header fields in responses received are processed by a proxy or UAC according to themessage body.following rules: 1. TheMethod value allowsfirst Via header field should indicate the proxy or clientto distinguish the response to an INVITE request from that of a CANCELprocessing this response.CANCEL requests can be generatedSpecifically, the sent-by value should equal the value inserted byproxies; if they were to increasethesequence number, it might conflict with a later request issuedproxy or UAC. The recevied parameter MUST NOT be used by a proxy or UAC to determine if theuser agentresponse is forthe same call. With a length of 32 bits, a server could generate, withinasingle call, onerequesta second for about 136 years before needingit sent. If the sent-by value is not equal towrap around. The initialthe valueofinserted by thesequence numberproxy or UAC, discard the message. Otherwise, remove this Via field. 2. If there ischosen so that subsequent requests withinno second Via header field, this response is destined for this client. Otherwise, use this Via field as thesame call will not wrap around.destination, as described in Section 10.46.5. 10.46.4 Generating Responses Anon-zero initial value allows to useUAS, proxy or redirect that server that generates atime-based initial sequence number, ifresponse copies theclient desires. A client could, for example, chooseVia header fields from the31 most significant bits of a 32-bit second clockrequest into the response, without changing their order, and uses the top (first) Via element asan initial sequence number. Forked requests MUST havethesame CSeqdestination, asthere would be ambiguitydescribed in the next section. 10.46.5 Sending Responses Given a destination described by a Via header field, the response is Handley/Schulzrinne/Schooler/Rosenberg [Page59]77] Internet Draft SIPNovember 24, 2000 otherwise between these forked requests and later BYE issued byMay 29, 2001 sent according to theclient user agent. Example: CSeq: 4711 INVITE 6.22 Date Datefollowing rules: o If the "sent-protocol" is ageneral-header field. Its syntax is: Date = "Date" ":" SIP-date SIP-date = rfc1123-date See [H14.18] for a definition of rfc1123-date. Note that unlike HTTP/1.1, SIP only supportsreliable transport protocol such as TCP, TLS or SCTP, send themost recent RFC 1123 [34] formatting for dates. As in [H3.3], SIP restrictsresponse using thetimezone in SIP-dateexisting TCP connection to"GMT", while RFC 1123 allows any timezone. The consistent use of GMT between Date, Expires and Retry- After headers allows implementation of simple clients that do not have a notionthe source ofabsolute time. Note that rfc1123- datethe original request. If no connection iscase-sensitive. The Date header field reflectsopen, open a connection to thetime whenIP address in therequestreceived parameter, if present using the port in the sent-by value, orresponseport 5060 if none isfirst sent. Thus, retransmissions have the same Date header field value aspresent. If theoriginal. Registrars MUST include this header in REGISTER responsesconnection attempt fails, or ifthey use absolute expiration times andthere was no received parameter, the server SHOULDinclude it for all responses. The Date header field can be used by simple end systems withoutattempt to open abattery-backed clockconnection toacquirethe address in the sent-by value, which may be a domain name. To do this, it constructs anotionSIP URL ofcurrent time. However,the form "sip:<sent- by>;transport=<sent-protocol>" and then uses the procedures defined inits GMT-form, it requires clients[35] toknow their offset from GMT. 6.23 Encryption The Encryption general-header field specifies thatdetermine thecontent has been encrypted. Section 13 describesIP address and port to open theoverall SIP security architectureconnection andalgorithms. Thissend the response to. o Otherwise, if the Via header fieldis intended for end- Handley/Schulzrinne/Schooler/Rosenberg [Page 60] Internet Draft SIP November 24, 2000 to-end encryption of requests and responses. Requests are encrypted based oncontains a "maddr" parameter, forward thepublic key belongingresponse to theentity namedaddress listed there, using the port indicated in "sent-by", or port 5060 if none is present. If theTo header field. Responses are encrypted based onaddress is a multicast address, thepublic key conveyedresponse SHOULD be sent using the TTL indicated in theResponse-Key header field. Note"ttl" parameter, or with a TTL of 1 if thatthe public keys themselves mayparameter is notbe used forpresent. o Otherwise, if it is a receiver-tagged field (Section 10.46.2), send theencryption. This depends onresponse to theparticular algorithms used. For any encrypted message, at leastaddress in themessage body and possibly other message header fields are encrypted. An application receiving a request"received" parameter, using the port indicated in the "sent-by" value, orresponse containingusing port 5060 if none is specified explicitly. If this fails, e.g., elicits anEncryption header field decryptsICMP "port unreachable" response, send thebody and then concatenatesresponse to theplaintextaddress in the "sent-by" parameter. The address to send to is determined by constructing a SIP URL of therequest lineform "sip:<sent-by>", andheaders ofthen using theoriginal message. Message headersDNS procedures defined in [35] to send thedecrypted part completely replace those withresponse. o Otherwise, if it is not receiver-tagged, send thesame field name inresponse to theplaintext part. (Note: If onlyaddress indicated by thebody of"sent-by" value. Note that themessageresponse to an unreliable datagram request is not returned tobe encrypted,thebody has to be prefixed with CRLF to allow proper concatenation.) Note thatport from which the requestmethod and Request-URI cannot be encrypted. Encryption only provides privacy;came, but it is always returned to therecipient has no guaranteesource IP that thattherequestor responsecamefrom the party listedfrom. 10.46.6 Syntax The format for a Via header field is shown in Fig. 9. The "maddr" parameter, designating theFrom message header, only thatmulticast address, and thesender used"ttl" parameter, designating therecipient's public key. However, proxies will not be able to modifytime-to-live (TTL) value, are included only if the requestor response. Encryptionwas sent via multicast. The "received" parameter is added only for receiver-added Via fields (Section 10.46.2). Handley/Schulzrinne/Schooler/Rosenberg [Page 78] Internet Draft SIP May 29, 2001 Via = ( "Via" | "v") ":" 1#( sent-protocol sent-by *( ";" via-params ) [ comment ] ) via-params = via-hidden | via-ttl | via-maddr | via-received | via-branch via-hidden = "hidden" via-ttl = "ttl" "=" ttl via-maddr = "maddr" "=" maddr via-received = "received" "=" host via-branch = "branch" "=" token sent-protocol = protocol-name "/" protocol-version "/" transport protocol-name = "SIP" | token protocol-version = token transport = "UDP" | "TCP" | token sent-by ="Encryption"( host [ ":"encryption-scheme 1*SP #encryption-params encryption-schemeport ] ) | ( concealed-host ) concealed-host = tokenencryption-paramsttl =generic-param1*3DIGIT ; 0 to 255 Figure 9: Syntax of Via header field The "branch" parameter is included by every proxy. The tokenindicates the formMUST be unique for each distinct request. The precise format ofencryption used; itthe token isdescribed in Section 13. The example in Figure 9 shows a message encryptedimplementation-defined. In order to be able to both detect loops and associate responses withASCII-armored PGP that was generatedthe corresponding request, the parameter SHOULD consist of two parts separable byapplying "pgp -ea" tothepayload toimplementation. One part, used for loop detection (Section 17.3.1), MAY beencrypted. Figure 9: PGP Encryption Example Since proxies can base their forwarding decision on any combinationcomputed as a cryptographic hash ofSIPthe To, From, Call-ID header fields,there is no guarantee that an encryptedthe Request-URI of the request"hiding"received (before translation) and the sequence number from the CSeq header field. The hash SHOULD also include any other fieldswill reachthesame destination as an Handley/Schulzrinne/Schooler/Rosenberg [Page 61] Internet Draft SIP November 24, 2000 INVITE sip:watson@boston.bell-telephone.com SIP/2.0 Via: SIP/2.0/UDP 169.130.12.5 From: <sip:a.g.bell@bell-telephone.com> To: T. A. Watson <sip:watson@bell-telephone.com> Call-ID: 187602141351@worcester.bell-telephone.com Cseq: 1 INVITE Content-Length: 829 Encryption: PGP version=2.6.2,encoding=ascii hQEMAxkp5GPd+j5xAQf/ZDIfGD/PDOM1wayvwdQAKgGgjmZWe+MTy9NEX8O25Red h0/pyrd/+DV5C2BYs7yzSOSXaj1C/tTK/4do6rtjhP8QA3vbDdVdaFciwEVAcuXs ODxlNAVqyDi1RqFC28BJIvQ5KfEkPuACKTK7WlRSBc7vNPEA3nyqZGBTwhxRSbIR RuFEsHSVojdCam4htcqxGnFwD9sksqs6LIyCFaiTAhWtwcCaN437G7mUYzy2KLcA zPVGq1VQg83b99zPzIxRdlZ+K7+bAnu8Rtu+ohOCMLV3TPXbyp+err1YiThCZHIu X9dOVj3CMjCP66RSHa/ea0wYTRRNYA/G+kdP8DSUcqYAAAE/hZPX6nFIqk7AVnf6 IpWHUPTelNUJpzUp5Ou+q/5P7ZAsn+cSAuF2YWtVjCf+SQmBR13p2EYYWHoxlA2/ GgKADYe4M3JSwOtqwU8zUJF3FIfk7vsxmSqtUQrRQaiIhqNyG7KxJt4YjWnEjF5E WUIPhvyGFMJaeQXIyGRYZAYvKKklyAJcm29zLACxU5alX4M25lHQd9FR9Zmq6Jed wbWvia6cAIfsvlZ9JGocmQYF7pcuz5pnczqP+/yvRqFJtDGD/v3s++G2R+ViVYJO z/lxGUZaM4IWBCf+4DUjNanZM0oxAE28NjaIZ0rrldDQmO8V9FtPKdHxkqA5iJP+ 6vGOFti1Ak4kmEz0vM/Nsv7kkubTFhRl05OiJIGr9S1UhenlZv9l6RuXsOY/EwH2 z8X9N4MhMyXEVuC9rt8/AUhmVQ== =bOW+ otherwise identical un-encrypted request. 6.24 Error-Info The Error-Info response header provides a pointerproxy uses toadditional information aboutmake a routing decision on theerror status response.request. Thisheader fieldisonly contained in 3xx, 4xx, 5xx and 6xx responses. Error-Info = "Error-Info" ":" # ( "<" URI ">" *( ";" generic-param )) 6.25 Expires The Expires entity-header field gives the date and time after whichto ensure that if themessage content expires. This header fieldrequest iscurrently defined only forrouted back to theREGISTERproxy, andINVITE methods. For REGISTER,one of those fields changes, it is treated as arequestspiral, andresponse-header field. Innot aREGISTER request, the client indicates how long it wishesloop. The algorithm used to compute theregistrationhash is implementation-dependent, but MD5 [36], expressed in hexadecimal, is a reasonable choice. (Note that base64 is not permissible for a token.) The other part, used for matching responses tobe valid. Inrequests, is a globally unique function of theresponse,branch taken, for example, a hash of a sequence number, local IP address and request-URI of theserver indicatesrequest sent on theearliest expiration time of all registrations.branch. For example: 7a83e5750418bce23d5106b4c06cc632.1 Theserver MAY"branch" parameter MUST depend on the incoming Handley/Schulzrinne/Schooler/Rosenberg [Page62]79] Internet Draft SIPNovember 24, 2000 choose a shorter time interval than that requested by the client, but SHOULDNOT choose a longer one. IfMay 29, 2001 request-URI, or any other headers used for routing, to distinguish looped requests from requests whose request-URI (or whatever headers are used for routing) is changed and which then reach aregistration updates an existing registration,server visited earlier. CANCEL and ACK requests MUST have theExpiressame branch valueofas themost recent registration is used, even if it is shorter thancorresponding request they cancel or acknowledge. When a response arrives at theearlier registration. For INVITE requests,proxy it can use the branch value to figure out which branch the response corresponds to. Via: SIP/2.0/UDP first.example.com:4000;ttl=16 ;maddr=224.2.0.1 ;branch=a7c6a8dlze.1 (Acme server) Via: SIP/2.0/UDP adk8 10.47 Warning The Warning response-header field is used to carry additional information about the status of arequestresponse. Warning headers are sent with responses andresponse-header field. In a request,have thecaller can limitfollowing format: Warning = "Warning" ":" 1#warning-value warning-value = warn-code SP warn-agent SP warn-text warn-code = 3DIGIT warn-agent = ( host [ ":" port ] ) | pseudonym ; thevalidityname or pseudonym ofan invitation, for example, if a client wants to limitthetime duration of a search or a conference invitation.server adding ; the Warning header, for use in debugging warn-text = quoted-string pseudonym = token Auser interfaceresponse MAYtake this ascarry more than one Warning header. The "warn-text" should be in ahintnatural language that is most likely to be intelligible toleave the invitation window on the screen even ifthe human useris not currently atreceiving theworkstation.response. Thisalso limitsdecision can be based on any available knowledge, such as thedurationlocation ofa search. Iftherequest expires beforecache or user, thesearch completes,Accept-Language field in a request, or theproxy returnsContent-Language field in a408 (Request Timeout) status. Inresponse. The default language is i-default [37]. Any server MAY add Warning headers to a302 (Moved Temporarily) response,response. Proxy servers MUST place additional Warning headers before any Authorization headers. Within that constraint, Warning headers MUST be added after any existing Warning headers not covered by a signature. A proxy servercan advise the client ofHandley/Schulzrinne/Schooler/Rosenberg [Page 80] Internet Draft SIP May 29, 2001 MUST NOT delete any Warning header field that it received with a response. When multiple Warning headers are attached to a response, themaximal durationuser agent SHOULD display as many of them as possible, in theredirection. Noteorder that they appear in theexpiration time doesresponse. If it is notaffect the durationpossible to display all of theactual session that may result from the invitation. Session description protocols may offerwarnings, theability to express time limits onuser agent first displays warnings that appear early in thesession duration, however.response. Thevaluewarn-code consists ofthis field can be either a SIP-date or an integer numberthree digits. A first digit ofseconds (in decimal), measured from the receipt"3" indicates warnings specific to SIP. This is a list of therequest. The latter approach is preferable for short durations, as it does not depend on clientscurrently-defined "warn-code"s, each with a recommended warn-text in English, andservers sharingasynchronized clock. Implementations MAY treat values larger than 2**32-1 (4294967295 or 136 years) as equivalent to 2**32-1. Expires = "Expires" ":" ( SIP-date | delta-seconds ) Two examplesdescription of itsusemeaning. Note that these warnings describe failures induced by the session description. Warnings 300 through 329 areExpires: Thu, 01 Dec 1994 16:00:00 GMT Expires: 5 6.26 From Requests and responses MUST contain a From general-header field,reserved for indicating problems with keywords in theinitiator ofsession description, 330 through 339 are warnings related to basic network services requested in therequest. (Note that this may be different fromsession description, 370 through 379 are warnings related to quantitative QoS parameters requested in theinitiatorsession description, and 390 through 399 are miscellaneous warnings that do not fall into one of thecall leg. Requests sent byabove categories. 300 Incompatible network protocol: One or more network protocols contained in thecallee tosession description are not available. 301 Incompatible network address formats: One or more network address formats contained in thecaller usesession description are not available. 302 Incompatible transport protocol: One or more transport protocols described in thecallee's addresssession description are not available. 303 Incompatible bandwidth units: One or more bandwidth measurement units contained in theFrom header field.) The From field MAY containsession description were not understood. 304 Media type not available: One or more media types contained in the"tag" parameter. The server copiessession description are not available. 305 Incompatible media format: One or more media formats contained in theFrom header field fromsession description are not available. 306 Attribute not understood: One or more of therequest tomedia attributes in theresponse. Thesession description are not supported. Handley/Schulzrinne/Schooler/Rosenberg [Page63]81] Internet Draft SIPNovember 24, 2000 optional "display-name" is meant to be rendered by a human-user interface.May 29, 2001 307 Session description parameter not understood: Asystem SHOULD use the display name "Anonymous" ifparameter other than those listed above was not understood. 330 Multicast not available: The site where theidentity ofuser is located does not support multicast. 331 Unicast not available: The site where theclientuser is located does not support unicast communication (usually due toremain hidden.the presence of a firewall). 370 Insufficient bandwidth: TheSIP-URL MUSTNOT containbandwidth specified in the"transport-param", "maddr-param", "ttl-param",session description or"headers" elements. A serverdefined by the media exceeds thatreceivesknown to be available. 399 Miscellaneous warning: The warning text can include arbitrary information to be presented to aSIP-URL with these elements ignores them. Even ifhuman user, or logged. A system receiving this warning MUST NOT take any automated action. 1xx and 2xx have been taken by HTTP/1.1. If the"display-name"warning isempty,caused by the"name-addr" form MUST be used ifsession description, the"addr-spec" containsstatus response SHOULD include acomma, question mark, or semicolon. Syntax issues are discussed in Section 6.5. From = ( "From" | "f" ) ":" ( name-addr | addr-spec ) *( ";" from-param ) from-param = tag-param | generic-param tag-param = "tag" "=" token Examples: From: "A. G. Bell" <sip:agb@bell-telephone.com> ;tag=a48s From: sip:+12125551212@server.phone2net.com From: Anonymous <sip:c8oqz84zk7z@privacy.org> The "tag" MAY appearsession description similar to that included in OPTIONS responses indicating theFrom fieldcapabilities ofa request. It MUSTthe UAS. Additional "warn-code"s, as in the example below, can bepresent when it is possible that two instances of a user sharing a SIPdefined through IANA. Examples: Warning: 307 isi.edu "Session parameter 'foo' not understood" Warning: 301 isi.edu "Incompatible network addresscan make call invitations with the same Call-ID.type 'E.164'" 10.48 WWW-Authenticate The"tag" valueWWW-Authenticate response-header field MUST beglobally unique and cryptographically random with at least 32 bits of randomness.included in 401 (Unauthorized) response messages. TheUA SHOULD use different tags for From and To header fields, but use the same pairfield value consists oftagsat leastwithinone challenge that indicates thesame Call-ID. It is RECOMMENDEDauthentication scheme(s) and parameters applicable tomaintainthesame tag pair across callsRequest-URI. See [H14.47] for a definition of the syntax, andinstancesSection 19 for an overview of usage. The content of theUA application. Maintaining"realm" parameter SHOULD be displayed to thesame tag pair allow restarting of auser. A user agentwithin interrupting existing calls. Using different tag values for From and To header fields simplifies users calling themselves. ForSHOULD cache thepurposeauthorization credentials for a given value ofidentifying call legs, two From or To header fields are equal ifthe destination (To header) andonly if:"realm" and attempt to re- Handley/Schulzrinne/Schooler/Rosenberg [Page64]82] Internet Draft SIPNovember 24, 2000 o The addr-spec component is equal, according toMay 29, 2001 use these values on therules in Section 2.1. o Any "tag"next request for that destination. 11 Status Code Definitions The response codes are consistent with, and"generic-param" parametersextend, HTTP/1.1 response codes. Not all HTTP/1.1 response codes areequal, compared according to the case-sensitivity rules in Section 6. Only parametersappropriate, and only those thatappear in both header fieldsarecompared. Call-ID, To and Fromappropriate areneededgiven here. Other HTTP/1.1 response codes SHOULD NOT be used. Response codes not defined by HTTP/1.1 have codes x80 upwards toidentify a call leg. The distinction between call and call leg matters in callsavoid clashes withmultiple responses tofuture HTTP response codes. Also, SIP defines aforked request.new class, 6xx. Theformatdefault behavior for unknown response codes issimilar to the equivalent RFC 822 [26] header, but with a URI insteadgiven for each category ofjust an email address. 6.27 In-Reply-To The In-Reply-To request header field enumerates the call-IDscodes. 11.1 Informational 1xx Informational responses indicate thatthis call references or returns. This allows automatic call distribution systems to route return calls totheoriginator ofserver or proxy contacted is performing some further action and does not yet have a definitive response. The client SHOULD wait for a further response from thefirst callserver, andallows calleesthe server SHOULD send such a response without further prompting. A server SHOULD send a 1xx response if it expects tofilter calls, sotake more than 200 ms to obtain a final response. A server MAY issue zero or more 1xx responses, with no restriction on their ordering or uniqueness. Note thatonly calls1xx responses are not transmitted reliably, thatreturn callsis, theyhave originated will be accepted. This field isdo nota substitute for request authentication. In-Reply-To = "In-Reply-To" ":" 1# callid Example: In-Reply-To: 70710@saturn.bell-tel.com, 17320@saturn.bell-tel.com 6.28 Max-Forwards The Max-Forwards request-header field may be used with any SIP methodcause the client tolimitsend an ACK. Servers are free to retransmit informational responses and clients can inquire about thenumbercurrent state ofproxies or gateways that can forwardcall processing by re-sending therequest torequest. Informational (1xx) responses other than 100 (Trying) MAY contain message bodies, including session descriptions. If a 1xx response contains a session description, a UAC SHOULD cease generating local ringback tone. Session descriptions in 1xx responses are interpreted in thenext downstream server. This can also be useful whensame manner as those in 2xx responses. In particular, theclient is attempting to tracesession description MUST be formatted in such arequest chain which appears toway that it would befailing or loopingvalid inmid-chain. Max-Forwards = "Max-Forwards" ":" 1*DIGIT Handley/Schulzrinne/Schooler/Rosenberg [Page 65] Internet Draft SIP November 24, 2000 The Max-Forwards value isadecimal integer indicating2xx response. Thus, theremaining number of times this request message is allowed to be forwarded. Each proxy or gateway recipient of a request containingUAS can only include aMax- Forwards header field MUST check and updatesession description in itsvalue prior to forwardingprovisional response if therequest.UAC has included one in an earlier INVITE. (SIP extensions may specify additional circumstances where session descriptions may be included.) Ifthe received value is zero (0), the recipient MUSTNOT forward the request and returns 483 (Too many hops). Instead,aserver MAY act aslater provisional response or 2xx contains afinal recipient for OPTIONS requests. Itdifferent session description, this new description isRECOMMENDED that the server include Supported, Server and Allow header fields intreated as if it were theresponse. Iforiginal response to thereceived Max-Forwards value is greater than zero, thensession description in theforwarded message MUST contain an updated Max-Forwards field with a value decremented by one (1). Example: Max-Forwards: 6 6.29 MIME-Version See [H19.4.1]. 6.30 OrganizationINVITE. TheOrganization general-header field conveysUAS can remove thename ofmedia stream by setting theorganizationport number towhich the entity issuing the request orzero in a subsequent session description contained in a provisional responsebelongs. It MAY also be inserted by proxies at the boundary of an organization.and thus restore normal ringback behavior. Thefield MAY be usedUAS cannot add media streams beyond those offered byclient software to filter calls. Organization = "Organization" ":" TEXT-UTF8-TRIM 6.31 Priority The Priority request-header field indicatestheurgency ofUAC in therequestINVITE. A provisional response without a session description has no effect on any early media that have already been set up. The media streams are assumed to be bidirectional unless marked asperceived by the client. Priority = "Priority" ":" priority-valueHandley/Schulzrinne/Schooler/Rosenberg [Page66]83] Internet Draft SIPNovember 24, 2000 priority-value = "emergency" | "urgent" | "normal" | "non-urgent" | other-priority other-priority = token It is RECOMMENDED that the value of "emergency" only be used when life, limbMay 29, 2001 send-only orproperty arereceive-only. For SDP, this is described inimminent danger. Examples: Subject: A tornadoSection B. Client behavior when receiving several different session descriptions from different branches isheading our way! Priority: emergency Subject: Weekend plans Priority: non-urgent These are the values of RFC 2076 [35], with the addition of "emergency". 6.32 Proxy-Authenticate The Proxy-Authenticate response-header field MUST be included as partundefined. 11.1.1 100 Trying Some unspecified action is being taken on behalf of this call (e.g., a407 (Proxy Authentication Required) response. It may also occur in a 401 (Unauthorized) response ifdatabase is being consulted), but therequest was forked.user has not yet been located. 11.1.2 180 Ringing Thefield value consists ofcalled user agent has located achallenge that indicatespossible location where theauthentication schemeuser has registered recently andparameters applicableis trying to alert the user. 11.1.3 181 Call Is Being Forwarded A proxyforserver MAY use thisRequest-URI. Unlike its usage within HTTP,status code to indicate that theProxy-Authenticate header MUST be passed upstream incall is being forwarded to a different set of destinations. 11.1.4 182 Queued The called party is temporarily unavailable, but theresponsecallee has decided to queue theUAC. In SIP, only UAC's can authenticate themselves to proxies.call rather than reject it. When the callee becomes available, it will return the appropriate final status response. Thesyntax for this header is defined in [H14.33]. See 14 forreason phrase MAY give further detailson its usage. A client SHOULD cacheabout thecredentials used for a particular proxy server and realm forstatus of thenext requestcall, e.g., "5 calls queued; expected waiting time is 15 minutes". The server MAY issue several 182 responses tothat server. Credentials are, in general, valid for a specific valueupdate the caller about the status of theRequest-URI at a particular proxy server. If a client contacts a proxy server that has required authentication inqueued call. 11.1.5 183 Session Progress The 183 (Session Progress) response is used to convey information about thepast, butprogress of theclient doescall which is nothave credentials for the particular Request-URI, itotherwise classified. The Reason-Phrase MAYattemptbe used touseconvey more details about themost-recently used credential.call progress. 11.2 Successful 2xx Theserver respondsrequest was successful and MUST terminate a search. 11.2.1 200 OK The request has succeeded. The information returned with401 (Unauthorized) iftheclient guessed wrong.response depends on the method used in the request, for example: BYE: The call has been terminated. The message body is empty. Handley/Schulzrinne/Schooler/Rosenberg [Page67]84] Internet Draft SIPNovember 24, 2000 This suggested caching behaviorMay 29, 2001 CANCEL: The search has been cancelled. The message body ismotivated by proxies restricting phone callsempty. INVITE: The callee has agreed toauthenticated users. It seems likely that in most cases, all destinations requireparticipate; thesame password. Note that end-to-end authentication is likely to be destination-specific. 6.33 Proxy-Authorizationmessage body indicates the callee's capabilities. OPTIONS: TheProxy-Authorization request-header field allowscallee has agreed to share its capabilities, included in the message body. REGISTER: The registration has succeeded. The client treats the message body according toidentify itself (oritsuser)Content-Type. 11.3 Redirection 3xx 3xx responses give information about the user's new location, or about alternative services that might be able toa proxy which requires authentication. The Proxy-Authorization field value consists of credentials containingsatisfy theauthentication information ofcall. They SHOULD terminate an existing search, and MAY cause the initiator to begin a new search if appropriate. To avoid forwarding loops, a user agentfor theclient or proxyand/or realm ofMUST check whether theresource being requested. Unlike Authorization,address returned by a redirect server equals an address tried earlier. 11.3.1 300 Multiple Choices The address in theProxy-Authorization header field applies onlyrequest resolved to several choices, each with its own specific location, and thenext outbound proxy that demanded authentication using the Proxy- Authenticate field. When multiple proxies are used inuser (or user agent) can select achain, the Proxy-Authorization header field is consumed by the first outbound proxy that was expectingpreferred communication end point and redirect its request toreceive credentials. A proxy MAY relay the credentialsthat location. The response SHOULD include an entity containing a list of resource characteristics and location(s) from which theclient request touser or user agent can choose thenext proxyone most appropriate, ifthat is the mechanismallowed bywhich the proxies cooperatively authenticate a given request. See [H14.34] for a definition ofthesyntax, and section 14 for a discussion of its usage. 6.34 Proxy-RequireAccept request header. TheProxy-Require header fieldentity format isused to indicate proxy-sensitive features that MUST be supportedspecified by theproxy. Any Proxy-Require header field features that are not supported bymedia type given in theproxy MUSTContent-Type header field. The choices SHOULD also benegatively acknowledged bylisted as Contact fields (Section 10.14). Unlike HTTP, theproxy toSIP response MAY contain several Contact fields or a list of addresses in a Contact field. User agents MAY use theclient if not supported. Proxy servers treat thisContact header fieldidentically to the Require field. See Section 6.36value formore details onautomatic redirection or MAY ask themechanics of this message anduser to confirm ausage example. Proxy-Require = "Proxy-Require" ":" 1#option-tag 6.35 Record-Route 6.35.1 Operation The Record-Route request andchoice. However, this specification does not define any standard for such automatic selection. This status responseheader fieldisaddedappropriate if the callee can be reached at several different locations and the server cannot or prefers not toa request by anyproxythat insists on being inthepath of subsequentrequest. 11.3.2 301 Moved Permanently Handley/Schulzrinne/Schooler/Rosenberg [Page68]85] Internet Draft SIPNovember 24, 2000 requests forMay 29, 2001 The user can no longer be found at thesame call leg. A proxy SHOULD add it to any request for robustness, but a request route, once established, persists untiladdress in theend ofRequest-URI and thecall leg, regardless of whetherrequesting client SHOULD retry at theRecord-Route header is present in subsequent requests. The Record-Routenew address given by the Contact header fieldcontains a globally reachable SIP-URI that identifies the proxy server, including an(Section 10.14). The caller SHOULD update any local directories, addressparameter (maddr) that identifies its location. Each such proxy server addsbooks and user location caches with this new value and redirect future requests to the address(es) listed. 11.3.3 302 Moved Temporarily The requesting client SHOULD retry the request at the new address(es) given by the Contact header field (Section 10.14). The Request-URI of theincomingnew requesttouses thebeginningvalue of thelist. Requests between both user agents involvedContact header in thecall leg, in either direction, traverse this route. Some proxies, such as those controlling firewalls or in an automatic call distribution (ACD) system, need to maintain call state and thus need to receive any BYE, re-INVITEresponse. The new request can take two different forms. In the first approach, the To, From, Call-ID, andACK packets forCSeq header fields in thecall. Note that proxy servers have to add Record-Route headers to eachnew request are the same aslong as they want to be "visited" byin thenext request fororiginal request, with a new branch identifier in thecall leg.Via header field. Proxies MUSTinclude an maddr parameter in the URI infollow this behavior and UACs MAY. UAs MAY also use theRecord- Route header, but MUSTNOT include a transport parameter. IfContact information for theRequest-URI did not containTo header field, as well as aport number andnew Call-ID value. Reusing theserver port number differs fromCSeq value allows proxies to avoid forwarding thedefault,request to the same destination twice, as a proxyMUST addwill consider it aport number to the hostport portionretransmission. The duration of theRequest-URI.redirection can be indicated through an Expires (Section 10.24) header. Ifitthere isimportant that all requests go to the same host, server administrators are advised to be careful in selectingno explicit expiration time, theappropriate name oraddressto ensure that name resolution does indeed resolve to the same host. For example, a domain name having an SRV record may resolve to a different network addresses on each attempt. Inclusion of, say, a TCP transport parameter may prevent a UA that supportsis onlyUDP but reachedvalid for this call and MUST NOT be cached for future calls. 11.3.4 305 Use Proxy The requested resource MUST be accessed through the proxyinsertinggiven by theRecord-Route via another proxy from reachingContact field. The Contact field gives the URI of the proxy. The recipient is expected to repeat this single request via the proxy. 305 responses MUST only be generated by user agent servers. 11.3.5 380 Alternative Service TheUAS copiescall was not successful, but alternative services are possible. The alternative services are described in theRecord-Route request header field unchanged intomessage body of the response.(Record-Route is only relevantFormats for2xx responsessuch bodies are not defined here, andresponses where the server can expectmay be the subject of future standardization. 11.4 Request Failure 4xx 4xx responses are definite failure responses from a particular server. The clienttoSHOULD NOT retryforthe sameCall-Id, as in 401 (Unauthorized) or 484 (Address Incomplete).) 6.35.2 Construction of Route Header Once a proxy P inserts a Record-Route header in arequestfrom UA A to UA B, all subsequent requests from A to B and from B to A visit P. A UA builds the Route header field for subsequent requests fromwithout modification (e.g., adding appropriate authorization). However, the same request to a different server might be successful. Handley/Schulzrinne/Schooler/Rosenberg [Page69]86] Internet Draft SIPNovember 24, 2000 Record-Route header fields received in either a response or a request. If a UAC finds a Record-Route header in a final response, it copies it, including all parameters, into Route header fields of all subsequent requests within the same call leg, reversing the order of fields, so that the first entry is the server closestMay 29, 2001 11.4.1 400 Bad Request The request could not be understood due to malformed syntax. The Reason-Phrase SHOULD identify theUAC. If thesyntax problem in more detail, e.g., "Missing Call-ID header". 11.4.2 401 Unauthorized The request requires user authentication. This responsecontained a Contact header field, theis issued by user agentadds its content asservers and registrars, while 407 (Proxy Authentication Required) is used by proxy servers. 11.4.3 402 Payment Required Reserved for future use. 11.4.4 403 Forbidden The server understood thelast Route header. If a UAS finds a Record-Route header in arequest,it copies the Record-Route maddr parameters as well as other Record-Route parameters and any port value, maintaining their ordering,but is refusing to fulfill it. Authorization will not help, and theRoute header field of future requests issued as a UAC. Sincerequest SHOULD NOT be repeated. 11.4.5 404 Not Found The server has definitive information that theURIs containeduser does not exist at the domain specified in theRecord-Route header fields are not useful forRequest-URI. This status is also returned if thereverse request path,domain in theUA fills all other componentsRequest-URI does not match any of theRoute name-addr value with the name-addr value found indomains handled by theContact orrecipient of theFrom header field.request. 11.4.6 405 Method Not Allowed Thelatter is used only if there is no Contact header field. All URI parametersmethod specified in theContact or From header field are copied. If the request featured a Contact header field, the Contact header valueRequest-Line isappended tonot allowed for theRouteaddress identified by the Request-URI. The response MUST include an Allow headerlist. 6.35.3 Request Destination Unless this would causefield containing aloop, any client, includinglist of valid methods for theUAC, SHOULD sendindicated address. 11.4.7 406 Not Acceptable The resource identified by thenextrequestfor this call legis only capable of generating response entities which have content characteristics not acceptable according to thefirst Request-URIaccept headers sent in theRoute request header field. A client MAY forward the requestrequest. 11.4.8 407 Proxy Authentication Required This code is similar toa designated proxy instead, for example, if it lacks DNS resolution capability. If a client uses401 (Unauthorized), but indicates that the client MUST firstRoute entry to routeauthenticate itself with therequest, it removes it. 6.35.4 Syntaxproxy. TheRecord-Routeproxy MUST return a Proxy-Authenticate header fieldhas the following syntax: Record-Route = "Record-Route" ":" 1# ( name-addr *( ";" rr-param )) rr-param = generic-param Proxy servers MUST include their address in(section 10.31) containing a"maddr" URL parameter to ensure that subsequent requests are guaranteedchallenge applicable toreach exactlythesame server. 6.35.5 Exampleproxy for the requested resource. The client MAY repeat the request with a suitable Proxy-Authorization Handley/Schulzrinne/Schooler/Rosenberg [Page70]87] Internet Draft SIPNovember 24, 2000 Example for a request where the proxy servers ieee.org and bell- telephone.com , in that order, insist on being part of subsequent request paths: Record-Route: <sip:a.g.bell@bell-telephone.com;maddr=s.bell-telephone.com>, <sip:a.bell@ieee.org;maddr=199.172.136.40> 6.36 Require The Require general-headerMay 29, 2001 header field (section 10.32). SIP access authentication isused by clients to tell user agent servers about options that the client expects the server to supportexplained inorder to properly process the request. If a server does not understand the option, it MUST respond by returning status code 420 (Bad Extension)section 18.2 andlist those options it does not understand in the Unsupported header. Require = "Require" ":" 1#option-tag Example: C->S: INVITE sip:watson@bell-telephone.com SIP/2.0 Require: com.example.billing Payment: sheep_skins, conch_shells S->C: SIP/2.0 420 Bad Extension Unsupported: com.example.billing19. This status code is used for applications where access tomake sure that the client-server interaction will proceed without delay when all options are understood by both sides, and only slow down if options are not understood (as in the example above). For a well-matched client-server pair,theinteraction proceeds quickly, savingcommunication channel (e.g., around-trip often required by negotiation mechanisms. In addition, it also removes ambiguity whentelephony gateway) rather than theclientcallee requiresfeatures that theauthentication. 11.4.9 408 Request Timeout The serverdoes not understand. Some features, such as call handling fields, are only of interest to end systems. Proxy and redirect servers MUST ignore features that arecould notunderstood. Ifproduce aparticular extension requires that intermediate Handley/Schulzrinne/Schooler/Rosenberg [Page 71] Internet Draft SIP November 24, 2000 devices support it,response within a suitable amount of time, for example, since it could not determine theextension MUST be tagged inlocation of theProxy-Require field as well (see Section 6.34). 6.37 Response-Keyuser in time. TheResponse-Keyamount of time may have been indicated in the Expires request-header fieldcanor may beusedset bya client to requestthekey thatserver. The client MAY repeat thecalled user agent SHOULD userequest without modifications at any later time. 11.4.10 409 Conflict The request could not be completed due toencrypta conflict with the current state of the resource. This responsewith. The syntax is: Response-Key = "Response-Key" ":" key-scheme 1*SP #key-param key-scheme = token key-param = generic-paramis returned if the action parameter in a REGISTER request conflicts with existing registrations. 11.4.11 410 Gone The"key-scheme" givesrequested resource is no longer available at thetype of encryptionserver and no forwarding address is known. This condition is expected to beused for the response. Section 13 describes security schemes.considered permanent. If theclient insists that theserverreturn an encrypted response, it includes a Require: org.ietf.sip.encrypt-response header field in its request. Ifdoes not know, or has no facility to determine, whether or not theserver cannot encrypt for whatever reason, it MUST follow normal Require header field procedures and return a 420 (Bad Extension) response. If this Require header fieldcondition isnot present, a serverpermanent, the status code 404 (Not Found) SHOULDstill encrypt if it can. 6.38 Retry-After The Retry-After response-header field canbe usedwith a 503 (Service Unavailable) responseinstead. 11.4.12 413 Request Entity Too Large The server is refusing toindicate how longprocess a request because theservicerequest entity isexpectedlarger than the server is willing or able tobe unavailableprocess. The server MAY close the connection to prevent therequestingclientand with a 404 (Not Found), 600 (Busy), or 603 (Decline) response to indicate whenfrom continuing thecalled party anticipates being available again. The value of this field can be either an SIP-date or an integer number of seconds (in decimal) afterrequest. If thetime ofcondition is temporary, theresponse. A REGISTER request MAYserver SHOULD includethisa Retry- After header fieldwhen deleting registrations with "Contact: * ;expires: 0". The Retry-After value then indicates when the user might again be reachable. The registrar MAY then include this information in responses to future calls. An optional comment can be usedto indicateadditional information about the time of callback. An optional "duration" parameter indicates how long the called party will be reachable starting at the initial time of availability. If no duration parameterthat it isgiven,temporary and after what time theHandley/Schulzrinne/Schooler/Rosenberg [Page 72] Internet Draft SIP November 24, 2000 serviceclient MAY try again. 11.4.13 414 Request-URI Too Long The server isassumedrefusing tobe available indefinitely. Retry-After = "Retry-After" ":" ( SIP-date | delta-seconds ) [ comment ] *( ";" retry-param ) retry-param = "duration" "=" delta-seconds | generic-param Examples of its use are Retry-After: Mon, 21 Jul 1997 18:48:34 GMT (I'm in a meeting) Retry-After: Mon, 01 Jan 9999 00:00:00 GMT (Dear John: Don't call me back, ever) Retry-After: Fri, 26 Sep 1997 21:00:00 GMT;duration=3600 Retry-After: 120 In the third example,service thecallee is reachable for one hour starting at 21:00 GMT. Inrequest because thelast example,Request-URI is longer than thedelayserver is2 minutes. 6.39 Routewilling to interpret. 11.4.14 415 Unsupported Media Type Handley/Schulzrinne/Schooler/Rosenberg [Page 88] Internet Draft SIP May 29, 2001 TheRoute request-header field determinesserver is refusing to service theroute takenrequest because the message body of the request is in a format not supported by the server for the requested method. The server SHOULD return arequest. Each host removeslist of acceptable formats using thefirst entryAccept, Accept-Encoding andthen proxiesAccept-Language header fields. The client SHOULD retry therequest torequest, this time omitting any bodies not supported by thehost listed in that entry, also using it asserver. 11.4.15 420 Bad Extension The server did not understand theRequest-URI.protocol extension specified in a Proxy-Require (Section 10.33) or Require (Section 10.35) header field. 11.4.16 480 Temporarily Unavailable Theoperationcallee's end system was contacted successfully but the callee isdescribedcurrently unavailable (e.g., not logged in, logged inmore detailinSection 6.35.such a manner as to preclude communication with the callee or activated the "do not disturb" feature). TheRoute header field hasresponse MAY indicate a better time to call in thefollowing syntax: Route = "Route" ":" 1# ( name-addr *( ";" rr-param )) 6.40 ServerRetry-After header. TheServer response-header field contains information aboutuser could also be available elsewhere (unbeknownst to this host), thus, this response does not terminate any searches. The reason phrase SHOULD indicate a more precise cause as to why thesoftware usedcallee is unavailable. This value SHOULD be setable by the useragent serveragent. Status 486 (Busy Here) MAY be used tohandle the request. The syntaxmore precisely indicate a particular reason forthis field is defined in [H14.38]. 6.41 Subjectthe call failure. Thisheader field providesstatus is also returned by asummary or indicatesredirect server that recognizes thenature ofuser identified by thecall, allowingRequest-URI, but does not currently have a valid forwarding location for that user. 11.4.17 481 Call Leg/Transaction Does Not Exist This status is returned under three conditions: The server received a BYE request that does not match any existing callfiltering without having to parseleg, thesession description. (Noteserver received a CANCEL request that does not match any existing transaction or thesession descriptionserver received an INVITE with a To tag that does nothavematch the local tag value. (A server simply discards an ACK referring tousean unknown transaction.) A UAC receiving a 481 to a request sent for an existing call leg MUST consider that call leg terminated. 11.4.18 482 Loop Detected The server received a request with a Via (Section 10.46) path containing itself. 11.4.19 483 Too Many Hops Handley/Schulzrinne/Schooler/Rosenberg [Page73]89] Internet Draft SIPNovember 24, 2000 the same subject indication as the invitation.) Subject = ( "Subject" | "s" ) ":" TEXT-UTF8-TRIM Example: Subject: Tune in - they are talking about your work! 6.42 SupportedMay 29, 2001 TheSupported general-header field enumerates all the capabilities ofserver received a request that contains a Max-Forwards (Section 10.27) header with theclientvalue zero. 11.4.20 484 Address Incomplete The server received a request with a To (Section 10.43) address orserver. This header fieldRequest-URI that was incomplete. Additional information SHOULD beincluded in all requests (except ACK) and in all responses. Includingprovided. This status code allows overlapped dialing. With overlapped dialing, theheader field in all responses greatly simplifiesclient does not know theuselength ofextensionsthe dialing string. It sends strings of increasing lengths, prompting the user forcall controlmore input, until it no longer receives a 484 status response. 11.4.21 485 Ambiguous The callee address provided insubsequent transactions withthesame server. Syntax: Supported = ( "Supported" | "k" ) ":" 1#option-tag 6.43 Timestamprequest was ambiguous. TheTimestamp general-header field describes whenresponse MAY contain a listing of possible unambiguous addresses in Contact headers. Revealing alternatives can infringe on privacy concerns of theclient sentuser or therequestorganization. It MUST be possible to configure a server to respond with status 404 (Not Found) or to suppress theserver. The valuelisting of possible choices if thetimestamp is of significance onlyrequest address was ambiguous. Example response to a request with theclientURL lee@example.com : 485 Ambiguous SIP/2.0 Contact: Carol Lee <sip:carol.lee@example.com> Contact: Ping Lee <sip:p.lee@example.com> Contact: Lee M. Foote <sip:lee.foote@example.com> Some email andit MAY use any timescale. The server MUST echovoice mail systems provide this functionality. A status code separate from 3xx is used since theexact same value and MAY, ifsemantics are different: for 300, ithas accurate information about this, add a floating point number indicating the number of secondsis assumed thathave elapsed since it has receivedtherequest. The timestamp is usedsame person or service will be reached by theclient to compute the round-trip time to the server so that it can adjust the timeout valuechoices provided. While an automated choice or sequential search makes sense forretransmissions. Timestamp = "Timestamp" ":" *(DIGIT) [ "." *(DIGIT) ] [ delay ] delay = *(DIGIT) [ "." *(DIGIT) ]a 3xx response, user intervention is required for a 485 response. 11.4.22 486 Busy Here The callee's end system was contacted successfully but the callee is Handley/Schulzrinne/Schooler/Rosenberg [Page74]90] Internet Draft SIPNovember 24, 2000 Note that there MUSTNOTMay 29, 2001 currently not willing or able to take additional calls at this end system. The response MAY indicate a better time to call in the Retry-After header. The user could also beany LWS betweenavailable elsewhere, such as through aDIGIT andvoice mail service, thus, this response does not terminate any searches. Status 600 (Busy Everywhere) SHOULD be used if thedecimal point. 6.44 Toclient knows that no other end system will be able to accept this call. 11.4.23 487 Request Terminated TheTo general-header field specifiesrequest was terminated by a BYE or CANCEL request. This response is never returned for a CANCEL request itself. 11.4.24 488 Not Acceptable Here The response has the"logical" recipient ofsame meaning as 606 (Not Acceptable), but only applies to therequest. To = ( "To" | "t" ) ":" ( name-addr | addr-spec ) *( ";" to-param ) to-param = tag-param | generic-param Requestsspecific entity addressed by the Request-URI and the request may succeed elsewhere. 11.5 Server Failure 5xx 5xx responses are failure responses given when a server itself has erred. They are not definitive failures, and MUSTcontainNOT terminate aTo general-header field, indicating the desired recipient ofsearch if other possible locations remain untried. 11.5.1 500 Server Internal Error The server encountered an unexpected condition that prevented it from fulfilling the request. Theoptional "display-name" is meant to be rendered by a human-user interface. The UAS or redirect server copiesclient MAY display theTo header field into its response,specific error condition, andMUST add a "tag" parameter. If there was more than one Via header field,MAY retry the requestwas handled by at least one proxy server. Since the receiver cannot know whether any of the proxy servers forkedafter several seconds. If therequest, itcondition issafest to assume that they might have. The SIP-URL MUSTNOT containtemporary, the"transport-param", "maddr-param", "ttl-param", or "headers" elements. Aserverthat receives a SIP-URL with these elements removes them before further processing. The "tag" parameter serves as a general mechanism to distinguish multiple instances of a user identified by a single SIP URL. As proxies can fork requests,MAY indicate when thesame request can reach multiple instances of a user (mobile and home phones, for example). As each can respond, there needs to be a means to distinguishclient may retry theresponses from each atrequest using thecaller. The situation also arises with multicast requests.Retry-After header. 11.5.2 501 Not Implemented Thetag inserver does not support theTo header field servesfunctionality required todistinguish responses at the UAC. It MUST be placed infulfill theTo field ofrequest. This is the appropriate responseby user agent, registrar and redirect servers, but MUSTNOT be inserted into responses forwarded upstream by proxies. However, responses generated locally by a proxy, and then sent upstream, MUST containwhen atag. AUASor redirect server MUST add a "tag" parameter for all final responsesdoes not recognize the request method and is not capable of supporting it for any user. (Proxies forward alltransactions withinrequests regardless of method.) 11.5.3 502 Bad Gateway The server, while acting as acall leg. All such parameters havegateway or proxy, received an invalid response from thesame value withindownstream server it accessed in attempting to fulfill thesame call leg. These servers SHOULDrequest. 11.5.4 503 Service Unavailable Handley/Schulzrinne/Schooler/Rosenberg [Page75]91] Internet Draft SIPNovember 24, 2000 add the tag for informational responses duringMay 29, 2001 The server is currently unable to handle theinitial INVITE transaction, but MUST add a tagrequest due toinformational responses for all subsequent transactions. See Section 6.26 for detailsa temporary overloading or maintenance of the"tag" parameter.server. The"tag" parameter in To headersimplication isignored when matching responses to requeststhatdid not containthis is a"tag" in their To header. Section 11 describes whentemporary condition which will be alleviated after some delay. If known, the"tag" parameter MUST appearlength of the delay MAY be indicated insubsequent requests. Note that if a request already containedatag, this tagRetry-After header. If no Retry-After is given, the client MUSTbe mirrored inhandle theresponse; a new tag MUSTNOT be inserted. Section 6.26 describes how To and From header fields are comparedresponse as it would forthe purposea 500 response. Note: The existence ofmatching requeststhe 503 status code does not imply that a server has tocall legs. UAS SHOULD accept requests even if they douse it when becoming overloaded. Some servers MAY wish to simply refuse the connection. 11.5.5 504 Server Time-out The server did notrecognizereceive a timely response from theURI schemeserver (e.g., atel: URI) orlocation server) it accessed in attempting to process the request. Note that 408 (Request Timeout) should be used if there was no response within theToperiod specified in the Expires header field from the upstream server. 11.5.6 505 Version Not Supported The server does notaddresssupport, or refuses to support, theuser. Only Request-URISIP protocol version thatdo not matchwas used in therecipient should cause requestsrequest message. The server is indicating that it is unable or unwilling tobe rejected. Even ifcomplete the"display-name" is empty,request using the"name-addr" form MUST be used ifsame major version as the"addr-spec" contains a comma, question mark, or semicolon. Noteclient, other than with this error message. The response MAY contain an entity describing why thatLWSversion iscommon, butnotmandatory between the display-namesupported andthe "<". The followingwhat other protocols areexamples of valid To headers: To:supported by that server. TheOperator <sip:operator@cs.columbia.edu>;tag=287447 To: sip:+12125551212@server.phone2net.com Call-ID, Toformat for such an entity is not defined here andFrom are needed to identify a call leg.may be the subject of future standardization. 11.5.7 513 Message Too Large Thedistinction between call and call leg matters in calls with multipleserver was unable to process the request since the message length exceeded its capabilities. 11.6 Global Failures 6xx 6xx responsesfromindicate that aforked request. The "tag" is added toserver has definitive information about a particular user, not just theTo header fieldparticular instance indicated in theresponse to allow forking of future requestsRequest-URI. All further searches forthe same call by proxies, while addressing only one of the possibly several respondingthis useragent servers. It also allows several instances ofare doomed to failure and pending searches SHOULD be terminated. 11.6.1 600 Busy Everywhere The callee's end system was contacted successfully but the callee is busy and does not wish tosend requests that can be distinguished. 6.45 Unsupportedtake the call at this time. TheUnsupported response-header field listsresponse MAY indicate a better time to call in thefeaturesRetry-After header. If the callee does notsupported bywish to reveal theserver. See Section 6.36reason fora usage example anddeclining the call, the Handley/Schulzrinne/Schooler/Rosenberg [Page76]92] Internet Draft SIPNovember 24, 2000 motivation. Syntax: Unsupported = "Unsupported" ":" 1#option-tag 6.46 User-Agent The User-Agent general-header field contains information aboutMay 29, 2001 callee uses status code 603 (Decline) instead. This status response is returned only if the clientuser agent originatingknows that no other end point (such as a voice mail system) will answer the request. Otherwise, 486 (Busy Here) should be returned. 11.6.2 603 Decline Thesyntax and semantics are definedcallee's machine was successfully contacted but the user explicitly does not wish to or cannot participate. The response MAY indicate a better time to call in[H14.42]. 6.47 Viathe Retry-After header. 11.6.3 604 Does Not Exist Anywhere TheVia field indicatesserver has authoritative information that thepath taken byuser indicated in the To requestso far. This prevents request looping and ensures replies takefield does not exist anywhere. Searching for the user elsewhere will not yield any results. 11.6.4 606 Not Acceptable The user's agent was contacted successfully but some aspects of thesame pathsession description such as therequests, which assists in firewall traversal and other unusual routing situations. 6.47.1 Requests The client originatingrequested media, bandwidth, or addressing style were not acceptable. A 606 (Not Acceptable) response means that therequest MUST insert intouser wishes to communicate, but cannot adequately support therequestsession described. The 606 (Not Acceptable) response MAY contain aVialist of reasons in a Warning header fieldcontainingdescribing why thetransport protocol usedsession described cannot be supported. Reasons are listed in Section 10.47. It is hoped that negotiation will not frequently be needed, and when a new user is being invited to join an already existing conference, negotiation may not be possible. It is up tosend the message,theclient's host nameinvitation initiator to decide whether ornetwork address and, ifnotthe default port number, the port number at which it wishestoreceive responses. (Note thatact on a 606 (Not Acceptable) response. 12 SIP Message Body 12.1 Body Inclusion Requests MAY contain message bodies unless otherwise noted. In thisport number can differ fromspecification, theUDP source port numberCANCEL request MUST NOT contain a message body. The use ofthe request.) A fully-qualified domain namemessage bodies for REGISTER requests isRECOMMENDED. Each subsequent proxy server that sendsfor further study. For response messages, the requestonwards MUST add its own additional Via field before any existing Via fields. A proxy that receives a redirection (3xx)method and the response status code determine the type andthen searches recursively, MUST useinterpretation of any message body. All responses MAY include a body. Message bodies for 1xx responses contain advisory information about thesame Via headers as onprogress of theoriginal proxiedrequest.A proxy SHOULD check the top-most Via header field1xx responses toensure that it containsINVITE requests MAY contain session descriptions. Their interpretation depends on thesender's correct network address, as seen from that proxy. Ifresponse status code, but generally Handley/Schulzrinne/Schooler/Rosenberg [Page 93] Internet Draft SIP May 29, 2001 informs thesender's addresscaller what kind of session the callee isincorrect,likely to establish, subject to later modification in theproxy MUST add an additional "received" attribute,2xx response. Request methods not defined in this specification MAY also contain session descriptions. 2xx responses to INVITE requests contain session descriptions. In 3xx responses, the message body MAY contain the description of alternative destinations or services, as described in Section6.47.2. A multi-homed host may not be able to insert a network address into11.3. For responses with status 400 or greater, theVia header field that can be reached bymessage body MAY contain additional, human-readable information about thenext hop,reasons forexample because if one of the networksfailure. It isprivate.RECOMMENDED that information in 1xx and 300 and greater responses be of type text/plain or text/html 12.2 Message Body Type Theaddress placed intoInternet media type of theViamessage body MUST be given by the Content-Type headermay differ fromfield. If theinterface actually used,body has undergone any encoding (such asthat interface is selected only at packet sending time by the IP layer. Handley/Schulzrinne/Schooler/Rosenberg [Page 77] Internet Draft SIP November 24, 2000 A client that sends a request to a multicast addresscompression) then this MUSTaddbe indicated by the"maddr" parameter to its ViaContent- Encoding header field,and SHOULD addotherwise Content-Encoding MUST be omitted. If applicable, the"ttl" parameter. (In that case,character set of themaddr parameter SHOULD containmessage body is indicated as part of thedestination multicast address, although under exceptional circumstances itContent-Type header-field value. The "multipart" MIME type [38] MAYcontainbe used within the body of the message. Clients that send requests containing multipart message bodies MUST be able to send aunicast address.) Ifsession description as a non-multipart message body if the serverreceives a request which containedrequests this through an"maddr" parameterAccept header field. 12.3 Message Body Length The body length inthe topmost Via field, itbytes SHOULDsendbe given by theresponse toContent-Length header field. Section 10.18 describes theaddress listedbehavior in detail. The "chunked" transfer encoding of HTTP/1.1 MUST NOT be used for SIP. (Note: The chunked encoding modifies the"maddr" parameter. Loop detection is describedbody of a message inSection 12.3.1. 6.47.2 Receiver-tagged Via Header Fields Every host that sends or forwardsorder to transfer it as a series of chunks, each with its own size indicator.) 13 Compact Form When SIPrequest addsis carried over UDP with authentication and aVia field indicating the host's address. However,complex session description, itismay be possible thatNetwork Address Translators (NATs) changethesourcesize of a request or response is larger than the MTU. To addressand portthis problem, a more compact form of SIP is also defined by using abbreviations for therequest (e.g.,common header fields listed below: short field name long field name note c Content-Type e Content-Encoding Handley/Schulzrinne/Schooler/Rosenberg [Page 94] Internet Draft SIP May 29, 2001 f From i Call-ID k Supported froma net-10 to a globally routable address),"know" l Content-Length m Contact from "moved" s Subject t To v Via Thus, the message inwhich casesection 20.2 could also be written: INVITE sip:bob@example.com SIP/2.0 v:SIP/2.0/UDP 131.215.131.131;maddr=239.128.16.254;ttl=16 v:SIP/2.0/UDP 216.112.6.38 f:sip:alice@wonderland.com t:sip:bob@example.com m:sip:alice@mouse.wonderland.com i:62729-27@216.112.6.38 c:application/sdp CSeq: 4711 INVITE l:187 v=0 o=user1 53655765 2353687637 IN IP4 128.3.4.5 s=Mbone Audio i=Discussion of Mbone Engineering Issues e=mbone@somewhere.com c=IN IP4 224.2.0.1/127 t=0 0 m=audio 3456 RTP/AVP 0 a=rtpmap:0 PCMU/8000 Clients MAY mix short field names and long field names within theVia headersame request. Servers MUST accept both short and long fieldcannotnames for requests. Proxies MAY change header fields between their long and short forms, but this MUST NOT berelied ondone toroute replies. To prevent this,fields following an Authorization header. 14 Behavior of SIP Clients and Servers 14.1 Multicast Unreliable Transport Protocols Requests MAY be multicast; multicast requests likely feature aproxyhost- independent Request-URI. This request SHOULDcheck the top-most Via header fieldbe scoped to ensurethatitcontainsHandley/Schulzrinne/Schooler/Rosenberg [Page 95] Internet Draft SIP May 29, 2001 is not forwarded beyond thesender's correct network address, as seen from that proxy. Ifboundaries of thesender's addressadministrative scope. This MAY be done with either TTL or administrative scopes [27], depending on what isincorrect,implemented in theproxy MUST addnetwork. A client receiving a"received" parametermulticast query does not have to check whether the host part of the Request-URI matches its own host or domain name. If the request was received via multicast, the response MUST be returned to theVia header field inserted byaddress listed in the maddr parameter of theprevious hop. Such a modified Via header field is known as a receiver-taggedVia header field.An example is: Via: SIP/2.0/UDP erlang.bell-telephone.com:5060 Via: SIP/2.0/UDP 10.0.0.1:5060 ;received=199.172.136.3 In(This parameter is REQUIRED.) Generally, thisexample, the message originated from 10.0.0.1 and traversedwill be aNATmulticast address. Such multicast responses are multicast with theexternal address border.ieee.org (199.172.136.3) to reach erlang.bell-telephone.com. The latter noticed the mismatch, and added a parameter tosame TTL as theprevious hop's Via header field, containingrequest, where theaddress thatTTL is derived from thepacket actually came from. (Note thatttl parameter in theNAT border.ieee.org is not a SIP server.) 6.47.3 ResponsesVia headerfields in responses are processed(Section 10.46). To avoid response implosion, servers MUST NOT answer multicast requests with a status code other than 2xx, 401, 407, 484 or 6xx. The server delays its response by a random interval uniformly distributed between zero and one second. Servers MAY suppress responses if they hear a lower-numbered or 6xx response from another group member prior to sending. Servers do not respond to CANCEL requests received via multicast to avoid request implosion. A proxy or UACaccording toSHOULD send a CANCEL on receiving thefollowing rules: 1. ThefirstVia header field should indicate the proxy2xx, 401, 407 orclient6xx response to a multicast request. Server response suppression is a MAY since it requires a server to violate some basic message processingthis response. Ifrules. Lets say A sends a multicast request, and itdoes not, discard the message. Otherwise, remove this Via field. Handley/Schulzrinne/Schooler/Rosenberg [Page 78] Internet Draft SIP November 24, 2000 2. If thereisno second Via header field, this response is destined for this client. Otherwise, use thisreceived by B, C, and D. B sends a 200 response. The topmost Via fieldas the destination, as describedinSection 6.47.5. 6.47.4 User Agent and Redirect Servers A UAS or redirect server copiestheVia header fields intoresponse will contain the address of A. C will also receive this response,without changing their order,anduses the top (first) Via elementcould use it to suppress its own response. However, C would normally not examine this response, as thedestination, as describedtopmost Via is not its own. Normally, a response received with an incorrect topmost Via MUST be dropped, but not in this case. To distinguish this packet from a misrouted or multicast looped packet is fairly complex, and for this reason thenext section. 6.47.5 Forwarding Responses Givenprocedure is adestination described byMAY. The CANCEL, instead, provides aVia header field, thesimpler and more standard way to perform response suppression. It issent according to the following rules: o Iffor this reason that the"sent-protocol"use of CANCEL here is a SHOULD. 14.2 Reliable Transport Protocols A single reliable transportprotocolconnection such asTCP, TLSTCP can serve one orSCTP, sendmore SIP transactions. A transaction contains zero or more provisional responses followed by one or more final responses. (Typically, transactions contain exactly one final response, but there are exceptional circumstances, where, for example, multiple 200 responses can be generated.) The client SHOULD keep the connection Handley/Schulzrinne/Schooler/Rosenberg [Page 96] Internet Draft SIP May 29, 2001 open at least until the first final responseusingarrives. The server SHOULD NOT close theexisting TCPconnectiontountil it has sent its final response (and possibly received thesource ofACK), at which point it MAY close theoriginal request. o Otherwise,TCP connection if it wishes to. However, normally it is theVia header field contains a "maddr" parameter, forward the responseclient's responsibility to close theaddress listed there, usingconnection. If theport indicated in "sent-by", or port 5060server leaves the connection open, and ifnone is present. Iftheaddress is a multicast address,client so desires it MAY re-use theresponse SHOULDconnection for further SIP requests. These requests can besent using the TTL indicated infor the"ttl" parameter,same transaction orwith a TTL of 1 if that parametercall, or for totally different transactions or calls. There isnot present. o Otherwise, if itno requirement that a transaction must complete before a new one is initiated on an existing connection. As areceiver-tagged field (Section 6.47.2), sendresult, a server MUST support receiving a request for a new transaction on an existing connection before the previous transaction on the same connection has completed. If a server needs to return a response tothe address in the "received" parameter, using the port indicated in the "sent-by" value, or using port 5060 if none is specified explicitly. o Otherwise, ifa client and no longer has a connection open to that client, itis not receiver-tagged, send the responseMAY open a connection to the addressindicated by the "sent-by" valuelisted in thesecondViaheader field. Note that the responseheader. Thus, a proxy or user agent MUST be prepared to receive both requests and responses on a "passive" connection. 14.3 Reliability for Requests Other Than INVITE 14.3.1 Unreliable Transport Protocols A SIP client using an unreliabledatagram request is not returned to the port from whichtransport protocol such as UDP SHOULD retransmit requests other than INVITE or ACK with an exponential backoff, starting at a T1 second interval, doubling therequest came. 6.47.6 Syntax The formatinterval for each packet, and capping off at aVia header fieldT2 second interval. This means that after the first packet isshown in Fig. 10. The "maddr" parameter, designatingsent, themulticast address, andsecond is sent T1 seconds later, the"ttl" parameter, designatingnext 2*T1 seconds after that, thetime-to-live (TTL) value, are included only ifnext 4*T1 seconds after that, and so on, until therequest was sent via multicast. The "received" parameter is added only for receiver-added Via fields (Section 6.47.2). The "branch" parameter is includedinterval reaches T2. Subsequent retransmissions are spaced byevery proxy. The token MUST be Handley/Schulzrinne/Schooler/Rosenberg [Page 79] Internet Draft SIP November 24, 2000 Via = ( "Via" | "v") ":" 1#( sent-protocol sent-by *( ";" via-params ) [ comment ] ) via-params = via-hidden | via-ttl | via-maddr | via-received | via-branch | via-extension via-hidden = "hidden" via-ttl = "ttl" "=" ttl via-maddr = "maddr" "=" host via-received = "received" "=" host via-branch = "branch" "=" token via-extension = generic-param sent-protocol = protocol-name "/" protocol-version "/" transport protocol-name = "SIP" | token protocol-version = token transport = "UDP" | "TCP" | token sent-by = host [ ":" port ] Figure 10: SyntaxT2 seconds. If the client receives a provisional response, it continues to retransmit the request, but with an interval ofVia header field uniqueT2 seconds. Retransmissions cease when the client has sent a total of eleven packets, or receives a definitive response. Default values foreach distinct request. The precise formatT1 and T2 are 500 ms and 4 s, respectively. Clients MAY use larger values, but SHOULD NOT use smaller ones. Servers retransmit the response upon receipt of a request retransmission. After thetoken is implementation-defined. In order toserver sends a final response, it cannot beable to both detect loops and associate responses withsure thecorresponding request,client has received theparameterresponse, and thus SHOULDconsist of two parts separable bycache theimplementation. One part, usedresults forloop detection (Section 12.3.1), MAY be computed asat least 10*T2 seconds to avoid having to, for example, contact the user or location server again upon receiving acryptographic hashrequest retransmission. Use of theTo, From, Call-ID header fields, the Request-URI ofexponential backoff is for congestion control Handley/Schulzrinne/Schooler/Rosenberg [Page 97] Internet Draft SIP May 29, 2001 purposes. However, the back-off must cap off, since requestreceived (before translation) andretransmissions are used to trigger response retransmissions at thesequence number fromserver. Without a cap, theCSeq header field.loss of a single response could significantly increase transaction latencies. Thealgorithm used to computevalue of thehash is implementation-dependent, but MD5 [36], expressed in hexadecimal,initial retransmission timer isa reasonable choice. (Notesmaller than thatbase64that for TCP since it isnot permissibleexpected that network paths suitable for interactive communications have round-trip times smaller than 500 ms. For congestion control purposes, the retransmission count has to be bounded. Given that most transactions are expected to consist of one request and atoken.) The other part, used for matching responsesfew responses, round-trip time estimation is not likely torequests,be very useful. If RTT estimation is desired to more quickly discover aglobally unique function ofmissing final response, each request retransmission needs to be labeled with its own Timestamp (Section 10.42), returned in thebranch taken, for example,response. The server caches the result until it can be sure that the client will not retransmit the same request again. Each server in ahash ofproxy chain generates its own final response to asequence number, local IP address and request- URICANCEL request. The server responds immediately upon receipt of the CANCEL requestsent on