view Side-By-Side changes
Internet Engineering Task Force SIP WG Internet DraftHandley/Schulzrinne/Schooler/Rosenberg draft-ietf-sip-rfc2543bis-04.txt ACIRI/Columbia U./Caltech/dynamicsoft July 20,Jonathan Rosenberg dynamicsoft Henning Schulzrinne Columbia U. Gonzalo Camarillo Ericsson Alan Johnston Worldcom Jon Peterson Neustar Robert Sparks dynamicsoft Mark Handley ACIRI Eve Schooler AT&T draft-ietf-sip-rfc2543bis-05.txt October 26, 2001 Expires:FebruaryApril 2002 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 Internetmultimedia conferences, Internettelephonecallscalls, multimedia distribution and multimediadistribution. Members in a session can communicate via multicast or via a mesh of unicast relations, or a combination of these.conferences. SIP invitations used to create sessions carry session descriptions which allow participants to agree on a set of compatible media types. SIPsupports user mobility by proxying and redirectingmakes use of elements called proxy servers to help route requests to theuser's current location. Users can register theirusers currentlocation. SIP is not tiedlocation, assist in firewall traversal, and provide features toany particular conference control protocol.users. SIPis designedalso provides a registration function that allows them tobe independentupload their current location for use by proxy servers. SIP runs ontop ofthe lower-layerseveral different transportprotocol and can be extended with additional capabilities. Handley/Schulzrinne/Schooler/Rosenbergprotocols. 1 Introduction Various Authors [Page 1] Internet Draft SIPJuly 20,October 26, 20011 Introduction 1.1There are many applications of the Internet that require the creation and management of a session, where a session is considered an exchange of data between an association of participants. The implementation of these services is complicated by the practices of participants; users may move between endpoints, they may be addressable by multiple names, and they may communicate in several different media - sometimes simultaneously. Numerous protocols have been authored that carry various forms of real-time multimedia session data such as voice, video, or text messages. SIP works in concert with these protocols by enabling Internet endpoints (called "user agents") to discover one another and to agree on a characterization of a session they would like to share. For locating prospective session participants, SIP relies on an infrastructure of network hosts (called "proxy servers") to which user agents can send registrations, invitations to sessions and other requests. SIP is an agile, general-purpose tool for creating, modifying and terminating sessions that works independently of underlying transport protocols and without dependency on the type of session that is being established. 2 Overview of SIP Functionality The Session Initiation Protocol (SIP) is an application-layer control protocol that can establish, modify and terminate multimedia sessions (conferences)orsuch as Internet telephony calls. SIP can also invite participants tounicast and multicast sessions; the initiatoralready existing sessions. A SIP entity issuing an invitation for an already existing session does not necessarily have to be a member of the session to which it is inviting. Mediaand participantscan be added to (and removed from) 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 enablewhich supports personalmobility. In the parlance of telecommunications intelligent network services, this is defined as: "Personalmobilityis 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[1] - usersas 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 tocan maintaincommunications when movinga singleend system from one subnet to another.externally visible identifier (SIP URI) regardless of their network location. SIP supports five facets of establishing and terminating multimedia communications: User location: determination of the end system to be used for communication; Usercapabilities: determination of the media and media parameters to be used; Useravailability: determination of the willingness of the called party to engage in communications;CallUser capabilities: determination of the media and media parameters to be used; Session setup: "ringing", establishment ofcallsession parameters at both called and calling party;CallVarious Authors [Page 2] Internet Draft SIP October 26, 2001 Session handling: including transfer and termination ofcalls.sessions, modifying session parameters, and invoking services. SIP isdesigned as partnot a vertically integrated communications system. SIP is rather a component of the overall IETF multimedia data and control architecturecurrently incorporatingwhich incorporates 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 advertisingHandley/Schulzrinne/Schooler/Rosenberg [Page 2] Internet Draft SIP July 20, 2001multimedia sessions via multicast and the session description protocol (SDP) (RFC 2327 [6]) for describing multimedia sessions. Therefore, SIP should be used in conjunction with other protocols in order to provide complete services to the users. However, the basic functionality and operation of SIP does not depend on any of these protocols. SIP does notoffer conference control services such as floor control or voting and does not prescribe how a conference is to be managed, butprovide services. SIP rather provides primitives that can be used tointroduce conference control protocols.implement different services. For example, SIPdoes not allocate multicast addresses andcan locate a user and deliver an opaque object to his current location. If this primitive is used to deliver a session description written in SDP, for instance, the parameters of a session can be agreed between endpoints. If the same primitive is used to deliver a photo of the caller as well as the session description, a "caller ID" service can be easily implemented. As this example shows, a single primitive is typically used to provide several different services. Consequently, generality is more important than efficiency when designing SIP primitives. 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 initiate a session that uses some other conference control protocol. SIP does not allocate multicast addresses and does not reserve network resources.1.23 Terminology In this document, the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALLNOT", "SHOULD", "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.34 Overview ofSIPOperation This sectionexplainswill introduce the basicprotocol 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.operations of the SIP protocol using simple examples. Note that this section isa request-response protocol, with requests sent by clients and received by servers. A single implementation typically combines both clienttutorial in nature andserver functionality. SIP requests can be sent usingdoes not contain anyreliable or unreliable protocol, including UDP, SCTP [8]normative statements. Various Authors [Page 3] Internet Draft SIP October 26, 2001 The first example will show the basic functions of SIP: location of an end point, signaling a desire to communicate, negotiation of session parameters to establish the session, andTCP. Protocol operation is largely independentteardown of thelower-layer transport protocol. This specification defines six SIP request methods: INVITE (Section 5.1) initiates sessions, ACK (Section 5.1.1) confirmssessionestablishment, OPTIONS (Section 8) requests information about capabilities, BYE (Section 6) terminatesonce established. Figure 1 shows asessions, CANCEL (Section 5.2) cancelstypical example of apending sessionSIP message exchange between two users, Alice and Bob. (Each message is labeled with the letter "F" andREGISTER (Section 7) allowsaclient to bindnumber for reference by the text.) In this example, Alice uses apermanentSIPURLapplication on her PC (referred to as atemporarysoftphone) to call Bob on his SIPURL reflectingphone over thecurrent network location.Internet. Also shown are two SIPrequestsproxy servers which act on behalf of Alice andresponses consistsBob to facilitate the session establishment. This typical arrangement is often referred to as the "SIP trapezoid" as shown by the geometric shape of the dashed lines in Figure 1. Alice "calls" Bob using his SIP identity, arequest (or status) line, a numbertype ofheader lines andUniform Resource Identifier (URI) called amessage body (Section 3).SIPrequests can be sent directly from a user agent client toURI and defined in Section 21.1. It has auser agent server, or they can traverse one or more proxy servers along the way. Often, proxy servers are associated with DNS domains,similar form toSMTP MTAs. User agents send requests either directly to the address indicated inan email address, typically containing a username and a host name. In this case it is sip:bob@biloxi.com, where biloxi.com is the domain of Bob's SIPURI or toservice provider (which can be an enterprise, retail provider, etc). Alice also has adesignated proxy ("outbound proxy"), independent Handley/Schulzrinne/Schooler/Rosenberg [Page 3] Internet DraftSIPJuly 20, 2001URI ofthe destination address. The current destinationsip:alice@atlanta.com. Alice might have typed in Bob's URI or perhaps clicked on a hyperlink or an entry in an address book. SIP iscarried in the Request-URI. Each proxy can forward the requestbased onlocal policy and information contained in the SIP request. The proxy MAY rewrite thean HTTP-like request/response transacton model. Each transaction consists of a requestURI. A proxy MAY also forwardthat invokes a particular "Method", or function, on therequest to another designated proxy regardless ofserver, and at least one response. In this example, the transaction begins with Alice's softphone sending an INVITE requestURI. For example, a departmental proxy could forward all authorized requestsaddressed to Bob's SIP URI. INVITE is an example of acorporate-wide proxySIP method whichthen forwards it to the proxy operated byspecifies theInternet service provider, which finally routesaction that therequest based onrequestor (Alice) wants the server (Bob) to take. The INVITE requestURI. Proxies MAY modify any partcontains a number ofthe SIP message thatheader fields. Header fields arenot integrity-protected, except those needed to identify call legs. Proxies generally do not modify the session description, but MAY do so. For example, ifadditional named attributes which provide additional information about a message. The ones present in an INVITE include a unique identifier for theuser agent wants to contactcall, theuser sip:alice@example.com, it sendsdestination address, Alice's address, and information about therequesttype of session that Alice wishes to establish with Bob. The INVITE (message F1 in Figure 1) might look like this: INVITE sip:bob@biloxi.com SIP/2.0 Via: SIP/2.0/UDP 10.1.3.3:5060 To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710@10.1.3.3 CSeq: 314159 INVITE Contact: <sip:alice@10.1.3.3> Content-Type: application/sdp Various Authors [Page 4] Internet Draft SIP October 26, 2001 atlanta.com . . . biloxi.com . proxy proxy . . . Alice's . . . . . . . . . . . . . . . . . . . . Bob's softphone SIP Phone | | | | | INVITE F1 | | | |--------------->| INVITE F3 | | | 100 Trying F2 |--------------->| INVITE F5 | |<---------------| 100 Trying F4 |--------------->| | |<-------------- | 180 Ringing F6 | | | 180 Ringing F7 |<---------------| | 180 Ringing F8 |<---------------| 200 OK F9 | |<---------------| 200 OK F10 |<---------------| | 200 OK F11 |<---------------| | |<---------------| | | | ACK F12 | |------------------------------------------------->| | Media Session | |<================================================>| | BYE F13 | |<-------------------------------------------------| | 200 OK F14 | |------------------------------------------------->| | | Figure 1: SIP session setup example with SIP trapezoid Contact-Length: 142 (Alice's SDP not shown) The first line of theserver handlingtext-encoded message contains theexample.com domain (Section 1.4.2). If that host acts asmethod name (INVITE). The lines which follow are aproxy server, it looks up whether it haslist of header fields. This example contains amapping from alice@example.com to another address. If so, it substitutes that address, say alice@sales.example.com, intominimum required set. The headers are briefly described below: Via contains theRequest-URIIP address (10.1.3.3), port number (5060), andthen sends the requesttransport protocol (UDP) on which Alice is expecting tothe server for the sales.example.com domain. Any server can also returnreceive responses to this request. Various Authors [Page 5] Internet Draft SIP October 26, 2001 To contains aresponse indicatingdisplay name (Bob) and adifferent destination to be tried by the upstream client or indicatingSIP URI (sip:bob@biloxi.com) that the requestcannot be forwarded. Typically, only the first request withinwas originally directed towards. From also contains acall traverses all proxies, while subsequent requests are exchanged directly between user agents. However,display name (Alice) and aproxy can indicateSIP URI (sip:alice@atlanta.com) thatit wants to remain inindicate therequest path via a Record-Route (Section 10.34) header field. 1.4 Definitionsoriginator of the request. Thisspecification usesheader field also has anumber of terms to refertag parameter which contains a pseudorandom string (1928301774) which was added to theroles playedURI byparticipants in SIP communications. The definitions of client, server and proxy are similar to thosethe softphone. It is used for identification purposes. Call-ID contains a globally unique identifier for this call, generated by theHypertext Transport Protocol (HTTP) (RFC 2616 [9]). The terms and generic syntaxcombination ofURIa pseudorandom string andURL are defined in RFC 2396 [10].the softphone's IP address. Thefollowing 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,combination of the To, From, andacts asCall-ID completely define aUAS to process it. In orderpeer-to-peer SIP relationship betwee Alice and Bob, and is referred todetermine how the request should be answered, it actsas aUAC and initiates a call outwards. Unlike a proxy server, it maintains complete call state"dialog". CSeq or Command Sequence contains an integer andmust participate in all requests foracall. Since itmethod name. The CSeq number ispurely a concatenation of other logical functions, no explicit definitions are neededincremented forits Handley/Schulzrinne/Schooler/Rosenberg [Page 4] Internet Draft SIP July 20, 2001 behavior. Call: A call consists of all participants in a session invited by a common source. A SIP call is identified by a globally unique call-id (Section 10.12),each new request, and iscreated whenauser agent sends an INVITE request. This INVITE request may generate multiple acceptances, each oftraditional sequence number. Contact contains a SIP URI whichare part of the same call (but different call legs). Furthermore, ifrepresents auser is inviteddirect route tothe same multicast session by several people, eachreach or contact Alice, usually composed ofthese invitations will be a unique call. In a multiparty conference unit (MCU) based call-in conference, each participant usesaseparate callusername at an IP address. While the Via header field is used toinvite himselftell other elements where to send theMCU. Call leg: A call leg is a pairwise signaling relationship between two SIP user agents. A call leg is established when a call invitation results inresponse, the Contact header field tells other elements where to send future requests for this dialog. Content-Type contains asuccessful response. It is identified bydescription of thecombinationmessage body (not shown). Content-Length contains an octet (byte) count of theCall-IDmessage body. The complete set of SIP headerfield, the local addressfields is defined in Section 22. The details of theparticipant, andsession, type of media, codec, sampling rate, etc. are not described using SIP. Rather, theremote addressbody of a SIP message contains a description of the session, encoded in some otherparticipant. For the caller, the local addressprotocol format. One such format is Session Description Protocol (SDP) [6]. This SDP message (not shown in theFrom field of the INVITE, andexample) is carried by theremote addressSIP message in an analogous way that a document attachment is carried by an email message, or a web page is carried in an HTTP message. Since theTo fieldsoftphone has no knowledge of Bob's exact location, or how to locate the200 class response. For the callee,SIP server in thelocal address isbiloxi.com domain, theTo field ofsoftphone sends the200 class responseINVITE to theINVITE, and the remoteSIP server that serves Alice's domain, atlanta.com. The IP addressis the From fieldof theINVITE.atlanta.com SIPURIs are compared according to Section 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 requestsserver could have been configured inthe opposite direction, i.e., From B and To A. Call Stateful: A proxy is said to be call stateful whenAlice's softphone, or itretains state that persistscould have been discovered by DHCP, forthe 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 sendsexample. The atlanta.com SIPrequests. 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 byserver is acommon session description. A conference can have zero or more members and includes the casestype ofa multicast conference, a full-mesh conference and a two-party "telephone call", as wellSIP server known ascombinations of these. Any number of calls can be used to createaconference. Downstream: Requests sent in the direction from the caller to Handley/Schulzrinne/Schooler/Rosenbergproxy server. A proxy server receives SIP requests and forwards them on Various Authors [Page5]6] Internet Draft SIPJuly 20,October 26, 2001 behalf of thecallee (i.e., user agent client to user agent server). Final response: A response that terminatesrequestor. In this example, the proxy server receives the INVITE request and generates aSIP transaction, as opposed100 Trying response which is sent back toa provisionalAlice's softphone. The 100 Trying response indicates thatdoes not. All 2xx, 3xx, 4xx, 5xxthe INVITE has been received and6xx responses are final. Initiator, calling party, caller: The party initiating a session invitation. Notethat thecalling party does not haveproxy is working on her behalf tobe the same as the one creating the conference. A caller retains this role fortry to route theduration of a call. Invitation: A request sentINVITE toa user (or service) requesting participationthe destination. Responses ina session. A successfulSIPinvitation consists of two transactions: an INVITE requestuse a numerical three digit code followed byan 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 ofacall. Isomorphic request or response: Two requests or responses are defined to be isomorphic for the purposes of this document if they havedescriptive phrase. This response contains the samevalues for the Call-ID,To,FromFrom, Call-ID, and CSeqheader fields. In addition, isomorphic requests haveas the INVITE, which allows Alice's softphone to correlate this response tohavethesame Request-URI andsent INVITE. The atlanta.com proxy server locates thesame top-most Via header. Location server: See location service. Location service: A location service is used by a SIP redirect orproxy serverto obtain information about a callee's possible location(s). Examples of sources of location information include SIP registrars, databases or mobility registration protocols. Location services are offeredat biloxi.com, possibly bylocation servers. Location servers MAY be part ofperforming aSIP server, butDNS (Domain Name Service) lookup to find themanner in which aSIP serverrequests location services is beyondwhich serves thescope of this document. Outbound proxy: A proxy thatbiloxi.com domain. This islocated neardescribed in Section 24. As a result, it obtains theoriginatorIP address ofrequests. It receives all outgoing requests from a particular UAC, including those requests whose Request-URLs identify a host other thantheoutbound proxy. The outboundbiloxi.com proxysends these requests, after any local processing, to the address indicated in the Request-URI. (All other proxy servers are simply referred asserver and forwards, or proxies,not inbound proxies.) Handley/Schulzrinne/Schooler/Rosenberg [Page 6] Internet Draft SIP July 20, 2001 Parallel search: In a parallel search, a proxy issues several requests to possible user locations upon receiving an incoming request. Rather than issuing onethe INVITE requestand then waiting forthere. Before forwarding thefinal response before issuingrequest, thenext request asatlanta.com proxy server adds an additional Via header field which contains its own IP address (the INVITE already contains Alice's IP address ina sequential search , a parallel search issues requests without waiting fortheresult of previous requests. Provisional response: Afirst Via). The biloxi.com proxy server receives the INVITE and responds with a 100 Trying responseused byback to the Atlanta.com proxy server to indicateprogress, but that does not terminate a SIP transaction. 1xx responses are provisional, other responses are considered final. Proxy, proxy server: An intermediary programthatacts as both a serverit has received the INVITE anda client foris processing thepurpose of making requests on behalf of other clients. Requests are serviced internally or by passing them on, possibly after translation, to other servers. Arequest. The proxyinterprets, 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 redirectserverisconsults aserver that acceptsdatabase, generically called aSIP request, mapslocation service, which contains the current IP addressinto zero or more new addresses and returns these addresses toof Bob. (We shall see in theclient. Unlike anext section how this database can be populated.) The biloxi.com proxy server, it does not initiateadds another Via header with its ownSIP request. Unlike a user agent server ,IP address to the INVITE and proxies itdoesto Bob's SIP phone. Bob's SIP phone receives the INVITE and begins to alert Bob to the incoming call from Alice so that Bob can decide whether or notaccept calls. Registrar: A registrar isto answer the call - i.e. Bob's phone rings. Bob's SIP phone sends an indication of this in aserver that accepts REGISTER requests. A registrar180 Ringing response. This response istypically co-located with arouted back thorough the two proxies in the reverse direction. Each proxyor redirect serveruses the Via header to figure out where to send the response, andMAY makeremoves itsinformation available throughown address from thelocation server. Regular Transaction: A regular transaction is any transaction withtop. As amethod other thanresult, although DNS and location service lookups were required to route the initial INVITE,ACK,the 180 Ringing response can be returned to the caller without lookups, orCANCEL. Ringback: Ringback iswithout state being maintained in thesignaling tone produced byproxies. This also has thecalling client's application indicatingdesirable property thata called party is being alerted (ringing). Server: A server is an application programeach proxy thataccepts requests in order to service requests and sends backsees the INVITE will also see all responses tothose requests. Servers are either proxy, redirectthe INVITE. When Alice's softphone receives the 180 Ringing response, it passes this information to Alice, perhaps using an audio ringback tone, oruser agent serversjust by displaying orregistrars. Session: From the SDP specification: "A multimedia session isflashing aHandley/Schulzrinne/Schooler/Rosenberg [Page 7] Internet Draft SIP July 20, 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,message on Alice's screen. In this example, Bob decides to answer thesame 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 incall. When he picks up theorigin field. (SIP) transaction: Ahandset his SIPtransaction occurs between a client and a server and comprises all messages from the first request sent from the client to the server up tophone sends afinal (non-1xx)200 OK responsesent from the serverto indicate that theclient. A transaction is identified by the CSeq sequence number (Section 10.20) within a singlecallleg. The ACK requesthas been answered. The 200 OK contains a message body containing thesame CSeq number asSDP media description of thecorresponding INVITE request, but comprises a transactiontype ofits own. Spiral: A spiralsession that Bob is willing to establish with Alice. As aSIP request whichresult, there isrouted toaproxy, forwarded onwards,two-phase exchange of SDP messages; Alice sent one to Bob, and Bob sent one back to Various Authors [Page 7] Internet Draft SIP October 26, 2001 Alice. This two-phase exchange provides basic negotiation capabilities, andarrives once again at that proxy, but this time, with a Request-URI that differs from the previous arrival. A spiralis based on a simple offer/answer model, If Bob did not wish to answer the call, or was busy on another call, an errorcondition, 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 everyresponseit receives upstream. Stateful Proxy: A logical entity that maintains state information for the durationwould have been sent instead ofa SIP transaction. Also known as a transaction stateful proxy.the 200 OK, which would have resulted in no media session being established. Thebehaviorcomplete list ofa stateful proxySIP response codes isfurther definedin Section17.3. A stateful proxy is23. The 200 OK (message F9 in Figure 1) might look like this: SIP/2.0 200 OK Via: SIP/2.0/UDP 10.2.1.1:5060;branch=4b43c2ff8.1 Via: SIP/2.0/UDP 10.1.1.1:5060;branch=77ef4c2312983.1 Via: SIP/2.0/UDP 10.1.3.3:5060 To: Bob <sip:bob@biloxi.com>;tag=a6c85cf From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710@10.1.3.3 CSeq: 314159 INVITE Contact: <sip:bob@10.4.1.4> Content-Type: application/sdp Contact-Length: 131 (Bob's SDP not shown) The first line of thesame as a call stateful proxy. Upstream: Responses sent inresponse contains thedirectionresponse code (200) and the reason phrase (OK). The remaining lines contain header fields. The Via header fields, To, From, Call- ID, and CSeq are all copied from theuser agent server toINVITE request. (Note that there are three Via headers - one added by Alice's SIP phone, one added by theuser agent client. URL-encoded: A character string encoded according to RFC 1738, Section 2.2 [11]. User agent client (UAC): A user agent client is a logical entityatlanta.com proxy, and one added by the biloxi.com proxy.) Also note thatinitiates aBob's SIPtransaction withphone has added arequest.tag parameter to the To header field. Thisrole lasts only fortag will be incorporated by both User Agents into theduration of that transaction. In other words, ifdialog and will be included in all future requests and responses in this call. The Contact header field contains apiece of software initiatesURI at which Bob can be directly reached at his SIP phone. The Content-Type and Content-Length refer to the not shown message body which contains Bob's SDP media information. In additon to DNS and location service lookups shown in this example, proxy servers can make arbitrarily complex "routing decisions" in order to decide where to send arequest, it acts asrequest. For example, if Bob's SIP phone returned aUAC for486 Busy Here response, theduration of that request. If it receivesbiloxi.com proxy server could proxy the INVITE to Bob's voicemail server. A proxy server can also send an INVITE to arequest later on, it takes onnumber of locations at therolesame time. This type ofa User Agent Handley/Schulzrinne/Schooler/Rosenbergparallel search is known as "forking". In this case, the 200 OK is routed back through the two proxies and Various Authors [Page 8] Internet Draft SIPJuly 20,October 26, 2001Server foris received by Alice's softphone which then stops theprocessing ofringback tone and indicates thattransaction. User agent server (UAS): A user agent serverthe call has been answered. Finally, an acknowledgement message, ACK, isa logical entity that respondssent by Alice toa SIP request, generally acting on behalfBob to confirm the reception ofsome user. Thethe final responseaccepts, rejects or redirects(200 OK). Note that in this example, therequest. This role lasts only forACK is sent directly from Alice to Bob, bypassing theduration of that transaction. In other words, if a piece of software respondstwo proxies. This is due toa request, it acts as a UAS fortheduration offact thatrequest. If it generates a request later on, it takes onthrough therole of a User Agent Client forINVITE/200 OK exchange, theprocessing of that transaction. User agent (UA): A logical entity which acts as both a user agent client andtwo SIP useragent server foragents have learned each other's IP address through theduration of a call. An application program MAY be capableContact header fields, something which was not known when the initial INVITE was sent. The lookups performed by the two proxies are no longer needed, so they drop put ofacting 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 othersthe call flow. This completes the INVITE/200/ACK three way handshake used toconferencesestablish SIP sessions, andas a user agent server to accept invitations. The roleis the end ofUACthe transaction. Full details on session setup is in Section 13. Alice andUAS as well as proxyBob's media session has now begun, andredirect servers are defined on a request-by-request basis. For example, the user agent initiating a call acts as a UAC whenthey begin sending media packets using theinitial INVITE request and as a UAS when receiving a BYE request fromformat agreed to in thecallee. Similarly,exchange of SDP. In general, thesame software can act as a proxy server for one request and asend-to-end media packets will take aredirect server fordifferent path from thenext 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 aSIPclient no yes no no inserts Via header no yes no no accepts ACK yes yes yes no Table 1: Properties ofsignaling messages. During thedifferent 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 [Page 9] Internet Draft SIP July 20, 2001 The host part issession, eithera 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,Alice orcan 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 oneBob may decide to change the characteristics ofseveral end systems),thefirst available person frommedia session. This is accomplished by sending agroup of individuals orre-INVITE containing awhole group. The form ofnew media description. If theaddress, for example, sip:sales@example.com ,change isnot sufficient, in general,acceptable todetermine the intent ofthecaller. Ifother party, auser or service chooses to be reachable at an address that200 OK isguessable from the person's name and organizational affiliation, the traditional method of ensuring privacy by having an unlisted "phone" numbersent which iscompromised. However, unlike traditional telephony, SIP offers authentication and access control mechanisms and can availitselfof 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 accordingresponded to with an ACK. This re-INVITE will reference therules in Section 16 and can be derived from eitherexisting dialog so theRoute, Contact or To header fields. When a client wishesother party knows that it is tosendmodify an existing session instead of establishing arequest,new session. If theclient either sends it tochange is not acceptable, an error response, such as alocally configured SIP proxy server,406 Not Acceptable response is sent, which also receives an ACK. However, theso-called outbound proxy , independentfailure of theRequest-URI, or sends it tore- INVITE does not cause theIP address and port correspondingexisting call to fail - theRequest-URI. The outbound proxy can be configured by any mechanism, including DHCP [12] and can be specified either as a setsession continues using the previously negotiated characteristics. Full details on session modification is in Section 14. At the end ofparameters such as network address or host name, protocol portthe call, Bob disconnects (hangs up) first, andtransport protocol, or asgenerates aSIP URI. If the Request-URIBYE message. This BYE isused, the client needsrouted directly todetermineAlice's softphone, again bypassing theprotocol, port and IP addressproxies. Alice confirms receipt of the BYE with aserver to200 OK response, whichto sendterminates therequest. A client SHOULD followsession and thesteps below to obtainBYE transaction. Note that no ACK is sent - an ACK is only sent in response to a response to an INVITE request. The reasons for thisinformation. Clients MUST re-run the above selection algorithm, re-drawing any random numbers involved, once per transaction rather thanspecial handling foreach request, i.e., requests within the same transaction MUSTINVITE will besentdiscussed later, but relate to thesame network address. Thus,reliability mechanisms in SIP, thesame address is usedlength of time it can take forthe request, any retransmissions, any associated CANCEL requestsa ringing phone to be answered, andACK requests for non-2xx responses. However, ACKs for 2xx responses use Handley/Schulzrinne/Schooler/Rosenbergforking. For this reason, request handling in SIP is often classified as either INVITE or non- INVITE, referring to all other methods besides INVITE. Full details on session termination is in Section 15. Full details of all the messages shown in the example of Figure 1 are shown in Section 25.2. Various Authors [Page10]9] Internet Draft SIPJuly 20,October 26, 2001another iteration of the selection algorithm. (Indeed, in manyIn some cases,theyit mayhave different request URIs.) A stateless proxy can accomplish this,be useful forexample, by using the modulo N of a hash ofproxies in theCall-ID value or some other combination of transaction-identifying headers asSIP signaling path see all theuniform random number described inmessaging between theweighting algorithm of RFC 2782. Here, N istwo endpoints for thesumduration ofweights withinthepriority 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-based programs:session. ForTCP, connect() returns ECONNREFUSEDexample, if theclient could not connect to abiloxi.com proxy serverat that address. For UDP, the socket needs to be boundwished to remain in thedestination address using connect() rather than sendto() or similar so that a second write() or send() fails with ECONNREFUSED if there is no server listening) IfSIP messaging path beyond theclient findsinitial INVITE, it would add to theserver is not reachable atINVITE aparticular address, it SHOULD behaverequired routing header field known asif it had receivedRecord- Route containing a400-class error response to that request. The client triesURI which resolves tofind one or more addresses fortheSIP serverproxy. This information would be received byquerying DNS. If a step elicits no addresses, the client continues to the next step. However if a step elicits one or more addresses, but noboth Bob's SIPserver at any of those addresses responds, then the client concludes the server is downphone anddoes not continue on(due to thenext step. IfRecord- Route header field being passed back in theclient is configured with200 OK) Alice's softphone and stored for theaddressduration ofan outbound proxy,theparameters ofdialog. This would then result in theoutbound proxy, including transport protocolACK, BYE, andport, become200 OK to thedestination used below. If there is no outbound proxy,BYE being received and proxied by thedestinationbiloxi.com proxy server. Each proxy can independently decide to receive subsequent messaging, and that messaging will go through all proxies that elected to receive it. A common use of this capability isthe Request-URI. The destination addressin firewall traversal or mid-call feature implementation. Registration is another common operation in SIP. Registration is one way in which themaddr parameter if it exists andbiloxi.com server can learn thehost element if not.current location of Bob. Upon initialization, and at periodic intervals, Bob's SIP phone sends REGISTER messages a server in the biloxi.com domain known as a SIP registrar. Thetransport protocolREGISTER messages associate Bob's SIP URL (sip:bob@biloxi.com) with the machine he is currently logged in at (conveyed as a SIP URL in thetransport parameter.Contact header). The registrar writes this association, also called a binding, to a database, called the location serviceidentifier, where it can be used by the proxy in the biloxi.com domain. Often, a registrar server forDNS SRV records [13]a domain is"_sip". 1. Ifco- located with thedestination addressproxy for that domain. It is an important concept that the distinction between types of SIP servers are logical, not physical. Bob is not limited to registering from anumeric IP address,single device. For example, both his SIP phone at home and theclient contactsone in theserveroffice could send in registrations. This information is stored together in the location service, and allows a proxy to perform various types of searches to locate Bob. Similarly, more than one user can be registered on a single device at thegiven addresssame time. The location service is just an abstract concept. It generally contains information that allows a proxy to input a URI and get back a translated URI that tells theport number specified inproxy where to send theSIP-URI or, ifrequest. Registrations are one way to create this information, but notspecified,thedefault port (5060). If the destination specifies a protocol,only way. Arbitrarily complex mapping functions can be programmed, at theclient contactsdiscretion of theserver usingadministrator. Finally, it is important to note thatprotocol. If no protocolin SIP, registration isspecified, the client first tries UDP. If attempt fails,used for routing incoming SIP requests and has no role in authorizing outgoing requests. Authorization and authentication are handled in SIP either on a request by request, challenge/response mechanism, orif the client does not support UDP but supports other Handley/Schulzrinne/Schooler/Rosenbergusing a lower layer scheme as discussed in Section 20. Various Authors [Page11]10] Internet Draft SIPJuly 20,October 26, 2001protocols, it tries those protocols in some implementation-defined order.Theclient then skips the remaining steps. 2. Ifcomplete set of SIP message details for this registration example is in Section 25.2. Additional operations in SIP include querying for thedestination specifies no port numbercapabilities of a SIP server orport number 5060,client using OPTIONS, and canceling a pending request using CANCEL will be introduced in later sections. 5 Structure of thetransportProtocol The SIP protocoldetermines the useis structured as a layered protocol, which means that its behavior is described in terms ofonea set ofthe following three rules: - If the destination does not specifyfairly independent processing stages, with only atransport protocol, DNS SRV records are retrieved according to RFC 2782 [13].loose coupling between each stage. Theresultsstructuring of thequery or queries are merged and ordered based on priority, keeping only records with transportprotocolsthatinto layers is for theclient supports. Then,purpose of presentation and conciseness; it allows thesearching technique outlinedgrouping of functions common across elements into a single place. It does not dictate an implementation inRFC 2782 [13]any way. When we say that an element "contains" a layer, that means it isusedcompliant toselect servers in order. Server selection across requests is independent of previous choices, except as noted above for stateless proxies. Message length or other request properties do not influencetheserver selection. The client attempts to contact each server in the order listed, at the port number specified in the SRV record. If noneset of rules defined by that layer. Not every element specified by theservers can be contacted,protocol contains every layer. Furthermore, theclient gives up. If there are no SRV records (with any transport protocol), DNS address recordselements specified by SIP areused,logical elements, not physical ones. A physical realization can choose to act asdescribed below. - Ifdifferent logical elements, perhaps even on atransporttransaction by transaction basis. The lowest layer of the SIP protocol isspecifiedits syntax andthis protocolencoding. Its encoding issupported by the client,specified using a BNF. The complete BNF is specified in Section 26. However, a basic overview of theprocedurestructure of a SIP message can be found in Section 7. This section introduces enough of an understanding of theparagraph above is used, limitedformat of a SIP message toDNS resource records with the transport protocol specified infacilitate understanding theSIP-URI. - Ifremainder of thetransport protocol specifiedprotocol. The next higher layer isnot supported by the client,the transport layer. This layer defines how a clientgives up. If there are no SRV records,takes a request, and physically sends it over the network, and how a response is sent by a server, and then received by a client. All SIP elements contain a transport layer. The transport layer is described in Section 19. The nextstep applies. 3. Ifhigher layer is thedestination specifies a port number other than 5060 or if theretransaction layer. Transactions areno SRV records, thea fundamental component of SIP. A transaction is a request, sent by a clientqueriestransaction (using theDNStransport layer), to a serverfor address records for the destination address. Address records include A RR's, AAAA RR's, or other similar records, chosen accordingtransaction, along with all responses to that request sent from theclient's network protocol capabilities. If the DNSserverreturns no address records, the client gives up. If there are address records, the same rules as in step 2 apply. Clients MUST NOT cache query results except accordingtransaction back to therulesclient. The transaction layer handles retransmissions, matching of responses to requests, and timeouts. Any task that a UAC wishes to accomplish takes place using a series of transactions. Discussion of transactions can be found inHandley/Schulzrinne/Schooler/RosenbergSection 17. User agents contain a transaction layer, as do stateful proxies. Stateless proxies do not contain a transaction layer. Various Authors [Page12]11] Internet Draft SIPJuly 20,October 26, 2001RFC 1035 [14].Theresultstransaction layer has a client component (referred to as a client transaction), and a server component (referred to as a server transaction), each ofthe DNS lookup operation do not, in general, leadwhich are represented by an FSM that is constructed to process amodificationparticular request. The layer on top of theRequest-URI. A proxytransaction layer isfreecalled the transaction user (TU), of which there are several types. When a TU wishes tomodifysend a request, it creates a client transaction instance and passes it theRequest-URIrequest, along with the destination IP address, port, and transport toany value desired, butsend theDNS lookups are usually based onrequest to. SIP provides theRequest-URI obtained fromability for alocation server. Iftransaction to be canceled by theDNS time-to-live value exceedsclient which initiated it. When afew minutes, servers generatingclient cancels alarge number oftransaction, it requestsare probably well advised to retry failed servers every few minutes. 1.4.3 SIP Transaction Oncethat thehost part has been resolvedserver give up on further processing, revert toa SIP server,theclient sends one or more SIP requests tostate thatserver and receives one or more responses from the server. A request (and its retransmissions) together withexisted before theresponses triggered by that request make uptransaction was initiated, and generate aSIP transaction. All responsesspecific error response to that transaction. This is done with arequest containCANCEL request, which constitutes its own transaction, but references thesame valuestransaction to be cancelled. Cancellation is described in Section 9. There are several different types of transaction users. A UAC contains a UAC core, a UAS contains a UAS core, and a proxy contains a proxy core. The behavior of theCall-ID, CSeq, To,UAC andFrom fields (withUAS cores depend largely on thepossible additionmethod. However, there are some common rules for all methods. These rules are captured in Section 8. The primarily deal with construction of atagrequest, in theTo field (section 10.43)). This allows responses to be matched with requests. The ACK request confirmingcase of a UAC, and processing of that request, and generation of a response, in thereceiptcase of a UAS. UAC and UAS core behavior for the REGISTER method is described in Section 10. Registrations play anINVITE responseimportant role in SIP. In fact, a UAS that handles a REGISTER isnot part of the transaction since it may traversegiven adifferent set of hosts. Ifspecial name - areliable stream protocolregistrar - and it isused, requestdescribed in that section. UAC andresponses withinUAS core behavior for the OPTIONS method, used for determining the capabilities of asingle SIP transactionUAC, arecarried over the same connection (seedescribed in Section14). Several SIP11. Certain other requestsfromare sent within a dialog peer-to-peer SIP relationship between a two user agents that persists for some time. The dialog facilitates sequencing of messages between thesame clientuser agents, and proper routing of requests between both them. One way tothe same server MAY use the same connection or MAY usesetup anew connection for each request. Ifdialog is with the INVITE method. When aclientUAC sendsthe request viaaunicast datagram protocol such as UDP, the receiving user agent directs the response according torequest that is within theinformation contained incontext of a dialog, it follows theVia header fields (Section 10.46). Each proxy servercommon UAC rules as discussed in Section 8, but also theforward path of the request forwardsrules for mid-dialog requests. Section 12 discusses dialogs, and presents theresponse using these Via header fields, as describedprocedures for their construction, and maintenance, indetailaddition to construction of requests within a dialog. The most important method inSections 10.46.3 and 10.46.4. For datagram protocols, reliabilitySIP isachieved using retransmission (Section 14). 1.4.4 Initiatingthe INVITE method, which is used to establish aSessionsession between participants. A session isinitiated witha collection of participants, and streams of media between them, for Various Authors [Page 12] Internet Draft SIP October 26, 2001 theINVITE request. A successfulpurposes of communication. Section 13 discusses how sessions are initiated, resulting in one or more SIPinvitation consistsdialogs. Section 14 discusses how characteristics oftwo requests,that session are modified, through the use of an INVITEfollowed by ACK. The INVITE (Section 5.1)requestasks the callee to join a particular conference or establishwithin atwo-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 July 20, 2001 has received that response by sending an ACK (Section 5.1.1) request. The INVITE request typically containsdialog. Finally, section 15 discusses how a sessiondescription, for example written in SDP (RFC 2327 [6]) format, that provides the called partyis terminated. The procedures of Sections 8, 10, 11, 12, 13, 14, and 15 deal entirely withenough information to jointhesession. For multicast sessions,UA core. Section 16 discusses thesession description enumeratesproxy element, which facilitates routing of messages between user agents. 6 Definitions This specification uses a number of terms to refer to themedia typesroles played by participants in SIP communications. The definitions of client, server andformats thatproxy areallowed to be distributedsimilar tothat session. For a unicast session, the session description enumeratesthose used by themedia typesHypertext Transport Protocol (HTTP) (RFC 2616 [8]). The terms andformats that the callergeneric syntax of URI and URL are defined in RFC 2396 [9]. The following terms have special significance for SIP. Back-to-Back user agent: A back-to-back user agent (B2BUA) iswilling to usea logical entity that receives a request, andwhereprocesses itwishes the media data to be sent.as a UAS. Ineither case, if the callee wishesorder toacceptdetermine how thecall,request should be answered, itresponds to the invitation by returningacts as asimilar description listingUAC and generates requests. Unlike a proxy server, it maintains dialog state, and must participate in all requests sent on themediadialogs itwishes to use. Forhas established. Since it is amulticast session, the callee SHOULD only returnconcatenation of asession description if itUAC and UAS, no explicit definitions are needed for its behavior. Call: A call isunable to receive the media indicated in the caller's description or wantsan informal term that refers toreceive data via unicast. The protocol exchangesa dialog between peers, generally set up for theINVITE method are shown in Fig. 1purposes of a multimedia conversation. Call leg: Another name for a dialog. Call stateful: A proxyserver and in Fig. 2is call stateful if it retains state for aredirect server. (Note that the messages shown indialog from thefigures have been abbreviated slightly.) In Fig. 1,initiating INVITE to the terminating BYE request. A call stateful proxyserver accepts the INVITE request (step 1), contactsis always stateful, but thelocation service with allconverse is not true. Client: A client is any network element that sends SIP requests, and receives SIP responses. Clients may orparts of the address (step 2)may not interact directly with a human user. User agent clients andobtainsproxies are clients. Conference: A multimedia session (see below) that contains multiple participants. Dialog: A dialog is amore precise location (step 3). The proxy server then issuespeer-to-peer SIP relationship between a Various Authors [Page 13] Internet Draft SIPINVITE requestOctober 26, 2001 UAC and UAS that persists for some time. A dialog is established by SIP messages, such as a 2xx response tothe address(es) returnedan INVITE request. A dialog is identified bythe location service (step 4). The user agent server alerts the user (step 5)a call identifier, local address, andreturnsremote address. A dialog was formerly known as asuccess indication to the proxy server (step 6). The proxy server then returns the success result to the original caller (step 7). The receiptcall leg in RFC 2543. Downstream: A direction ofthismessageis confirmed by the caller using an ACK request,forwarding within a transaction whichis forwardedrefers to thecallee (steps 8 and 9). Notedirection thatan ACK can also be sent directly to the callee, bypassingrequests flow from theproxy.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. Allrequests2xx, 3xx, 4xx, 5xx and 6xx responseshave the same Call- ID.are final. Informational Response: Same as a provisional response. Initiator, calling party, caller: Theredirect server shown in Fig. 2 accepts theparty initiating a session with an INVITErequest (step 1), contactsrequest. A caller retains this role from thelocation service as before (steps 2 and 3) and, instead of contactingtime it sends thenewly found address itself, returnsINVITE until theaddress totermination of any dialogs established by thecaller (step 4), which is then acknowledged viaINVITE. Invitation: An INVITE request. Invitee, invited user, called party, callee: The party that receives anACKINVITE request(step 5). The caller issuesfor the purposes of establishing a newrequest, withsession. A callee retains this role from thesame call-ID but a higher CSeq, totime it receives theaddress returnedINVITE until the termination of the dialog established by that INVITE. Isomorphic request or response: Two requests are defined to be isomorphic for thefirst server (step 6). Inpurposes of this document if they have theexample,same values for thecall succeeds (step 7). The callerCall-ID, To, From, CSeq, Request- URI andcallee completethehandshake with an ACK (step 8). The next section discusses what happenstop-most Via header. Two responses are isomorphic if they have thelocation service returns more than one possible alternative. 1.4.5 Locating a User Handley/Schulzrinne/Schooler/Rosenberg [Page 14] Internet Draft SIP July 20, 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 server A callee may move between a number of different end systems over time. These locations can be dynamically registered withsame values for theSIP server (Sections 1.4.7, 7).Call-ID, To, From, CSeq and top Via header. Alocation server MAYmessage which is isomorphic to another is alsouse one or more other protocols, suchknown asfinger (RFC 1288 [15]), rwhois (RFC 2167 [16]), LDAP (RFC 1777 [17]), multicast-based protocols [18] or operating-system dependent mechanisms to actively determine the end system whereauser might be reachable.retransmission. Location server: See location service. Location service: A locationserver MAY return several locations because the userservice islogged in at several hosts simultaneously or because the location server has (temporarily) inaccurate information. Theused by a SIP redirect or proxy servercombines the resultstoyieldobtain information about alist ofcallee's possible location(s). It is an abstract database, sometimes referred to as azero or more locations. Handley/Schulzrinne/Schooler/Rosenberg [Page 15] Internet Draft SIP July 20, 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: Exampleserver. The contents ofSIP redirect server Handley/Schulzrinne/Schooler/Rosenbergthe database can be populated in many ways, including being written by registrars. Loop: A request that arrives at a proxy, is forwarded, and later arrives back at the same proxy. When it arrives the second Various Authors [Page16]14] Internet Draft SIPJuly 20,October 26, 2001The action taken on receiving a list of locations varies with the type of SIP server. A SIP redirect server returns the listtime, its Request-URI is identical to theclient as Contactfirst time, and other headers(Section 10.14). A SIPthat affect proxyserver can sequentially or in parallel try the addresses untiloperation are unchanged, so that thecall is successful (2xx response) orproxy would make thecallee has declinedsame processing decision on thecall (6xx response). With sequential attempts, a proxy server can implement an "anycast" service. If a proxy server forwards a SIP request,request itMUST add itself tomade thebeginning offirst time around. Looped requests are errors, and thelist of forwarders noted inprocedures for detecting them and handling them are described by theVia (Section 10.46) headers.protocol. Method: TheVia trace ensures that replies can take the same path back, ensuring correct operation through compliant firewalls and avoiding request loops. Onmethod is theresponse path, each host MUST remove its Via, soprimary function thatrouting internal informationa request ishidden frommeant to invoke on a server. The method is carried in thecalleerequest message itself. Example methods are INVITE andoutside networks.BYE. Outbound proxy: ASIP invitation may traverse more than one SIPproxyserver. If one ofthat receives all requests from a client, even though it is not the server resolved by the Request-URI. The outbound proxy sends these"forks"requests, after any local processing, to therequest, i.e., issues more than one requestaddress indicated inresponse to receivingtheinvitation request, it is possible thatRequest-URI, or to another outbound proxy. Parallel search: In aclient is reached, independently, by moreparallel search, a proxy issues several requests to possible user locations upon receiving an incoming request. Rather than issuing onecopy ofrequest and then waiting for theinvitation request. Each of these copies bearsfinal response before issuing thesame Call-ID, butnext request as in adifferent topmost Via header branch parameter (see Section 10.46). The user agent MAY choose which final response to return for each such request, typically returningsequential search , a200 (OK)parallel search issues requests without waiting foronly one of them. 1.4.6 Changing an Existing Session In some circumstances, it is desirable to changetheparametersresult ofan existing session. This is doneprevious requests. Provisional response: A response used byre-issuing the INVITE withinthesame call leg,server to indicate progress, butwithinthat does not terminate anew or different body or header fields to convey the new information. This re INVITE MUST haveSIP transaction. 1xx responses are provisional, other responses are considered final. Proxy, proxy server: An intermediary entity that acts as both a server and ahigher CSeq than any previous request from theclienttofor theserver. For example, two parties may have been conversing and then wantpurpose of making requests on behalf of other clients. A proxy server primarily plays toaddrole of routing, which means its job is to ensure that athird party, switchingrequest is passed on tomulticastanother entity that can further process the request. Proxies are also useful forefficiency. Oneenforcing policy and for firewall traversal. A proxy interprets, and, if necessary, rewrites parts ofthe participants invites the third party with the new multicast addressa request message before forwarding it. Registrar: A registrar is a server that accepts REGISTER requests, andsimultaneously sends an INVITE toplaces thesecond party, withinformation it receives in those requests into thenew multicast session description, but withlocation service for theold 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)domain itcan be reached.handles. Regular Transaction: Aclient MAY also use it to install call handling features at the server. 1.5 Protocol Properties 1.5.1 Minimal State Handley/Schulzrinne/Schooler/Rosenbergregular transaction is any transaction with a method other than INVITE, ACK, or CANCEL. Various Authors [Page17]15] Internet Draft SIPJuly 20,October 26, 2001A single conference session or call involves one or more SIP request-response transactions. Proxy servers do not have to keep state forRingback: Ringback is the signaling tone produced by the calling party's application indicating that aparticular call, however, they MAY maintain state forcalled party is being alerted (ringing). Server: A server is asingle SIP transaction, as discussednetwork element that receives requests inSection 17. For efficiency, a server MAY cache the results of locationorder to service them, and sends back responses to those requests.1.5.2 Lower-Layer-Protocol Neutral SIP makes minimal assumptions about the underlying transportExamples of servers are proxies, user agent servers, redirect servers, andnetwork-layer protocols. The lower-layer can provide eitherregistrars. Sequential search: In apacket orsequential search, abyte stream service, with reliable or unreliable service. In an Internet context, SIP is ableproxy server attempts each contact address in sequence, proceeding toutilize both UDP and TCP as transport protocols, among others. UDP allowstheapplication to more carefully controlnext one only after the previous has generated a non- 2xx final response. Session: From thetimingSDP specification: "A multimedia session is a set ofmessagesmultimedia senders andtheir retransmission, to perform parallel searches without requiring TCP connection state for each outstanding request,receivers and the data streams flowing from senders touse multicast. Routers can more readily snoop SIP UDP packets. TCP allows easier passage through existing firewalls. When TCP is used, SIPreceivers. A multimedia conference is an example of a multimedia session." (RFC 2327 [6]) (A session as defined for SDP canusecomprise one or moreconnections to attempt to contactRTP sessions.) As defined, auser orcallee can be invited several times, by different calls, tomodify parameters of an existing conference. Different SIP requests forthe sameSIP call MAY use different TCP connections orsession. If SDP is used, asingle 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 beyondsession is defined by thescopeconcatenation ofthis document. All entities MUST support UDP. User agents SHOULD implement TCP transport. Stateful proxy, registrar,the user name , session id , network type , address type andredirect servers MUST implement TCP transport. Other transports MAY be supported by any entity. 1.5.3 Text-Based SIP is text-based, using ISO 10646 in UTF-8 encoding throughout. This allows easy implementationaddress elements inlanguages such as Java, Tcl and Perl, allows easy debugging, and most importantly, makesthe origin field. (SIP) transaction: A SIPflexibletransaction occurs between a client andextensible. As SIP is used for initiating multimedia conferences rather than delivering media data, it is believed that the additional overhead of usingatext-based protocol is not significant. 2 SIP Uniform Resource Locators SIP URLs are used within SIPserver and comprises all messages from the first request sent from the client toindicatetheoriginator (From), current destination (Request-URI) and final recipient (To) ofserver up to aSIP request, andfinal (non-1xx) response sent from the server tospecify redirection addresses (Contact).the client, and the ACK for the response in the case the response was a 2xx. The ACK for a 2xx response is a separate transaction. Spiral: A spiral is a SIPURL can also be embedded in web pages or other hyperlinksrequest which is routed toindicate Handley/Schulzrinne/Schooler/Rosenberg [Page 18] Internet Draft SIP July 20, 2001a proxy, forwarded onwards, and arrives once again at that proxy, but this time, differs in aparticular user or service can be called via SIP. When used asway which will result in ahyperlink, the SIP URL indicatesdifferent processing decision than theuse oforiginal request. Typically, this means that it has a Request-URI that differs from theINVITE method. The SIP URL schemeprevious arrival. A spiral is not an error condition, unlike a loop. Stateless proxy: A logical entity that does not maintain the client or server transaction state machines definedto allow setting SIP request-header fieldsin this specification when it processes requests. A stateless proxy forwards every request it receives downstream and every response it receives upstream. Stateful proxy: A logical entity that maintains the client and server transaction state machines defined by this Various Authors [Page 16] Internet Draft SIPmessage-body. This corresponds to the use of mailto: URLs. It makes it possible, for example, to specifyOctober 26, 2001 specification during thesubject, urgency or media typesprocessing ofcalls initiated throughaweb page orrequest. Also known asparta transaction stateful proxy. The behavior ofan email message.a stateful proxy is further defined in Section 16. ASIP URL followsstateful proxy is not theguidelinessame as a call stateful proxy. Transaction User (TU): The layer ofRFC 2396 [10] and hasprotocol processing that resides above thesyntax shown in Fig. 3. The syntax is described using Augmented Backus-Naur Form (see Section C). Althoughtransaction layer. Transaction users include theABNF described in Section C uses implicit whitespace, unescaped whitespace MUST NOT be presentUAC core, UAS core, and proxy core. Upstream: A direction of message forwarding within aSIP URL. Any reserved characters havetransaction which refers tobe escaped andthe direction that responses flow from the"set of characters reserved within any given URI componentuser agent server to 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 isdefined bya logical entity thatcomponent. In general,creates acharacter is reserved ifnew request, and then uses thesemanticsclient transaction state machinery to send it. The role of UAC lasts only for theURI changesduration of that transaction. In other words, ifthe character is replaced with its escaped US-ASCII encoding" [10]. Excluded US-ASCII characters [10], such as space and control characters and characters useda piece of software initiates a request, it acts asURL delimiters, also MUST be escaped. URLs MUST NOT contain unescaped space and control characters. The URI character classes referenced above are described in Appendix C. The componentsa UAC for the duration of that transaction. If it receives a request later on, it takes on theSIP URI haverole of a User Agent Server for thefollowing meanings. user:processing of that transaction. UAC Core: Thenameset of processing functions required of a UAC that reside above the transaction and transport layers. User agent server (UAS): A useraddressed. Noteagent server is a logical entity thatthis field MAY be empty where the destination host does not havegenerates anotion of users, e.g.,response to a SIP request. The response accepts, rejects or redirects the request. This role lasts only forembedded devices. telephone-subscriber: Ifthehost is an Internet telephony gateway,duration of that transaction. In other words, if atelephone-subscriber field MAY be used insteadpiece of software responds to auser field. The telephone-subscriber field usesrequest, it acts as a UAS for thenotationduration ofRFC 2806 [19]. Any charactersthat transaction. If it generates a request later on, it takes on the role of a User agent client for theun-escaped "telephone-subscriber"processing of thatare not either in the set "unreserved" or "user-unreserved" MUST be escaped.transaction. UAS Core: The set ofcharacters not reserved inprocessing functions required at a UAS that reside above theRFC 2806 descriptiontransaction and transport layers. User agent (UA): A logical entity which can act as both a user agent client and user agent server for the duration oftelephone-subscriber containsanumberdialog. The role ofcharacters 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)UAC and UAS as well as proxy and redirect servers are defined on a transaction-by-transaction basis. For example, the"unwise" characters, i.e., punctuation of %5buser agent initiating a call acts as a UAC when sending the initial INVITE request andabove. Handley/Schulzrinne/Schooler/Rosenbergas a UAS when receiving a BYE request from the callee. Various Authors [Page19]17] Internet Draft SIPJuly 20,October 26, 2001SIP-URL = "sip:" [ userinfo "@" ] hostport url-parameters [ headers ] userinfo = [ user | telephone-subscriber [ ":" password ]] user = *( unreserved | escaped | user-unreserved) user-unreserved = "&" | "=" | "+" | "$" | "," | ";" | "?" | "/" password = *( unreserved | escaped | "&" | "=" | "+" | "$" | "," ) hostport = host [ ":" port ] host = hostname | IPv4address | IPv6reference hostname = *( domainlabel "." ) toplabel [ "." ] domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum toplabel = alpha | alpha *( alphanum | "-" ) alphanum IPv4address = 1*3digit "." 1*3digit "." 1*3digit "." 1*3digit IPv6reference = "[" IPv6address "]" IPv6address = hexpart [ ":" IPv4address ] hexpart = hexseq | hexseq "::" [ hexseq ] | "::" [ hexseq ] hexseq = hex4 *( ":" hex4) hex4 = 1*4HEX port = *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 = token user-param = "user=" ( "phone" | "ip" | other-user) other-user = token method-param = "method=" Method ttl-param = "ttl=" ttl maddr-param = "maddr=" host other-param = pname ["=" pvalue] pname = 1*paramchar pvalue = 1*paramchar paramchar = param-unreserved | unreserved | escaped param-unreserved= "[" | "]" | "/" | ":" | "&" | "+" | "$" headers = "?" header *( "&" header ) header = hname "=" hvalue hname = 1*( hnv-unreserved | unreserved | escaped ) hvalue = *( hnv-unreserved | unreserved | escaped ) hnv-unreserved = "[" | "]" | "/" | "?" | ":" | "+" | "$" Figure 3:Similarly, the same software can act as a proxy server for one request and as a redirect server for the next request. Proxy, location and registrar servers defined above are logical entities; implementations MAY combine them into a single application program. 7 SIPURL syntax Handley/Schulzrinne/Schooler/Rosenberg [Page 20] Internet DraftMessages SIPJuly 20, 2001 The telephone numberis aspecial case of a user nametext-based protocol andcannot be distinguished byuses the ISO 10646 character set in UTF-8 encoding (RFC 2279 [11]). A SIP message is either aBNF. Thus,request from aURL parameter, user, is addedclient todistinguish telephone numbersa server, or a response fromuser names. The user parameter value "phone" indicates thata server to a client. Both Request (section 7.1) and Response (section 7.2) messages use theuser part containsgeneric-message format of RFC 822 [12]. Both types of messages consist of atelephone number. Even without this parameter, recipientsstart-line, one or more header fields (also known as "headers"), an empty line indicating the end ofSIP URLs MAY interpretthepre-@ part asheader fields, and an optional message-body. generic-message = start-line *message-header CRLF [ message-body ] The start-line, each message-header line, and the empty line MUST be terminated by atelephone numbercarriage-return line-feed sequence (CRLF). Note that the empty line MUST be present even iflocal restrictions onthename spacemessage-body is not. Except foruser name allow it. password: The SIP scheme MAY usetheformat "user:password"above difference in character sets, much of SIP's message and header field syntax is identical to HTTP/1.1. Rather than repeating theuserinfo field. Thesyntax and semantics here we use [HX.Y] to refer to Section X.Y ofpasswords in the userinfo is NOT RECOMMENDED, becausethepassing 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 requirecurrent HTTP/1.1 specification (RFC 2616 [8]). Note, however, thatnumeric 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. TheSIPURL requires the latter form, without brackets. port: The port number to send a request to. Ifis notpresent, the procedures outlined in Section 1.4.2an extension of HTTP. 7.1 Requests SIP Requests areused to determine the port number to senddistinguished by having arequest to. URL parameters: SIP URLs can define specific parameters ofRequest-Line for a start- line. A Request-Line begins with a method token, followed by therequest. URL parameters are added afterRequest-URI and thehost componentprotocol version, and ending with CRLF. The elements are separated bysemi-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 namesSP characters. No CR or LF aredefined for UDP [20], TCP [21], TLS [22], 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 suppliedallowed except in thehost 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 proxyend-of-line CRLF sequence. No LWS isused. Handley/Schulzrinne/Schooler/Rosenbergallowed in any of the elements. Various Authors [Page21]18] Internet Draft SIPJuly 20,October 26, 2001The ttl parameter determines the time-to-live value of the UDP multicast packetMethod Request-URI SIP-Version o Method This specification defines six methods : REGISTER for registering contact information, INVITE, ACK andMUST only be used if maddr is a multicast addressCANCEL for setting up sessions, BYE for terminating sessions andthe transport protocol is UDP.OPTIONS for querying servers about their capabilities. SIP extensions may define additional methods. o Request-URI Theuser parameter wasRequest-URI is a SIP URL as describedabove. For example, to specify to call j.doe@big.com using multicast to 239.255.255.1 within Section 21.1 or attl of 15,general URI (RFC 2396 [9]). It indicates thefollowing URL would be used: sip:j.doe@big.com;maddr=239.255.255.1;ttl=15user or service to which this request is being addressed. Thetransport, maddr,Request-URI MUST NOT contain unescaped spaces or control characters andttl parametersMUST NOT beusedenclosed inthe 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"<>". SIPrequest can be definedservers MAY support Request-URIs with schemes other than "sip", for example the"?""tel" URI scheme of RFC 2806 [13]. It MAY translate non-SIP URIs using any mechanismwithinat its disposal, resulting in either a SIPURL. The special hname "body" indicates that the associated hvalue isURI or some other scheme. o SIP Version Both request and response messages include themessage-bodyversion oftheSIPINVITE request. Headers MUST NOT be usedinthe Fromuse, andTo header fieldsfollow [H3.1] (with HTTP replaced by SIP, andthe Request-URI; they are ignored if present. hnameHTTP/1.1 replaced by SIP/2.0) regarding version ordering, compliance requirements, andhvalue are encodingsupgrading ofaversion numbers. To be compliant with this specification, applications sending SIPheader name and value, respectively. All URL reserved characters in the header names and valuesmessages MUSTbe escaped. Method: The methodinclude a SIP- Version ofthe SIP request can be specified with the method parameter. This parameter"SIP/2.0". The string is case-insensitive, but implementations MUSTNOT be used in the From and To header fields andsend upper-case. Unlike HTTP/1.1, SIP treats theRequest-URI; theyversion number as a literal string. In practice, this should make no difference. 7.2 Responses SIP Responses areignored if present. Table 2 summarizes where the componentsdistinguished by having a Status-Line for a start- line. A Status-Line, consists of theSIP URL can be used. Entries marked "m" are mandatory, those marked "o" are optional,protocol version followed by a numeric Status-Code andthose marked "-" are not allowed. For optional elements, the second column indicates the default value if theits associated textual phrase, with each element separated by SP characters. No CR or LF isnot present. Examples of SIP URLs are: sip:j.doe@big.com sip:j.doe:secret@big.com;transport=tcp sip:j.doe@big.com?subject=project%20x&priority=urgent Handley/Schulzrinne/Schooler/Rosenbergallowed except in the final CRLF sequence. SIP-version Status-Code Reason-Phrase Various Authors [Page22]19] Internet Draft SIPJuly 20,October 26, 2001default 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-param -- o o o o o o headers -- - - - o - o Table 2: Use and default values of URL components for SIP headers, Request-URI and references 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%40example.com@gateway.com sip:alice@registrar.com;method=REGISTER 2.1 SIP URL Comparison SIP URLs are compared for equality according toThe Status-Code is a 3-digit integer result code that indicates thefollowing rules: o Comparisonsoutcome ofscheme name ("sip"), domain names, parameter namesan attempt to understand andheader names are case-insensitive, all other comparisons are case-sensitive. osatisfy a request. TheorderingReason-Phrase is intended to give a short textual description ofparameters and headersthe Status-Code. The Status-Code is intended for use by automata, whereas the Reason-Phrase is intended for the human user. A client is notsignificant in comparing SIP URLs. o userrequired to examine ortelephone-subscriber, password, host, port and any url-parameter parameters ofdisplay theURI must match. If oneReason-Phrase. The first digit of thecomponents inStatus-Code defines theprevious sentence is omitted, it matches based on its default value. (For example, otherwise equivalent URLs withoutclass of response. The last two digits do not have any categorization role. For this reason, any response with aport specificationstatus code between 100 and 199 is referred to as a "1xx response", any response withport 5060 match.) URL parameters (which excludes telephone-subscriber, password,a status code between 200 andport) not found in both URLs being compared, for which there is no default value, are ignored,299 as a "2xx response", andtherefore not included in the comparison operation. Other URL components not found in both URLs being compared,so on. SIP/2.0 allows 6 values forwhich there is no Handley/Schulzrinne/Schooler/Rosenberg [Page 23] Internet Draft SIP July 20, 2001 default value, are included inthecomparison operation, andfirst digit: 1xx: Informational -- request received, continuing to process theresult will be thatrequest; 2xx: Success -- theURLs do not match. o Characters other than thoseaction was successfully received, understood, and accepted; 3xx: Redirection -- further action needs to be taken in order to complete the"reserved" and "unsafe" sets (see RFC 2396 [10]) are equivalentrequest; 4xx: Client Error -- the request contains bad syntax or cannot be fulfilled at this server; 5xx: Server Error -- the server failed totheir ""%" HEX HEX" encoding. o An IP address that isfulfill an apparently valid request; 6xx: Global Failure -- theresult of a DNS lookuprequest cannot be fulfilled at any server. Full definitions ofa host name does not match that host name. o URL parameters that have no default value are compared only if they are presentthese classes and each registered code appear inboth URLs. Thus, the following URLs are equivalent: sip:juser@%65xample.com:5060 sip:juser@ExAmPlE.CoM;Transport=udp while SIP:JUSER@ExAmPlE.CoM;Transport=udp sip:juser@ExAmPlE.CoM;Transport=UDP are not. The following URLs are also equivalent: sip:user@domain.com;foo=baz sip:user@domain.com while sip:user@domain.com sip:domain.com are not.Section 23. 7.3 Header Fields SIP header fieldssuch as Contact, From and Toareequal ifsimilar to HTTP header fields in both syntax andonly if their URIs match undersemantics. In particular, SIP header fields follow the [H4.2] definitions of syntax for message-header, the rulesabovefor extending header fields over multiple lines, the use of multiple message-header fields with the same field-name, andif theirthe rules regarding ordering of headerparameters (suchfields. 7.3.1 Header Field Format Header fields follow the same generic header format ascontact-param, from-param and to-param) matchthat given inname and parameter value, where parameter names and token parameter values are compared ignoring case and quoted-string parameter values are case- sensitive. Handley/Schulzrinne/Schooler/RosenbergSection 3.1 of RFC 822 [12]. Each header field consists of a field Various Authors [Page24]20] Internet Draft SIPJuly 20,October 26, 20012.2 Non-SIP URLs SIP header fieldsname followed by a colon (":") and theRequest-URI MAY contain non-SIP URLs, withfield value. field-name: field-value Note that theexceptions noted below. As an example, if a call fromformal grammar for atelephone is relayed tomessage-header specified in Section 26 allow for an arbitrary amount of whitespace on either side of theInternet via SIP,colon. No space before theSIP From header field might containcolon and atel: URL [19]. Insingle space (SP) between thefollowing locations, only SIP URLs are allowed: o Request-URI in a REGISTER request; o Contact header field in INVITE andcolon and2xx responses to INVITE. Implementations MAY compare non-SIP URLs by treating them as generic URIs [10] or, alternatively, compare them byte-by-byte. 3 SIP Message Overview SIPthe field-value isa text-based protocolpreferred. That is, Subject: lunch Subject : lunch Subject :lunch Subject: lunch are all valid, anduses the ISO 10646 character set in UTF-8 encoding (RFC 2279 [23]). Senders MUST terminate lines with a CRLF,equivalent, butreceivers MUST also interpret CR and LF by themselves as line terminators. Onlythecombinations CR CR, LF LF and CRLF CRLF terminatelast is themessage header. Implementations MUST only send CRLF CRLF. CRpreferred form. Header fields can be extended over multiple lines by preceding each extra line with at least one SP or horizontal tab (HT). The line break andLF insteadthe whitespace at the beginning ofCRLF is for backwards-compatibility; their use is deprecated. Except fortheabove difference in character sets andnext linetermination, much ofare treated as a single SP character. Thus themessage syntax is and header fieldsfollowing areidentical to HTTP/1.1; rather than repeatingequivalent: Subject: I know you're there, pick up thesyntaxphone andsemantics here we use [HX.Y]talk toreferme! Subject: I know you're there, pick up the phone and talk toSection X.Yme! The relative order of header fields with different field names is not significant. The relative order of those with thecurrent HTTP/1.1 specification (RFC 2616 [9]). In addition, we describe SIPsame field name is important. Multiple header fields with the same field-name may be present inboth prosea message if andan augmented Backus-Naur form (ABNF). See section Conly if the entire field-value foran overview of ABNF. Note, however,thatSIPheader field isnot an extension of HTTP. Unlike HTTP, SIP MAY use UDP or other unreliable datagram protocols. Each such datagram carries one request or response. Datagrams, including all headers, SHOULD NOTdefined as a comma-separated list (i.e., #(values)). It MUST belarger thanpossible to combine thepath maximum transmission unit (MTU) ifmultiple header fields into one "field-name: field-value" pair, without changing theMTU is known, or 1500 bytes ifsemantics of theMTU is unknown. However, implementationsmessage, by appending each subsequent field-value to the first, each separated by a comma. Implementations MUST be able tohandle messages up toprocess multiple header fields with themaximum datagram packet size. For UDP, this size is 65,535 bytes, including headers. Handley/Schulzrinne/Schooler/Rosenbergsame name in any combination of the single-value-per-line or comma-separated value forms. The following blocks of headers are valid and equivalent: Route: sip:alice@atlanta.com Subject: Lunch Route: sip:bob@biloxi.com Route: sip:carol@chicago.com Various Authors [Page25]21] Internet Draft SIPJuly 20,October 26, 2001The MTURoute: sip:alice@atlanta.com, sip:bob@biloxi.com Route: sip:carol@chicago.com Subject: Lunch Subject: Lunch Route: sip:alice@atlanta.com, sip:bob@biloxi.com, sip:carol@chicago.com Each of1500 bytes accommodates encapsulation withinthe"typical" ethernet MTU without IP fragmentation. Recent studies [24] indicate that an MTU of 1500 bytesfollowing blocks isa reasonable assumption. The next lower common MTU values are 1006 bytes for SLIP and 296 for low-delay PPP (RFC 1191 [25]). Thus, another reasonable value would be a message size of 950 bytes,valid but not equivalent toaccommodate packet headers withintheSLIP MTU without fragmentation. A SIP messageothers: Route: sip:alice@atlanta.com Route: sip:bob@biloxi.com Route: sip:carol@chicago.com Route: sip:bob@biloxi.com Route: sip:alice@atlanta.com Route: sip:carol@chicago.com Route: sip:alice@atlanta.com,sip:carol@chicago.com,sip:bob@biloxi.com The format of a header field-value is defined per header-name. It will always be eithera request from a client to a server,an opaque sequence of TEXT-UTF8 octets, or aresponse from a server to a client. SIP-message = Request | Response Both Request (section 4) and Response (section 9) messages use the generic-message formatcombination ofRFC 822 [26] for transferring entities (the bodywhitespace, tokens, separators, and quoted strings. Many of them will adhere to themessage). Both types of messages consistgeneral form of astart-line, one or more header fields (also known as "headers"), an empty line (i.e.,value followed by aline with nothing preceding the carriage-return line-feed (CRLF)) indicating the endsemi-colon separated sequence of parameter-name, parameter-value pairs: field-name: field-value *(;parameter-name=parameter-value) When comparing headers, field names are always case-insensitive. Unless otherwise stated in the definition of a particular headerfields,field, field values, parameter names, andan optional message-body. To avoid confusion with similar-named headersparameter values (tokens inHTTP, we refer to the headers describing the message bodygeneral) are case-insensitive. Unless specified otherwise, values expressed asentity headers. These componentsquoted strings aredescribed in detail in the upcoming sections. generic-message = start-line *message-header CRLF [ message-body ] start-line = Request-Line | ;Section 4.1 Status-Line ;Section 9.1 message-header = ( general-header | request-header | response-header | entity-header ) Handley/Schulzrinne/Schooler/Rosenbergcase-sensitive. The following are equivalent: Contact: <sip:alice@atlanta.com>;expires=3600 CONTACT: <sip:alice@atlanta.com>;ExPiReS=3600 Contact-Disposition: session;handling=optional contact-disposition: Session;HANDLING=OPTIONAL Various Authors [Page26]22] Internet Draft SIPJuly 20,October 26, 2001In the interest of robustness, any leading empty line(s) MUST be ignored. In other words, if the RequestThe following are not equivalent; Warning: 370 devnull "Choose a bigger pipe" Warning: 370 devnull "CHOOSE A BIGGER PIPE" 7.3.2 Header Field Classification Some header fields only make sense in requests or responses. These are called Request Header Fields and Responsemessage begins with one or more CRLF, CR,Header fields respectively. Those header fields that can appear in either a request orLFs, these charactersresponse are called General Header Fields. If a header appears in a message not matching its category (such as a request header in a response), it MUST be ignored.4 Request The Request message format is shown below: Request = Request-Line ;Section4.1 *( general-header | request-header | entity-header ) CRLF [ message-body ] ; Section 12 4.1 Request-Line The Request-Line begins with22 defines the classification of each header. 7.3.3 Compact Form SIP provides amethod token, followed bymechanism to represent common header fields in an abbreviated form. This may be useful when messages would otherwise become to large to be carried on theRequest-URI andtransport available to it (exceeding theprotocol version, and ending with CRLF. The elements are separated by SP characters. No CR or LFMTU when using UDP for example). These compact forms areallowed exceptdefined in Section 22. A compact form MAY be substituted for thefinal CRLF sequence. No LWS is allowed inlonger form of a header name at any time without changing the semantics of a theelements. The Request-URI MUST NOT be enclosed in "<>". absoluteURI is defined in [H3.2.1]. Request-Line = Method SP Request-URI SP SIP-Version CRLF Request-URI = SIP-URL | absoluteURI SIP-Version = "SIP/2.0" 4.2 Methods The methods are describedmessage. Multiple header fields indetail 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 INVITEa message with the same header name MAY appear with an arbitrary mix of its long andCANCEL, whethershort field name form. Implementations MUST accept both themethod islong and short forms of each header name. 7.4 Bodies Requests, including new requests defined in extensions to thisspecification or elsewhere, inspecification, MAY contain message bodies unless otherwise noted. For response messages, thesame way. Thus, no method-specific support is required in these servers for methods other than INVITErequest method andCANCEL. Methods that are not supported by a user agent server or registrar cause a 501 (Not Implemented)the responseto be returned (Section 11). Handley/Schulzrinne/Schooler/Rosenberg [Page 27]status code determine the type and interpretation of any message body. All responses MAY include a body. 7.4.1 Message Body Type The InternetDraft SIP July 20, 2001 general-header = Accept ; Section 10.6 | Accept-Encoding ; Section 10.7 | Accept-Language ; Section 10.8 | Call-ID ; Section 10.12 | Call-Info ; Section 10.13 | Contact ; Section 10.14 | CSeq ; Section 10.20 | Date ; Section 10.21 | Encryption ; Section 10.22 | From ; Section 10.25 | MIME-Version ; Section 10.28 | Organization ; Section 10.29 | Record-Route ; Section 10.34 | Require ; Section 10.35 | Supported ; Section 10.41 | Timestamp ; Section 10.42 | To ; Section 10.43 | User-Agent ; Section 10.45 | Via ; Section 10.46 entity-header = Allow ; Section 10.10 | Content-Disposition ; Section 10.15 |media type of the message body MUST be given by the Content-Type header field. If the body has undergone any encoding (such as compression) then this MUST be indicated by the Content- Encoding header field, otherwise Content-Encoding; Section 10.16 | Content-Language ; Section 10.17 | Content-Length ; Section 10.18 |MUST be omitted. If applicable, the character set of the message body is indicated as part of the Content-Type; Section 10.19 | Expires ; Section 10.24 request-header = Alert-Info ; Section 10.9 | Authorization ; Section 10.11 | In-Reply-To ; Section 10.26 | Max-Forwards ; Section 10.27 | Priority ; Section 10.30 | Proxy-Authorization ; Section 10.32 | Proxy-Require ; Section 10.33 | Route ; Section 10.38 | Response-Key ; Section 10.36 | Subject ; Section 10.40 response-header = Error-Info ; Section 10.23 | Proxy-Authenticate ; Section 10.31 | Retry-After ; Section 10.37 | Server ; Section 10.39 | Unsupported ; Section 10.44 | Warning ; Section 10.47 | WWW-Authenticate ; Section 10.48 Table 3: SIP headers Handley/Schulzrinne/Schooler/Rosenbergheader-field value. Various Authors [Page28]23] Internet Draft SIPJuly 20,October 26, 2001Method = "INVITE" | "ACK" | "OPTIONS" | "BYE" | "CANCEL" | "REGISTER" | extension-method extension-method = token 4.3 Request-URITheRequest-URI is a SIP URL as described"multipart" MIME type defined inSection 2 or a general URI (RFC 2396 [10]). In particular, it MUST NOT contain unescaped spaces or control characters. It indicates the user or service to which this request is being addressed. Unlike the To field, the Request-URIRFC 2046 [14] MAY bere-written by proxies. As shown in Table 2,used within theRequest-URI MAY containbody of theuser-param parameter as well as transport-related parameters. A servermessage. Implementations thatreceives a SIP-URL with illegal elements removes them before further processing. Transport-related parameters are needed when a UAC proxies allsend requests containing multipart message bodies MUST be able to send adefault proxy, which would then need this information to generate the appropriate request. Typically, the UAC sets the Request-URI and To to the same SIP URL, presumed to remain unchanged over long time periods. However,session description as a non-multipart message body if theUAC has cached a more direct path toremote implementation requests this through an Accept header field. 7.4.2 Message Body Length The body length in bytes is provided by thecallee, e.g., fromContent-Length header field. Section 22.14 describes theContactnecessary contents of this headerfieldin detail. The "chunked" transfer encoding ofa response to a previous request, the To would still contain the long-term, "public" address, while the Request-URI wouldHTTP/1.1 MUST NOT beset to the cached address. Proxy and redirect servers MAY useused for SIP. (Note: The chunked encoding modifies theinformationbody of a message inthe Request-URI and request header fieldsorder tohandle the request and possibly rewrite the Request-URI. For example,transfer it as arequest addressed to the generic address sip:sales@acme.com is proxied to the particular 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 partseries ofthe Request-URI typically agreeschunks, each with its own size indicator.) 7.5 Framing SIP messages Unlike HTTP, SIP MAY use UDP or other unreliable datagram protocols. Each such datagram carries oneof the host names of the receiving server. If it does not, the serverrequest or response. Datagrams, including all headers, SHOULDproxyNOT be larger than therequest topath maximum transmission unit (MTU) if theaddress indicatedMTU is known, orreturn a 404 (Not Found) response1500 bytes ifitthe MTU isunwilling or unableunknown. However, implementations MUST be able to handle messages up todo so. For example, the Request-URI and server host name can disagree inthecasemaximum datagram packet size. For UDP, this size is 65,535 bytes, including headers. The MTU ofa firewall proxy1500 bytes accommodates encapsulation within the "typical" ethernet MTU without IP fragmentation. Recent studies [15] indicate thathandles outgoing calls. This modean MTU ofoperation1500 bytes issimilara reasonable assumption. The next lower common MTU values are 1006 bytes for SLIP and 296 for low-delay PPP (RFC 1191 [16]). Thus, another reasonable value would be a message size of 950 bytes, tothataccommodate packet headers within the SLIP MTU without fragmentation. In the interest ofHTTP proxies. Handley/Schulzrinne/Schooler/Rosenbergrobustness, 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. Likewise, Implementations processing SIP messages over stream oriented transports MUST ignore noise between messages. 8 General User Agent Behavior Various Authors [Page29]24] Internet Draft SIPJuly 20,October 26, 2001SIP servers MAY support Request-URIs with schemes other than "sip", for example the "tel" URI scheme [19].A user agent represents an end system. ItMAY translate non-SIP URIs using any mechanism at its disposal, resulting in eithercontains aSIP URI or some other scheme. IfUser Agent Client (UAC), which generates requests, and aSIP server receivesUser Agent Server (UAS) which responds to them. A UAC is capable of generating a requestwithbased on some external stimulus (the user clicking aURI indicatingbutton, or ascheme the server does not understand, the server MUST returnsignal on a PSTN line), and processing a400 (Bad Request)response.It MUST do this even ifA UAS is capable of receiving a request, and generating response, based on user input, external stimulus, theTo header field containsresult of aschemeprogram execution, or some other mechanism. When a UAC sends a request, itdoes understand, since proxies are responsible for processing the Request-URI. (The To field is onlywill pass through some number ofinterest toproxy servers, which forward theUAS.) 4.3.1 SIP Version Bothrequest towards the UAS. When the UAS generates a response, the response is forwarded towards the UAC. UAC and UAS procedures depend strongly on two factors. First, whether the request or responsemessages includeis inside or outside of a dialog, and second, based on theversionmethod ofSIPa request. Dialogs are discussed thoroughly inuse,Section 12; they represent a peer-to-peer relationship between user agents, andfollow [H3.1] (with HTTP replacedare established bySIP,specific SIP methods, such as INVITE. In this section, we discuss the method independent rules for UAC andHTTP/1.1 replaced by SIP/2.0) regarding version ordering, compliance requirements, and upgradingUAS behavior when processing of requests that are outside ofversion numbers. To be compliant with this specification, applications sending SIP messages MUST includeaSIP- Versiondialog. This includes, of"SIP/2.0". The string is case-insensitive, but implementations MUST use upper-case. Unlike HTTP/1.1, SIP treatscourse, theversion number asrequests which themselves establish aliteral string. In practice, this should make no difference. 4.4 Option Tags Option tagsdialog. 8.1 UAC Behavior 8.1.1 Generating the Request A valid SIP request formulated by a UAC MUST at a minimum contain the following headers: To, From, CSeq, Call-ID, and Via; all of these headers areunique identifiers used to designate new optionsmandatory inSIP.all SIP messages. Thesetagsfive headers areused in Require (Section 10.35), Supported (Section 10.41) and Unsupported (Section 10.44) header fields. Syntax: option-tag = token See Section C forthedefinition of token. The creatorfundamental building blocks of anewSIPoption MUST either prefixmessage, as they jointly provide for most of theoption with their reverse domain name or registercritical message routing services including thenew option withaddressing of messages, theInternet Assigned Numbers Authority (IANA). An examplerouting of responses, ordering of messages, and the unique identification of transactions. Examples of requests send outside of areverse-domain-name option is "com.foo.mynewfeature", whose inventor can be reached at "foo.com". For these features, individual organizations are responsibledialog include an INVITE to establish a session (Section 13) and an OPTIONS to query forensuringcapabilities (Section 11). 8.1.1.1 To The To general-header field first and foremost specifies the desired "logical" recipient of the request, or the address of record of the user or resource thatoption names dois the target of this request. This may or may notcollide withinbe thesame domain. The host name partultimate recipient of theoption MUSTrequest. The To header MAY contain a SIP URI, but it may also make uselower-case;of other URI schemes (for example as theoption name is case-sensitive. Handley/Schulzrinne/Schooler/Rosenbergtel URL [13]) when appropriate. The To header field Various Authors [Page30]25] Internet Draft SIPJuly 20,October 26, 2001Options registered with IANA do notallows for a display name; this is meant to containperiods and are globally unique. IANA option tags are case-sensitive. 4.4.1 Registering New Option Tags with IANA When registeringanew SIP option,descriptive version of thefollowing information MUST be provided: o NameURI, anddescription of option. The name MAY be of any length, but SHOULDis intended to beno 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, header parameter fields or parameter values defined by this option.displayed to a user interface. ASIP option MUST NOT redefineUAC may learn how to populate the To headerfields or parameters definedfield for a particular request ineither RFC 2543, any standards-track extensions to RFC 2543, or other extensions registered through IANA. o Indicationa number ofwho has change control overways. Usually theoption (for example, IETF, ISO, ITU-T, other international standardization bodies, a consortium oruser will suggest the To header field through aparticular companyhuman interface, perhaps inputting the URI manually orgroupselecting it from some sort ofcompanies); oaddress book. Areference to a further description, if available, for example (in orderrequest outside ofpreference) an RFC, a published paper,apatent filing,dialog MUST NOT contain atechnical report, documented source code or a computer manual; o Contact information (postal and email address). Registrations should be sent to iana@iana.org This procedure has been borrowed from RTSP [4] and the RTP AVP [27]. 5 INVITE, ACK and CANCEL 5.1 INVITE The INVITE method indicates thattag; theuser or service is being invited to participatetag ina session. The message body MAY contain a descriptionthe To field of a request identifies thesession to whichpeer of thecalleedialog. Since no dialog isbeing invited.established, no tag is present. Fortwo-party calls,further information on thecallerTo header see Section 22.37. The following is an example of valid To header: To: Carol <sip:carol@chicago.com> 8.1.1.2 From The From general-header field indicates thetypelogical identity ofmedia it is able to receive and possiblythemedia it is willing to send as well as their parameters such as network destination. A success response MUST indicate in its message body which mediainitiator of thecallee wishes to receive and MAY indicaterequest, possibly themediauser's address of record. Like thecalleeTo field, it contains a URI and optionally a display name. It isgoing to send. Handley/Schulzrinne/Schooler/Rosenberg [Page 31] Internet Draftused by SIPJuly 20, 2001 Not all session description formats have the abilityelements toindicate sending media. The caller MAY choosedetermine processing rules to apply toomit the request body (i.e., not send a session description) or sendasession description that does not list any media types. This indicatesrequest (for example, automatic call rejection). As such, it is very important that thecaller doesURI notknow its desired media characteristics until the call has been accepted. In this case, the UAS SHOULD still return a session description in its informational (1xx)contain IP addresses orsuccess (2xx) response, containing those media streams and codecs it supports. If the INVITE request didhost names, since these are not logical names. The From header field allows for a display name; this is meant to contain acomplete session description, the caller MUST include one indescriptive version of theACK request. A UAC MUST NOT send an updated session description in an ACK request if it had already sentURI, and is intended to be displayed to asession description in the INVITE request. If theuser interface. A UACwishes to modify the session after the call setup has begun, it MUST initiate another INVITE transaction afterSHOULD use thecurrent one has completed. Delayingdisplay name "Anonymous" if thesession description untilidentity of theACK requestclient isuseful for gateways from H.323v1toSIP, whereremain hidden. Usually theH.323 media characteristics are not known untilvalue that populates thecall is established. A server MAY automatically respond to an invitation forFrom header field in requests generated by aconference theparticular user agent isalready participating in, identified eitherpre-provisioned by theSIP Call-IDuser ora globally unique identifier withinby thesession description, with a 200 (OK) response. The behavioradministrators ofUAS depend on whether they are Internet telephony gateways tothePSTN. A UAS not acting as a gateway which receives an INVITE withuser's local domain. If aRequest-URIparticular user agent is used by multiple users, it might have switchable profiles thatdoes not correspondinclude a URI corresponding toonethe identity ofits configured addresses, MUST respond with 404 (Not Found). A UAS acting as a gateway translatestheINVITE request into a telephony signaling message. If the INVITE has a Call-ID value that matches a recent call, the UAS compares the Request-URI with the Request-URIprofiled user. Recipients of requests can authenticate theprevious INVITEoriginator of a requestfor the same Call-ID. If the Request-URI contains additional digitsinthe "user" part, the UAS treats the INVITE as adding additional digitsorder tothe original dialed string. This is known as overlap dialing. If the gateway knowsascertain thatthe telephone number is incomplete, it returns a 484 (Address Incomplete) status response. If a user agent receives an INVITE requestthey are who their From header field claims they are (see Section 20.2 foran existing call leg withmore on authentication). The From field MUST contain ahigher CSeq sequence number than any previous INVITE fornew "tag" parameter, chosen by theHandley/Schulzrinne/Schooler/RosenbergUAC. See Section 21.3 for details on choosing a tag. Various Authors [Page32]26] Internet Draft SIPJuly 20,October 26, 2001same Call-ID, it MUST check any version identifiers in the session description or, if there are no version identifiers, the content ofFor further information on thesession description toFrom header seeif it has changed.Section 22.20. Examples: From: "Bob" <sip:bob@biloxi.com> ;tag=a48s From: sip:+12125551212@server.phone2net.com;tag=887s From: Anonymous <sip:c8oqz84zk7z@privacy.org>;tag=hyh8 8.1.1.3 Call-ID The Call-ID general-header field acts as a unique identifier to group together series of messages. ItMUST also inspect any other header fields for changes. If thereis always the same for all requests and responses sent by either UA in achange,dialog. It is also theuser agent MUST updatesame in each registration from a UA within a single boot cycle. In a new request created by a UAC outside of anyinternal state or information generateddialog, unless overridden by method specific behavior, it MUST be selected by the UAC as aresult ofa globally unique identifier over space and time; all SIP user agents must have a means to guarantee thatheader. If the session description has changed,the Call-ID headers they produce will not be inadvertently generated by any other useragent server MUST adjust the session parameters accordingly, possibly after askingagent. Use of cryptographically random identifiers [17] in theuser for confirmation. (Versioninggeneration of Call-IDs 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 sessiondescription can be used to accommodatehijacking, and reduces thecapabilitieslikelihood ofnew arrivals to a conference, add or delete mediaunintentional Call-ID collisions. No provisioning orchange from a unicast to a multicast conference.) If an INVITE requesthuman interface is required foran existing session fails,thesession description agreed upon inselection of thelast successful INVITE transaction remains in force. A UAC MUST NOT issue another INVITE requestCall-ID header field value for a request. For further information on thesame call leg before the previous INVITE transaction has completed. A UAS that receives an INVITE before it sent the final responseCall-ID header see Section 22.8. Example: Call-ID: f81d4fae-7dec-11d0-a765-00a0c91e6bf6@foo.bar.com 8.1.1.4 CSeq Various Authors [Page 27] Internet Draft SIP October 26, 2001 The Cseq header serves as a way toan INVITE withidentify and order transactions. It consists of alower CSeqsequence numberonand a method. The method MUST match that of thesame call legrequest. The sequence number value is arbitrary, but MUSTreturnbe expressible as a400 (Bad Request) response32-bit unsigned integer and MUSTincludebe less than 2**31. As long as it follows the above guidelines, aRetry-Afterclient may use any mechanism it would like to select CSeq header fieldwith a randomly chosen value of between 0 and 10 seconds. If a UA A sends anvalues. For further information on the CSeq header see Section 22.16. Example: CSeq: 4711 INVITErequest8.1.1.5 Via The Via header is used toBdetermine the transport to use for sending a request, andreceives an INVITE request from B before it has receivedfor identifying the IP address and port where the response is toits request from B, A MAY return a 500 (Internal Server Error), which SHOULD include a Retry-Afterbe sent. Rules for setting and using the values in this headerfield specifying whenare described in Section 19. For further information on therequest should be resubmitted. In most cases,Via header see Section 22.40. 8.1.1.6 Contact The Contact header provides aUASIP URI that canassumebe used to contact that specific instance of theorderuser agent for subsequent requests. The Contact header MUST be present in any request that can result in the establishment ofmessages received corresponds toa dialog. For theorder they were sent. In rare circumstances,methods defined in this specification, that includes only theresponse from B andINVITE request. For these requests, therequest from B may be reordered onscope of thewire. In addition, if A or B change multicast addresses, strict transaction orderingContact isnecessary sothe dialog. That is, the Contact header refers to the URL thatboth sides agree onthefinal result. A UAC MUST be preparedUA would like to receivemedia data according to the session description as soon as it sends an INVITE (or re-INVITE) and can start sending media data when it receives a provisional or final response containingrequests at, for requests that are part of that dialog only. Only asession description.single URI MUST be present. For further information on the Contact header, see Section 22.10. 8.1.1.7 Request-URI The initialINVITE fromRequest-URI of theUACmessage SHOULDcontainbe set to theAllow and Supported header fields, and MAY containvalue of theAccept headerURI in the To field.A 200 (OK) response toOne notable exception is theinitial INVITEREGISTER method; behavior fora call SHOULD containsetting theAllow and Supported header fields, and MAY containRequest-URI of register is given in Section 10. Another exception is theAccept header field. Handley/Schulzrinne/Schooler/Rosenbergcase of pre-existing Route headers; in that case, the procedures of Section 12.2.1.1 as they Various Authors [Page33]28] Internet Draft SIPJuly 20,October 26, 2001Including these header fields allows the UACpertain todeterminethefeaturesRequest- URI are followed, even though there is no dialog. 8.1.1.8 Supported and Require If the UAC supports extensionssupportedto SIP that can be applied by theUAS forserver to theduration ofresponse, the UAC SHOULD include a Supported header in thecall, without probing. This method MUST be supported by SIP proxy, redirect and user agent servers as well as clients. 5.1.1 ACK The ACKrequestconfirms thatlisting theclient has received a final responseoption tags for those extensions. The option-tags listed MUST only refer toan INVITE request. (ACKextensions defined in standards track RFCs. This isused only with INVITE requests.) Treatment of ACK for a 200 class response differs significantlyto prevent servers from insisting thatof a non-200 class response. 2xx responses are acknowledged by client user agents, all other final responses by the first stateful proxy or client user agentclients implement non-standard, vendor defined features in order to receive service. Extensions defined by experimental and informational RFCs are explicitly excluded from usage with theresponse. The Via is always initializedSupported header in a request, since they too are often used to document vendor defined extensions. If thehostUAC wishes to insist thatoriginates the ACK request, i.e., the client user agent aftera2xx response orUAS understand an extension that thefirst proxy orUAC will apply toreceive a non-2xx final response. For a non-200 class response,theViarequest in order to process theACK that is constructedrequest, it MUSTbe the same asinsert a Require header into the requestbeing acknowledged. The ACK for a 200 class response will contain Route headers if Record-Route headers were present inlisting theresponse. An ACKoption tag for that extension. If the UAC wishes to apply an extension to the request and insist that anon-200 class response never contains Route headers. The ACKproxy understand that extension, it MUST insert a Proxy-Require header into the request listing the option tag for that extension. 8.1.1.9 Additional Message Components After a200 class response is forwardednew request has been created, the headers described above have been properly constructed, any additional optional headers are added, as are any headers specific to thecorresponding INVITE request, based on its Request-URI or Route headers, and thusmethod. SIP requests MAYtakecontain adifferent path thanMIME-encoded message-body. Regardless of theoriginal INVITE request, and MAY even causetype of body that anew transport connection torequest contains, certain headers must beopened in orderformulated tosend it.characterize the contents of the body. For further information on these headers see Section 7.4. 8.1.2 Sending the Request TheRequest-URIdestination for theACKrequest issetthen computed. This can be a preconfigured IP address, port and transport of an outbound proxy, or it can be determined through DNS procedures applied to thetop entryRequest- URI. These procedures are described inthe routeSection 24, which yield an ordered set of address, port and transports to attempt. The UAC SHOULD follow the procedures defined there for stateful elements, trying each address until a200 class response (see Section 16). Forserver is contacted. Each try constitutes anon-200 class response, the Request-URInew transaction, and therefore a new client transaction MUST be constructed for each. Various Authors [Page 29] Internet Draft SIP October 26, 2001 8.1.3 Processing Responses Responses are first processed by thesame as the Request-URI intransport layer, and then passed up to therequest being acknowledged.transaction layer. TheACK request does not generate responses for any transport protocol.transaction layer performs its processing, and then passes it up to the TU. TheACK request for a 200 classmajority of responseMAY contain a message body withprocessing in thefinal session descriptionTU is method specific. However, there are some general behaviors independent of the method. 8.1.3.1 Unrecognized Responses A UAC MUST treat any response they do not recognize as being equivalent to the x00 response code of that class, and MUST beused byable to process thecallee. See Section 5.1x00 response code forfurther details on the relationship between session descriptions in INVITE and ACK requests. A proxy server receiving an ACK request after having sentall classes. For example, if a3xx, 4xx, 5xx, or 6xxUAC receives an unrecognized responsemust 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 tag incode of 431, it can safely assume that there was something wrong with its request and treat theTo field.response as if it had received a 400 (Bad Request) response code. 8.1.3.2 Vias Ifthe tagmore than one Via header field is present in a response, theACK ToUAC SHOULD discard the message. The presence of additional Via headerfield matchesfields that precede thetagoriginator of the request suggests that the message was misrouted or possibly corrupted. 8.1.3.3 Processing 3xx responses Upon receipt of a redirection response (e.g. a 3xx response status code), clients SHOULD use the URI(s) in theToContact header fieldofto formulate a new request. To do that, theresponse, andclient copies all but theFrom, CSeq"method-param" andCall-ID"header" elements of the addr-spec part of the Contact headerfields infield into theresponse match those inRequest-URI of theACK,request. It uses theACK is meant"header" parameters to create headers for theproxy server. Otherwise,request, replacing any default headers normally used. In all other respects, requests sent upon receipt of a redirect response SHOULD re-use theACKheaders and bodies of the original request. The Contact values present in redirection responses SHOULD NOT beproxied downstreamcached across calls, asany other request. However, an ACKthey may notdestined forrepresent theproxy SHOULD NOT Handley/Schulzrinne/Schooler/Rosenbergmost desirable location for a particular destination address. 8.1.3.4 Processing 4xx responses Certain 4xx response codes require specific UA processing, Various Authors [Page34]30] Internet Draft SIPJuly 20,October 26, 2001be retransmitted. It is possible forindependent of the method. If auser agent client401 orproxy server to receive multiple 3xx, 4xx, 5xx,407 response is received, the UAC SHOULD follow the authorization procedures of Section 20.2.2 and6xx responsesSection 20.2.3 toaretry the requestalong a single branch. This can happen under various error conditions, typically whenwith credentials. If aforking proxy transitions from stateful to stateless before receiving all responses. The various responses will all be identical, except for the tag in the To field, which413 response isdifferent for each one. It can therefore be used as areceived (Section 23.4.11), it meansto disambiguate them. This method MUST be supported by SIP user agents. 5.2 CANCEL The CANCELthat the requestcancelscontained apending request withbody that was longer than thesame Call-ID, To, From, top Via header and Request-URI and CSeq (sequence number only) header field values, but does not affect a completed request or existing calls. (A request is considered completed ifUAS was willing to accept. If possible, theserver has returned a final status response.) TheUACcan use a BYE request to terminate a call ifSHOULD retry theCANCEL arrived too late. A user agent clientrequest, either omitting the body orproxy client MAY issue a CANCEL request at any time. A proxy client SHOULD generateusing one of aCANCEL request for branches withoutsmaller length. If afinal415 responseafteris received (Section 23.4.13), ithas forked ameans the requestand receives a 2xx or 6xx response from one ofcontained media types not supported by thebranches. AUAS. The UACor proxy clientSHOULDsend a CANCEL ifretry sending the request, this timenotedonly using content with types listed in theExpiresAccept headerofin therequest has elapsed or no provisional or final response was received after a client-determined timeout interval. Finally, internal logic such as scripts, MAY trigger CANCEL requests. A stateful proxy that receives a CANCEL request immediately respondsresponse, witha 200 classencodings listed in the Accept-Encoding header in the response, and with languages listed in the Accept-Language in the response.It then generatesIf anew CANCEL, and forwards420 response is received (Section 23.4.14), it means the requestto all destinations with pending requests. A stateless proxy,contained a Require or Proxy-Require header listing an option-tag for a feature not supported by astatefulproxywith no transaction state foror UAS. The UAC SHOULD retry thecancelledrequest,proxies the CANCEL request to the same set of destinations the original request was proxied to. The Request-URI, topmost Via, Call-ID, To,this time omitting any extensions listed in thenumeric part of CSeq and FromUnsupported headerfieldsin theCANCEL request are identical to those inresponse. In all of the above cases, retrying theoriginalrequestbeing cancelled, including tags. This allowsis accomplished by creating aCANCELnew requestto be matchedwith the appropriate modifications. This new requestit cancels. However, to allowSHOULD have theclient to distinguish responses tosame value of theCANCEL from those toCall-ID, To, and From of theoriginalprevious request, but the CSeqMethod component is set to CANCEL. The Via header fieldshould contain a new sequence number that isinitialized toone higher than theproxy issuingprevious. With other 4xx responses, a retry may or may not be possible depending on theCANCEL request. (Thus, responses to this CANCEL request only reachmethod and theHandley/Schulzrinne/Schooler/Rosenberg [Page 35] Internet Draft SIP July 20, 2001 issuing proxy.) The behavioruse case. 8.2 UAS Behavior When a request outside of a dialog is processed by a UAS, there are a set of processing rules which are followed, independent of theuser agent or redirect servermethod. Section 12 gives guidance onreceivinghow aCANCEL request depends onUAS can tell whether a request is inside or outside of a dialog. 8.2.1 Authentication/Authorization A UAS MAY authenticate the originator of a request, and this process may require the serverhas already sentto issue afinal responsechallenge for credentials. The required behavior is independent of theoriginal request. If it has,method of theCANCELrequest, and is detailed in Section 20.2. 8.2.2 Method Inspection Various Authors [Page 31] Internet Draft SIP October 26, 2001 Once a requesthasis authenticated (or noeffect onauthentication was desired), theoriginal request, any call state and onUAS MUST inspect theresponses generated formethod of theoriginalrequest. If theserver hasUAS does notissued a final response for the original request, it immediately responds tosupport theoriginalmethod of a requestwithit MUST generate a487 (Request Terminated), following normal rules405 (Method Not Allowed) response. Procedures forresponse retransmissions definedgeneration of responses are described in Section14. For INVITE requests, the UAC as usual sends8.2.7. The UAS MUST also add anACK requestAllow header toconfirm receipt of any finalthe 405 response. TheCANCEL request itself is answered with a 200 (OK) response in either case. IfAllow header field MUST list theUAS or redirect server has no recordset of methods supported by therequest being cancelled,UAS generating theCANCELmessage. The Allow header isresponded to with a 481. A proxy client or UAC cannot rely on receiving a 487 (Request Terminated) response, aspresented in Section 22.5. If the method is one supported by the server, processing continues. 8.2.3 Header Inspection If aRFC 2543-compliantUASwilldoes notgenerate suchunderstand aresponse. If there has been no final response after 32 seconds, the client MAY consider the original transaction to have been cancelled. The BYE request cannot be used to cancel branches ofheader field in aparallel search, since several branches may, through intermediate proxies, findrequest (i.e. the header is not defined in this specification or in any supported extension), thesame user agentserver MUST ignore that header andthen terminatecontinue processing thecall.message. A UAS SHOULD ignore any malformed headers which are not necessary for processing requests. 8.2.3.1 Toterminate a call instead of just pending searches,and Request-URI The To header field identifies theUAC must use BYE insteadoriginal recipient ofor in addition to CANCEL. While CANCEL can terminate any pendingthe requestother than ACK or CANCEL, it is typically useful only for INVITE. 200 responses to INVITE and 200 responses to CANCEL can be distinguisheddesignated by themethoduser identified in theCseq headerFrom field.This method MUST be supported by proxy servers and SHOULD be supported by all other SIP server types. 6 BYETheuser agent client uses BYE to indicate tooriginal recipient may or may not be theserver that it wishes to releaseUAS processing the request, do to callleg. A BYE request is forwarded like an INVITE request and MAY be issued by either callerforwarding orcallee.other proxy operations. ABYE request SHOULD NOT be sentUAS MAY apply any policy it wishes in determination of whether toterminateaccept requests when the To field is not the identity of the UAS. However, it is RECOMMENDED that apending call request which hasUAS accept requests even if they do notgenerated eitherrecognize the URI scheme (e.g., afinal responsetel: URI) in the To header, ora provisional response containing aif the Totag. A party toheader does not address acallknown or current user of this UAS. If, on the other hand, the UAS decides to reject the request, it SHOULDissue a BYE request before releasinggenerate acall ("hanging up"). A party receivingresponse with aBYE request MUST cease transmitting media streams specifically directed at403 status code and send it to theparty issuingserver transaction for transmission. However, the Request-URI identifies the UAS that is to process theBYErequest.Handley/Schulzrinne/Schooler/Rosenberg [Page 36] Internet Draft SIP July 20, 2001 AIf the Request-URI does not identify an address that the UASreceiving a BYE request MUST respondis willing toany pendingaccept requestsreceivedfor, it SHOULD reject the request with a 404 (Not Found) response. If the Request-URI does not provide sufficient information forthat call, including INVITE. Itthe UAS to determine whether it isRECOMMENDED thatwilling to process the request, it SHOULD return a487 response is generated.485 (Ambiguous) response. Thismethodresponse SHOULD contain a Contact header field containing URIs of new addresses to besupported by user agent servers. 7 Registrars, Registrations and the REGISTER Method A clienttried. Typically, a UA which uses the REGISTER method to bindtheits addresslisted in the To header field with a SIP serverof record toone or more URIs wherea specific contact address, will see requests whose Request-URI equals those contact addresses. Various Authors [Page 32] Internet Draft SIP October 26, 2001 8.2.3.2 Require Assuming theclient can be reached, contained inUAS decides that it is theContact header fields. These URIs may use any URI scheme, not limitedproper element toSIP. Itprocess the request, it examines the Require header field, if present. The Require general-header field isparticularly importantused by UAC to tell UAS about SIP extensions thatREGISTER requests are authenticated since they allowthe UAC expects the UAS toredirect future requests (see Section 18.2). 7.1 Wheresupport in order toRegister A user agentproperly process the request. If a UAS does not understand an option listed in a Require header field, it MUST respond by generating a response with status code 420 (Bad Extension). The UAS MUST add a Unsupported, and list in it those options it does not understand amongst those in the Require header of the request. Upon receipt of the 420 the client SHOULDattempt to register periodically according toretry therules below. A UArequest, this time without using those extensions listed in the Unsupported header in the response. Example: UACC->UAS: INVITE sip:watson@bell-telephone.com SIP/2.0 Require: com.example.billing Payment: sheep_skins, conch_shells UASS->UAC: SIP/2.0 420 Bad Extension Unsupported: com.example.billing This issaidtobe "visiting" if its From address domain differs frommake sure that thecurrent network domainclient-server interaction will proceed without delay when all options are understood by both sides, andis said to be "at home"only slow down ifthe twooptions are not understood (as in thesame. Local server: If an outbound proxy is configured, the UA SHOULD sendexample above). For aREGISTER request to it. Ifwell-matched client-server pair, theUA is visiting,interaction proceeds quickly, saving a round-trip often required by negotiation mechanisms. In addition, itusesalso removes ambiguity when theFrom address consistingclient requires features that the server does not understand. Some features, such as call handling fields, are only of interest to end systems. 8.2.4 Content Processing Assuming theURL-escaped user identity atUAS understands any extensions required by thevisited domain, e.g.,client, theuser identified as alice@wonderland.com would register as alice%40wonderland.com@example.com if she is visitingUAS examines theexample.com domain. Multicast:body of the message, and the headers that describe it. Ifno local outbound proxy is configured, multicast registrationsthere areaddressed to the well-known "all SIP servers" multicast address "sip.mcast.net" (224.0.1.75). This request MUST be scoped to ensure it is not forwarded beyondany bodies whose type (indicated by theboundaries ofContent-Type), language (indicated by theadministrative system. This MAY be done with either TTLContent-Language) oradministrative scopes [28], depending on what is implemented inencoding (indicated by thenetwork. SIP user agents MAY listen to that addressContent-Encoding) are not understood, anduse it to become aware of the location of other local users [18]; however, they dothat body part is notrespond tooptional (as indicated by therequest. Multicast registration may be inappropriate in some environments, for example, if multiple businesses shareContent- Disposition) header, thesame local area network. Home server: IfUAS MUST reject theUA is visiting, it SHOULD also sendrequest with a 415 (Unsupported Media Type) response. The response MUST contain aHandley/Schulzrinne/Schooler/RosenbergAccept Various Authors [Page37]33] Internet Draft SIPJuly 20,October 26, 2001registration to its home SIP server, identified by its home address. For example, alice@wonderland.com would send a registration to the SIP server for the domain wonderland.com when she is visiting another network. TBD: What Contact should be used? A user agent SHOULD register with a local server on startup and periodically thereafter by sending a REGISTER request. The period is given by the expiration time indicated in the registration response. It is RECOMMENDED that the UA registers via multicast and send a registration to its "home" address, i.e., the server forheader listing thedomain thattypes of all bodies ituses as its From addressunderstands, inoutgoing requests. 7.2 REGISTER Header Fields Request-URI: The Request-URI namesthedestination of the registration request, i.e.,event thedomainrequest contained bodies of types not supported by theregistrar. The user name MUST be empty. Generally,UAS. If thedomains inrequest contained content encodings not understood by theRequest-URI andUAS, theToresponse MUST contain an Accept-Encoding headerfield havelisting thesame value; however, it is possible to register as a "visitor", while maintaining one's name. For example, a traveler sip:alice@acme.com (To) might register underencodings understood by theRequest- URI sip:atlanta.hiayh.org ,UAS. If the request contained content with languages not understood by theformer asUAS, theToresponse MUST contain an Accept-Language headerfield andindicating thelatter aslanguages understood by theRequest-URI. The REGISTER requestUAS. Beyond these checks, body handling isno longer forwarded once it has reachedmethod and type specific. For further information on theserver whose authoritative domain isprocessing of Content-specific headers see Section 7.4. 8.2.5 Applying Extensions A UAS that wishes to apply some extension when generating theone listedresponse MUST only do so if support for that extension is indicated in theRequest-URI. Call-ID: All registrations from a client SHOULD use the same Call-IDSupported headervalue, at least withinin thesame reboot cycle. Cseq: Registrations withrequest. If thesame Call-ID MUST have increasing CSeq header values. However,desired extension is not supported, the serverdoes not reject out-of-order requests. 7.3 Registering Contact Locations REGISTER requests are processed inSHOULD rely only on baseline SIP and any other extensions supported by the client. To ensure that theorder received. ClientsSHOULDavoid sendingcan be fulfilled, any specification of a newregistration (as opposedextension MUST include discussion of how toa retransmission) until they have receivedgracefully return to baseline SIP when theresponse fromextension is not present. In rare circumstances, where the serverfor the previous one. Clients may register from different locations, by necessity using different Call-ID values. Thus, the CSeq valuecannotbe used to enforce ordering. Since registrations are additive, ordering is less of a problem than if each Handley/Schulzrinne/Schooler/Rosenberg [Page 38] Internet Draft SIP July 20, 2001 REGISTERprocess the requestcompletely replaced all earlier ones. We define "address-of-record" aswithout theSIP address thatextension, theregistry knowsserver MAY send a 421 (Extension Required) response. This response indicates that theregistrand, typicallyproper response cannot be generated without support ofthe form "user@domain" rather than "user@host". In third-party registration, the entity issuing the request is different from the entity being registered. To:a specific extension. TheToneeded extension(s) MUST be included in a Require headerfield containsin theaddress-of-record whose registrationresponse. This behavior is NOT RECOMMENDED, as it will generally break interoperability. Any extensions applied to a non-421 response MUST becreated or updated. From: The Fromlisted in a Require headerfield containsincluded in theaddress-of-record ofresponse. Of course, theperson responsible forserver MUST NOT apply extensions not listed in theregistration. For first- party registration, it is identical to the ToSupported headerfield value. It is RECOMMENDED that registrars authorize whether the entity in the From field is allowed to register addresses for the address-of-recordin theTo field. Contact: The request MAY containrequest. As aContact header field. Future non-REGISTER requests for the URI given inresult of this, theToRequire headerfield SHOULD be directed to the address(es) giveninthe Contact header. If the request does not containaContact header, the registration remains unchanged. This is useful to obtain the current list of registrationsresponse will only ever contain option tags defined in standards track RFCs. 8.2.6 Processing theresponse, as described below. If a SIP URI in a registration Contact header field differs from existing registrations according toRequest Assuming all of theruleschecks inSection 2.1, it is added tothelist of registration. If it is equivalent, according to these rules, to an existing registration, all Contact header field parameters for this entry are updated accordingly. URIs other than SIP URIsprevious subsections arecompared according topassed, thestandard URI equivalency rules forUAS processing becomes method specific. Section 10 deals with theURI schema. All current registrations MUST shareREGISTER request, section 11 deals with thesame action value. Registrations that have a different action than current registrations forOPTIONS request, section 13 deals with thesame user MUST be rejectedINVITE request, and section 15 deals withstatus of 409 (Conflict). A proxy server ignorestheq parameter when processing non-REGISTER requests, whileBYE request. 8.2.7 Generating the Response When a UAS wishes to construct aredirect server simply returns that parameter in its Contactresponseheader field. Handley/Schulzrinne/Schooler/Rosenbergto a request, it follows Various Authors [Page39]34] Internet Draft SIPJuly 20,October 26, 2001Having the proxy server interpret the q parameter is not sufficient to guide proxy behavior, as it is not clear, for example, how long it is supposed to wait between trying addresses. If the registration is changed while a user agent or proxy server processes an invitation, the new information SHOULDthese procedures. Additional procedures may beused. 7.4 Registration Expiration An optional "expires" Contact parameter indicatesneeded depending on thedesired expiration timestatus code of theregistration. If a Contact entry does not have an "expires" parameter, the Expires request andresponseheader field is used asand thedefault value. If neithercircumstances ofthese mechanisms is used, SIP URIsits construction. These additional procedures areassumed to expire after one hour. Other URI schemes have no expiration times. Registrations not refreshed after this amountdocumented elsewhere. The From field oftime SHOULD be silently discarded. In a REGISTER request, the client indicates how long it wishes the registration to be valid. In the response,theserver indicatesresponse MUST equal theearliest expiration timeFrom field ofall registrations. If a registration updates an existing registration,theExpires valuerequest. The Call-ID field of themost recent registration is used, even if it is shorter thanresponse MUST equal theearlier registration.Call-ID field of the request. Theregistrar determinesCseq field of theexpiration time; it may be longer or shorter thanresponse MUST equal theone requested byCseq field of theregistrand.request. TheREGISTER response contains the actual registration lifetime;Via headers in theclientresponse MUSTrefresh at least as often and SHOULD NOT refresh more frequently. In general,equal theserver SHOULD honorVia headers in theexpiration time offered byrequest, and MUST maintain theuser agent. A server MAY decide to lengthen the expiration interval if, for example, the refresh rate ofsame ordering. If aparticular client exceedsrequest contained athreshold. This behavior is different from RFC 2543, which only allowed registrars to decrease, but not increase, the interval. AllowingTo tag in theregistrar to setrequest, theregistration interval protects it against excessively frequent registration refreshes while limitingTo field in thestateresponse MUST equal thatit needs to maintain and decreasingof thechance for stale registrations that require proxying effort. Registration refreshes SHOULD be sent torequest. However, if thesame address asTo field in theoriginal registration, unless redirected. 7.5 List of Current Registrations Handley/Schulzrinne/Schooler/Rosenberg [Page 40] Internet Draft SIP July 20, 2001 2xx REGISTER responses SHOULD list all current registrationrequest did not contain a tag, the URI in theContact header field. An "expires" parameterTo field in the response MUSTindicateequal theexpiration time ofURI in theregistration. 7.6 Removing Registrations Registrations expire as described above or may be removed explicitly by settingTo field in theexpires parameter for an existing registration to zero or including an Expires: 0 header field. Registrations are matched based onrequest. Additionally, theuser, host, port and maddr parameters. A client can remove all registrations by includingUAS MUST add asingle Contact headertag to the To fieldwithin thewildcard address "*".response. Thisusageserves to identify the UAS that isonly allowedresponding, possibly resulting inREGISTER requests whenaExpires header with value of zero is present. Supportcomponent ofthis method is RECOMMENDED; registrars MUST support it. 8 OPTIONSa dialog ID. TheOPTIONS method issame tag MUST be used for all responses toquery a server as to its capabilities. A serverthatbelievesrequest, both provisional and final. Procedures for generation of tags are defined in Section 21.3. 8.3 Redirect Servers In some architectures itcan contactmay be desirable to reduce theuser, such asprocessing load on proxy servers that are responsible for routing requests by relying on redirection. Redirection allows servers to push routing information for auser agent where the user is loggedrequest back inand has been recently active, MAY responda response to the client, thereby taking themselves out of the loop of further messaging for this transaction while still aiding in locating the target of the request. When the originator of the requestwith a capability set. A called user agent MAY returnreceives the redirection it will send astatus reflecting hownew request based on the routing information itwould have respondedhas received. By propagating routing information from the core of the network toan invitation, e.g., 600 (Busy).its edges, redirection allows for considerable network scalability. A redirect serverSHOULD return Allow, Accept, Accept- Encoding, Accept-Languageis logically constituted of a server transaction layer andSupported header fields. The response MAY containamessage body indicating the capabilities of the end system (rather than properties of any existing call). The usetransaction user that has access to a location service ofthe Call-ID header field is discussed insome kind (see Section10.12. An OPTIONS requests10 foran existing call-id has no impactmore onthat call. This method MUST be supported by SIP user agentsregistrars andregistrars. 9 Response After receivinglocation services). This location service is effectively a database containing mappings between a single URI andinterpretingarequest message,set of one or more alternative locations at which therecipient responds with a SIP response message. The response message format is shown below: Response = Status-Line ; Section 9.1 *( general-header | response-header | entity-header ) CRLF [ message-body ] ; Section 12 Handley/Schulzrinne/Schooler/Rosenberg [Page 41] Internet Draft SIP July 20, 2001 SIP's structuretarget ofresponses is similar to [H6], but is defined explicitly here. 9.1 Status-Line The first linethat URI can be found. A redirect server does not issue any SIP requests of its own. After receiving aResponse message isrequest other than CANCEL, theStatus-Line, consisting ofserver gathers 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 inlist of alternative locations from thefinal CRLF sequence. Status-Line = SIP-version SP Status-Code SP Reason-Phrase CRLF 9.1.1 Status Codeslocation service andReason Phrases The Status-Code iseither returns a3-digit integer result code that indicates the outcomefinal response ofthe attempt to understand and satisfyclass 3xx or it refuses the request.The Reason-Phrase is intended to giveFor well- formed CANCEL requests, it SHOULD return ashort textual description of2xx response. This response ends theStatus-Code.SIP transaction. TheStatus-Code is intended for use by automata, whereas the Reason-Phrase is intendedredirect server maintains transaction state forthe human user. The client is not required to examine or display the Reason-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-code extension-code = 3DIGIT Reason-Phrase = *<TEXT-UTF8, excluding CR, LF> We provideanoverview of the Status-Code below, and provide full definitions in Section 11. The first digit of the Status-Code definesentire SIP transaction. It is theclassresponsibility ofresponse. The last two digits do not have any categorization role. SIP/2.0 allows 6 values for the first digit: 1xx: Informational -- request received, continuingclients toprocess the request; 2xx: Success -- the action was successfully received, understood, and accepted; Handley/Schulzrinne/Schooler/Rosenbergdetect forwarding loops between redirect Various Authors [Page42]35] Internet Draft SIPJuly 20,October 26, 20013xx: Redirection -- further action needs to be taken in orderservers. When a redirect server returns a 3xx response tocomplete the request; 4xx: Client Error --a request, it populates therequest contains bad syntaxlist of (one orcannot be fulfilled at this server; 5xx: Server Error -- the server failedmore) alternative locations into Contact headers. An "expires" parameter tofulfill an apparently valid request; 6xx: Global Failure --therequest cannotContact header may also befulfilled at any server. Figures 4 through 8 presentsupplied to indicate theindividual valueslifetime of thenumericContact data. The Contact header field contains URIs giving the new locations or user names to try, or may simply specify additional transport parameters. A 301 or 302 responsecodes, and an example set of corresponding reason phrases for SIP/2.0. These reason phrases are only recommended; theymaybe replaced by local equivalents without affectingalso give theprotocol. Notesame location and username thatSIP adopts many HTTP/1.1 response codes. SIP/2.0 adds response codes inwas targeted by therange starting at x80initial request but specify additional transport parameters such as a different server or multicast address toavoid conflicts with newly defined HTTP response codes, and addstry, or anew class, 6xx,change ofresponse codes. SIP response codes are extensible.SIPapplications are not requiredtransport from UDP tounderstand the meaning of all registered response codes, though such understanding is obviously desirable. However, applications MUST understand the class of any response code, as indicated byTCP or vice versa. Note that thefirst digit, and treat any unrecognized response as being equivalentContact header field MAY also refer to a different entity than thex00 response code of that class. However, proxies SHOULD distinguish 100 from other 1xx responses. (The former SHOULD NOT be forwarded, while the latter MUST be. See Section 17.3.)one originally called. For example,if a client receives an unrecognized response code of 431, it can safely assume that there was something wrong with its request and treat the response as if it had receiveda400 (Bad Request) response code. In such cases, user agents SHOULD present to the user the message body returned with the response, since that message body is likely to include human-readable information which will explain the unusual status. 10 Header Field DefinitionsSIPheader fields are similarcall connected toHTTP header fields in both syntax and semantics. In particular, SIP header fields follow the syntax for message-headerGSTN gateway may need to deliver a special informational announcement such asdescribed in [H4.2]. The rules for extending"The number you have dialed has been changed." A Contact response headerfields over multiple lines, and use of multiple message-header fields Handley/Schulzrinne/Schooler/Rosenberg [Page 43] Internet Draft SIP July 20, 2001 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 withfield can contain any suitable URI indicating where thesame field-name, described in [H4.2] also apply to SIP. The rules in [H4.2] regarding ordering of header fields apply to SIP. The header fields required, optional andcalled party can be reached, notapplicable for each method are listed in Table 4 and Table 5. The table uses "o"limited toindicate optional, "m" mandatory and "-"SIP URIs. For example, it could contain URL's fornot applicable. "Optional" means thatphones, fax, or irc (if they were defined) or aUA MAY includemailto: (RFC 2368, [18]) URL. The "expires" parameter of the Contact header fieldinindicates how long the URI is valid. The parameter is either arequestnumber indicating seconds orresponse, andaUA MAY ignorequoted string containing a SIP-date. If this parameter is not provided, the value of the Expires header fieldif present indetermines how long therequestURI is valid. Implementations MAY treat values larger than 2**32-1 (4294967295 seconds orresponse. A "mandatory" request header field MUST be present in a request, and136 years) as equivalent to 2**32-1. Redirect servers MUSTbeignore features that are not understoodby(including unrecognized headers, Required extensions, or even method names) and proceed with theUAS receivingredirection of therequest. A mandatory response header fieldsession in question. If a particular extension requires that intermediate devices support it, the extension MUST bepresenttagged in theresponse, and the headerProxy-Require fieldMUST be understood by the UACas well (see Section 22.28). 9 Canceling a Request The previous section has discussed general UA behavior for generating requests, and processingthe response. "Not applicable" meansresponses, forrequest header fields that the header field MUST NOT be present inrequests of all methods. In this section, we discuss arequest. If onegeneral purpose method, called CANCEL. The CANCEL request, as the name implies, isplaced inused to cancel a previous request sent bymistake,a client. Specifically, itMUST be ignored byasks theUAS receivinguser agent server to cease processing the request, and generate an error response to Various Authors [Page 36] Internet Draft SIP October 26, 2001 that request.Similarly,CANCEL has no effect on aheader field labeled "not applicable"request that has already been responded to. Because of this, it is most useful to CANCEL requests which can take a long time to respond to. For this reason, CANCEL is most useful for INVITE requests, which can take aresponse meanslong time to generate a response. In thattheusage, a UASMUST NOT placethat receives a CANCEL request for an INVITE, but has not yet sent a response, would "stop ringing", and then respond to the INVITE with a specific error response (a 487). Cancel requests can be constructed and sent by any type of client, including both proxies and user agent servers. Section 15 discusses under what conditions a UAC would CANCEL an INVITE request, and Section 16 discusses proxy usage of INVITE. Because a stateful proxy can generate its own CANCEL, a stateful proxy also responds to a CANCEL, rather than simply forwarding a response it would receive from a downstream element. For that reason, CANCEL is referred to as a "hop-by-hop" request, since it is responded to at each stateful proxy hop. 9.1 Client Behavior The following procedures are used to construct a CANCEL request. The Request-URI, Call-ID, To, the numeric part of CSeq and From header fields in theresponse, andCANCEL request MUST be identical to those in theUACrequest being cancelled, including tags. A CANCEL constructed by a client MUSTignorehave only a single Via header, whose value matches theheadertop Via in theresponse. "m*"request being cancelled. Using the same values for these headers allows the CANCEL to be matched with the request it cancels (Section 9.2 indicatesahow such matching occurs). However, the method part of the Cseq headerthat SHOULD be sent, but servers needMUST have a value of CANCEL. This allows it to bepreparedidentified and processed as a transaction in its own right (See Section 17). Once the CANCEL is constructed, the client SHOULD check whether any response (provisional or final) has been received for the request being cancelled (herein referred toreceive messages without that header field. A "*" indicates thatas theheader fields are required"original request"). The CANCEL request MUST NOT be sent if no provisional response has been received, rather, themessage body is not empty. See sections 10.18, 10.19 and 12client MUST wait fordetails. Handley/Schulzrinne/Schooler/Rosenberg [Page 44] Internet Draft SIP July 20, 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 The "where" column describestherequest andarrival of a provisional responsetypes with whichbefore sending theheader field can be used. "R" refers to header fields that can be used in requests (that is,request. If the original requestand general header fields). Handley/Schulzrinne/Schooler/Rosenberg [Page 45] Internet Draft SIP July 20, 2001 Global-Failure = "600" ; Busy Everywhere | "603" ; Decline | "604" ; Does not exist anywhere | "606" ; Not Acceptable Figure 8: Global failure status codes "r" designateshas generated aresponse or general-header fieldfinal response, the CANCEL SHOULD NOT be sent, asapplicableit is an effective no-op, since CANCEL has no effect on requests which have already generated a final response. When the client decides toall responses, whilesend the CANCEL, it creates alist of numeric values indicatesclient transaction for thestatus codesCANCEL, and passes it the CANCEL request along withwhichtheheader field can be used. "g"destination address, port and"e" designate general (Section 10.1)transport. The destination address, port, andentity header (Section 10.2) fields, respectively. If a header field is marked "c", it is copied fromtransport for therequestCANCEL MUST be identical to those used to send theresponse. The "proxy" column describes whether proxies can add comma-separated elementsoriginal request. Various Authors [Page 37] Internet Draft SIP October 26, 2001 If it was allowed toheaders ("c",send the CANCEL before receiving a response forconcatenate or comma), can modifytheheader ("m"), can addprevious request theheader if not present ("a") or need to readserver could receive theheader ("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 fieldsCANCEL before the original request. Note thatwere authenticated byboth theUA if indicated intransaction corresponding to thetable. Depending on local policy, proxies MAY inspect any non-encrypted header fieldsoriginal request andMAY modify any non- authenticated header field, but proxiesthe CANCEL transaction will complete independently. However, a UAC canceling a request cannot rely onfields other than the ones indicated inreceiving a 487 (Request Terminated) response for thetable to be readable or modifiable.original request, as an RFC 2543- compliant UAS will not generate such a response. Ifauthenticationthere isused,no final response for therulesoriginal request inSection 18.2 apply. Proxies SHOULD NOT re-order header fields. Other header fields can be added as required;64*T1 seconds for an INVITE transaction, and T3 seconds for aserver MUST ignore header fields not defined in this specificationnon-INVITE transaction, the client SHOULD then consider the original transaction cancelled and SHOULD destroy the client transaction handling the original request. 9.2 Server Behavior The CANCEL method requests thatit does not understand.the TU at the server side cancel a pending request with the same Call-ID, To, From, top Via header and Request-URI and CSeq (sequence number only) header field values. The processing of a CANCEL request at a server depends on the type of server. A stateless proxyMUST NOT remove or modify header fields not defined in this specification thatwill forward it, a stateful proxy might respond to itdoes not understand. A compact formand generate some CANCEL requests ofthese header fields is also defined inits own, and a UAS will respond to it. See Section1316.8 foruse over UDP whenproxy treatment of CANCEL. When a UAS receives a CANCEL, it looks for any server transactions which were created by requests with the same To, From, Call-ID, Cseq numeric value, Request-URI and top Via header. If no matching transactions are found, the CANCEL is responded to with a 481 (Call Leg/Transaction Does Not Exist). If the transaction for the original request still exists, the behavior of the UAS on receiving a CANCEL request depends on whether it hasto fit intoalready sent asingle packetfinal response for original request. If it has, the CANCEL request has no effect on the processing of the original request, no effect on any session state, andsizeno effect on the responses generated for the original request. If the UAS has not issued a final response for the original request, it immediately responds to the original request with a 487 (Request Terminated). The CANCEL request itself isan issue. Table 6answered with a 200 (OK) response inAppendix A lists those header fields that different client and server types MUST be ableeither case. Once the response is constructed it is passed toparse.the server transaction for the CANCEL request. 10 Registrations 10.1General Header Fields General header fields applyOverview of Usage SIP is a protocol that offers a discovery capability. For one user toboth request and response messages. Handley/Schulzrinne/Schooler/RosenbergVarious Authors [Page46]38] Internet Draft SIPJuly 20,October 26, 2001Header fieldinitiate a session with another, SIP must discover the current host(s) that the called user is reachable at. This discovery process is accomplished by SIP proxy servers, which are responsible for receiving a request, determining where to send it based on knowledge of the location of the user, and then sending it there. To do this, proxies consult an abstract service known as a location service , which provides address bindings for a particular domain. These address bindings map an incoming SIP URL, sip:bob@Biloxi.com , for example, to one or more SIP URLs which are somehow "closer" to the desired user, sip:bob@engineering.Biloxi.com , for example. Ultimately, a proxyACK 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 2xx o o o m* m* o Allow r o o o 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 gwill consult 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: Summarylocation service which maps a received URL to the current host(s) that a user is logged in to. There are many ways by which the contents ofheader fields, A--O The "general-header" field namesthe location service can beextended reliably only in combination withestablished. One way is administratively. In the above example, Bob is known to be achangemember of the engineering department through access to a corporate database. SIP provides a mechanism, however, for a user agent to explicitly create a binding in theprotocol version. However, new or experimental header fields MAY be givenlocation service of a proxy. This mechanism is known as registration. The process of registration entails sending a REGISTER message to a special type of UAS known as a registrar. The registrar acts as a front end to thesemanticslocation service for a domain, reading and writing mappings based on the contents ofgeneral header fields if all parties inthecommunication recognize themREGISTER messages. This location service will then be consulted by a proxy server that is responsible for routing requests for that domain. SIP does not mandate a particular mechanism for implementing the location service. The only requirement is that a registrar for some domain MUST be capable of reading and writing data toHandley/Schulzrinne/Schooler/Rosenberg [Page 47] Internet Draftthe location service, and a proxy for that domain MUST be capable of reading that same data. A registrar MAY be co-located with a particular SIPJuly 20, 2001 Header field whereproxyACK BYE CAN INV OPT REG ___________________________________________________________________ Priority Rserver for the same domain, allowing usage of an in memory database for the location service. Usage of 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 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: Summaryshared database is another implementation choice. The choice depends entirely on the architectural requirements (redundancy, scalability, etc) ofheader fields, P--Z; (1): copieda particular deployment. Registration creates bindings in a location service for a particular domain that associate an "address of record" URI withpossible additionone or more "contact addresses". This means that when a proxy for that domain receives a request whose request URI matches the address oftag 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 aboutrecord, themessage-body or, if no body is present, aboutproxy will forward theresource identified byrequest to therequest. The term "entity header" iscontact addresses registered to that address of record. Generally, it only makes sense to register anHTTP 1.1 term where the response body can containaddress of record at atransformed versionlocation service for a domain when requests for that address ofthe message body. The original message body is referredrecord would be routed toasthat domain. In most cases, this means that the"entity". We retaindomain of thesame terminology for header fields but usually referregistration will need to match the"message body" rather then the entity as the two are the samedomain inSIP. 10.3 Request Header Fields The "request-header" fields allow the client to pass additional information about the request, and abouttheclient itself, toURI of theHandley/Schulzrinne/Schooler/Rosenbergaddress of record. Various Authors [Page48]39] Internet Draft SIPJuly 20,October 26, 2001server. These fields act as request modifiers, with semantics equivalent to the parameters of a programming language method invocation.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 semanticsmost important usage of"request- header" fields if all parties inthecommunication recognize themregistration mechanism is tobe request-header fields. Unrecognized header fields are treated as "entity-header" fields. 10.4 Response Header Fields The "response-header" fields allowinform a proxy of theserver to pass additional information aboutmapping between theresponseaddress of record and the current host on whichcannot be placed intheStatus- Line. These header fields give information aboutUA resides. However, theserverregistration process is a general mechanism for establishing bindings, andabout further access to the resource identified by the Request-URI. Response-header field namescan beextended reliably only in combination with a change in the protocol version. However, new or experimental header fields MAY be given the semanticsused for other purposes (for example, to set up call forwarding). 10.2 Construction of"response- header" fields if all parties inthecommunication recognize them toREGISTER request Several operations can 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") followperformed with a REGISTER method with respect to a registrar. One of these is thesame generic header format asbasic registration operation thatgiven in Section 3.1 of RFC 822 [26]. Each header field consists of a name followed byis described above, which provides acolon (":")new binding between an address of record andthe field value. Field names are case-insensitive. The field value MAY be preceded by any amountone or more contact addresses. Registration on behalf ofleading white space (LWS), thoughasingle space (SP) is preferred. Header fields canparticular address of record may beextended over multiple linesperformed bypreceding each extra line with at least one SPa third party if they are authorized to do so. A client may also remove previous bindings, orhorizontal tab (HT). Applications MUST follow HTTP "common form" when generating these constructs, since there might exist some implementations that failquery toaccept anything beyonddetermine which bindings are currently in place for an address of record. Aside from thecommon forms. message-header = field-name ":" [ field-value ] CRLF field-name = token field-value = *( field-content | LWS ) field-content = <exceptions noted in this and theOCTETs making upfollowing sections, thefield-value and consisting of either *TEXT-UTF8 or combinationsconstruction oftoken, separators,the REGISTER method, andquoted-string> Handley/Schulzrinne/Schooler/Rosenberg [Page 49] Internet Draft SIP July 20, 2001 The relative orderbehavior ofheader fields with different field namesclients sending a REGISTER isnot significant. Multiple header fields withidentical to thesame field-name may be presentgeneral UAC behavior described ina message ifSection 8.1 andonly ifSection 17.1. Regardless of theentire field-value foroperation thatheader fieldisdefined asperformed by acomma-separated list (i.e., #(values)). It MUST be possible to combineREGISTER, themultiplefollowing header fieldsinto one "field-name: field-value" pair, without changingMUST be formulated as follows: Request-URI: The Request-URI names thesemanticsdomain of themessage, by appending each subsequent field-value tolocation service that thefirst, each separated by a comma.registration is meant for (e.g. "chicago.com"). Theorder in whichuser name MUST be empty. To: The To headerfields withfield contains thesame field-name are receivedaddress of record whose registration istherefore significantto be created or modified. Note that theinterpretation of the combinedinitial To header fieldvalue,andthus a proxy MUST NOT changetheorder of theseRequest-URI fieldvalues whenSHOULD therefore be different in amessage is forwarded. Unless otherwise stated, parameter names, parameter values and tokens are case-insensitive. Values expressed as quoted strings are case- sensitive.REGISTER message. From: TheContact,Fromand Toheaderfields contain a URL. If the URLfield containsa comma, question mark or semicolon,theURL MUSTaddress of record of the person responsible for the registration, which MAY beenclosed in angle brackets (<identical to the value of the To header field. For third- party registrations the From header field and>). Any URL parametersTo header field arecontained 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, withdifferent. Call-ID: All registrations from a user agent client SHOULD use theexception that if no Acceptsame Call-ID headeris present,value, at least within theserver SHOULD assume a default value of application/sdp As a request-header field, it issame reboot cycle. If different Call-IDs were usedonly 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 acceptableforfuture 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 restrictsoverlapping REGISTER messages coming from thecontent-codings [H3.5] that are acceptable insame client, theresponse. See [H14.3]. The syntax of this header is defined in Handley/Schulzrinne/Schooler/Rosenbergregistrar might have trouble determining their ordering. Various Authors [Page50]40] Internet Draft SIPJuly 20,October 26, 2001[H14.3]. The semantics in SIP are identical to those defined in [H14.3]. Note: An empty Accept-EncodingContact: REGISTER requests MAY contain one or more Contact headerfield is permissible, even though the syntaxfields. Contact addresses are presented in[H14.3] does not provide for it. It is equivalent to Accept-Encoding: identity, i.e., onlytheidentity encoding, meaning no encoding, is permissible. If no Accept-EncodingContact headerfield is present infields of REGISTER requests. Note that user agents MUST NOT send arequest,new registration (containing new Contact header fields, as opposed to a retransmission) until they have received a response from theserver MUST useregistrar for the"identity" encoding. HTTP/1.1 [H14.3] states thatprevious one. The following optional Contact header parameters also contain behavior specific to theserverregistration process. action: The "action" parameter has been deprecated. UACs SHOULD NOT use the"identity" encoding unless it has additional information about"action" parameter. expires: The "expires" parameter indicates how long thecapabilities ofUAC would like theclient. Thisbinding to be valid. The parameter is either a number indicating seconds or a quoted string containing a SIP-date. If this parameter isneeded for backwards-compatibility with old HTTP clients and doesnotaffect SIP. 10.8 Accept-Language The Accept-Language general-header follows the syntax defined in [H14.4]. The rules for ordering the languages based onprovided, theq parameter apply to SIP as well. When used in SIP,value of theAccept-Language general-headerExpires header fieldcan be used to allow the client to indicate todetermines how long theserver in which language it would prefer to receive reason phrases, session descriptionsbinding is valid. Implementations MAY treat values larger than 2**32-1 (4294967295 seconds orstatus responses carried136 years) asmessage bodies. A proxy MAY use this fieldequivalent tohelp select the destination for the call, for example,2**32-1. 10.2.1 Adding Bindings with REGISTER For ahuman operator conversant insimple registration, alanguage spoken byREGISTER request sent to a registrar includes contact addresses to which requests should be forward for thecaller. Example: Accept-Language: da, en-gb;q=0.8, en;q=0.7 10.9 Alert-Infooriginating user's address of record. TheAlert-Info header field indicates thataddress of record itself (i.e. 'sip:carol@chicago.com') MUST populate thecontent indicated inTo header of theURLs should be rendered insteadREGISTER. The Contact header fields ofring tone. A user SHOULD be able to disable this feature selectively to prevent unauthorized disruptions. Alert-Info = "Alert-Info" ":" # ( "<"the request typically contain SIP URIs that identify particular SIP endpoints (i.e. 'sip:carol@cube2214a.chicago.com'), but they MAY use any URI">" *( ";" generic-param )) Handley/Schulzrinne/Schooler/Rosenberg [Page 51] Internet Draftscheme; this way a SIPJuly 20, 2001 generic-param = token [ "=" ( token | host | quoted-string ) ] Example: Alert-Info: <http://wwww.example.com/sounds/moo.wav> 10.10 Allow The Allow header field listsUA can choose to register telephone numbers (with thesettel URL, [13]) or email addresses (with a mailto URL, [18]) as Contacts for an address ofmethods supported byrecord. For example, if Carol, whose address of record is to register with theuser agent generatingregistrar associated with themessage. An Allow header field MUSTlocation service of chicago.com. This location service would then bepresent inaccessed by a405 (Method Not Allowed) response to any request,proxy server that receives requests targeting users in the chicago.com domain, andSHOULDhence new requests for Carol's address of record will bepresent inrouted to her SIP endpoint. Once a2xx OPTIONS response. In this usage,client has established bindings at a registrar, itindicatesMAY send subsequent registrations containing new bindings or modifications to pre-existing bindings as necessary. The 2xx response to thesetREGISTER message will contain (in Contact header fields) a complete list ofmethodsbindings thatcan be invoked on the resource identified byhave been registered for this address of record at this registrar. Various Authors [Page 41] Internet Draft SIP October 26, 2001 bob +----+ | UA | | | +----+ | |3)INVITE | carol@chicago.com chicago.com +--------+ V +---------+ 2)Store|Location|4)Query +-----+ |Registrar|=======>| Service|<=======|Proxy|sip.chicago.com +---------+ +--------+=======>+-----+ A 5)Resp | | | | | 1)REGISTER| | | | +----+ | | UA |<-------------------------------+ cube2214a| | 6)INVITE +----+ carol@cube2214a.chicago.com carol Figure 2: REGISTER example Various Authors [Page 42] Internet Draft SIP October 26, 2001 10.2.1.1 Setting theRequest-URIExpiration Interval of Contact Addresses When a client sends a REGISTER request, it MAY suggest an expiration interval that indicates how long therequest sent byclient would like theUAC. Allow SHOULDregistration to bepresentvalid (although as is detailed in Section 10.3, the registrar has the ultimate say). There are two ways in which a client can suggest anINVITE request (initialexpiration interval for a binding: through an Expires header, orre-INVITE), and SHOULD be present in any 2xx response toanINVITE. In this usage, it indicates what methods can"expires" Contact header parameter. The latter allows expiration intervals to beinvoked within the call leg,suggested on a per-binding basis when more than one binding is given in a single REGISTER, whereas theuser agent sending the message,former suggests an expiration interval for all Contact header fields that do not contain theduration of the call leg. For example, if"expires" parameter. If neither mechanism for expressing aAllow wassuggested expiration time is present in a200 OK to an initial INVITE listing INFO, the caller would know that itREGISTER, a default suggestion of one hour is assumed. 10.2.1.2 Setting Preference among Contact Addresses If more than one Contact issafe to send an INFO request on the call leg established by the 200 OK. An Allow MAY besent inany 1xx responses for an INVITE; it carries the same meaning as if it appeared ina2xx, but conveys this informationREGISTER, then the registering UA intends to associate all of theUAC beforeURIs given in these Contact headers with thecall is established.address of record present in the To field. Thisis helpful iflist can be prioritized with theUAC wishes to send additional requests on the call leg before it is accepted. Allow MAY be present in provisional and final responses"q" mechanism. q: The "q" parameter indicates a relative preference formethods besides INVITE and OPTIONS. It carriesthesame semantics in this case is it does in a 2xxparticular Contact header field compared toOPTIONS. All methods, including ACK and CANCEL, understood by the UA MUST be includedother bindings present in this REGISTER message or existing within thelistlocation service ofmethods intheAllow header, when present. The absenceregistrar. For an example of how a proxy server uses "q" values, see Section 16.5. 10.2.2 Removing Bindings with REGISTER Registrations are removed from the registrar through anAllow header MUST NOTexpiration process; registrations are soft state and need to beinterpretedrefreshed periodically. A client may attempt tomean that the UA sendinginfluence themessage supports no methods. Rather, it implies thatexpiration intervals selected by theUA is not providing any information on what methods it supports. Supplying an Allow headerregistrar as described inresponses to methods other than OPTIONS cuts down on the number of messages needed. Handley/Schulzrinne/Schooler/Rosenberg [Page 52] Internet Draft SIP July 20, 2001 Allow = "Allow" ":" 1#Method 10.11 AuthorizationSection 10.2.1. A registering user agentthat wishes to authenticate itself with a UAS or registrar -- usually, but not necessarily, after receivingrequests the immediate removal of a401 response -- MAY do sobinding byincludingspecifying anAuthorization header field with the request.expiration interval of "0" for that contact address in a REGISTER. It is RECOMMENDED that user agents support this mechanism so that bindings can be removed (for whatever reason) before their expiration interval has passed. TheAuthorizationREGISTER-specific Contact header field valueconsists of credentials containing the authentication informationof "*" applies to all registrations, but it MUST only be used when theuser agent for the realmExpires header is present with a value ofthe resource being requested. Section 18.2 overviews the use"0". Various Authors [Page 43] Internet Draft SIP October 26, 2001 Use of theAuthorization"*" Contact headerfield, and Section 19 describes the syntax and semantics when used with HTTP Basic and Digest authentication. 10.12 Call-ID The Call-ID general-headerfielduniquely identifiesvalue allows aparticular invitation orregistering user agent to remove allregistrationsofa particular client. Note that a single multimedia conference can give rise to several callsits bindings expediently. 10.2.3 Fetching Bindings withdifferent Call-IDs, e.g., ifREGISTER If no Contact headers are present in auser invitesREGISTER, then the UA is not in fact registering any new bindings, and the list of bindings is therefore left unchanged. As noted above, in asingle individual several timessuccessful response to this REGISTER message, thesame (long-running) conference. For an INVITE request,complete list of existing bindings is returned, and thus acallee user agent server SHOULD NOT alertREGISTER without Contact headers serves as a fetch operation. 10.2.4 Refreshing Registrations When a 2xx response has been received by theuser ifclient for a REGISTER request, theuser has responded previously toclient MUST determine when each of theCall-IDbindings enumerated in theINVITE request. Ifresponse needs to be refreshed. This may include bindings that were registered in previous REGISTER transactions. Since theuser is already a memberlist of bindings returned in theconference andresponse to a REGISTER may contain bindings that were not included in this REGISTER transaction, theconference parameters containedclient must correlate Contact header fields in thesession description have not changed, a callee user agent server MAY silently acceptresponse with thecall, regardless ofContact header fields it sent in theCall-ID. An invitation for an existing Call-ID or session can changerequest in order to establish proper expiration timers. This correlation should be performed in accordance with theparameters ofURI comparison rules given in Section 21.1.4. The registering UA MUST re-register each contact address at least as often as theconference.mandated expiration interval. Aclient application MAY decide to simply indicate to the userREGISTER thatthe conference parametersrefreshes a binding SHOULD havebeen changed and accept the invitation automatically or it MAY require user confirmation. A user may be invited tothe sameconference or call using several different Call-IDs. If desired,Call-ID as theclient MAY use identifiers withinrequest which created thesession description to detect this duplication. For example, SDP containsbinding. The CSeq header SHOULD have asession id and versionnumeric sequence numberin the origin (o) field. The REGISTER and OPTIONS methods usethat is one higher than theCall-IDvalue(in addition tosent in theCSeq value)last request with the same Call-ID. Note that a UA MUST must update its expiration timers for refreshing each binding every time it receives a response tounambiguously match requests and responses. All REGISTER requests issued byasingle clientregistration request. Registration refreshes SHOULDusebe sent to the sameCall-ID, at least withinaddress as thesame boot cycle. For these requests, it makes no difference whetheroriginal registration, unless redirected. 10.2.5 Discovering a Registrar Depending on theCall-ID value matches an existing call or not. Handley/Schulzrinne/Schooler/Rosenberg [Page 53] Internet Draftpolicy of their administrative domain, SIPJuly 20, 2001 Since the Call-ID is generated by and for SIP, there is no reason to dealUAs can be configured with thecomplexityaddress ofURL-encoding and case-ignoring string comparison. callid = token [ "@" token ] Call-ID = ( "Call-ID" | "i" ) ":" callid The callid MUST beaglobally unique identifier and MUST NOTlocal registrar. Some UAs may bereused for later calls. Use of cryptographically random identifiers [29] 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 callsequipped withthird-party control. For systems which have tight bandwidth constraints, many ofprotocol tools (outside themandatoryscope of SIP) that allow them to discover their local registrar dynamically. Various Authors [Page 44] Internet Draft SIPheaders have a compact form,October 26, 2001 Note that asdiscussed in Section 13. These arean alternatenames for the headers which occupy less spacemeans of discovering a registrar if no local registrar is configured in themessage. In the case of Call-ID,user agent, clients MAY register via multicast. Multicast registrations are addressed to thecompact formwell- known "all SIP servers" multicast address "sip.mcast.net" (224.0.1.75). This request MUST be scoped to ensure it isi. For example, both ofnot forwarded beyond thefollowing 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 The Call-Info general header field provides additional information aboutboundaries of thecalleradministrative system. This MAY be done with either TTL orcallee,administrative scopes (see [19]), depending onwhether itwhat isfoundimplemented ina request or response. The purpose of the URI is described bythe"purpose" parameter. "icon" designates an image suitable as an iconic representationnetwork. SIP user agents MAY listen to that address and use it to become aware of thecaller or callee; "info" describeslocation of other local users (see [20]); however, they do not respond to thecaller or calleerequest. Multicast registration may be inappropriate ingeneral, e.g., through a web page; "card" providessome environments, for example, if multiple businesses share the same local area network. If abusiness card (e.g., in vCard [30] or LDIF [31] formats). Handley/Schulzrinne/Schooler/Rosenberg [Page 54] Internet DraftSIPJuly 20, 2001 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 inUA knows of an appropriate registrar it SHOULD attempt to register with thisspecification,server periodically - management of registration intervals is detailed below. 10.3 Processing of REGISTER at theContact general-header field can appear in INVITE, OPTIONS, ACK, andRegistrar A registrar is a UAS that responds to a REGISTERrequests, and in 1xx, 2xx, 3xx,request, and485 responses. Other methods defined elsewhere may allow or require the use ofstores theContact header field. Thisinformation gathered from that request in a location service that isgenerally necessary if the recipient of this method needsin turn accessible tosendproxy servers within its administrative domain. A registrar handles requeststo the originator. In general, it providesas aURL where the user can be reached for further communications. In some of the cases below,UAS (in conformity with Section 8.2 and Section 17.2) but it accepts only theclient uses information fromREGISTER method and generates only theContact header fieldresponses detailed inRequest-URI of future requests. In these cases,this section. Note that theclient copies all butREGISTER method also does not support the"method-param"Record-Route or Route header, and"header" elements ofthat proxy servers MUST NOT add Record-Route headers to REGISTER requests. A registrar must know (through provisioning or some other mechanism) theaddr-spec part ofset if administrative domain(s) for which its associated location service(s) are responsible. REGISTER requests MUST be processed by a registrar in theContact header field intoorder that they are received. Upon theRequest-URIarrival of a REGISTER message, therequest. It usesregistrar MUST inspect the"header" parametersRequest-URI tocreate headersdetermine whether it has access to a location service responsible for therequest, replacing any default headers normally used. Unless the client is configureddomain tousewhich this request is addressed. If this message is for some other administrative domain, then if the registrar can act as adefaultproxyfor all outgoing requests,server, itthen directsSHOULD forward the request to theaddress and port specified by the "maddr" and "port" parameters, usingaddressed domain (following thetransport protocol givengeneral behavior for proxying messages described inthe "transport" parameter. If "maddr" is a multicast address, the value of "ttl" is used as the time-to-live value. INVITE, OPTIONS and ACK requests: INVITE requests MUST, and ACK requests MAY containSection 16). When asingle Contact header indicatingregistrar receives asingle URI from which location the requestREGISTER message, it isoriginating. The URI SHOULD containRECOMMENDED that theaddress ofregistrar authenticate theclient itself (i.e., its IP address, or a FQDNuser agent client. Mechanisms for thehost, or an SRV record with the highest priority entry beingan FQDNVarious Authors [Page 45] Internet Draft SIP October 26, 2001 authentication ofthat host). SeeSIP user agents are described in Section1620.2; registration behavior in no way overrides the generic authentication framework forusageSIP. If no authentication mechanism is available, the registrar MAY take the From address as the asserted identity of theContact header for routing subsequent requests. For OPTIONS, Contact provides a hint where future SIP requests can be sent ororiginator of the request. Once the identity of the registering usercan be contacted via non-SIP means. INVITE 1xx responses: A UAS sending a provisional response (1xx) MAY insert a Contact response header. Ithas been ascertained, it is RECOMMENDED that thesame Handley/Schulzrinne/Schooler/Rosenberg [Page 55] Internet Draft SIP July 20, 2001 semantics inregistrar determine if the authenticated user agent is authorized to request and/or modify registrations for this address of record. For example, a1xx response asregistrar might consult a2xx INVITE response.authorization database (directly or through an appropriate protocol) that maps credentials or other tokens of identity resulting from authentication to one or more addresses of record for which this identity is responsible. Note thatCANCEL requests MUST NOTin architectures that support third-party registration, one entity may besent toresponsible for updating the registrations associated with multiple addresses of record. When the registrar has determined thataddress, but rather followthesame path asclient is permitted to make theoriginal request. INVITE and OPTIONS 2xx responses: A user agent server sending a definitive, positive response (2xx)request, the registrar MUSTinsert a single Contact responseextract the address of record from the To header field of the REGISTER. Note that the registrar MUST extract the entire To header fieldindicating a single SIPURIunder whichin order to use itis reachable most directly for future SIP requests, suchasACK, within the same call leg. The URI SHOULD containan index in theaddress oflocation service. Next, theserver itself (i.e.,registrar MUST query itsIP address, or a FQDNlocation service (the repository of previously registered bindings) for thehost, or an SRV recordset of bindings associated with this address of record. If thehighest priority entry beingan FQDNaddress ofthat host). See Section 16record is not valid forusage ofthis administrative domain (for example, because theContact header for routing subsequent requests. If a UA supports both UDP and TCP, it SHOULD NOT indicate a transport parameter inusername is not assigned), then theURI.registration attempt fails (see below). A full URI comparison (as described in Section 21.1.4) MUST be performed to determine whether a given binding matches this address of record. The registrar now MUST extract all the Contactvalue SHOULD NOT be cached across calls, as it may not representheader fields from themost desirable location for a particular destination address.REGISTERrequests and responses: See Section 7. Themessage (note that there may be no Contact headervalue of "*" is only usedfield). Each contact address in a REGISTERrequests. 3xx and 485 responses: The Contact response-header field canMUST now beused with a 3xx or 485 (Ambiguous) response codescompared toindicate one or more alternate addressesall existing registrations at this location service according totry. It can appearthe rules inresponses to BYE, INVITE and OPTIONS methods. The Contact header field containsSection 21.1.4. Note that URIsgiving the new locations or user names to try, or may simply specify additional transport parameters. A 300 (Multiple Choices), 301 (Moved Permanently), 302 (Moved Temporarily) or 485 (Ambiguous) response SHOULD contain a Contact field containingother than SIP URIsof newin contact addressestoMUST betried. 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 addresscompared according totry orthe standard URI equivalency rules for the URI schema in question. If achange of SIP transport from UDP to TCP or vice versa. The client copies information frommatch is found among pre-existing registrations, theContact header field intoregistrar MUST copy all parameters associated with theRequest-URI as described above. 4xx, 5xx and 6xx responses: Thecurrent Contactresponse-headerheader fieldcan be used with a 4xx, 5xx or 6xx response to indicatefrom thelocation where additional information aboutREGISTER message into theerror can be found. Handley/Schulzrinne/Schooler/Rosenbergpre-existing binding in its Various Authors [Page56]46] Internet Draft SIPJuly 20,October 26, 2001Note thatlocation service (overwriting with changed values any existing parameters as necessary, with theContact header field MAYexception of "expires"). Expiration intervals for this contact address MUST alsorefer 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 containbe reset, based on anysuitable URI indicating wheresuggested expiration in thecalled partyREGISTER (remember that this can bereached, not limited to SIP URLs. For example, it could contain URL's for phones, fax, or irc (if they were defined) or"0"). If no match is found among the set of pre-existing registrations, the registrar MUST create amailto: (RFC 2368, [32]) URL. The followingnew binding in its location service between the address of record and the current Contact header field. All Contact header field parameters aredefined. Additional parameters maycopied verbatim into this new binding (again with the exception of "expires"). An expiration interval MUST bedefinedselected by the registrar, taking into account any suggested expiration for this contact address inother specifications. q: The "qvalue" indicatestherelative preference amongREGISTER. Allowing thelocations given. "qvalue" values are decimal numbers from 0registrar to1, with higher values indicating higher preference. The default value is 0.5. action: The "action" parameter is used only when registering withset theREGISTER request. It indicates whetherregistration interval protects it against excessively frequent registration refreshes while limiting theclient wishesstate that it needs to maintain and decreasing theserver proxylikelihood of registrations going stale. The expiration interval mandated by the registrar may be either longer orredirect future requests intended forshorter than theclient. If this parameter is not specifiedinterval suggested by theaction taken depends on server configuration. In its response,sender of the REGISTER, though the registrar SHOULDindicateabide by themode used. This parameter is ignored for other requests. expires: The "expires" parameter indicates how longregistering client's suggestion. A server MAY decide to lengthen theURI is valid. The parameter is eitherexpiration interval if the refresh rate of anumber indicating seconds orparticular client exceeds aquoted string containingthreshold, for example. After the expiration interval selected by the registrar for aSIP-date. If this parameter isbinding has passed, if the binding has notprovided,been refreshed (increasing thevalueexpiration interval), the registrar SHOULD silently discard the binding. Once all bindings in the location service have been updated to reflect any changes present to contact addresses in the REGISTER message, the registrar MUST remove any bindings that expire immediately. The REGISTER might have set the expiration interval for some bindings to "0" to remove them before their expiration interval passes. Finally, the registrar must generate a response. If the address of record given in theExpiresTo header fielddetermines how longof theURIREGISTER method isvalid. Implementations MAY treat values larger than 2**32-1 (4294967295 seconds or 136 years) as equivalent to 2**32-1. Contact = ( "Contact" | "m" ) ":" ("*" | (1# (( name-addr | addr-spec ) *( ";" contact-params )))) 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 <"> | contact-extension contact-extension = generic-param qvalue = ("0" ["." 0*3DIGIT]) | ("1" ["." 0*3("0")]) Handley/Schulzrinne/Schooler/Rosenbergvalid for its administrative domain, then a 200 response MUST be sent, Various Authors [Page57]47] Internet Draft SIPJuly 20,October 26, 2001Even if the "display-name" is empty, the "name-addr" formwhich MUSTbe used if the "addr-spec" containscontain acomma, semicolon or question mark. Note that there may or may not be LWS between the display-name and the "<". Thecomplete list (within Contact headerfield fulfills functionality similar tofields) of theLocation header fieldcurrently valid bindings inHTTP. However, the HTTP header only allows one address, unquoted. Since URIs can contain commas and semicolons as reserved characters, they can be mistaken for header or parameter delimiters, respectively. The current syntax corresponds to that fortheTo and From header, which also allowslocation service associated with theuseaddress ofdisplay 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" ":" 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,record contained in thecaseTo field ofmultipart messages, a message body part is tothe REGISTER request. This list MAY beinterpreted byempty (in which case theUAC or UAS. The SIP header extends200 would not contain any Contact headers). In a successful response to a REGISTER, wherein theMIME Content-Type (RFC 1806 [33]). The value "session" indicates thatbindings for this address of record are enumerated as described above, thebody part describes a session,registrar MUST supply an expiration interval for each contact address in eithercallsan "expires" parameter of a Contact header orearly (pre-call) media. The value "render" indicatesan Expires header. This interval specifies the expiration interval that has been mandated by thebody part should be displayed or otherwise rendered toregistrar (taking into account theuser. For backward-compatibility, ifregistering UA's suggestion). If theContent- Disposition header is not missing, bodies of Content-Type Handley/Schulzrinne/Schooler/Rosenberg [Page 58] Internet Draft SIP July 20, 2001 application/sdp implyregistration failed because thedisposition "session", while other content types imply "render". The disposition type "icon" indicates thataddress of record contained in thebody part contains an image suitable as an iconic representationTo field of thecaller or callee. The value "alert" indicates that the body part contains information, such as an audio clip, that shouldREGISTER is not valid for this domain, then a 404 MUST berendered instead of ring tone.sent. 11 Querying for Capabilities Thehandling parameter, handling-parm, describes how the UAS should react if it receivesSIP method OPTIONS allows amessage body whose content typeclient to query another client ordisposition type it does not understand. If the parameter has the value "optional",server as to its capabilities. This allows a client to discover information about theUAS MUST ignoremethods, content types, extensions, codecs etc. supported without actually "ringing" themessage body; ifother party. For example, before a client inserts a Require header field into an INVITE listing an option that ithas the value "required",is not certain the destination UASMUST return 415 (Unsupported Media Type). Ifsupports, thehandling parameter is missing,client can query thevalue "required" isdestination UAS with an OPTIONS tobe assumed. Ifsee if thisheader field is missing, 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 fieldoption isused as a modifier to the "media-type". When present, its value indicates what additional content codings have been applied to the entity-body, and thus what decoding mechanisms MUST be appliedreturned inorder to obtain the media-type referenced by the Content-Typea Supported header field.Content-Encoding is primarily used to allow a body to be compressed without losing the identityThe target ofits underlying media type. If multiple encodings have been applied to an entity,thecontent codings MUST be listed inOPTIONS request is identified by theorder inRequest-URI, whichthey were applied. All content-coding values are case-insensitive. The Internet Assigned Numbers Authority (IANA) acts ascould identify another User Agent or aregistry for content-coding value tokens. See [H3.5] forSIP Server. Alternatively, adefinitionserver receiving an OPTIONS request with a Max- Forwards header value ofthe syntax for content-coding. Clients0 MAYapply content encodingsrespond to thebody in requests. Ifrequest regardless of theserverRequest-URI. This behavior isnot capablecommon with HTTP/1.1. An OPTIONS request sent as part ofdecoding the body, oran established dialog does notrecognizehave any impact on the dialog. 11.1 Construction of OPTIONS Request An OPTIONS request is constructed using thecontent-coding values, it MUST sendstandard rules for a415 "Unsupported Media Type" response, listing acceptable encodings in the Accept-Encoding header.SIP request as discussed Section 8.1.1. Aserver MAY apply content encodings to the bodies in responses. The server MUST only use encodings listed in the Accept- EncodingContact header field MAY be present inthe request. Handley/Schulzrinne/Schooler/Rosenbergan OPTIONS. Various Authors [Page59]48] Internet Draft SIPJuly 20,October 26, 200110.17 Content-Language See [H14.12]. 10.18 Content-Length The Content-Length entity-header field indicates the size ofOPEN ISSUE #197: What is themessage-body, in decimal numbersemantic ofoctets, sent to the recipient. Content-Length = ( "Content-Length" | "l" ) ":" 1*DIGIT An example is Content-Length: 3495 Applications SHOULD usethis Contact An Accept header field SHOULD be included to indicate thesizetype of message body themessage-bodyUAC wishes tobe transferred, regardless of the media type ofreceive in theentity. (The sizeresponse. Example OPTIONS request: OPTIONS sip:carol@chicago.com SIP/2.0 Via: SIP/2.0/UDP 10.1.1.1:5060;branch=23411513a6 Via: SIP/2.0/UDP 10.1.3.3:5060 To: <sip:carol@chicago.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710@10.1.3.3 CSeq: 63104 OPTIONS Contact: <sip:alice@10.1.3.3> Accept: application/sdp Contact-Length: 0 11.2 Processing ofthe message-body does not include the CRLF separating headers and body.) Any Content-Length greater than or equalOPTIONS Request The response tozeroan OPTIONS is constructed using the standard rules for avalid value. If no body is presentSIP response as discussed ina message, thenSection 8.2.7. The response code chosen is theContent-Length header field MUSTsame that would have been chosen had the request been an INVITE. That is, a 200 (OK) would besetreturned if the UAS is ready tozero. Ifaccept aserver receivescall, adatagram request without Content-Length, it MUST assume that486 (Busy Here) would be returned if the UAS is busy, etc. This allows an OPTIONS requestencompassesto be used to determine theremainderbasic state ofthe packet. If a server receives a datagram request withaContent-Length, but the value differs fromUAS, which can be an indication of whether thesizeUAC will accept an INVITE request. Note that this use of OPTIONS has limitations due thebody sentdifferences inthe request, the server SHOULD returnproxy handling of OPTIONS and INVITE requests. While a400 (Bad Request) response. Ifforked INVITE can result in multiple 200 OK responses being returned, aresponse does not containforked OPTIONS will only result in aContent-Length, the client assumes thatsingle 200 OK response, since itencompasses the remainder of the datagram packet or the data until the stream connectionisclosed, as applicable. Section 12 describes how to determinetreated by proxies using thelength ofnon-INVITE handling. See Section 13.2.1 for themessage body. The abilitynormative details. Allow, Accept, Accept-Encoding, Accept-Language, and Supported header fields SHOULD be present in a 200 OK response toomit Content-Length simplifies the creation of cgi-like scripts that dynamically generate responses. 10.19 Content-Type The Content-Type entity-headeran OPTIONS request. A Contact header fieldindicates the media type of the message-body sent to the recipient. The "media-type" element is definedMAY be present in[H3.7]. The Content-Typea 200 OK response. A Warning headerMUSTfield MAY bepresent if thepresent. A message bodyis not empty. IfMAY be sent, thebody is empty, and a Content-Length headertype of which ispresent, it indicates thatdetermined by thebody ofAccept header in thespecific type has zero Handley/Schulzrinne/Schooler/RosenbergOPTIONS request. Various Authors [Page60]49] Internet Draft SIPJuly 20,October 26, 2001length (for example, if it 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 the CSeq (command sequence) general-header fieldExample OPTIONS response (corresponding toevery request. A CSeq header field in a request containsthe requestmethod andin Section 11.1): SIP/2.0 200 OK Via: SIP/2.0/UDP 10.1.1.1:5060;branch=23411513a6 Via: SIP/2.0/UDP 10.1.3.3:5060 To: <sip:carol@chicago.com>;tag=93810874 From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710@10.1.3.3 CSeq: 63104 OPTIONS Contact: <sip:carol@10.3.6.6> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE Accept: application/sdp Accept-Encoding: gzip Accept-Language: en Supported: foo Content-Type: application/sdp Contact-Length: 274 v=0 o=carol 28908764872 28908764872 IN IP4 10.3.6.6 s=- t=0 0 c=IN IP4 10.3.6.6 m=audio 0 RTP/AVP 0 1 3 99 a=rtpmap:0 PCMU/8000 a=rtpmap:1 1016/8000 a=rtpmap:3 GSM/8000 a=rtpmap:99 SX7300/8000 m=video 0 RTP/AVP 31 34 a=rtpmap:31 H261/90000 a=rtpmap:34 H263/90000 12 Dialogs A key concept for asingle decimal sequence number. The sequence number MUST be expressible asuser agent is that of a32-bit unsigned integer.dialog. Aserver MUST echo the CSeq value from the request in its response. The CSeq header serves to order transactions withindialog represents acall leg, and to providepeer- to-peer SIP relationship between ameans to uniquely identify transactions. CSeq = "CSeq" ":" 1*DIGIT Method For requeststwo user agents thatare outside of a call leg, orpersists fora request that initiates a session, the valuesome time. The dialog facilitates sequencing of messages between thesequence number is arbitrary, but MUST be less than 2**31. For requests which are subsequent ones within an existing call leg (such as a re-INVITE or BYE), the CSeq header MUST contain strictly monotonically increasinguser agents, andcontiguous (increasing-by-one) sequence numbers; sequence numbers do not wrap around. Retransmissionsproper routing ofthe same request carry the same CSeq value. Forrequestsoutside ofbetween both them. The dialog represents acall leg, ordering is irrelevant, and so the value of the CSeq numbercontext in which to interpret SIP messages. The previous section discussed method independent UA processing for requestsreceived byand responses outside of aUAS is not important. Fordialog. This section discusses how those requestswithin a call leg, ordering is important. Therefore, a UAS MUST remember the highest sequence number for any request received within a call leg. The server MUST reject, usingand responses are used to construct a400 class response, any requestdialog, and then how subsequent requests and responses are sent within acall leg with a lower sequence number. Any request that is received with a sequence number higher than the highest received so far (even it is higher by more than one), SHOULD be accepted. Handley/Schulzrinne/Schooler/Rosenbergdialog. Various Authors [Page61]50] Internet Draft SIPJuly 20,October 26, 2001If a client initiates a session, and receives multiple 200 class responses,A dialog is identified at eachestablishesUA with aseparate call leg. For subsequent requests within each of those call legs (each ofdialog ID, whichdiffers only by theconsists of a Call-ID value, a local URI and local tagin the To field),(together called theCSeq numbers increment independently fromlocal address), and a remote URI and remote tag (together called theother call legs. Furthermore,remote address). The dialog ID at each UA involved in theCSeq numbering spacedialog isunique in each direction. That is,not theCSeq values in requests from A to B are independent ofsame. Specifically, thevalues in requests from Blocal URI and local tag at one UA are identical toA. The ACK request MUST containthesame CSeq numeric value asremote URI and remote tag at theINVITE requestpeer UA. The tags are opaque tokens thatit refers to, butfacilitate the generation of unique dialog IDs. A dialog ID is also associated with all responses, and with any request that contains aMethod of "ACK".tag in the To field. TheCANCEL request MUST containrules for computing thesame CSeq numeric value asdialog ID of a message depend on whether therequest it cancels, but withentity is aMethod of "CANCEL". The MethodUAC or UAS. For a UAC, the Call-ID valueallowsof theclientdialog ID is set todistinguishtheresponse to a CANCEL request from thatCall-ID of therequest itmessage, the remote address iscancelling. CANCEL requests can be generated by proxies; if they wereset toincreasethesequence number, it might conflict with a later request issued byTo field of theuser agent formessage, and thesame call. With a lengthlocal address is set to the From field of32 bits, a server could generate, within a single call,the message (these rules apply to both requests and responses). As onerequestwould expect, for asecond for about 136 years before needing to wrap around. The initialUAS, the Call-ID value of thesequence numberdialog ID ischosen so that subsequent requests withinset to thesame call will not wrap around. A non-zero initial value allowsCall-ID of the message, the remote address is set touse a time-based initial sequence number, iftheclient desires.From field of the message, and the local address is set to the To field of the message. Aclient could,dialog contains certain pieces of state needed forexample, choosefurther message transmissions within the31 most significant bitsdialog. This state consists of the Call-ID, a32-bit second clock as an initiallocal sequencenumber. Example: CSeq: 4711 INVITE 10.21 Date Date isnumber (used to order requests from the UA to its peer), ageneral-header field. Its syntax is: Date = "Date" ":" SIP-date SIP-date = rfc1123-date See [H14.18] forremote sequence number (used to order requests from its peer to the UA), and adefinitionroute set, which is an ordered list ofrfc1123-date. Note that unlike HTTP/1.1, SIP only supports the most recent RFC 1123 [34] formatting for dates. As in [H3.3], SIP restricts the timezone in SIP-date to Handley/Schulzrinne/Schooler/Rosenberg [Page 62] Internet Draft SIP July 20, 2001 "GMT", while RFC 1123 allows any timezone.URIs. Theconsistent use of GMT between Date, Expires and Retry- After headers allows implementationroute set is the set ofsimple clientsservers thatdo not haveneed to be traversed to send anotion of absolute time. Note that rfc1123- daterequest to the peer. A dialog can also be in the "early" state, which occurs when it iscase-sensitive. The Date header field reflectscreated with a provisional response, and then transition to thetime"established" state when therequest orfinal responseis first sent. Thus, retransmissions have the same Date header field value ascomes. 12.1 Creation of a Dialog Dialogs are created through theoriginal. Registrars MUST include this header in REGISTERgeneration of non-failure responsesif they use absolute expiration timesto requests with specific methods. Within this specification, only the 2xx andSHOULD include it for all responses. The Date header field can be used1xx responses to INVITE establish a dialog. A dialog established bysimple end systems withoutabattery-backed clocknon-final response toacquireanotion of current time. However, in its GMT-form, it requires clients to know their offset from GMT. 10.22 Encryption The Encryption general-header field specifies that the content has been encrypted. Section 18 describes the overall SIP security architecture and algorithms. This header fieldrequest isintendedcalled an early dialog. Extensions MAY define other means forend- to-end encryption of requests and responses. Requestscreating dialogs. Section 13 gives more details that areencrypted based on the public key belongingspecific to theentity named in the To header field. Responses are encrypted based on the public key conveyed inINVITE method. Here, we describe theResponse-Key header field. Noteprocess for creation of dialog state thatthe public keys themselves mayis notbe used for the encryption. This dependsdependent on theparticular algorithms used. For any encrypted message, at least the message body and possibly other message header fields are encrypted. An application receivingmethod. 12.1.1 UAS When a UAS responds to a requestorwith a responsecontaining an Encryption header field decrypts the body and then concatenates the plaintextthat establishes a dialog (such as a 2xx to INVITE), therequest line and headers of the original message. MessageUAS MUST copy all Record-Route headersin the decrypted part completely replace those withfrom thesame field name inrequest into theplaintext part. (Note: If onlyresponse, and MUST maintain thebodyorder of those headers. This includes themessage is to be encrypted, the body has to be prefixed with CRLF to allow proper concatenation.) Note that the request methodURIs, URI parameters, andRequest-URI cannot be encrypted. Encryption only provides privacy; the recipient has no guarantee that the request or response came from the party listed in the From message header, only that the sender used the recipient's public key. However, proxies will not Handley/Schulzrinne/Schooler/RosenbergVarious Authors [Page63]51] Internet Draft SIPJuly 20,October 26, 2001be able to modify the request or response. Encryption = "Encryption" ":" encryption-scheme 1*SP #encryption-params encryption-scheme = token encryption-params = generic-param The token indicates the form of encryption used; it is described in Section 18. Since proxies can base their forwarding decision onanycombination of SIP header fields, there is no guarantee that an encrypted request "hiding"Record-Route headerfields will reachparameters, whether they are known or unknown to thesame destination as an otherwise identical un-encrypted request. 10.23 Error-InfoUAS. TheError-Info response header providesUAS MUST add apointerContact header field toadditional information abouttheerror statusresponse.ThisThe Contact header fieldis only containedcontains an address where the UAS would like to be contacted for subsequent requests in3xx, 4xx, 5xx and 6xx responses. Error-Info = "Error-Info" ":" # ( "<" URI ">" *( ";" generic-param )) 10.24 Expires The Expires entity-header field givesthedate and time after whichdialog (which includes themessage content expires. This header field is currently defined onlyACK forthe REGISTER, as described in Section 7, and INVITE methods. For INVITE requests, it is a request and response-header field. Inarequest, the caller can limit2xx response in thevaliditycase of aninvitation, for example, if a client wants to limitINVITE). Generally, thetime durationhost portion ofa search or a conference invitation. A user interface MAY takethisas a hint to leave the invitation window on the screen even if the userURI isnot currently at the workstation. This also limitsthedurationIP address ofa search. If the request expires beforethesearch completes,host, or its FQDN. The URI provided in theproxy returns a 408 (Request Timeout) status. In a 302 (Moved Temporarily) response,Contact header MUST be aserver can adviseSIP URL. The UAS then constructs theclientstate of themaximaldialog. This state MUST be maintained for the duration of theredirection. Handley/Schulzrinne/Schooler/Rosenberg [Page 64] Internet Draft SIP July 20, 2001 Note that the expiration time does not affectdialog. First, thedurationroute set MUST be computed by following these steps: 1. The list of URIs in theactual session that may result fromRecord-Route headers in theinvitation. Session description protocols may offerrequest, if present, are taken, including any URI parameters. 2. The URI in theability to express time limits onContact header from thesession duration, however.request if present, is taken, including any URI parameters. ThevalueURI is appended to the bottom ofthis field can be either a SIP-date or an integer numberthe list ofseconds (in decimal), measuredURIs from thereceipt ofprevious step. Contact was not mandatory in RFC2543. Thus, if therequest. The latter approachUAS ispreferable for short durations, as it doestalking to an older UAC, the UAC might notdepend on clients and servers sharinghave inserted the Contact header. 3. The resulting list of URIs is called the route set These rules clearly imply that asynchronized clock. Implementations MAY treat values larger than 2**32-1 (4294967295 or 136 years) as equivalentUA MUST be able to2**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 Requestsparse andresponses MUST containprocess Record-Route header fields. This is aFrom general-header field, indicatingchange from RFC2543, where all record-route and route processing was optional for user agents. It is possible for theinitiator ofroute set to be empty. This will occur if neither Record-Route headers nor a Contact header were present in the request.(Note that this mayThe UAS MUST also remember whether the bottom-most entry in the route set was constructed from a Contact header or not. This is effectively a boolean value, which we refer to as CONTACT_SET. This is needed in order for the UA to determine whether the bottom most value can bedifferentupdated from subsequent requests; if it was constructed from a Contact, it can be updated. The remote sequence number sequence number MUST be set to theinitiatorvalue of the sequence number in the Cseq header of the request. The local sequence number MUST be empty. The callleg. Requests sent byidentifier component of thecalleedialog ID MUST be set to thecaller usevalue of thecallee's addressCall-ID in theFrom header field.)request. TheFromlocal address component of the dialog ID MUST be set to the To field in the response to the request (which therefore includes the tag), Various Authors [Page 52] Internet Draft SIP October 26, 2001 and the remote address component of the dialog ID MUSTcontainbe set to the"tag" parameter. However, a serverFrom field in the request. A UAS MUST be prepared to receive a request without atag,tag in the From field, in which case the tag is considered to effectively have a value ofzero.null. This is to maintain backwards compatibility with RFC2543, which did not mandate From tags.. The server copies12.1.2 UAC When a UAC receives a response that establishes a dialog, it constructs theFrom header field fromstate of therequest todialog. This state MUST be maintained for theresponse. The optional "display-name" is meant toduration of the dialog. First, the route set MUST berenderedcomputed bya human-user interface. A system SHOULD usefollowing these steps: 1. The list of URIs present in thedisplay name "Anonymous"Record-Route headers in the response are taken, if present, including all URI parameters, and their order is reversed. 2. The URI in theidentity ofContact header from theclientresponse, if present, is taken, including all URI parameters, and appended toremain hidden.the end of the list from the previous step. 3. TheSIP-URL MUST NOT containlist of URIs resulting from the"transport-param", "maddr-param", "ttl-param", or "headers" elements. A server that receives a SIP-URL with these elements ignores them. Even ifabove two operations is referred to as the"display-name"route set It isempty,possible for the"name-addr" form MUSTroute set to beusedempty. This will occur if neither Record-Route headers nor a Contact header were present in the"addr-spec" containsresponse. The UAC MUST also remember whether the bottom-most entry in the route set was constructed from acomma, question mark,Contact header orsemicolon. Syntax issues are discussed in Section 10.5. Handley/Schulzrinne/Schooler/Rosenberg [Page 65] Internet Draft SIP July 20, 2001 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;tag=887s From: Anonymous <sip:c8oqz84zk7z@privacy.org>;tag=hyh8 The "tag" value MUST be globally unique and cryptographically random with at least 32 bits of randomness. It SHOULD differnot. This is effectively a boolean value, which we refer to as CONTACT_SET. This is needed in order foreach call leg. Forthepurpose of identifying call legs, two From or To header fields are equalUA to determine whether the bottom most value can be updated from subsequent requests; ifand only if: oit was constructed from a Contact, it can be updated. Theaddr-spec component is equal, accordinglocal sequence number sequence number MUST be set to therules in Section 2.1. o Any "tag" and "generic-param" parameters are equal, compared according tovalue of thecase-sensitivity rules in Section 10. Only parameters that appearsequence number inboththe Cseq headerfields are compared. Call-ID, To and From are needed to identify a call leg. The distinction between call and call leg matters in calls with multiple responses to a forkedof the request. Theformatremote sequence number MUST be empty (it issimilar toestablished when theequivalent RFC 822 [26] header, but withUA sends aURI instead of just an email address. 10.26 In-Reply-To The In-Reply-Torequestheader field enumerateswithin thecall-IDs that this call references or returns. This allows automaticdialog). The calldistribution systems to route return callsidentifier component of the dialog ID MUST be set to theoriginatorvalue of thefirst call and allows callees to filter calls, so that only calls that return calls they have originated will be accepted. This field is not a substitute for request authentication. Handley/Schulzrinne/Schooler/Rosenberg [Page 66] Internet Draft SIP July 20, 2001 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-ForwardsCall-ID in the request. TheMax-Forwards request-header field maylocal address component of the dialog ID MUST beused with any SIP methodset tolimitthenumberFrom field in the request, and the remote address component ofproxies or gateways that can forwardtherequestdialog ID MUST be set to thenext downstream server. This can also be useful whenTo field of theclient is attemptingresponse. A UAC MUST be prepared totracereceive arequest chain which appears to be failing or loopingresponse without a tag inmid-chain. Max-Forwards = "Max-Forwards" ":" 1*DIGIT The Max-Forwards valuethe To field, in which case the tag is considered to effectively have adecimal integer indicating the remaining numbervalue oftimes this request messagenull. This isallowedtobe forwarded. Each proxy or gateway recipient ofmaintain backwards compatibility with RFC2543, which did not mandate To tags. Various Authors [Page 53] Internet Draft SIP October 26, 2001 12.2 Requests within arequest containingDialog Once aMax- Forwards header field MUST check and update its value prior to forwarding the request. Ifdialog has been established between two UAs either of them MAY initiate new transactions as needed within thereceived value is zero (0),dialog. However, a dialog imposes some restrictions on therecipientuse of simultaneous transactions. A TU MUST NOTforward the request and returns 483 (Too many hops). Instead,initiate aserver MAY act asnew regular transaction within afinal recipient for OPTIONS requests. Itdialog while a regular transaction isRECOMMENDED that the server include Supported, Server and Allow header fieldsin progress (in either direction) within that dialog. OPEN ISSUE #113: Should we relax theresponse. If the received Max-Forwards valueconstraint on non- overlapping regular transactions? A refresh request sent within a dialog isgreater than zero, then the forwarded message MUST contain an updated Max-Forwards field withdefined as avalue decremented by one (1). Example: Max-Forwards: 6 10.28 MIME-Version See [H19.4.1]. 10.29 Organization Handley/Schulzrinne/Schooler/Rosenberg [Page 67] Internet Draft SIP July 20, 2001 The Organization general-header field conveysrequest that can modify thenameroute set of theorganization to whichdialog. For dialogs that have been established with an INVITE, theentity issuingonly refresh request defined is re- INVITE (see Section 14). Other extensions may define different refresh requests for dialogs established in other ways. Note that an ACK is NOT a refresh request. 12.2.1 UAC Behavior 12.2.1.1 Generating the Request A requestor response belongs. It MAY also be insertedwithin a dialog is constructed byproxies atusing many of theboundarycomponents ofan organization. The field MAY be used by client software to filter calls. Organization = "Organization" ":" TEXT-UTF8-TRIM 10.30 Prioritythe state stored as part of the dialog. ThePriority request-headerTo header fieldindicates the urgencyof the requestas perceived byMUST be set to theclient. Priority = "Priority" ":" priority-value priority-value = "emergency" | "urgent" | "normal" | "non-urgent" | other-priority other-priority = token It is RECOMMENDED thatremote address, and thevalue of "emergency" onlyFrom header field MUST beused when 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 areset to thevalues of RFC 2076 [35], withlocal address (both including tags, assuming theaddition of "emergency". 10.31 Proxy-Authenticatetags are not null). TheProxy-Authenticate response-header fieldCall-ID of the request MUST beincluded as partset to the Call-ID of the dialog. Requests within a407 (Proxy Authentication Required) response. It may also occur Handley/Schulzrinne/Schooler/Rosenberg [Page 68] Internet Draft SIP July 20, 2001dialog MUST contain strictly monotonically increasing and contiguous CSeq sequence numbers (increasing-by-one) ina 401 (Unauthorized) responseeach direction. Therefore, if therequest was forked. The fieldlocal sequence number is not empty, the valueconsistsofa challenge that indicatestheauthentication schemelocal sequence number MUST be incremented by one, andparameters applicable to the proxy forthisRequest-URI. Unlike its usage within HTTP,value MUST placed into theProxy-Authenticate headerCseq header. If the local sequence number is empty, an initial value MUST bepassed upstream in the response tochosen using theUAC. In SIP, only UAC's can authenticate themselves to proxies.guidelines of Section 8.1.1.4. Thesyntax for this header is definedmethod field in[H14.33]. See 19 for further details on its usage. A client SHOULD cachethecredentials used for a particular proxy server and realm forCseq header MUST match thenext request to that server. Credentials are, in general, valid for a specific valuemethod of theRequest-URI atrequest. With aparticular proxy server. Iflength of 32 bits, a clientcontactscould generate, within aproxy server that has required authentication in the past, but the client does not have credentialssingle call, one request a second forthe particular Request-URI, it MAY attemptabout 136 years before needing touse the most-recently used credential.wrap around. Theserver responds with 407 if the client guessed wrong. This suggested caching behaviorinitial value of the Various Authors [Page 54] Internet Draft SIP October 26, 2001 sequence number ismotivated by proxies restricting phone calls to authenticated users. It seems likelychosen so thatin most cases, all destinations requiresubsequent requests within the samepassword. Note that end-to-end authentication is likely to be destination-specific. 10.32 Proxy-Authorization The Proxy-Authorization request-header fieldcall will not wrap around. A non-zero initial value allowsthe client to identify itself (or its user)clients to use aproxy which requires authentication.time-based initial sequence number. A client could, for example, choose the 31 most significant bits of a 32-bit second clock as an initial sequence number. TheProxy-Authorization field value consistsRequest-URI ofcredentials containingrequests is determined according to theauthentication informationfollowing rules: The UAC takes the list of URI in theuser agent forroute set inserted into theproxy and/or realmrequest URI of theresource being requested. Unlike Authorization,request, including all URI parameters. Any URI parameters not allowed in theProxy-Authorizationrequest URI MUST then be stripped. Each of the remaining URIs (if any) from the route set , including all URI parameters, MUST be placed into a Route header fieldapplies onlyinto the request, in order. A TU SHOULD follow the rules just mentioned to build thenextRequest-URI of the request, regardless of whether the UA uses an outbound proxythat demanded authentication using the Proxy- Authenticate field. When multiple proxies are usedserver or not. However, in some instances, achain,UA may not be willing or capable of sending theProxy-Authorization header field is consumed byrequest to thefirst outbound proxy that was expectingtop element in the route set is not capable of DNS, and therefore may not be able toreceive credentials. A proxy MAY relayfollow those procedures. In these cases, thecredentials fromUA MAY send theclientrequest to a local outbound server. In this case, it MUST NOT remove thenext proxytop Route header. In dialogs created by an INVITE, ifthat isthemechanism by whichUA is theproxies cooperatively authenticate a given request. See [H14.34] for a definition ofcaller, it sets thesyntax, and section 19 for a discussion of its usage. 10.33 Proxy-Require Handley/Schulzrinne/Schooler/Rosenberg [Page 69] Internet Draft SIP July 20, 2001 The Proxy-Require header field is usedRequest-URI toindicate proxy-sensitive features that MUST be supported by the proxy. If a proxy server does not understandtheoption,same value itMUST respond by returning status code 420 (Bad Extension)used for the initial request, andlist those optionssends it to its local outbound server. Bug#161: Which Request-URI doesnot understand intheUnsupported header.callee use? A UAC SHOULDattemptinclude a Contact header in any refresh requests within a dialog, and unless there is a need toretrychange it, therequest, without usingURI SHOULD be thefeatures listedsame as used in previous requests within theUnsupported header. Seedialog. As discussed in Section10.35 for more details on the mechanics of this message and12.2.2, ausage example. Proxy-Require = "Proxy-Require" ":" 1#option-tag 10.34 Record-Route The Record-RouteContact headerfield hasin a refresh request updates thefollowing syntax: Record-Route = "Record-Route" ":" 1# ( name-addr *( ";" rr-param )) rr-param = generic-param Details ofroute set. This allows a UA to provide a new contact address, should itsuseaddress change during the duration of the dialog. However, requests that aredescribed in Section 16. 10.35 Require The Require general-header field is used by clients to tell user agent servers about options thatnot refresh requests do not affect theclient expectsroute set for theserver to support in order to properly processdialog. Once therequest. If a server does not understandrequest has been constructed, theoption, it MUST respond by returning status code 420 (Bad Extension) and list those options it does not understand inaddress of theUnsupported header. A UAC SHOULD attempt to retryserver is computed and therequest, withoutrequest is sent, using thefeatures listed insame procedures for requests outside of a dialog (Section 8.1.1). 12.2.1.2 Processing theUnsupported 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 Handley/Schulzrinne/Schooler/RosenbergResponses Various Authors [Page70]55] Internet Draft SIPJuly 20,October 26, 2001Unsupported: com.example.billing This is to make sure that the client-server interactionThe UAC willproceed without delay when all options are understood by both sides, and only slow down if options are not understood (as inreceives responses to theexample above). For a well-matched client-server pair,request from theinteraction proceeds quickly, savingtransaction layer. The behavior of around-trip often required by negotiation mechanisms. In addition, it also removes ambiguity when the client requires featuresUAC that receives a 3xx response for a request sent within a dialog is theserver does not understand. Some features, suchsame ascall handling fields, are only of interest to end systems. Proxy and redirect servers MUST ignore features that are not understood. If a particular extension requires that intermediate devices support it,if theextension MUST be taggedrequest would have been sent outside a dialog. This behavior is described inthe Proxy-Require field as well (seeSection10.33). 10.36 Response-Key The Response-Key request-header field can be used by a client to request the key13.2.2. Note however that when thecalled user agent SHOULD use to encrypt the response with. The syntax is: Response-Key = "Response-Key" ":" key-scheme 1*SP #key-param key-scheme = token key-param = generic-param The "key-scheme" givesUAC tries alternative locations it still uses thetype of encryption to be usedroute set for theresponse. Section 18 describes security schemes. If the client insists thatdialog to build theserver return an encrypted response, it includes a Require: org.ietf.sip.encrypt-responseRoute headerfield in itsof the request. Ifthe server cannot encrypta UAC has a route set forwhatever reason, it MUST follow normal Require header field proceduresa dialog, andreturnreceives a420 (Bad Extension) response. If this Require2xx response to a refresh it sent, the Contact header field of the response is examined. If not present, the route set remains unchanged. If the response had aserver SHOULD still encrypt if it can. 10.37 Retry-After Handley/Schulzrinne/Schooler/Rosenberg [Page 71] Internet Draft SIP July 20, 2001 The Retry-After response-headerContact header field, and the boolean variable CONTACT_SET is false, the URL in the Contact header fieldcan be used with a 503 (Service Unavailable)in the response is added toindicate how longtheservicebottom of the route set , and CONTACT_SET isexpected to be unavailableset to true. If therequesting client and withrefresh request response had a404 (Not Found), 600 (Busy), or 603 (Decline)Contact header field, and CONTACT_SET is true, the URL in the Contact header field of the response toindicate whenthecalled party anticipates being available again. Therefresh request replaces the bottom valueof this field can be either an SIP-datein the route set is responded with a non-2xx final response the route set remains unchanged as if no refresh request had been issued. If the response for the a request within a dialog is a 481 (Call/Transaction Does Not Exist) oran integer number of seconds (in decimal) aftera 408 (Request Timeout) thetime ofUAC SHOULD terminate theresponse. An optional comment can be used to indicate additional information aboutdialog. For INVITE initiated dialogs terminating thetimedialog consists ofcallback. An optional "duration" parameter indicates how long the called partysending a BYE. 12.2.2 UAS behavior The UAS willbe reachable starting atreceive theinitial time of availability.request from the transaction layer. Ifno duration parameter is given,theservice is assumed to be 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 inrequest has ameeting) 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 Intag in thethird example,To header field, thecallee is reachable for one hour starting at 21:00 GMT. InUAS core computes thelast example,dialog identifier corresponding to thedelayrequest and compares it with existing dialogs. If there is2 minutes. 10.38 Route The Route header field hasa match, this is a mid-dialog request. In that case, thefollowing syntax: Route = "Route" ":" 1# ( name-addr *( ";" rr-param )) Detailssame processing rules for requests outside ofits use are describeda dialog, discussed in Section16. 10.39 Server The Server response-header field contains information about the Handley/Schulzrinne/Schooler/Rosenberg [Page 72] Internet Draft SIP July 20, 2001 software used8.2, are applied by theuser agent server to handleUAS once therequest. The syntax for this fieldrequest isdefinedreceived from the transaction layer. Requests that do not change in[H14.38]. 10.40 Subject This header field provides a summary or indicatesany way thenaturestate of a dialog may be received within a dialog (e.g., an OPTIONS request). They are processed as if they had been received outside thecall, allowing call filtering without having to parse the session description. (Notedialog. Requests within a dialog MAY contain Record-Route and Contact header fields. However, requests thatthe session description doesare nothave to userefresh requests do not update thesame subject indication asroute set for theinvitation.) Subject = ( "Subject" | "s" ) ":" TEXT-UTF8-TRIM Example: Subject: Tune in - theydialog. This specification only defines one refresh request: re-INVITE (see Section 14). Various Authors [Page 56] Internet Draft SIP October 26, 2001 Special rules apply when updated Record-Route or Contact header fields aretalking about your work! 10.41 Supported The Supported general-header field enumerates allreceived inside a refresh request. If a UAS has a route set for a dialog, and receives a refresh for that dialog containing Record-Route header fields, it MUST copy those header fields into any 2xx response to that request. If thecapabilities ofboolean variable CONTACT_SET is true, theclient or server. ThisContact header fieldSHOULD be includedinall requests (except ACK) andthe request (if present) replaces the last entry inall responses. Includingthe route set the UAS MUST add the URL in the Contact header field inall responses greatly simplifies the use of extensions for call control in subsequent transactions withthesame server. Syntax: Supported = ( "Supported" | "k" ) ":" 1#option-tag 10.42 Timestamp The Timestamp general-header field describes whenre- INVITE to theclient sentbottom of therequestroute set , and then set CONTACT_SET to true. If theserver. The client usesrequest did not contain a Contact header field, thecurrent time valueroute-set at thetime of transmission, i.e., each retransmission of a request is likely to have a different timestamp value. The value ofUAS remains unchanged. If thetimestampremote sequence number isof significance only to the client andempty, itMAY use any timescale. The serverMUSTechobe set to theexact samevalueHandley/Schulzrinne/Schooler/Rosenberg [Page 73] Internet Draft SIP July 20, 2001of the sequence number inall provisional and final responses and MAY, if it has accurate information about this, add a floating pointthe Cseq header in the request. If the remote sequence numberindicatingwas not empty, but the sequence number ofseconds that have elapsed since it has receivedtherequest. The timestamprequest isused by the client to compute the round- trip time tolower than theserver so that it can adjustremote sequence number, thetimeout value for retransmissions. Timestamp = "Timestamp" ":" *(DIGIT) [ "." *(DIGIT) ] [ delay ] delay = *(DIGIT) [ "." *(DIGIT) ] Note that thererequest is out of order and MUSTNOTbeany LWS betweenrejected with aDIGIT and500 response. If thedecimal point. 10.43 To The To general-header field specifiesremote sequence number was not empty, and the"logical" recipientsequence number of therequest. To = ( "To" | "t" ) ":" ( name-addr | addr-spec ) *( ";" to-param ) to-param = tag-param | generic-param Requests and responses MUST contain a To general-header field, indicatingrequest is greater than thedesired recipient ofremote sequence number, therequest. The optional "display-name"request ismeantin order. It is possible for the CSeq header to berenderedhigher than the remote sequence number by more than one. This is not an error condition, and ahuman-user interface. TheUASor redirect server copies the To header field into its response,SHOULD be prepared to receive andMUST add a "tag" parameter.process requests with CSeq values more than one higher than the previous received request. TheSIP-URLUAS MUSTNOT containthen set 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. The "tag" parameter serves as a general mechanismremote sequence number todistinguish multiple instances of a user identified by a single SIP URL. As proxies can fork requests,thesame request can reach multiple instancesvalue ofa user (mobile and home phones, for example). As each can respond, there needs to be a means to distinguish the responses from each atthecaller. The situation also arises with multicast requests. The tagsequence number in theToCseq headerfield serves to distinguish responses at the UAC. It MUST be placedin theTo fieldrequest. 12.3 Termination of a Dialog Dialogs can end in several different ways, depending on theresponse by user agent, registrar and redirect servers, but MUST NOT be inserted into responses forwarded upstream by proxies. However, Handley/Schulzrinne/Schooler/Rosenberg [Page 74] Internet Draft SIP July 20, 2001 responses generated locally bymethod. When aproxy, and then sent upstream, MUST contain a tag. A UAS or redirect server MUST adddialog is established with INVITE, it is terminated with a"tag" parameter for all final responses for all transactions withinBYE. No other means to terminate acall leg. All such parameters have the same value within the same call leg. These servers SHOULD add the tag for informational responses during the initial INVITE transaction,dialog are described in this specification, butMUST addextensions can define other ways. 13 Initiating atag to informational responses for all subsequent transactions. See Section 10.25 for details of the "tag" parameter. The "tag" parameter in To headers is ignored when matching responsesSession 13.1 Overview When a user agent client desires torequests that did not containinitiate a"tag" in their To header. Section 15 describes when the "tag" parameter MUST appear in subsequent requests. Note that ifsession (for example, audio, video, or a game), it formulates an INVITE request. The INVITE requestalready contained a tag, this tag MUST be mirrored in the response;asks anew tag MUST NOT be inserted. Section 10.25 describes how To and From header fields are compared for the purpose of matching requestsserver tocall legs.establish a session. This request is forwarded by proxies, eventually arriving at one or more UASSHOULDwhich can potentially acceptrequests even if they do not recognizetheURI scheme (e.g., a tel: URI) or ifinvitation. These UAS's will frequently need to query theTo header does not addressuser about whether to accept theuser. Only Request-URI that do not matchinvitation. After some time, those UAS can accept therecipient should cause requests to be rejected. Even ifinvitation (meaning the"display-name"session isempty, the "name-addr" form MUSTto beused ifestablished) by sending a 2xx response. If the"addr-spec" containsinvitation is not accepted, acomma, question mark,3xx,4xx,5xx orsemicolon. Note that LWS6xx response iscommon, but not mandatory betweensent, depending on thedisplay-name andreason for the"<". 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 to identify a call leg. The distinction between call and call leg matters in calls with multiple responses fromrejection. Before sending aforked request. The "tag" is added to the To header field infinal response, the UAS can also send a provisional response (1xx) toallow forking of future requests for the same call by proxies, while addressing only one ofadvise thepossibly several responding user agent servers. It also allows several instancesUAC of progress in contacting thecallee to send requests that can be Handley/Schulzrinne/Schooler/Rosenbergcalled user. Various Authors [Page75]57] Internet Draft SIPJuly 20,October 26, 2001distinguished. 10.44 Unsupported The Unsupported response-header field listsAfter possibly receiving one or more provisional responses, thefeatures not supported byUA will get one or more 2xx responses or one non-2xx final response. Because of theserver. See Section 10.35protracted amount of time it can take to receive final responses to INVITE, the reliability mechanisms for INVITE transactions differ from those of other requests (like OPTIONS). Once it receives ausage 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 originatingfinal response, therequest.UAC needs send an ACK for every final response it receives. Thesyntax and semantics are defined in [H14.43]. 10.46 Via The Via field indicates the path taken byprocedure for sending this ACK depends on therequest so far. This prevents request loopingtype of response. For final responses between 300 andensures replies take the same path as699, therequests, which assistsACK processing is done infirewall traversal and other unusual routing situations. 10.46.1 Requests The client originatingtherequest MUST insert intotransaction layer, and follows one set of rules (See Section 17). For 2xx responses, therequest a Via field containingACK is generated by thetransport protocol usedUAC core. A 2xx response tosend the message,an INVITE establishes a session, and it also creates a dialog between theclient's host name or network address and, if notUA that issued thedefault port number,INVITE and theport number at which it wishes to receive responses. (NoteUA thatthis port number can differgenerated the 2xx response. Therefore, when multiple 2xx responses are received from different remote UAs (because theUDP source port numberINVITE forked), each 2xx establishes a different dialog. All these dialogs are part of therequest.) A fully-qualified domain name is RECOMMENDED. Each subsequent proxy server that sendssame call. This section provides details on the establishment of a session using INVITE. 13.2 Caller Processing 13.2.1 Creating the Initial INVITE Since the initial INVITE represents a requestonwards MUST addoutside of a dialog, itsown additional Viaconstruction follows the procedures of Section 8.1.1. Additional processing is required for the specific case of INVITE. An Allow header fieldbefore any existing Via fields. A proxy that receives a redirection (3xx) response and then searches recursively, MUST use(Section 22.5) SHOULD be present in thesame Via headers asINVITE. It indicates what methods can be invoked within a dialog, on theoriginal proxied request. A client that sendsUA sending the INVITE, for the duration of the dialog. For example, arequest toUA capable of receiving INFO requests within amulticast address MUST adddialog [21] SHOULD include an Allow header listing the"maddr" parameter to its ViaINFO method. A Supported headerfield, andfield (Section 22.35) SHOULDaddbe present in the"ttl" parameter. (In that case,INVITE. It enumerates all themaddr parameter SHOULD containextensions understood by thedestination multicast address, although under exceptional circumstances itUAC. An Accept (Section 22.1) header field MAYcontain a unicast address.) If a server receives a requestbe present in the INVITE. It indicates whichcontained an "maddr" parametercontent-types are acceptable to the UA, in both thetopmost Via field,response received by it, and in any subsequent requests sent to itSHOULD sendwithin dialogs established by theresponseINVITE. The Accept header is especially useful for indicating support of various session description formats. The UA MAY add an Expires header field (Section 22.19) to limit theaddress listedvalidity of the invitation. If the time indicated in theHandley/Schulzrinne/Schooler/RosenbergExpires Various Authors [Page76]58] Internet Draft SIPJuly 20,October 26, 2001"maddr" parameter. Loop detectionheader field isdescribed in Section 17.3.1. 10.46.2 Receiver-tagged Via Header Fields A proxy or UAS receivingreached and no final answer for the INVITE has been received the UAC core SHOULD generate a CANCEL requestSHOULD checkfor thefirst Viaoriginal INVITE. A UAC MAY also find useful to add, among others, Subject (Section 22.34), Organization (Section 22.24) and User-Agent (Section 22.39) headerfieldfields. They all contain useful information related toensure that it contains the sender's correct network address, as seen from that proxy. IftheVia header contains a domain name or if it contains an IP address that differs from the packet source address, the proxy or UAS SHOULDINVITE. The UAC MAY choose to add a"received" attributemessage body tothat Via header field. A multi-homed host may not be ablethe INVITE. Section 8.1.1.9 deals with how toinsert a network address intoconstruct theViaheaderfield that can be reached byfields- Content-Type among others- needed to describe thenext hop,message body. There are special rules forexample because ifmessage bodies that contain a session description - their corresponding Content-Disposition is "session". SIP uses an offer/answer model where one UA sends a session description, called the offer, which contains a proposed description of thenetworks is private.session. Theaddress placed intooffer indicates theVia header may differdesired communications means (audio, video, games), parameters of those means (such as codec types) and addresses for receiving media from theinterface actually used, as that interface is selected only at packet sending time byofferer. The other UA responds with another session description, called theIP layer. Similarly, a request traversing a network address translator (NAT) will also causeanswer, which indicates which communications means are accepted, thesending addressparameters which apply todifferthose means, and addresses for receiving media from theaddress seen byanswerer. The offer/answer model can be mapped into