draft-ietf-mmusic-sip-10.txt   draft-ietf-mmusic-sip-11.txt 
Internet Engineering Task Force MMUSIC WG Internet Engineering Task Force MMUSIC WG
Internet Draft Handley/Schulzrinne/Schooler/Rosenberg Internet Draft Handley/Schulzrinne/Schooler/Rosenberg
ietf-mmusic-sip-10.txt ISI/Columbia U./Caltech/Bell Labs. ietf-mmusic-sip-11.txt ISI/Columbia U./Caltech/Bell Labs.
November 12, 1998 December 15, 1998
Expires: May 1999 Expires: June 1999
SIP: Session Initiation Protocol SIP: Session Initiation Protocol
STATUS OF THIS MEMO STATUS OF THIS MEMO
This document is an Internet-Draft. Internet-Drafts are working This document is an Internet-Draft. Internet-Drafts are working
documents of the Internet Engineering Task Force (IETF), its areas, documents of the Internet Engineering Task Force (IETF), its areas,
and its working groups. Note that other groups may also distribute and its working groups. Note that other groups may also distribute
working documents as Internet-Drafts. working documents as Internet-Drafts.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as ``work in progress''. material or to cite them other than as ``work in progress''.
To learn the current status of any Internet-Draft, please check the To learn the current status of any Internet-Draft, please check the
``1id-abstracts.txt'' listing contained in the Internet-Drafts Shadow ``1id-abstracts.txt'' listing contained in the Internet-Drafts Shadow
Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe),
munnari.oz.au (Pacific Rim), ftp.ietf.org (US East Coast), or munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or
ftp.isi.edu (US West Coast). ftp.isi.edu (US West Coast).
Distribution of this document is unlimited. Distribution of this document is unlimited.
ABSTRACT ABSTRACT
The Session Initiation Protocol (SIP) is an application- The Session Initiation Protocol (SIP) is an application-
layer control (signaling) protocol for creating, layer control (signaling) protocol for creating,
modifying and terminating sessions with one or more modifying and terminating sessions with one or more
participants. These sessions include Internet multimedia participants. These sessions include Internet multimedia
skipping to change at page 5, line 19 skipping to change at page 5, line 19
request. request.
Invitee, invited user, called party, callee: The person or service Invitee, invited user, called party, callee: The person or service
that the calling party is trying to invite to a conference. that the calling party is trying to invite to a conference.
Isomorphic request or response: Two requests or responses are defined Isomorphic request or response: Two requests or responses are defined
to be isomorphic for the purposes of this document if they have to be isomorphic for the purposes of this document if they have
the same values for the Call-ID, To, From and CSeq header the same values for the Call-ID, To, From and CSeq header
fields. In addition, requests have to have the same Request-URI. fields. In addition, requests have to have the same Request-URI.
Location server: See location service Location server: See location service.
Location service: A location service is used by a SIP redirect or Location service: A location service is used by a SIP redirect or
proxy server to obtain information about a callee's possible proxy server to obtain information about a callee's possible
location(s). Location services are offered by location servers. location(s). Location services are offered by location servers.
Location servers MAY be co-located with a SIP server, but the Location servers MAY be co-located with a SIP server, but the
manner in which a SIP server requests location services is manner in which a SIP server requests location services is
beyond the scope of this document. beyond the scope of this document.
Parallel search: In a parallel search, a proxy issues several Parallel search: In a parallel search, a proxy issues several
requests to possible user locations upon receiving an incoming requests to possible user locations upon receiving an incoming
request. Rather than issuing one request and then waiting for request. Rather than issuing one request and then waiting for
the final response before issuing the next request as in a the final response before issuing the next request as in a
sequential search , a parallel search issues requests without sequential search , a parallel search issues requests without
waiting for the result of previous requests. waiting for the result of previous requests.
Provisional response: A response used by the server to indicate Provisional response: A response used by the server to indicate
progress, but that does not terminate a SIP transaction. 1xx progress, but that does not terminate a SIP transaction. 1xx
responses are provisional, other responses are considered final responses are provisional, other responses are considered final.
Proxy, proxy server: An intermediary program that acts as both a Proxy, proxy server: An intermediary program that acts as both a
server and a client for the purpose of making requests on behalf server and a client for the purpose of making requests on behalf
of other clients. Requests are serviced internally or by passing of other clients. Requests are serviced internally or by passing
them on, possibly after translation, to other servers. A proxy them on, possibly after translation, to other servers. A proxy
interprets, and, if necessary, rewrites a request message before interprets, and, if necessary, rewrites a request message before
forwarding it. forwarding it.
Redirect server: A redirect server is a server that accepts a SIP Redirect server: A redirect server is a server that accepts a SIP
request, maps the address into zero or more new addresses and request, maps the address into zero or more new addresses and
returns these addresses to the client. Unlike a proxy server , returns these addresses to the client. Unlike a proxy server ,
it does not initiate its own SIP request. Unlike a user agent it does not initiate its own SIP request. Unlike a user agent
server , it does not accept calls. server , it does not accept calls.
Registrar: A registrar is server that accepts REGISTER requests. A Registrar: A registrar is a server that accepts REGISTER requests. A
registrar is typically co-located with a proxy or redirect registrar is typically co-located with a proxy or redirect
server and MAY offer location services. server and MAY offer location services.
Ringback: Ringback is the signaling tone produced by the calling Ringback: Ringback is the signaling tone produced by the calling
client's application indicating that a called party is being client's application indicating that a called party is being
alerted (ringing). alerted (ringing).
Server: A server is an application program that accepts requests in Server: A server is an application program that accepts requests in
order to service requests and sends back responses to those order to service requests and sends back responses to those
requests. Servers are either proxy, redirect or user agent requests. Servers are either proxy, redirect or user agent
skipping to change at page 7, line 11 skipping to change at page 7, line 11
An application program MAY be capable of acting both as a client and An application program MAY be capable of acting both as a client and
a server. For example, a typical multimedia conference control a server. For example, a typical multimedia conference control
application would act as a user agent client to initiate calls or to application would act as a user agent client to initiate calls or to
invite others to conferences and as a user agent server to accept invite others to conferences and as a user agent server to accept
invitations. The properties of the different SIP server types are invitations. The properties of the different SIP server types are
summarized in Table 1. summarized in Table 1.
property redirect proxy user agent registrar property redirect proxy user agent registrar
server server server server server server
__________________________________________________________________________ __________________________________________________________________
also acts as a SIP client no yes no no also acts as a SIP client no yes no no
returns 1xx status yes yes yes yes returns 1xx status yes yes yes yes
returns 2xx status no yes yes yes returns 2xx status no yes yes yes
returns 3xx status yes yes yes yes returns 3xx status yes yes yes yes
returns 4xx status yes yes yes yes returns 4xx status yes yes yes yes
returns 5xx status yes yes yes yes returns 5xx status yes yes yes yes
returns 6xx status no yes yes no returns 6xx status no yes yes no
inserts Via header no yes no no inserts Via header no yes no no
accepts ACK yes yes yes no accepts ACK yes yes yes no
skipping to change at page 7, line 40 skipping to change at page 7, line 40
(Section 1.4.3). The most common SIP operation is the invitation (Section 1.4.3). The most common SIP operation is the invitation
(Section 1.4.4). Instead of directly reaching the intended callee, a (Section 1.4.4). Instead of directly reaching the intended callee, a
SIP request may be redirected or may trigger a chain of new SIP SIP request may be redirected or may trigger a chain of new SIP
requests by proxies (Section 1.4.5). Users can register their requests by proxies (Section 1.4.5). Users can register their
location(s) with SIP servers (Section 4.2.6). location(s) with SIP servers (Section 4.2.6).
1.4.1 SIP Addressing 1.4.1 SIP Addressing
The "objects" addressed by SIP are users at hosts, identified by a 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, SIP URL. The SIP URL takes a form similar to a mailto or telnet URL,
i.e., user@host user part is a user name, a civil name or a telephone i.e., user@host. The user part is a user name or a telephone number.
number. The host part is either a domain name having a DNS SRV (RFC The host part is either a domain name having a DNS SRV (RFC 2052
2052 [14]), CNAME or A record (RFC 1035 [15]), or a numeric network [14]), CNAME or A record (RFC 1035 [15]), or a numeric network
address. 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 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 existing media agents, can be included in some mailers' message
headers, or can be recorded during previous invitation interactions. headers, or can be recorded during previous invitation interactions.
In many cases, a user's SIP URL can be guessed from his email In many cases, a user's SIP URL can be guessed from their email
address. address.
Examples of SIP URLs include:
sip:mjh@metro.isi.edu
sip:watson@bell-telephone.com
sip:root@193.175.132.42
sip:info@ietf.org
A SIP URL address can designate an individual (possibly located at A SIP URL address can designate an individual (possibly located at
one of several end systems), the first available person from a group one of several end systems), the first available person from a group
of individuals or a whole group. The form of the address, for of individuals or a whole group. The form of the address, for
example, sip:sales@example.com , is not sufficient, in general, to example, sip:sales@example.com , is not sufficient, in general, to
determine the intent of the caller. determine the intent of the caller.
If a user or service chooses to be reachable at an address that is If a user or service chooses to be reachable at an address that is
guessable from the person's name and organizational affiliation, the guessable from the person's name and organizational affiliation, the
traditional method of ensuring privacy by having an unlisted "phone" traditional method of ensuring privacy by having an unlisted "phone"
number is compromised. However, unlike traditional telephony, SIP number is compromised. However, unlike traditional telephony, SIP
offers authentication and access control mechanisms and can avail offers authentication and access control mechanisms and can avail
itself of lower-layer security mechanisms, so that client software itself of lower-layer security mechanisms, so that client software
can reject unauthorized or undesired call attempts. can reject unauthorized or undesired call attempts.
1.4.2 Locating a SIP Server 1.4.2 Locating a SIP Server
When a client wishes to send a request, the client either sends it to When a client wishes to send a request, the client either sends it to
a locally configured SIP proxy server (as in HTTP), independent of a locally configured SIP proxy server (as in HTTP), independent of
the Request-URI, or sends it to the IP address and port corresponding the Request-URI, or sends it to the IP address and port corresponding
to the Request-URI. For the latter case, the client performs the to the Request-URI.
following steps to obtain the server's IP address.
A SIP client MUST follow the following steps to resolve the host part For the latter case, the client must determine the protocol, port and
of the Request-URI. If a client supports only TCP or UDP, but not IP address of a server to send the request to. A client SHOULD follow
both, the client omits the respective address type. If the SIP the steps below to obtain this information. At each step, unless
address contains a port number, that number is to be used, otherwise, stated otherwise, the client SHOULD try to contact a server at the
the default port number 5060 is to be used. The default port number port number listed in the Request-URI. If no port number is present
is the same for UDP and TCP. In all cases, the client first attempts in the Request-URI, the client uses port 5060. If the Request-URI
to contact the server using UDP, then TCP. specifies a protocol (TCP or UDP), the client contacts the server
using that protocol. If no protocol is specified, the client tries
UDP (if UDP is supported), and if the attempt fails, then tries TCP
(if TCP is supported).
A client SHOULD rely on ICMP "Port Unreachable" messages rather than The client tries to find one or more addresses for the server by
time-outs to determine that a server is not reachable at a particular querying DNS. There are several different ways it may query DNS, and
address. (For socket-based programs: For TCP, connect() returns these are listed in the steps below. If a step elicits no addresses,
ECONNREFUSED if there is no server at the designated address; for the client SHOULD continue to the next step. However if a step
UDP, the socket needs to be bound to the destination address using elicits one or more addresses, but no SIP server at any of those
connect() rather than sendto() or similar so that a second write() addresses responds, then the client concludes the server is down and
fails with ECONNREFUSED. ) If it finds the server is not reachable SHOULD NOT continue on to the next step.
at a particular address, it SHOULD behave as if it received a 400-
class error response to that request.
If the SIP address contains a numeric IP address, the client contacts 1. If the host portion of the Request-URI is an IP address,
the SIP server at that address. Otherwise, the client follows the the client contacts the server at the given address. If the
steps below. host portion of the Request-URI is not an IP address, the
client proceeds to the next step.
1. If there is a SRV DNS resource record (RFC 2052 [14]) of 2. An implementation MAY use the experimental procedure in
type sip.udp or type sip.tcp, order all such records by Appendix D at this step. This step relies on DNS SRV
their priority value and attempt to contact the servers in records, which are currently experimental and may change
that order. If a port number is explicitly specified in the before being published as a standard. If this step is used,
SIP URL, it overrides the port number in the SRV record. It and no servers are returned in the DNS query, the client
is RECOMMENDED that DNS zone files give higher weight to proceeds to the next step.
servers running UDP than those running TCP. If a server
responds, skip the remaining steps below.
2. Check if there is a DNS CNAME or A record for the given 3. The client queries the name server for CNAME records with
host and try to contact a SIP server at the one or more the QNAME=sip.host, where host is the host portion of the
addresses listed, again trying first UDP, then TCP. If a Request-URI, as described in RFC 2219 [16]. For each
server responds, skip the remaining step. address in the answer, the client attempts to contact a
server at that address. If, however, there were no CNAME
records, the client goes to the next step.
3. If all of the above methods fail to locate a server, the 4. The client queries the name server for A records with the
caller MAY contact an SMTP server at the user's host and QNAME=sip.host, where host is the host portion of the
use the SMTP EXPN command to obtain an alternate address Request-URI, as described in RFC 2219 [16]. For each
and repeat the steps above. As a last resort, a client MAY address in the answer, the client attempts to contact a
choose to deliver the session description to the callee server at that address. If, however, there were no A
using electronic mail, encapsulating it as a MIME [16] records, the client goes to the next step.
attachment. This allows mail readers with automated
processing of attachments to start the appropriate tool.
Alternatively, the human user can examine the session
description and take whatever actions they like.
A client MAY cache the result of the reachability steps for a 5. The client queries the name server for CNAME records for
particular address and retry that host address for the next request. the host portion of the Request-URI. For each address in
It SHOULD honor DNS TTL's and expire the cache entry at the the answer, the client attempts to contact a server at that
appropriate time. If the client does not find a SIP server at the address. If, however, there were no CNAME records, the
cached address, it MUST start the search at the beginning of the client goes to the next step.
sequence.
An organization MAY use sip. domain as the name CNAME or A name of 6. The client queries the name server for A records for the
its SIP server, according to RFC 2219 [17]. A client MAY attempt to host portion of the Request-URI. For each address in the
contact a server with the name sip. domain when given the address answer, the client attempts to contact a server at that
user@domain. address. If there were no A records, the client stops, as
it has been unable to locate a server.
This suggestion allows a reasonably smooth transition until A client SHOULD rely on explicit network notifications to determine
the widespread deployment of DNS SRV records. that a server is not reachable, rather than relying on timeouts. In
particular, a client SHOULD be prepared to receive ICMP port,
protocol, or host unreachable messages as a form of explicit
notifications, and MAY be prepared to process other messages. (For
socket-based programs: For TCP, connect() returns ECONNREFUSED if the
client could not connect to a server at that address. For UDP, the
socket needs to be bound to the destination address using connect()
rather than sendto() or similar so that a second write() fails with
ECONNREFUSED if there is no server listening) If the client finds the
server is not reachable at a particular address, it SHOULD behave as
if it had received a 400-class error response to that request.
A client MAY cache a successful DNS query result. A successful query
is one which contained records in the answer, and a server was
contacted at one of the addresses from the answer. When the client
wishes to send a request to the same host, it MUST start the search
as if it had just received this answer from the name server. The
client MUST expire the cache entry after the DNS time-to-live value
has elapsed. If the client does not find a SIP server among the
addresses listed in the cached answer, it MUST start the search at
the beginning of the sequence described above.
For example, consider a client which wishes to send a SIP request.
The Request-URI for the destination is sip:user@company.com. The
client only supports UDP. It would follow these steps:
1. The host portion is not an IP address, so the client goes
to step 2 above.
2. The client decides to implement the optional SRV record
step. The client does a DNS query of
QNAME="sip.udp.company.com", QCLASS=IN, QTYPE=SRV. Since it
doesn't support TCP, it omits the TCP query. There were no
addresses in the DNS response, so the client goes to the
next step.
3. The client does a DNS query of QNAME="sip.company.com",
QCLASS=IN, QTYPE=CNAME. There were no addresses in the DNS
response. The client therefore goes to the next step.
4. The client does a DNS query of QNAME="sip.company.com",
QCLASS=IN, QTYPE=A. There is one answer. The client tries
that address using UDP at port 5060, and succeeds at
delivering the request.
1.4.3 SIP Transaction 1.4.3 SIP Transaction
Once the host part has been resolved to a SIP server, the client Once the host part has been resolved to a SIP server, the client
sends one or more SIP requests to that server and receives one or sends one or more SIP requests to that server and receives one or
more responses from the server. A request (and its retransmissions) more responses from the server. A request (and its retransmissions)
together with the responses triggered by that request make up a SIP together with the responses triggered by that request make up a SIP
transaction. All responses to a request contain the same values in transaction. All responses to a request contain the same values in
the Call-ID, CSeq, To, and From fields (with the possible addition of the Call-ID, CSeq, To, and From fields (with the possible addition of
a tag in the To field 6.37). This allows responses to be matched with a tag in the To field (section 6.37)). This allows responses to be
requests. The ACK request following an INVITE is not part of the matched with requests. The ACK request following an INVITE is not
transaction since it may traverse a different set of hosts. part of the transaction since it may traverse a different set of
hosts.
If TCP is used, request and responses within a single SIP transaction If TCP is used, request and responses within a single SIP transaction
are carried over the same TCP connection (see Section 10). Several are carried over the same TCP connection (see Section 10). Several
SIP requests from the same client to the same server MAY use the same SIP requests from the same client to the same server MAY use the same
TCP connection or MAY open a new connection for each request. TCP connection or MAY use a new connection for each request.
If the client sent the request via unicast UDP, the response is sent If the client sent the request via unicast UDP, the response is sent
to the address contained in the next Via header field (Section 6.40) to the address contained in the next Via header field (Section 6.40)
of the response. If the request is sent via multicast UDP, the of the response. If the request is sent via multicast UDP, the
response is directed to the same multicast address and destination response is directed to the same multicast address and destination
port. For UDP, reliability is achieved using retransmission (Section port. For UDP, reliability is achieved using retransmission (Section
10). 10).
The SIP message format and operation is independent of the transport The SIP message format and operation is independent of the transport
protocol. protocol.
skipping to change at page 11, line 19 skipping to change at page 12, line 5
then issues a SIP INVITE request to the address(es) returned by the then issues a SIP INVITE request to the address(es) returned by the
location service (step 4). The user agent server alerts the user location service (step 4). The user agent server alerts the user
(step 5) and returns a success indication to the proxy server (step (step 5) and returns a success indication to the proxy server (step
6). The proxy server then returns the success result to the original 6). The proxy server then returns the success result to the original
caller (step 7). The receipt of this message is confirmed by the caller (step 7). The receipt of this message is confirmed by the
caller using an ACK request, which is forwarded to the callee (steps caller using an ACK request, which is forwarded to the callee (steps
8 and 9). Note that an ACK can also be sent directly to the callee, 8 and 9). Note that an ACK can also be sent directly to the callee,
bypassing the proxy. All requests and responses have the same Call- bypassing the proxy. All requests and responses have the same Call-
ID. ID.
The transport, maddr, and ttl parameters MUST NOT be used in the From
and To header fields and the Request-URI; they are ignored if
present.
Headers: Headers of the SIP request can be defined with the "?"
mechanism within a SIP URL. The special hname "body" indicates
that the associated hvalue is the message-body of the SIP INVITE
request. Headers MUST NOT be used in the From and To header
fields and the Request-URI; they are ignored if present.
Method: The method of the SIP request can be specified with the
method parameter. This parameter MUST NOT be used in the From
and To header fields and the Request-URI; they are ignored if
present.
Table 2 summarizes where the components of the SIP URL can be used
and what default values they assume if not 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
sip:+1-212-555-1212:1234@gateway.com;user=phone
sip:1212@gateway.com
sip:alice@10.1.2.3
sip:alice@example.com
sip:alice
sip:alice@registrar.com;method=REGISTER
Within a SIP message, URLs are used to indicate the source and
intended destination of a request, redirection addresses and the
current destination of a request. Normally all these fields will
contain SIP URLs.
SIP URLs are case-insensitive, so that for example the two URLs
sip:j.doe@example.com and SIP:J.Doe@Example.com are equivalent. All
URL parameters are included when comparing SIP URLs for equality.
SIP header fields MAY contain non-SIP URLs. As an example, if a call
from a telephone is relayed to the Internet via SIP, the SIP From
header field might contain a phone URL.
3 SIP Message Overview
SIP is a text-based protocol and uses the ISO 10646 character set in
UTF-8 encoding (RFC 2279 [22]). Lines are terminated by CRLF, but
receivers MUST also interpret CR and LF by themselves as line
terminators.
Except for the above difference in character sets, much of the
message syntax is identical to HTTP/1.1; rather than repeating it
here we use [HX.Y] to refer to Section X.Y of the current HTTP/1.1
specification (RFC 2068 [11]). In addition, we describe SIP in both
prose and an augmented Backus-Naur form (BNF) [H2.1] described in
detail in RFC 2234 [23].
Unlike HTTP, SIP MAY use UDP. When sent over TCP or UDP, multiple SIP
transactions can be carried in a single TCP connection or UDP
datagram. UDP datagrams, including all headers, SHOULD NOT be larger
than the path maximum transmission unit (MTU) if the MTU is known, or
1400 bytes if the MTU is unknown.
The 1400 bytes accommodates lower-layer packet headers
within the "typical" MTU of around 1500 bytes. Recent
studies [24] indicate that an MTU of 1500 bytes is a
reasonable assumption. The next lower common MTU values are
1006 bytes for SLIP and 296 for low-delay PPP (RFC 1191
[25]). Thus, another reasonable value would be a message
size of 950 bytes, to accommodate packet headers within the
SLIP MTU without fragmentation.
A SIP message is either a request from a client to a server, or a
response from a server to a client.
+....... cs.columbia.edu .......+ +....... cs.columbia.edu .......+
: : : :
: (~~~~~~~~~~) : : (~~~~~~~~~~) :
: ( location ) : : ( location ) :
: ( service ) : : ( service ) :
: (~~~~~~~~~~) : : (~~~~~~~~~~) :
: ^ | : : ^ | :
: | hgs@lab : : | hgs@lab :
: 2| 3| : : 2| 3| :
: | | : : | | :
skipping to change at page 14, line 5 skipping to change at page 12, line 44
The redirect server shown in Fig. 2 accepts the INVITE request (step The redirect server shown in Fig. 2 accepts the INVITE request (step
1), contacts the location service as before (steps 2 and 3) and, 1), contacts the location service as before (steps 2 and 3) and,
instead of contacting the newly found address itself, returns the instead of contacting the newly found address itself, returns the
address to the caller (step 4), which is then acknowledged via an ACK address to the caller (step 4), which is then acknowledged via an ACK
request (step 5). The caller issues a new request, with the same request (step 5). The caller issues a new request, with the same
call-ID but a higher CSeq, to the address returned by the first call-ID but a higher CSeq, to the address returned by the first
server (step 6). In the example, the call succeeds (step 7). The server (step 6). In the example, the call succeeds (step 7). The
caller and callee complete the handshake with an ACK (step 8). caller and callee complete the handshake with an ACK (step 8).
The next section discusses what happens if the location service
returns more than one possible alternative.
1.4.5 Locating a User
A callee may move between a number of different end systems over
time. These locations can be dynamically registered with the SIP
server (Sections 1.4.7, 4.2.6). A location server MAY also use one or
more other protocols, such as finger (RFC 1288 [17]), rwhois (RFC
2167 [18]), LDAP (RFC 1777 [19]), multicast-based protocols [20] or
operating-system dependent mechanisms to actively determine the end
system where a user might be reachable. A location server MAY return
several locations because the user is logged in at several hosts
simultaneously or because the location server has (temporarily)
inaccurate information. The SIP server combines the results to yield
a list of a zero or more locations.
The action taken on receiving a list of locations varies with the
type of SIP server. A SIP redirect server returns the list to the
client as Contact headers (Section 6.13). A SIP proxy server can
sequentially or in parallel try the addresses until the call is
successful (2xx response) or the callee has declined the call (6xx
response). With sequential attempts, a proxy server can implement an
"anycast" service.
If a proxy server forwards a SIP request, it MUST add itself to the
end of the list of forwarders noted in the Via (Section 6.40)
headers. The Via trace ensures that replies can take the same path
back, ensuring correct operation through compliant firewalls and
avoiding request loops. On the response path, each host MUST remove
its Via, so that routing internal information is hidden from the
callee and outside networks. A proxy server MUST check that it does
not generate a request to a host listed in the Via sent-by, via-
received or via-maddr parameters (Section 6.40). (Note: If a host has
several names or network addresses, this does not always work. Thus,
each host also checks if it is part of the Via list.)
A SIP invitation may traverse more than one SIP proxy server. If one
of these "forks" the request, i.e., issues more than one request in
response to receiving the invitation request, it is possible that a
client is reached, independently, by more than one copy of the
invitation request. Each of these copies bears the same Call-ID. The
user agent MUST return the same status response returned in the first
response. Duplicate requests are not an error.
1.4.6 Changing an Existing Session
In some circumstances, it is desirable to change the parameters of an
existing session. This is done by re-issuing the INVITE, using the
+....... cs.columbia.edu .......+ +....... cs.columbia.edu .......+
: : : :
: (~~~~~~~~~~) : : (~~~~~~~~~~) :
: ( location ) : : ( location ) :
: ( service ) : : ( service ) :
: (~~~~~~~~~~) : : (~~~~~~~~~~) :
: ^ | : : ^ | :
: | hgs@lab : : | hgs@lab :
: 2| 3| : : 2| 3| :
: | | : : | | :
skipping to change at page 14, line 48 skipping to change at page 15, line 4
+...............................+ +...............................+
====> SIP request ====> SIP request
....> SIP response ....> SIP response
^ ^
| non-SIP protocols | non-SIP protocols
| |
Figure 2: Example of SIP redirect server Figure 2: Example of SIP redirect server
same Call-ID, but a new or different body or header fields to convey
the new information. This re INVITE MUST have a higher CSeq than any
previous request from the client to the server.
The next section discusses what happens if the location service For example, two parties may have been conversing and then want to
returns more than one possible alternative. add a third party, switching to multicast for efficiency. One of the
participants invites the third party with the new multicast address
A callee may move between a number of different end systems over and simultaneously sends an INVITE to the second party, with the new
time. These locations can be dynamically registered with the SIP multicast session description, but with the old call identifier.
server (Sections 1.4.7, 4.2.6). A location server MAY also use one or
more other protocols, such as finger (RFC 1288 [18]), rwhois (RFC
2167 [19]), LDAP (RFC 1777 [20]), multicast-based protocols [21] or
operating-system dependent mechanisms to actively determine the end
system where a user might be reachable. A location server MAY return
several locations because the user is logged in at several hosts
simultaneously or because the location server has (temporarily)
inaccurate information. The SIP server combines the results to yield
a list of a zero or more locations. It is RECOMMENDED that each
location server sorts results according to the likelihood of success.
The action taken on receiving a list of locations varies with the
type of SIP server. A SIP redirect server returns the list to the
client as Contact headers (Section 6.13). A SIP proxy server can
sequentially or in parallel try the addresses until the call is
successful (2xx response) or the callee has declined the call (6xx
response). With sequential attempts, a proxy server can implement an
"anycast" service.
If a proxy server forwards a SIP request, it MUST add itself to the
end of the list of forwarders noted in the Via (Section 6.40)
headers. The Via trace ensures that replies can take the same path
back, ensuring correct operation through compliant firewalls and
avoiding request loops. On the response path, each host MUST remove
its Via, so that routing internal information is hidden from the
callee and outside networks. A proxy server MUST check that it does
not generate a request to a host listed in the Via sent-by, via-
received or via-maddr parameters (Section 6.40). (Note: If a host has
several names or network addresses, this does not always work. Thus,
each host also checks if it is part of the Via list.)
A SIP invitation may traverse more than one SIP proxy server. If one
of these "forks" the request, i.e., issues more than one request in
response to receiving the invitation request, it is possible that a
client is reached, independently, by more than one copy of the
invitation request. Each of these copies bears the same Call-ID. The
user agent MUST return the same status response returned in the first
response. Duplicate requests are not an error.
1.4.6 Changing an Existing Session
In some circumstances, it is desirable to change the parameters of an 1.4.7 Registration Services
existing session. For example, two parties may have been conversing
and then want to add a third party, switching to multicast for
efficiency. One of the participants invites the third party with the
new multicast address and simultaneously sends an INVITE to the
second party, with the new multicast session description, but with
the old call identifier.
The REGISTER request allows a client to let a proxy or redirect The REGISTER request allows a client to let a proxy or redirect
server know at which address(es) it can be reached. A client MAY also server know at which address(es) it can be reached. A client MAY also
use it to install call handling features at the server. use it to install call handling features at the server.
1.5 Protocol Properties 1.5 Protocol Properties
1.5.1 Minimal State 1.5.1 Minimal State
A single conference session or call involves one or more SIP A single conference session or call involves one or more SIP
skipping to change at page 16, line 31 skipping to change at page 15, line 42
SIP makes minimal assumptions about the underlying transport and SIP makes minimal assumptions about the underlying transport and
network-layer protocols. The lower-layer can provide either a packet network-layer protocols. The lower-layer can provide either a packet
or a byte stream service, with reliable or unreliable service. or a byte stream service, with reliable or unreliable service.
In an Internet context, SIP is able to utilize both UDP and TCP as In an Internet context, SIP is able to utilize both UDP and TCP as
transport protocols, among others. UDP allows the application to more transport protocols, among others. UDP allows the application to more
carefully control the timing of messages and their retransmission, to carefully control the timing of messages and their retransmission, to
perform parallel searches without requiring TCP connection state for perform parallel searches without requiring TCP connection state for
each outstanding request, and to use multicast. Routers can more each outstanding request, and to use multicast. Routers can more
readily snoop SIP UDP packets. TCP allows easier passage through readily snoop SIP UDP packets. TCP allows easier passage through
existing firewalls, and given the similar protocol design, allows existing firewalls.
common servers for SIP, HTTP and the Real Time Streaming Protocol
(RTSP) (RFC 2326 [4]).
When TCP is used, SIP can use one or more connections to attempt to When TCP is used, SIP can use one or more connections to attempt to
contact a user or to modify parameters of an existing conference. contact a user or to modify parameters of an existing conference.
Different SIP requests for the same SIP call MAY use different TCP Different SIP requests for the same SIP call MAY use different TCP
connections or a single persistent connection, as appropriate. connections or a single persistent connection, as appropriate.
For concreteness, this document will only refer to Internet For concreteness, this document will only refer to Internet
protocols. However, SIP MAY also be used directly with protocols protocols. However, SIP MAY also be used directly with protocols
such as ATM AAL5, IPX, frame relay or X.25. The necessary naming such as ATM AAL5, IPX, frame relay or X.25. The necessary naming
conventions are beyond the scope of this document. User agents SHOULD conventions are beyond the scope of this document. User agents SHOULD
implement both UDP and TCP transport, proxy and redirect servers implement both UDP and TCP transport. Proxy, registrar, and redirect
MUST. servers MUST implement both UDP and TCP transport.
1.5.3 Text-Based 1.5.3 Text-Based
SIP is text-based, using ISO 10646 in UTF-8 encoding throughout. This SIP is text-based, using ISO 10646 in UTF-8 encoding throughout. This
allows easy implementation in languages such as Java, Tcl and Perl, allows easy implementation in languages such as Java, Tcl and Perl,
allows easy debugging, and most importantly, makes SIP flexible and allows easy debugging, and most importantly, makes SIP flexible and
extensible. As SIP is used for initiating multimedia conferences extensible. As SIP is used for initiating multimedia conferences
rather than delivering media data, it is believed that the additional rather than delivering media data, it is believed that the additional
overhead of using a text-based protocol is not significant. overhead of using a text-based protocol is not significant.
2 SIP Uniform Resource Locators
SIP URLs are used within SIP messages to indicate the originator SIP URLs are used within SIP messages to indicate the originator
(From), current destination (Request-URI) and final recipient (To) of (From), current destination (Request-URI) and final recipient (To) of
a SIP request, and to specify redirection addresses (Contact). A SIP a SIP request, and to specify redirection addresses (Contact). A SIP
URL can also be embedded in web pages or other hyperlinks to indicate URL can also be embedded in web pages or other hyperlinks to indicate
that a particular user or service can be called via SIP. When used as that a particular user or service can be called via SIP. When used as
a hyperlink, the SIP URL indicates the use of the INVITE method. a hyperlink, the SIP URL indicates the use of the INVITE method.
The SIP URL scheme is defined to allow setting SIP request-header The SIP URL scheme is defined to allow setting SIP request-header
fields and the SIP message-body. fields and the SIP message-body.
skipping to change at page 17, line 28 skipping to change at page 16, line 42
part of an email message. part of an email message.
A SIP URL follows the guidelines of RFC 2396 [12] and has the syntax A SIP URL follows the guidelines of RFC 2396 [12] and has the syntax
shown in Fig. 3. The syntax is described using Augmented Backus-Naur shown in Fig. 3. The syntax is described using Augmented Backus-Naur
Form (See Section C). Note that reserved characters have to be Form (See Section C). Note that reserved characters have to be
escaped and that the "set of characters reserved within any given URI escaped and that the "set of characters reserved within any given URI
component is defined by that component. In general, a character is component is defined by that component. In general, a character is
reserved if the semantics of the URI changes if the character is reserved if the semantics of the URI changes if the character is
replaced with its escaped US-ASCII encoding" [12]. replaced with its escaped US-ASCII encoding" [12].
The URI character classes referenced above are described in Appendix
C.
The components of the SIP URI have the following meanings.
user: If the host is an Internet telephony gateway, the user field
MAY also encode a telephone number using the notation of
SIP-URL = "sip:" [ userinfo "@" ] hostport SIP-URL = "sip:" [ userinfo "@" ] hostport
url-parameters [ headers ] url-parameters [ headers ]
userinfo = user [ ":" password ] userinfo = user [ ":" password ]
user = *( unreserved | escaped user = *( unreserved | escaped
| ";" | "&" | "=" | "+" | "$" | "," ) | ";" | "&" | "=" | "+" | "$" | "," )
password = *( unreserved | escaped password = *( unreserved | escaped
| ";" | "&" | "=" | "+" | "$" | "," ) | ";" | "&" | "=" | "+" | "$" | "," )
hostport = host [ ":" port ] hostport = host [ ":" port ]
host = hostname | IPv4address host = hostname | IPv4address
hostname = *( domainlabel "." ) toplabel [ "." ] hostname = *( domainlabel "." ) toplabel [ "." ]
domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
toplabel = alpha | alpha *( alphanum | "-" ) alphanum toplabel = alpha | alpha *( alphanum | "-" ) alphanum
IPv4address = 1*digit "." 1*digit "." 1*digit "." 1*digit IPv4address = 1*digit "." 1*digit "." 1*digit "." 1*digit
port = *digit port = *digit
url-parameters = *( ";" url-parameter ) url-parameters = *( ";" url-parameter )
url-parameter = transport-param | user-param url-parameter = transport-param | user-param | method-param
| ttl-param | maddr-param | tag-param | other-param | ttl-param | maddr-param | other-param
transport-param = "transport=" ( "udp" | "tcp" ) transport-param = "transport=" ( "udp" | "tcp" )
ttl-param = "ttl=" ttl ttl-param = "ttl=" ttl
ttl = 1*3DIGIT ; 0 to 255 ttl = 1*3DIGIT ; 0 to 255
maddr-param = "maddr=" host maddr-param = "maddr=" host
user-param = "user=" ( "phone" ) user-param = "user=" ( "phone" | "ip" )
method-param = "method=" Method
tag-param = "tag=" UUID tag-param = "tag=" UUID
UUID = 1*( hex | "-" ) UUID = 1*( hex | "-" )
other-param = ( token $|$ ( token "=" ( token $|$ quoted-string ))) other-param = ( token | ( token "=" ( token | quoted-string )))
hname = *uric headers = "?" header *( "&" header )
header = hname "=" hvalue
hname = 1*uric
hvalue = *uric hvalue = *uric
uric = reserved | unreserved | escaped uric = reserved | unreserved | escaped
reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
"$" | "," "$" | ","
digits = 1*DIGIT digits = 1*DIGIT
Figure 3: SIP URL syntax Figure 3: SIP URL syntax
telephone-subscriber (Fig. 4). The telephone number is a special
case of a user name and cannot be distinguished by a BNF. Thus,
a URL parameter, user, is added to distinguish telephone numbers
from user names. The phone identifier is to be used when
connecting to a telephony gateway. Even without this parameter,
recipients of SIP URLs MAY interpret the pre-@ part as a phone
number if local restrictions on the name space for user name
telephone-subscriber = global-phone-number | local-phone-number telephone-subscriber = global-phone-number | local-phone-number
global-phone-number = "+" 1*phonedigit [isdn-subaddress] global-phone-number = "+" 1*phonedigit [isdn-subaddress]
[post-dial] [post-dial]
local-phone-number = 1*(phonedigit | dtmf-digit | local-phone-number = 1*(phonedigit | dtmf-digit |
pause-character) [isdn-subaddress] pause-character) [isdn-subaddress]
[post-dial] [post-dial]
isdn-subaddress = ";isub=" 1*phonedigit isdn-subaddress = ";isub=" 1*phonedigit
post-dial = ";postd=" 1*(phonedigit | dtmf-digit post-dial = ";postd=" 1*(phonedigit | dtmf-digit
| pause-character) | pause-character)
phonedigit = DIGIT | visual-separator phonedigit = DIGIT | visual-separator
visual-separator = "-" | "." visual-separator = "-" | "."
pause-character = one-second-pause | wait-for-dial-tone pause-character = one-second-pause | wait-for-dial-tone
one-second-pause = "p" one-second-pause = "p"
wait-for-dial-tone = "w" wait-for-dial-tone = "w"
dtmf-digit = "*" | "#" | "A" | "B" | "C" | "D" dtmf-digit = "*" | "#" | "A" | "B" | "C" | "D"
Figure 4: SIP URL syntax; telephone subscriber Figure 4: SIP URL syntax; telephone subscriber
The URI character classes referenced above are described in Appendix
C.
user: If the host is an Internet telephony gateway, the user field
MAY also encode a telephone number using the notation of
telephone-subscriber (Fig. 4). The telephone number is a special
case of a user name and cannot be distinguished by a BNF. Thus,
a URL parameter, user, is added to distinguish telephone numbers
from user names. The phone identifier is to be used when
connecting to a telephony gateway. Even without this parameter,
recipients of SIP URLs MAY interpret the pre-@ part as a phone
number if local restrictions on the name space for user name
allow it. allow it.
If a server handles SIP addresses for another domain, it MUST If a server handles SIP addresses for another domain, it MUST URL-
URL-encode the "@" character (%40). The ";" character MUST be encode the "@" character (%40). The ";" character MUST be URL-
URL-encoded, as otherwise it is not possible to distinguish, in encoded, as otherwise it is not possible to distinguish the case
one parsing pass, the case host;parameter and user;moreuser@host host;parameter and user;moreuser@host in one parsing pass.
the userinfo field. The use of passwords in the userinfo is
NOT RECOMMENDED, because the passing of authentication
information in clear text (such as URIs) has proven to be a
security risk in almost every case where it has been used.
host: The mailto: URL and RFC 822 email addresses require password: The SIP scheme MAY use the format "user:password" in the
that numeric host addresses ("host numbers") are userinfo field. The use of passwords in the userinfo is NOT
enclosed in square brackets (presumably, since host RECOMMENDED, because the passing of authentication information
names might be numeric), while host numbers without in clear text (such as URIs) has proven to be a security risk in
brackets are used for all other URLs. The SIP URL almost every case where it has been used.
requires the latter form, without brackets.
port: If missing, the port number is assumed to be the SIP host: The mailto: URL and RFC 822 email addresses require that
default port, 5060. numeric host addresses ("host numbers") are enclosed in square
brackets (presumably, since host names might be numeric), while
host numbers without brackets are used for all other URLs. The
SIP URL requires the latter form, without brackets.
URL parameters: SIP URLs can define specific parameters of The issue of IPv6 literal addresses in URLs is being looked at
the request. URL parameters are added after the host elsewhere in the IETF. SIP implementers are advised to keep up to
component and are separated by semi-colons. The date on that activity.
transport parameter determines the the transport
mechanism (UDP or TCP). UDP is to be assumed when no port: The port number to send a request to. If not present, the
explicit transport parameter is included. The maddr procedures outlined in Section 1.4.2 are used to determine the
parameter provides the server address to be contacted port number to send a request to.
for this user, overriding the address supplied in the
host field. This address is typically a multicast URL parameters: SIP URLs can define specific parameters of the
address, but could also be the address of a backup request. URL parameters are added after the host component and
server. The ttl parameter determines the time-to-live are separated by semi-colons. The transport parameter determines
value of the UDP multicast packet and MUST only be the the transport mechanism (UDP or TCP). UDP is to be assumed
used if maddr is a multicast address and the transport when no explicit transport parameter is included. The maddr
protocol is UDP. The user parameter was described parameter provides the server address to be contacted for this
above. For example, to specify to call j.doe@big.com user, overriding the address supplied in the host field. This
using multicast to 239.255.255.1 with a ttl of 15, the address is typically a multicast address, but could also be the
following URL would be used: address of a backup server. The ttl parameter determines the
time-to-live value of the UDP multicast packet and MUST only be
used if maddr is a multicast address and the transport protocol
is UDP. The user parameter was described above. For example, to
specify to call j.doe@big.com using multicast to 239.255.255.1
with a ttl of 15, the following URL would be used:
sip:j.doe@big.com;maddr=239.255.255.1;ttl=15 sip:j.doe@big.com;maddr=239.255.255.1;ttl=15
SIP-message = Request | Response The transport, maddr, and ttl parameters MUST NOT be used in the From
and To header fields and the Request-URI; they are ignored if
present.
Both Request (section 4) and Response (section 5) messages use the Headers: Headers of the SIP request can be defined with the "?"
generic-message format of RFC 822 [26] for transferring entities (the mechanism within a SIP URL. The special hname "body" indicates
body of the message). Both types of messages consist of a start-line, that the associated hvalue is the message-body of the SIP INVITE
one or more header fields (also known as "headers"), an empty line request. Headers MUST NOT be used in the From and To header
(i.e., a line with nothing preceding the carriage-return line-feed fields and the Request-URI; they are ignored if present. hname
(CRLF)) indicating the end of the header fields, and an optional and hvalue are encodings of a SIP header name and value,
message-body. To avoid confusion with similar-named headers in HTTP, respectively. All URL reserved characters in the header names
we refer to the headers describing the message body as entity and values MUST be escaped.
headers. These components are described in detail in the upcoming
Method: The method of the SIP request can be specified with the
method parameter. This parameter MUST NOT be used in the From
and To header fields and the Request-URI; they are ignored if
present.
Table 2 summarizes where the components of the SIP URL can be used
and what default values they assume if not 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
sip:+1-212-555-1212:1234@gateway.com;user=phone
default Req.-URI To From Contact external default Req.-URI To From Contact external
user -- x x x x x user -- x x x x x
password -- x x x x password -- x x x x
host mandatory x x x x x host mandatory x x x x x
port 5060 x x x x x port 5060 x x x x x
user-param ip x x x x x user-param ip x x x x x
method INVITE x x method INVITE x x
maddr-param -- x x maddr-param -- x x
ttl-param 1 x x ttl-param 1 x x
transp.-param -- x x transp.-param -- x x
headers -- x x headers -- x x
Table 2: Use and default values of URL components for SIP headers, Table 2: Use and default values of URL components for SIP headers,
Request-URI and references Request-URI and references
sip:1212@gateway.com
sip:alice@10.1.2.3
sip:alice@example.com
sip:alice
sip:alice@registrar.com;method=REGISTER
Within a SIP message, URLs are used to indicate the source and
intended destination of a request, redirection addresses and the
current destination of a request. Normally all these fields will
contain SIP URLs.
SIP URLs are case-insensitive, so that for example the two URLs
sip:j.doe@example.com and SIP:J.Doe@Example.com are equivalent. All
URL parameters are included when comparing SIP URLs for equality.
SIP header fields MAY contain non-SIP URLs. As an example, if a call
from a telephone is relayed to the Internet via SIP, the SIP From
header field might contain a phone URL.
3 SIP Message Overview
SIP is a text-based protocol and uses the ISO 10646 character set in
UTF-8 encoding (RFC 2279 [21]). Senders MUST terminate lines with a
CRLF, but receivers MUST also interpret CR and LF by themselves as
line terminators.
Except for the above difference in character sets, much of the
message syntax is and header fields are identical to HTTP/1.1; rather
than repeating the syntax and semantics here we use [HX.Y] to refer
to Section X.Y of the current HTTP/1.1 specification (RFC 2068 [11]).
In addition, we describe SIP in both prose and an augmented Backus-
Naur form (ABNF). See section C for an overview of ABNF.
Note, however, that SIP is not an extension of HTTP.
Unlike HTTP, SIP MAY use UDP. When sent over TCP or UDP, multiple SIP
transactions can be carried in a single TCP connection or UDP
datagram. UDP datagrams, including all headers, SHOULD NOT be larger
than the path maximum transmission unit (MTU) if the MTU is known, or
1500 bytes if the MTU is unknown.
The 1500 bytes accommodates encapsulation within the
"typical" ethernet MTU without IP fragmentation. Recent
studies [22] indicate that an MTU of 1500 bytes is a
reasonable assumption. The next lower common MTU values are
1006 bytes for SLIP and 296 for low-delay PPP (RFC 1191
[23]). Thus, another reasonable value would be a message
size of 950 bytes, to accommodate packet headers within the
SLIP MTU without fragmentation.
A SIP message is either a request from a client to a server, or a
response from a server to a client.
SIP-message = Request | Response
Both Request (section 4) and Response (section 5) messages use the
generic-message format of RFC 822 [24] for transferring entities (the
body of the message). Both types of messages consist of a start-line,
one or more header fields (also known as "headers"), an empty line
(i.e., a line with nothing preceding the carriage-return line-feed
(CRLF)) indicating the end of the header fields, and an optional
message-body. To avoid confusion with similar-named headers in HTTP,
we refer to the headers describing the message body as entity
headers. These components are described in detail in the upcoming
sections. sections.
generic-message = start-line generic-message = start-line
*message-header *message-header
CRLF CRLF
[ message-body ] [ message-body ]
start-line = Request-Line | ;Section 4.1
start-line = Request-Line | Section 4.1 Status-Line ;Section 5.1
Status-Line Section 5.1
message-header = ( general-header message-header = ( general-header
| request-header | request-header
| response-header | response-header
| entity-header ) | entity-header )
In the interest of robustness, any leading empty line(s) MUST be In the interest of robustness, any leading empty line(s) MUST be
ignored. In other words, if the Request or Response message begins ignored. In other words, if the Request or Response message begins
with a CRLF, CR, or LF, these characters MUST be ignored. with one or more CRLF, CR, or LFs, these characters MUST be ignored.
4 Request 4 Request
The Request message format is shown below: The Request message format is shown below:
Request = Request-Line ; Section 4.1
*( general-header
| request-header
| entity-header )
CRLF
[ message-body ] ; Section 8
4.1 Request-Line
The Request-Line begins with a method token, followed by the
Request-URI and the protocol version, and ending with CRLF. The
elements are separated by SP characters. No CR or LF are allowed
except in the final CRLF sequence.
Request-Line = Method SP Request-URI SP SIP-Version CRLF
4.2 Methods
The methods are defined below. Methods that are not supported by a
proxy or redirect server are treated by that server as if they were
an OPTIONS method and forwarded accordingly. Methods that are not
general-header = Accept ; Section 6.7 general-header = Accept ; Section 6.7
| Accept-Encoding ; Section 6.8 | Accept-Encoding ; Section 6.8
| Accept-Language ; Section 6.9 | Accept-Language ; Section 6.9
| Call-ID ; Section 6.12 | Call-ID ; Section 6.12
| Contact ; Section 6.13 | Contact ; Section 6.13
| CSeq ; Section 6.17 | CSeq ; Section 6.17
| Date ; Section 6.18 | Date ; Section 6.18
| Encryption ; Section 6.19 | Encryption ; Section 6.19
| Expires ; Section 6.20 | Expires ; Section 6.20
| From ; Section 6.21 | From ; Section 6.21
skipping to change at page 21, line 45 skipping to change at page 23, line 44
response-header = Allow ; Section 6.10 response-header = Allow ; Section 6.10
| Proxy-Authenticate ; Section 6.26 | Proxy-Authenticate ; Section 6.26
| Retry-After ; Section 6.32 | Retry-After ; Section 6.32
| Server ; Section 6.34 | Server ; Section 6.34
| Unsupported ; Section 6.38 | Unsupported ; Section 6.38
| Warning ; Section 6.41 | Warning ; Section 6.41
| WWW-Authenticate ; Section 6.42 | WWW-Authenticate ; Section 6.42
Table 3: SIP headers Table 3: SIP headers
Request = Request-Line ; Section 4.1
*( general-header
| request-header
| entity-header )
CRLF
[ message-body ] ; Section 8
4.1 Request-Line
The Request-Line begins with a method token, followed by the
Request-URI and the protocol version, and ending with CRLF. The
elements are separated by SP characters. No CR or LF are allowed
except in the final CRLF sequence.
Request-Line = Method SP Request-URI SP SIP-Version CRLF
4.2 Methods
The methods are defined below. Methods that are not supported by a
proxy or redirect server are treated by that server as if they were
an OPTIONS method and forwarded accordingly. Methods that are not
supported by a user agent server or registrar cause a 501 (Not supported by a user agent server or registrar cause a 501 (Not
Implemented) response to be returned (Section 7). Implemented) response to be returned (Section 7). As in HTTP, the
Method token is case-sensitive.
Method = "INVITE" | "ACK" | "OPTIONS" | "BYE" Method = "INVITE" | "ACK" | "OPTIONS" | "BYE"
| "CANCEL" | "REGISTER" | "CANCEL" | "REGISTER"
4.2.1 INVITE 4.2.1 INVITE
The INVITE method indicates that the user or service is being invited The INVITE method indicates that the user or service is being invited
to participate in a session. The message body contains a description to participate in a session. The message body contains a description
of the session to which the callee is being invited. For two-party of the session to which the callee is being invited. For two-party
calls, the caller indicates the type of media it is able to receive calls, the caller indicates the type of media it is able to receive
skipping to change at page 23, line 43 skipping to change at page 25, line 18
The ACK request MAY contain a message body with the final session The ACK request MAY contain a message body with the final session
description to be used by the callee. If the ACK message body is description to be used by the callee. If the ACK message body is
empty, the callee uses the session description in the INVITE request. empty, the callee uses the session description in the INVITE request.
A proxy server receiving an ACK request after having sent a 3xx, 4xx, A proxy server receiving an ACK request after having sent a 3xx, 4xx,
5xx, or 6xx response must make a determination about whether the ACK 5xx, or 6xx response must make a determination about whether the ACK
is for it, or for some user agent or proxy server further downstream. is for it, or for some user agent or proxy server further downstream.
This determination is made by examining the tag in the To field. If This determination is made by examining the tag in the To field. If
the tag in the ACK To header field matches the tag in the To header the tag in the ACK To header field matches the tag in the To header
field of the response, the ACK is meant for the proxy server. field of the response, and the From, CSeq and Call-ID header fields
Otherwise, the ACK SHOULD be proxied downstream as any other request. in the response match those in the ACK, the ACK is meant for the
proxy server. Otherwise, the ACK SHOULD be proxied downstream as any
other request.
It is possible for a user agent client or proxy server to It is possible for a user agent client or proxy server to
receive multiple 3xx, 4xx, 5xx, and 6xx responses to a receive multiple 3xx, 4xx, 5xx, and 6xx responses to a
request along a single branch. This can happen under request along a single branch. This can happen under
various error conditions, typically when a forking proxy various error conditions, typically when a forking proxy
transitions from stateful to stateless before receiving all transitions from stateful to stateless before receiving all
responses. The various responses will all be identical, responses. The various responses will all be identical,
except for the tag in the To field, which is different for except for the tag in the To field, which is different for
each one. It can therefore be used as a means to each one. It can therefore be used as a means to
disambiguate them. disambiguate them.
skipping to change at page 25, line 47 skipping to change at page 27, line 25
4.2.6 REGISTER 4.2.6 REGISTER
A client uses the REGISTER method to register the address listed in A client uses the REGISTER method to register the address listed in
the To header field with a SIP server. the To header field with a SIP server.
A user agent MAY register with a local server on startup by sending a A user agent MAY register with a local server on startup by sending a
REGISTER request to the well-known "all SIP servers" multicast REGISTER request to the well-known "all SIP servers" multicast
address "sip.mcast.net" (224.0.1.75). This request SHOULD be scoped address "sip.mcast.net" (224.0.1.75). This request SHOULD be scoped
to ensure it is not forwarded beyond the boundaries of the to ensure it is not forwarded beyond the boundaries of the
administrative system. This MAY be done with either TTL or administrative system. This MAY be done with either TTL or
administrative scopes[27], depending on what is implemented in the administrative scopes[25], depending on what is implemented in the
network. However, use of administrative scoping is RECOMMENDED. SIP network. SIP user agents MAY listen to that address and use it to
user agents MAY listen to that address and use it to become aware of become aware of the location of other local users [20]; however, they
the location of other local users [21]; however, they do not respond do not respond to the request. A user agent MAY also be configured
to the request. A user agent MAY also be configured with the address with the address of a registrar server to which it sends a REGISTER
of a registrar server to which it sends a REGISTER request upon request upon startup.
startup.
Requests are processed in the order received. Clients SHOULD avoid Requests are processed in the order received. Clients SHOULD avoid
sending a new registration (as opposed to a retransmission) until sending a new registration (as opposed to a retransmission) until
they have received the response from the server for the previous one. they have received the response from the server for the previous one.
Clients may register from different locations, by necessity Clients may register from different locations, by necessity
using different Call-ID values. Thus, the CSeq value cannot using different Call-ID values. Thus, the CSeq value cannot
be used to enforce ordering. Since registrations are be used to enforce ordering. Since registrations are
additive, ordering is less of a problem than if each additive, ordering is less of a problem than if each
REGISTER request completely replaced all earlier ones. REGISTER request completely replaced all earlier ones.
skipping to change at page 27, line 45 skipping to change at page 29, line 22
This allows a service known as "directed pick-up". In the This allows a service known as "directed pick-up". In the
telephone network, directed pickup permits a user at a telephone network, directed pickup permits a user at a
remote station who hears his own phone ringing to pick up remote station who hears his own phone ringing to pick up
at that station, dial an access code, and be connected to at that station, dial an access code, and be connected to
the calling user as if he had answered his own phone. the calling user as if he had answered his own phone.
A server MAY choose any duration for the registration lifetime. A server MAY choose any duration for the registration lifetime.
Registrations not refreshed after this amount of time SHOULD be Registrations not refreshed after this amount of time SHOULD be
silently discarded. Responses to a registration SHOULD include an silently discarded. Responses to a registration SHOULD include an
Expires header (Section 6.20), indicating the time at which the Expires header (Section 6.20) or expires Contact parameters (Section
server will drop the registration. If none is present, one hour is 6.13), indicating the time at which the server will drop the
assumed. Clients MAY request a registration lifetime by indicating registration. If none is present, one hour is assumed. Clients MAY
the time in an Expires header in the request. A server SHOULD NOT use request a registration lifetime by indicating the time in an Expires
a higher lifetime than the one requested, but MAY use a lower one. A header in the request. A server SHOULD NOT use a higher lifetime than
single address (if host-independent) MAY be registered from several the one requested, but MAY use a lower one. A single address (if
different clients. host-independent) MAY be registered from several different clients.
A client cancels an existing registration by sending a REGISTER A client cancels an existing registration by sending a REGISTER
request with an expiration time (Expires) of zero seconds for a request with an expiration time (Expires) of zero seconds for a
particular Contact or the wildcard Contact designated by a "*" for particular Contact or the wildcard Contact designated by a "*" for
all registrations. Registrations are matched based on the user, host, all registrations. Registrations are matched based on the user, host,
port and maddr parameters. port and maddr parameters.
The server SHOULD return the current list of registrations in the 200 The server SHOULD return the current list of registrations in the 200
response as Contact header fields. response as Contact header fields.
skipping to change at page 29, line 5 skipping to change at page 30, line 27
to the callee, e.g., from the Contact header field of a to the callee, e.g., from the Contact header field of a
response to a previous request, the To would still contain response to a previous request, the To would still contain
the long-term, "public" address, while the Request-URI the long-term, "public" address, while the Request-URI
would be set to the cached address. would be set to the cached address.
Proxy and redirect servers MAY use the information in the Request-URI Proxy and redirect servers MAY use the information in the Request-URI
and request header fields to handle the request and possibly rewrite and request header fields to handle the request and possibly rewrite
the Request-URI. For example, a request addressed to the generic the Request-URI. For example, a request addressed to the generic
address sip:sales@acme.com is proxied to the particular person, e.g., 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:bob@ny.acme.com , with the To field remaining as
sip:sales@acme.com ny.acme.com , Bob then designates Alice as the sip:sales@acme.com. At ny.acme.com , Bob then designates Alice as
temporary substitute. the temporary substitute.
The host part of the Request-URI typically agrees with one of the The host part of the Request-URI typically agrees with one of the
host names of the receiving server. If it does not, the server SHOULD host names of the receiving server. If it does not, the server SHOULD
proxy the request to the address indicated or return a 404 (Not proxy the request to the address indicated or return a 404 (Not
Found) response if it is unwilling or unable to do so. For example, Found) response if it is unwilling or unable to do so. For example,
the Request-URI and server host name can disagree in the case of a the Request-URI and server host name can disagree in the case of a
firewall proxy that handles outgoing calls. This mode of operation firewall proxy that handles outgoing calls. This mode of operation is
similar to that of HTTP proxies. similar to that of HTTP proxies.
If a SIP server receives a request with a URI indicating a scheme If a SIP server receives a request with a URI indicating a scheme
other than SIP which that server does not understand, the server MUST other than SIP which that server does not understand, the server MUST
return a 400 (Bad Request) response. It MUST do this even if the To return a 400 (Bad Request) response. It MUST do this even if the To
header field contains a scheme it does understand. This is because header field contains a scheme it does understand. This is because
proxies are responsible for processing the Request-URI; the To field proxies are responsible for processing the Request-URI; the To field
is of end to end significance. is of end-to-end significance.
4.3.1 SIP Version 4.3.1 SIP Version
Both request and response messages include the version of SIP in use, Both request and response messages include the version of SIP in use,
and basically follow [H3.1], with HTTP replaced by SIP. To be and follow [H3.1] (with HTTP replaced by SIP, and HTTP/1.1 replaced
compliant with this specification, applications sending SIP messages by SIP/2.0) regarding version ordering, compliance requirements, and
MUST include a SIP-Version of "SIP/2.0". upgrading of version numbers. To be compliant with this
specification, applications sending SIP messages MUST include a SIP-
Version of "SIP/2.0".
4.4 Option Tags 4.4 Option Tags
Option tags are unique identifiers used to designate new options in Option tags are unique identifiers used to designate new options in
SIP. These tags are used in Require (Section 6.30) and Unsupported SIP. These tags are used in Require (Section 6.30) and Unsupported
(Section 6.38) fields. (Section 6.38) fields.
Syntax: Syntax:
option-tag = token option-tag = token
See Section C for a definition of token. The creator of a new SIP See Section C for a definition of token. The creator of a new SIP
option MUST either prefix the option with their reverse domain name option MUST either prefix the option with their reverse domain name
or register the new option with the Internet Assigned Numbers or register the new option with the Internet Assigned Numbers
Authority (IANA). For example, "com.foo.mynewfeature" is an apt name Authority (IANA). For example, "com.foo.mynewfeature" is an apt name
for a feature whose inventor can be reached at "foo.com". Individual for a feature whose inventor can be reached at "foo.com". Individual
organizations are then responsible for ensuring that option names organizations are then responsible for ensuring that option names
don't collide. Options registered with IANA have the prefix don't collide. Options registered with IANA have the prefix
"org.ietf.sip.", options described in RFCs have the prefix "org.iana.sip.", options described in RFCs have the prefix
"org.ietf.rfc.N", where N is the RFC number. Option tags are case- "org.ietf.rfc.N", where N is the RFC number. Option tags are case-
insensitive. insensitive.
4.4.1 Registering New Option Tags with IANA 4.4.1 Registering New Option Tags with IANA
When registering a new SIP option, the following information MUST be When registering a new SIP option, the following information MUST be
provided: provided:
o Name and description of option. The name MAY be of any length, o Name and description of option. The name MAY be of any length,
but SHOULD be no more than twenty characters long. The name but SHOULD be no more than twenty characters long. The name
MUST consist of alphanum (See Figure 3 characters only. MUST consist of alphanum (See Figure 3) characters only;
o Indication of who has change control over the option (for o Indication of who has change control over the option (for
example, IETF, ISO, ITU-T, other international standardization example, IETF, ISO, ITU-T, other international standardization
bodies, a consortium or a particular company or group of bodies, a consortium or a particular company or group of
companies); companies);
o A reference to a further description, if available, for o A reference to a further description, if available, for
example (in order of preference) an RFC, a published paper, a example (in order of preference) an RFC, a published paper, a
patent filing, a technical report, documented source code or a patent filing, a technical report, documented source code or a
computer manual; computer manual;
o Contact information (postal and email address); o Contact information (postal and email address);
This procedure has been borrowed from RTSP [4] and the RTP
Borrowed from RTSP and the RTP AVP. AVP [26].
5 Response 5 Response
After receiving and interpreting a request message, the recipient After receiving and interpreting a request message, the recipient
responds with a SIP response message. The response message format is responds with a SIP response message. The response message format is
shown below: shown below:
Response = Status-Line ; Section 5.1 Response = Status-Line ; Section 5.1
*( general-header *( general-header
| response-header | response-header
| entity-header ) | entity-header )
CRLF CRLF
[ message-body ] ; Section 8 [ message-body ] ; Section 8
[H6] applies except that HTTP-Version is replaced by SIP-Version. SIP's structure of responses is similar to [H6], but is defined
Also, SIP defines additional response codes and does not use some explicitly here.
HTTP codes.
5.1 Status-Line 5.1 Status-Line
The first line of a Response message is the Status-Line, consisting The first line of a Response message is the Status-Line, consisting
of the protocol version (Section 4.3.1) followed by a numeric of the protocol version (Section 4.3.1) followed by a numeric
Status-Code and its associated textual phrase, with each element Status-Code and its associated textual phrase, with each element
separated by SP characters. No CR or LF is allowed except in the separated by SP characters. No CR or LF is allowed except in the
final CRLF sequence. final CRLF sequence.
Status-Line = SIP-version SP Status-Code SP Reason-Phrase CRLF Status-Line = SIP-version SP Status-Code SP Reason-Phrase CRLF
5.1.1 Status Codes and Reason Phrases 5.1.1 Status Codes and Reason Phrases
The Status-Code is a 3-digit integer result code that indicates the The Status-Code is a 3-digit integer result code that indicates the
outcome of the attempt to understand and satisfy the request. The outcome of the attempt to understand and satisfy the request. The
Reason-Phrase is intended to give a short textual description of the Reason-Phrase is intended to give a short textual description of the
Status-Code. The Status-Code is intended for use by automata, whereas Status-Code. The Status-Code is intended for use by automata, whereas
the Reason-Phrase is intended for the human user. The client is not the Reason-Phrase is intended for the human user. The client is not
required to examine or display the Reason-Phrase. required to examine or display the Reason-Phrase.
Status-Code = Informational Fig. 5 Status-Code = Informational ;Fig. 5
| Success Fig. 5 | Success ;Fig. 5
| Redirection Fig. 6 | Redirection ;Fig. 6
| Client-Error Fig. 7 | Client-Error ;Fig. 7
| Server-Error Fig. 8 | Server-Error ;Fig. 8
| Global-Failure Fig. 9 | Global-Failure ;Fig. 9
| extension-code | extension-code
extension-code = 3DIGIT extension-code = 3DIGIT
Reason-Phrase = *<TEXT, excluding CR, LF> Reason-Phrase = *<TEXT-UTF8, excluding CR, LF>
We provide an overview of the Status-Code below, and provide full We provide an overview of the Status-Code below, and provide full
definitions in Section 7. The first digit of the Status-Code defines definitions in Section 7. The first digit of the Status-Code defines
the class of response. The last two digits do not have any the class of response. The last two digits do not have any
categorization role. SIP/2.0 allows 6 values for the first digit: categorization role. SIP/2.0 allows 6 values for the first digit:
1xx: Informational -- request received, continuing to process the 1xx: Informational -- request received, continuing to process the
request; request;
2xx: Success -- the action was successfully received, understood, and 2xx: Success -- the action was successfully received, understood, and
skipping to change at page 32, line 41 skipping to change at page 34, line 19
status. status.
Informational = "100" ; Trying Informational = "100" ; Trying
| "180" ; Ringing | "180" ; Ringing
| "181" ; Call Is Being Forwarded | "181" ; Call Is Being Forwarded
| "182" ; Queued | "182" ; Queued
Success = "200" ; OK Success = "200" ; OK
Figure 5: Informational and success status codes Figure 5: Informational and success status codes
6 Header Field Definitions
Redirection = "300" ; Multiple Choices Redirection = "300" ; Multiple Choices
| "301" ; Moved Permanently | "301" ; Moved Permanently
| "302" ; Moved Temporarily | "302" ; Moved Temporarily
| "303" ; See Other | "303" ; See Other
| "305" ; Use Proxy | "305" ; Use Proxy
| "380" ; Alternative Service | "380" ; Alternative Service
Figure 6: Redirection status codes Figure 6: Redirection status codes
6 Header Field Definitions
SIP header fields are similar to HTTP header fields in both syntax
and semantics. In particular, SIP header fields follow the syntax for
message-header as described in [H4.2]. The rules for extending header
fields over multiple lines, and use of multiple message-header fields
with the same field-name, described in [H4.2] also apply to SIP. The
rules in [H4.2] regarding ordering of header fields apply to SIP,
with the exception of Via fields, see below, whose order matters.
Additionally, header fields which are hop-by-hop MUST appear before
any header fields which are end-to-end. Proxies SHOULD NOT reorder
Client-Error = "400" ; Bad Request Client-Error = "400" ; Bad Request
| "401" ; Unauthorized | "401" ; Unauthorized
| "402" ; Payment Required | "402" ; Payment Required
| "403" ; Forbidden | "403" ; Forbidden
| "404" ; Not Found | "404" ; Not Found
| "405" ; Method Not Allowed | "405" ; Method Not Allowed
| "406" ; Not Acceptable | "406" ; Not Acceptable
| "407" ; Proxy Authentication Required | "407" ; Proxy Authentication Required
| "408" ; Request Timeout | "408" ; Request Timeout
| "409" ; Conflict | "409" ; Conflict
| "410" ; Gone | "410" ; Gone
| "411" ; Length Required | "411" ; Length Required
| "413" ; Request Message Body Too Large | "413" ; Request Entity Too Large
| "414" ; Request-URI Too Large | "414" ; Request-URI Too Large
| "415" ; Unsupported Media Type | "415" ; Unsupported Media Type
| "420" ; Bad Extension | "420" ; Bad Extension
| "480" ; Temporarily not available | "480" ; Temporarily not available
| "481" ; Call Leg/Transaction Does Not Exist | "481" ; Call Leg/Transaction Does Not Exist
| "482" ; Loop Detected | "482" ; Loop Detected
| "483" ; Too Many Hops | "483" ; Too Many Hops
| "484" ; Address Incomplete | "484" ; Address Incomplete
| "485" ; Ambiguous | "485" ; Ambiguous
| "486" ; Busy Here | "486" ; Busy Here
Figure 7: Client error status codes Figure 7: Client error status codes
SIP header fields are similar to HTTP header fields in both syntax
and semantics [H4.2, H14]. In general, the ordering of the header
fields is not of importance (with the exception of Via fields, see
below). The only requirement is that header fields which are hop-by-
hop MUST appear before any header fields which are end-to-end.
Server-Error = "500" ; Internal Server Error Server-Error = "500" ; Internal Server Error
| "501" ; Not Implemented | "501" ; Not Implemented
| "502" ; Bad Gateway | "502" ; Bad Gateway
| "503" ; Service Unavailable | "503" ; Service Unavailable
| "504" ; Gateway Timeout | "504" ; Gateway Time-out
| "505" ; SIP Version not supported | "505" ; SIP Version not supported
Figure 8: Server error status codes Figure 8: Server error status codes
header fields. Proxies add Via header fields and MAY add other hop-
by-hop header fields. They can modify certain header fields, such as
Max-Forwards 6.23 and "fix up" the Via header fields with "received"
parameters as described in Section 6.40.1. Proxies MUST NOT alter any
fields that are authenticated (see Section 13.2).
Global-Failure | "600" ; Busy Everywhere Global-Failure | "600" ; Busy Everywhere
| "603" ; Decline | "603" ; Decline
| "604" ; Does not exist anywhere | "604" ; Does not exist anywhere
| "606" ; Not Acceptable | "606" ; Not Acceptable
Figure 9: Global failure status codes Figure 9: Global failure status codes
Proxies MUST NOT reorder or otherwise modify header fields other than
by adding a new Via header field, adding another hop-by-hop header
field or fixing up the Via header fields with "received" parameters
as described in Section 6.40.1. Proxies MUST NOT, for example,
change how header fields are broken across lines. This allows an
authentication field to be added after the Via header fields that
will not be invalidated by proxies.
The header fields required, optional and not applicable for each The header fields required, optional and not applicable for each
method are listed in Table 4 and Table 5. The table uses "o" to method are listed in Table 4 and Table 5. The table uses "o" to
indicate optional, "m" mandatory and "-" for not applicable. A "*" indicate optional, "m" mandatory and "-" for not applicable. A "*"
indicates that the header fields are needed only if message body is indicates that the header fields are needed only if message body is
not empty: The Content-Type and Content-Length header fields are not empty. See sections 6.15, 6.16 and 8 for details.
required when there is a valid message body (of non-zero length)
associated with the message (Section 8).
The "where" column describes the request and response types with The "where" column describes the request and response types with
which the header field can be used. "R" refers to header fields that which the header field can be used. "R" refers to header fields that
can be used in requests (that is, request and general header fields). can be used in requests (that is, request and general header fields).
"r" designates a response or general-header field as applicable to "r" designates a response or general-header field as applicable to
all responses, while a list of numeric values indicates the status all responses, while a list of numeric values indicates the status
codes with which the header field can be used. "g" and "e" designate codes with which the header field can be used. "g" and "e" designate
general (Section 6.1) and entity header (Section 6.2) fields, general (Section 6.1) and entity header (Section 6.2) fields,
respectively. If a header field is marked "c", it is copied from the respectively. If a header field is marked "c", it is copied from the
request to the response. request to the response.
The "enc." column describes whether this message header field MAY be The "enc." column describes whether this message header field MAY be
encrypted end-to-end. A "n" designates fields that MUST NOT be encrypted end-to-end. A "n" designates fields that MUST NOT be
encrypted, while "c" designates fields that SHOULD be encrypted if encrypted, while "c" designates fields that SHOULD be encrypted if
encryption is used. encryption is used.
The "e-e" column has a value of "e" for end-to-end and a value of "h" The "e-e" column has a value of "e" for end-to-end and a value of "h"
for hop-by-hop header fields. for hop-by-hop header fields.
Other header fields can be added as required; a server MUST ignore
header fields not defined in this specification that it does not
understand. A proxy MUST NOT remove or modify header fields not
defined in this specification that it does not understand. A compact
form of these header fields is also defined in Section 9 for use over
UDP when the request has to fit into a single packet and size is an
issue.
Table 6 in Appendix A lists those header fields that different client
and server types MUST be able to parse.
where enc. e-e ACK BYE CAN INV OPT REG where enc. e-e ACK BYE CAN INV OPT REG
__________________________________________________________________________ __________________________________________________________
Accept R e - - - o o o Accept R e - - - o o o
Accept 415 e - - - o o o Accept 415 e - - - o o o
Accept-Encoding R e - - - o o o Accept-Encoding R e - - - o o o
Accept-Encoding 415 e - - - o o o Accept-Encoding 415 e - - - o o o
Accept-Language R e - o o o o o Accept-Language R e - o o o o o
Accept-Language 415 e - o o o o o Accept-Language 415 e - o o o o o
Allow 200 e - - - - m - Allow 200 e - - - - m -
Allow 405 e o o o o o o Allow 405 e o o o o o o
Authorization R e o o o o o o Authorization R e o o o o o o
Call-ID gc n e m m m m m m Call-ID gc n e m m m m m m
skipping to change at page 35, line 45 skipping to change at page 37, line 36
Date g e o o o o o o Date g e o o o o o o
Encryption g n e o o o o o o Encryption g n e o o o o o o
Expires g e - - - o - o Expires g e - - - o - o
From gc n e m m m m m m From gc n e m m m m m m
Hide R n h o o o o o o Hide R n h o o o o o o
Max-Forwards R n e o o o o o o Max-Forwards R n e o o o o o o
Organization g c h - - - o o o Organization g c h - - - o o o
Table 4: Summary of header fields, A--O Table 4: Summary of header fields, A--O
Other header fields can be added as required; a server MUST ignore 6.1 General Header Fields
optional header fields that it does not understand. A compact form of
these header fields is also defined in Section 9 for use over UDP General header fields apply to both request and response messages.
when the request has to fit into a single packet and size is an The "general-header" field names can be extended reliably only in
combination with a change in the protocol version. However, new or
experimental header fields MAY be given the semantics of general
header fields if all parties in the communication recognize them to
be "general-header" fields. Unrecognized header fields are treated as
"entity-header" fields.
6.2 Entity Header Fields
The "entity-header" fields define meta-information about the
message-body or, if no body is present, about the resource identified
by the request. The term "entity header" is an HTTP 1.1 term where
the response body can contain a transformed version of the message
where enc. e-e ACK BYE CAN INV OPT REG where enc. e-e ACK BYE CAN INV OPT REG
________________________________________________________________________ ___________________________________________________________________
Proxy-Authenticate 407 n h o o o o o o Proxy-Authenticate 407 n h o o o o o o
Proxy-Authorization R n h o o o o o o Proxy-Authorization R n h o o o o o o
Proxy-Require R n h o o o o o o Proxy-Require R n h o o o o o o
Priority R c e - - - o - - Priority R c e - - - o - -
Require R e o o o o o o Require R e o o o o o o
Retry-After R c e - - - - - o Retry-After R c e - - - - - o
Retry-After 404,480,486 c e o o o o o o Retry-After 404,480,486 c e o o o o o o
503 c e o o o o o o 503 c e o o o o o o
600,603 c e o o o o o o 600,603 c e o o o o o o
Response-Key R c e - o o o o o Response-Key R c e - o o o o o
skipping to change at page 36, line 32 skipping to change at page 38, line 32
To gc(1) n e m m m m m m To gc(1) n e m m m m m m
Unsupported 420 e o o o o o o Unsupported 420 e o o o o o o
User-Agent g c e o o o o o o User-Agent g c e o o o o o o
Via gc(2) n e m m m m m m Via gc(2) n e m m m m m m
Warning r e o o o o o o Warning r e o o o o o o
WWW-Authenticate 401 c e o o o o o o WWW-Authenticate 401 c e o o o o o o
Table 5: Summary of header fields, P--Z; (1): copied with possible Table 5: Summary of header fields, P--Z; (1): copied with possible
addition of tag; (2): UAS removes first Via header field addition of tag; (2): UAS removes first Via header field
issue.
Table 6 in Appendix A lists those header fields that different client
and server types MUST be able to parse.
6.1 General Header Fields
General header fields apply to both request and response messages.
The "general-header" field names can be extended reliably only in
combination with a change in the protocol version. However, new or
experimental header fields MAY be given the semantics of general
header fields if all parties in the communication recognize them to
be "general-header" fields. Unrecognized header fields are treated as
"entity-header" fields.
6.2 Entity Header Fields
The "entity-header" fields define meta-information about the
message-body or, if no body is present, about the resource identified
by the request. The term "entity header" is an HTTP 1.1 term where
the response body can contain a transformed version of the message
body. The original message body is referred to as the "entity". We body. The original message body is referred to as the "entity". We
retain the same terminology for header fields but usually refer to retain the same terminology for header fields but usually refer to
the "message body" rather then the entity as the two are the same in the "message body" rather then the entity as the two are the same in
SIP. SIP.
6.3 Request Header Fields 6.3 Request Header Fields
The "request-header" fields allow the client to pass additional The "request-header" fields allow the client to pass additional
information about the request, and about the client itself, to the information about the request, and about the client itself, to the
server. These fields act as request modifiers, with semantics server. These fields act as request modifiers, with semantics
skipping to change at page 37, line 49 skipping to change at page 39, line 28
6.5 End-to-end and Hop-by-hop Headers 6.5 End-to-end and Hop-by-hop Headers
End-to-end headers MUST be transmitted unmodified across all proxies, End-to-end headers MUST be transmitted unmodified across all proxies,
while hop-by-hop headers MAY be modified or added by proxies. while hop-by-hop headers MAY be modified or added by proxies.
6.6 Header Field Format 6.6 Header Field Format
Header fields ("general-header", "request-header", "response-header", Header fields ("general-header", "request-header", "response-header",
and "entity-header") follow the same generic header format as that and "entity-header") follow the same generic header format as that
given in Section 3.1 of RFC 822 [26]. Each header field consists of a given in Section 3.1 of RFC 822 [24]. Each header field consists of a
name followed by a colon (":") and the field value. Field names are name followed by a colon (":") and the field value. Field names are
case-insensitive. The field value MAY be preceded by any amount of case-insensitive. The field value MAY be preceded by any amount of
leading white space (LWS), though a single space (SP) is preferred. leading white space (LWS), though a single space (SP) is preferred.
Header fields can be extended over multiple lines by preceding each Header fields can be extended over multiple lines by preceding each
extra line with at least one SP or horizontal tab (HT). Applications extra line with at least one SP or horizontal tab (HT). Applications
MUST follow HTTP "common form" when generating these constructs, MUST follow HTTP "common form" when generating these constructs,
since there might exist some implementations that fail to accept since there might exist some implementations that fail to accept
anything beyond the common forms. anything beyond the common forms.
message-header = field-name ":" [ field-value ] CRLF message-header = field-name ":" [ field-value ] CRLF
field-name = token field-name = token
field-value = *( field-content | LWS ) field-value = *( field-content | LWS )
field-content = < the OCTETs making up the field-value field-content = < the OCTETs making up the field-value
and consisting of either *TEXT and consisting of either *TEXT-UTF8
or combinations of token, or combinations of token,
tspecials, and quoted-string> tspecials, and quoted-string>
The relative order of header fields with different field names is not The relative order of header fields with different field names is not
significant. Multiple header fields with the same field-name may be significant. Multiple header fields with the same field-name may be
present in a message if and only if the entire field-value for that present in a message if and only if the entire field-value for that
header field is defined as a comma-separated list (i.e., #(values)). header field is defined as a comma-separated list (i.e., #(values)).
It MUST be possible to combine the multiple header fields into one It MUST be possible to combine the multiple header fields into one
"field-name: field-value" pair, without changing the semantics of the "field-name: field-value" pair, without changing the semantics of the
message, by appending each subsequent field-value to the first, each message, by appending each subsequent field-value to the first, each
separated by a comma. The order in which header fields with the same separated by a comma. The order in which header fields with the same
field-name are received is therefore significant to the field-name are received is therefore significant to the
interpretation of the combined field value, and thus a proxy MUST NOT interpretation of the combined field value, and thus a proxy MUST NOT
change the order of these field values when a message is forwarded. change the order of these field values when a message is forwarded.
Field names are not case-sensitive, although their values may be. Field names are not case-sensitive, although their values may be.
skipping to change at page 38, line 35 skipping to change at page 40, line 17
message, by appending each subsequent field-value to the first, each message, by appending each subsequent field-value to the first, each
separated by a comma. The order in which header fields with the same separated by a comma. The order in which header fields with the same
field-name are received is therefore significant to the field-name are received is therefore significant to the
interpretation of the combined field value, and thus a proxy MUST NOT interpretation of the combined field value, and thus a proxy MUST NOT
change the order of these field values when a message is forwarded. change the order of these field values when a message is forwarded.
Field names are not case-sensitive, although their values may be. Field names are not case-sensitive, although their values may be.
6.7 Accept 6.7 Accept
See [H14.1] for syntax. This request-header field is used only with The Accept header follows the syntax defined in [H14.1]. The
the INVITE, OPTIONS and REGISTER request methods to indicate what semantics are also identical, with the exception that if no Accept
media types are acceptable in the response. header is present, the server SHOULD assume a default value of
application/sdp.
This request-header field is used only with the INVITE, OPTIONS and
REGISTER request methods to indicate what media types are acceptable
in the response.
Example: Example:
Accept: application/sdp;level=1, application/x-private, text/html Accept: application/sdp;level=1, application/x-private, text/html
6.8 Accept-Encoding 6.8 Accept-Encoding
The Accept-Encoding request-header field is similar to Accept, but The Accept-Encoding request-header field is similar to Accept, but
restricts the content-codings [H3.4.1] that are acceptable in the restricts the content-codings [H3.4.1] that are acceptable in the
response. See [H14.3]. response. See [H14.3]. The syntax of this header is defined in
[H14.3]. The semantics in SIP are identical to those defined in
[H14.3].
6.9 Accept-Language 6.9 Accept-Language
See [H14.4] for syntax. The Accept-Language request-header field can The Accept-Language header follows the syntax defined in [H14.4]. The
be used to allow the client to indicate to the server in which rules for ordering the languages based on the q parameter apply to
language it would prefer to receive reason phrases, session SIP as well. When used in SIP, the Accept-Language request-header
field can be used to allow the client to indicate to the server in
which language it would prefer to receive reason phrases, session
descriptions or status responses carried as message bodies. A proxy descriptions or status responses carried as message bodies. A proxy
MAY use this field to help select the destination for the call, for MAY use this field to help select the destination for the call, for
example, a human operator conversant in a language spoken by the example, a human operator conversant in a language spoken by the
caller. caller.
Example: Example:
Accept-Language: da, en-gb;q=0.8, en;q=0.7 Accept-Language: da, en-gb;q=0.8, en;q=0.7
6.10 Allow 6.10 Allow
skipping to change at page 39, line 33 skipping to change at page 41, line 21
The Allow entity-header field lists the set of methods supported by The Allow entity-header field lists the set of methods supported by
the resource identified by the Request-URI. The purpose of this field the resource identified by the Request-URI. The purpose of this field
is strictly to inform the recipient of valid methods associated with is strictly to inform the recipient of valid methods associated with
the resource. An Allow header field MUST be present in a 405 (Method the resource. An Allow header field MUST be present in a 405 (Method
Not Allowed) response and SHOULD be present in an OPTIONS response. Not Allowed) response and SHOULD be present in an OPTIONS response.
Allow = "Allow" ":" 1#Method Allow = "Allow" ":" 1#Method
6.11 Authorization 6.11 Authorization
See [H14.8].
A user agent that wishes to authenticate itself with a server -- A user agent that wishes to authenticate itself with a server --
usually, but not necessarily, after receiving a 401 response -- MAY usually, but not necessarily, after receiving a 401 response -- MAY
do so by including an Authorization request-header field with the do so by including an Authorization request-header field with the
request. The Authorization field value consists of credentials request. The Authorization field value consists of credentials
containing the authentication information of the user agent for the containing the authentication information of the user agent for the
realm of the resource being requested. realm of the resource being requested.
Section 13.2 overviews the use of the Authorization header, and
section 15 describes the syntax and semantics when used with PGP
based authentication.
6.12 Call-ID 6.12 Call-ID
The Call-ID general-header field uniquely identifies a particular The Call-ID general-header field uniquely identifies a particular
invitation or all registrations of a particular client. Note that a invitation or all registrations of a particular client. Note that a
single multimedia conference can give rise to several calls with single multimedia conference can give rise to several calls with
different Call-IDs, e.g., if a user invites a single individual different Call-IDs, e.g., if a user invites a single individual
several times to the same (long-running) conference. several times to the same (long-running) conference.
For an INVITE request, a callee user agent server SHOULD NOT alert For an INVITE request, a callee user agent server SHOULD NOT alert
the user if the user has responded previously to the Call-ID in the the user if the user has responded previously to the Call-ID in the
skipping to change at page 40, line 26 skipping to change at page 42, line 15
conference parameters have been changed and accept the invitation conference parameters have been changed and accept the invitation
automatically or it MAY require user confirmation. automatically or it MAY require user confirmation.
A user may be invited to the same conference or call using several A user may be invited to the same conference or call using several
different Call-IDs. If desired, the client MAY use identifiers within different Call-IDs. If desired, the client MAY use identifiers within
the session description to detect this duplication. For example, SDP the session description to detect this duplication. For example, SDP
contains a session id and version number in the origin (o) field. contains a session id and version number in the origin (o) field.
The REGISTER and OPTIONS methods use the Call-ID value to The REGISTER and OPTIONS methods use the Call-ID value to
unambiguously match requests and responses. All REGISTER requests unambiguously match requests and responses. All REGISTER requests
issued by a single client MUST use the same Call-ID. issued by a single client SHOULD use the same Call-ID, at least
within the same boot cycle.
Since the Call-ID is generated by and for SIP, there is no Since the Call-ID is generated by and for SIP, there is no
reason to deal with the complexity of URL-encoding and reason to deal with the complexity of URL-encoding and
case-ignoring string comparison. case-ignoring string comparison.
Call-ID = ( "Call-ID" | "i" ) ":" local-id "@" host Call-ID = ( "Call-ID" | "i" ) ":" local-id "@" host
local-id = 1*uric local-id = 1*uric
"host" SHOULD be either a fully qualified domain name or a globally "host" SHOULD be either a fully qualified domain name or a globally
routable IP address. If this is the case, the "local-id" SHOULD be an routable IP address. If this is the case, the "local-id" SHOULD be an
identifier consisting of URI characters that is unique within "host". identifier consisting of URI characters that is unique within "host".
Use of cryptographically random identifiers [28] is RECOMMENDED. If, Use of cryptographically random identifiers [27] is RECOMMENDED. If,
however, host is not an FQDN or globally routable IP address (such as however, host is not an FQDN or globally routable IP address (such as
a net 10 address), the local-id MUST be globally unique, as opposed a net 10 address), the local-id MUST be globally unique, as opposed
to unique within host. These rules guarantee overall global to unique within host. These rules guarantee overall global
uniqueness of the Call-ID. The value for Call-ID MUST NOT be reused uniqueness of the Call-ID. The value for Call-ID MUST NOT be reused
for a different call. Call-IDs are case-sensitive. for a different call. Call-IDs are case-sensitive.
Using cryptographically random identifiers provides some Using cryptographically random identifiers provides some
protection against session hijacking. Call-ID, To and From protection against session hijacking. Call-ID, To and From
are needed to identify a call leg between call and call leg are needed to identify a call leg. The distinction between
matters in calls with third-party control. call and call leg matters in calls with third-party
control.
For systems which have tight bandwidth constraints, many of the For systems which have tight bandwidth constraints, many of the
mandatory SIP headers have a compact form, as discussed in Section 9. mandatory SIP headers have a compact form, as discussed in Section 9.
These are alternate names for the headers which occupy less space in These are alternate names for the headers which occupy less space in
the message. In the case of Call-ID, the compact form is i. the message. In the case of Call-ID, the compact form is i.
For example, both of the following are valid: For example, both of the following are valid:
Call-ID: f81d4fae-7dec-11d0-a765-00a0c91e6bf6@foo.bar.com Call-ID: f81d4fae-7dec-11d0-a765-00a0c91e6bf6@foo.bar.com
or or
i:f81d4fae-7dec-11d0-a765-00a0c91e6bf6@foo.bar.com i:f81d4fae-7dec-11d0-a765-00a0c91e6bf6@foo.bar.com
6.13 Contact 6.13 Contact
The Contact general-header field can appear in requests, 1xx, 2xx, The Contact general-header field can appear in INVITE, ACK, and
and 3xx responses. REGISTER requests, and in 1xx, 2xx, 3xx, and 485 responses. In
general, it provides a URL where the user can be reached for further
communications.
INVITE and ACK requests: INVITE and ACK requests MAY contain Contact INVITE and ACK requests: INVITE and ACK requests MAY contain Contact
headers indicating from which location the request is headers indicating from which location the request is
originating. originating.
This allows the callee to send a BYE directly to the caller This allows the callee to send future requests, such as
instead of through a series of proxies. The Via header is BYE, directly to the caller instead of through a series of
not sufficient since the desired address may be that of a proxies. The Via header is not sufficient since the
proxy. desired address may be that of a proxy.
INVITE 2xx responses: A user agent server sending a definitive, INVITE 2xx responses: A user agent server sending a definitive,
positive response (2xx) MAY insert a Contact response header positive response (2xx) MAY insert a Contact response header
field indicating the SIP address under which it is reachable field indicating the SIP address under which it is reachable
most directly for future SIP requests, such as ACK, within the most directly for future SIP requests, such as ACK, within the
same Call-ID. The Contact header field contains the address of same Call-ID. The Contact header field contains the address of
the server itself or that of a proxy, e.g., if the host is the server itself or that of a proxy, e.g., if the host is
behind a firewall. The value of this Contact header is copied behind a firewall. The value of this Contact header is copied
into the Request-URI of subsequent requests for this call. into the Request-URI of subsequent requests for this call. If
the response also contains a Record-Route header field, the
address in the Contact header field is added as the last item in
the Route header field. See Section 6.29 for details.
The Contact value SHOULD NOT be cached across calls, as it The Contact value SHOULD NOT be cached across calls, as it
may not represent the most desirable location for a may not represent the most desirable location for a
particular destination address. particular destination address.
INVITE 1xx responses: A UAS sending a provisional response (1xx) MAY INVITE 1xx responses: A UAS sending a provisional response (1xx) MAY
insert a Contact response header. It has the same semantics in a insert a Contact response header. It has the same semantics in a
1xx response as a 2xx INVITE response. Note that CANCEL requests 1xx response as a 2xx INVITE response. Note that CANCEL requests
MUST NOT be sent to that address, but rather follow the same MUST NOT be sent to that address, but rather follow the same
path as the original request. path as the original request.
skipping to change at page 43, line 5 skipping to change at page 44, line 52
"maddr" is a multicast address, the value of "ttl" is used as "maddr" is a multicast address, the value of "ttl" is used as
the time-to-live value. the time-to-live value.
Note that the Contact header field MAY also refer to a different Note that the Contact header field MAY also refer to a different
entity than the one originally called. For example, a SIP call entity than the one originally called. For example, a SIP call
connected to GSTN gateway may need to deliver a special information connected to GSTN gateway may need to deliver a special information
announcement such as "The number you have dialed has been changed." announcement such as "The number you have dialed has been changed."
A Contact response header field can contain any suitable URI A Contact response header field can contain any suitable URI
indicating where the called party can be reached, not limited to SIP indicating where the called party can be reached, not limited to SIP
URLs. For example, it can contain a phone or fax, URLs. For example, it can contain a phone or fax, mailto: (RFC 2368,
[28]) or irc: URL.
mailto: (RFC 2368, [29]) or irc: URL.
The following parameters are defined. Additional parameters may be The following parameters are defined. Additional parameters may be
defined in other specifications. defined in other specifications.
q: The "qvalue" indicates the relative preference among the locations q: The "qvalue" indicates the relative preference among the locations
given. "qvalue" values are decimal numbers from 0.0 to 1.0, with given. "qvalue" values are decimal numbers from 0 to 1, with
higher values indicating higher preference. higher values indicating higher preference.
action: The "action" parameter is used only when registering with the action: The "action" parameter is used only when registering with the
REGISTER request. It indicates whether the client wishes that REGISTER request. It indicates whether the client wishes that
the server proxy or redirect future requests intended for the the server proxy or redirect future requests intended for the
client. If this parameter is not specified the action taken client. If this parameter is not specified the action taken
depends on server configuration. In its response, the registrar depends on server configuration. In its response, the registrar
SHOULD indicate the mode used. This parameter is ignored for SHOULD indicate the mode used. This parameter is ignored for
other requests. other requests.
expires: The "expires" parameter indicates how long the URI is valid. expires: The "expires" parameter indicates how long the URI is valid.
The parameter is either a number indicating seconds or a quoted The parameter is either a number indicating seconds or a quoted
string containing an HTTP-date. If this parameter is not string containing a SIP-date. If this parameter is not provided,
provided, the value of the Expires header field determines how the value of the Expires header field determines how long the
long the URI is valid. URI is valid. Implementations MAY treat values larger than
2**32-1 (4294967295 or 136 years) as equivalent to 2**32-1.
Contact = ( "Contact" | "m" ) ":" ("*" | (1# ( name-addr | addr-spec Contact = ( "Contact" | "m" ) ":"
("*" | (1# ( name-addr | addr-spec )
[ *( ";" contact-params ) ] [ comment ] )) [ *( ";" contact-params ) ] [ comment ] ))
name-addr = [ display-name ] "<" addr-spec ">" name-addr = [ display-name ] "<" addr-spec ">"
addr-spec = SIP-URL | URI addr-spec = SIP-URL | URI
display-name = *token | quoted-string display-name = *token | quoted-string
contact-params = "q" "=" qvalue contact-params = "q" "=" qvalue
| "action" "=" "proxy" | "redirect" | "action" "=" "proxy" | "redirect"
| "expires" "=" delta-seconds | <"> HTTP-date <"> | "expires" "=" delta-seconds | <"> SIP-date <">
| extension-attribute | extension-attribute
extension-attribute = extension-name [ "=" extension-value ] extension-attribute = extension-name [ "=" extension-value ]
Even if the "display-name" is empty, the "name-addr" form MUST be Even if the "display-name" is empty, the "name-addr" form MUST be
used if the "addr-spec" contains a comma, semicolon or question mark. used if the "addr-spec" contains a comma, semicolon or question mark.
The Contact header field fulfills functionality similar to The Contact header field fulfills functionality similar to
the Location header field in HTTP. However, the HTTP header the Location header field in HTTP. However, the HTTP header
only allows one address, unquoted. Since URIs can contain only allows one address, unquoted. Since URIs can contain
skipping to change at page 44, line 18 skipping to change at page 46, line 18
header, which also allows the use of display names. header, which also allows the use of display names.
Example: Example:
Contact: "Mr. Watson" <sip:watson@worcester.bell-telephone.com> Contact: "Mr. Watson" <sip:watson@worcester.bell-telephone.com>
;q=0.7; expires=3600, ;q=0.7; expires=3600,
"Mr. Watson" <mailto:watson@bell-telephone.com> ;q=0.1 "Mr. Watson" <mailto:watson@bell-telephone.com> ;q=0.1
6.14 Content-Encoding 6.14 Content-Encoding
Content-Encoding = ( "Content-Encoding" | "e" ) ":"
1#content-coding
The Content-Encoding entity-header field is used as a modifier to the The Content-Encoding entity-header field is used as a modifier to the
"media-type". When present, its value indicates what additional "media-type". When present, its value indicates what additional
content codings have been applied to the entity-body, and thus what content codings have been applied to the entity-body, and thus what
decoding mechanisms MUST be applied in order to obtain the media-type decoding mechanisms MUST be applied in order to obtain the media-type
referenced by the Content-Type header field. Content-Encoding is referenced by the Content-Type header field. Content-Encoding is
primarily used to allow a document to be compressed without losing primarily used to allow a body to be compressed without losing the
the identity of its underlying media type. See [H14.12]. identity of its underlying media type.
Content-Encoding = ( "Content-Encoding" | "e" ) ":" 1#content-coding If multiple encodings have been applied to an entity, the content
codings MUST be listed in the order in which they were applied.
6.15 Content-Length All content-coding values are case-insensitive. The Internet Assigned
Numbers Authority (IANA) acts as a registry for content-coding value
tokens. See [3.5] for a definition of the syntax for content-coding.
Clients MAY apply content encodings to the body in requests. If the
server is not capable of decoding the body, or does not recognize any
of the content-coding values, it MUST send a 415 "Unsupported Media
Type" response, listing acceptable encodings in the Accept-Encoding
header. A server MAY apply content encodings to the bodies in
responses. The server MUST only use encodings listed in the Accept-
Encoding header in the request.
6.15 Content-Length
The Content-Length entity-header field indicates the size of the The Content-Length entity-header field indicates the size of the
message-body, in decimal number of octets, sent to the recipient. message-body, in decimal number of octets, sent to the recipient.
Content-Length = ( "Content-Length" | "l" ) ":" 1*DIGIT Content-Length = ( "Content-Length" | "l" ) ":" 1*DIGIT
An example is An example is
Content-Length: 3495 Content-Length: 3495
Applications SHOULD use this field to indicate the size of the Applications SHOULD use this field to indicate the size of the
skipping to change at page 47, line 4 skipping to change at page 49, line 17
INVITE request from that of a CANCEL response. CANCEL requests can be INVITE request from that of a CANCEL response. CANCEL requests can be
generated by proxies; if they were to increase the sequence number, generated by proxies; if they were to increase the sequence number,
it might conflict with a later request issued by the user agent for it might conflict with a later request issued by the user agent for
the same call. the same call.
With a length of 32 bits, a server could generate, within a single With a length of 32 bits, a server could generate, within a single
call, one request a second for about 136 years before needing to wrap call, one request a second for about 136 years before needing to wrap
around. The initial value of the sequence number is chosen so that around. The initial value of the sequence number is chosen so that
subsequent requests within the same call will not wrap around. A subsequent requests within the same call will not wrap around. A
non-zero initial value allows to use a time-based initial sequence non-zero initial value allows to use a time-based initial sequence
number, which protects against ambiguities when clients are re- number, if the client desires. A client could, for example, choose
invited to the same call after rebooting. A client could, for the 31 most significant bits of a 32-bit second clock as an initial
example, choose the 31 most significant bits of a 32-bit second clock sequence number.
as an initial sequence number.
Forked requests MUST have the same CSeq as there would be ambiguity Forked requests MUST have the same CSeq as there would be ambiguity
otherwise between these forked requests and later BYE issued by the otherwise between these forked requests and later BYE issued by the
client user agent. client user agent.
Example: Example:
CSeq: 4711 INVITE CSeq: 4711 INVITE
6.18 Date 6.18 Date
General-header field. See [H14.19]. Date is a general-header field. Its syntax is:
SIP-date = rfc1123-date
See [H14.19] for a definition of rfc1123-date. Note that unlike
HTTP/1.1, SIP only supports the most recent RFC1123 [29] formatting
for dates.
The Date header field reflects the time when the request or response The Date header field reflects the time when the request or response
is first sent. Thus, retransmissions have the same Date header field is first sent. Thus, retransmissions have the same Date header field
value as the original. value as the original.
The Date header field can be used by simple end systems The Date header field can be used by simple end systems
without a battery-backed clock to acquire a notion of without a battery-backed clock to acquire a notion of
current time. current time.
6.19 Encryption 6.19 Encryption
The Encryption general-header field specifies that the content has The Encryption general-header field specifies that the content has
been encrypted. Section 13 describes the overall SIP security been encrypted. Section 13 describes the overall SIP security
architecture and algorithms. This header field is intended for end- architecture and algorithms. This header field is intended for end-
to-end encryption of requests and responses. Requests are encrypted to-end encryption of requests and responses. Requests are encrypted
with a public key belonging to the entity named in the To header based on the public key belonging to the entity named in the To
field. Responses are encrypted with the public key conveyed in the header field. Responses are encrypted based on the public key
Response-Key header field. conveyed in the Response-Key header field. Note that the public keys
themselves may not be used for the encryption. This depends on the
SIP chose not to adopt HTTP's Content-Transfer-Encoding particular algorithms used.
header field because the encrypted body may contain
additional SIP header fields as well as the body of the
message. See section 13.1.1
For any encrypted message, at least the message body and possibly For any encrypted message, at least the message body and possibly
other message header fields are encrypted. An application receiving a other message header fields are encrypted. An application receiving a
request or response containing an Encryption header field decrypts request or response containing an Encryption header field decrypts
the body and then concatenates the plaintext to the request line and the body and then concatenates the plaintext to the request line and
headers of the original message. Message headers in the decrypted headers of the original message. Message headers in the decrypted
part completely replace those with the same field name in the part completely replace those with the same field name in the
plaintext part. (Note: If only the body of the message is to be plaintext part. (Note: If only the body of the message is to be
encrypted, the body has to be prefixed with CRLF to allow proper encrypted, the body has to be prefixed with CRLF to allow proper
concatenation.) Note that the request method and Request-URI cannot concatenation.) Note that the request method and Request-URI cannot
skipping to change at page 48, line 26 skipping to change at page 50, line 43
be able to modify the request or response. be able to modify the request or response.
Encryption = "Encryption" ":" encryption-scheme 1*SP Encryption = "Encryption" ":" encryption-scheme 1*SP
#encryption-params #encryption-params
encryption-scheme = token encryption-scheme = token
encryption-params = token "=" ( token | quoted-string ) encryption-params = token "=" ( token | quoted-string )
The token indicates the form of encryption used; it is The token indicates the form of encryption used; it is
described in section 13. described in section 13.
The following example for a message encrypted with ASCII-armored PGP The example in Figure 10 shows a message encrypted with ASCII-armored
was generated by applying "pgp -ea" to the payload to be encrypted. PGP that was generated by applying "pgp -ea" to the payload to be
encrypted.
Since proxies can base their forwarding decision on any combination
of SIP header fields, there is no guarantee that an encrypted request
"hiding" header fields will reach the same destination as an
otherwise identical un-encrypted request.
6.20 Expires
The Expires entity-header field gives the date and time after which
the message content expires.
This header field is currently defined only for the REGISTER and
INVITE methods. For REGISTER, it is a request and response-header
field. In a REGISTER request, the client indicates how long it wishes
the registration to be valid. In the response, the server indicates
the earliest expiration time of all registrations. The server MAY
choose a shorter time interval than that requested by the client, but
INVITE sip:watson@boston.bell-telephone.com SIP/2.0 INVITE sip:watson@boston.bell-telephone.com SIP/2.0
Via: SIP/2.0/UDP 169.130.12.5 Via: SIP/2.0/UDP 169.130.12.5
From: <sip:a.g.bell@bell-telephone.com> From: <sip:a.g.bell@bell-telephone.com>
To: T. A. Watson <sip:watson@bell-telephone.com> To: T. A. Watson <sip:watson@bell-telephone.com>
Call-ID: 187602141351@worcester.bell-telephone.com Call-ID: 187602141351@worcester.bell-telephone.com
Content-Length: 885 Content-Length: 885
Encryption: PGP version=2.6.2,encoding=ascii Encryption: PGP version=2.6.2,encoding=ascii
hQEMAxkp5GPd+j5xAQf/ZDIfGD/PDOM1wayvwdQAKgGgjmZWe+MTy9NEX8O25Red hQEMAxkp5GPd+j5xAQf/ZDIfGD/PDOM1wayvwdQAKgGgjmZWe+MTy9NEX8O25Red
h0/pyrd/+DV5C2BYs7yzSOSXaj1C/tTK/4do6rtjhP8QA3vbDdVdaFciwEVAcuXs h0/pyrd/+DV5C2BYs7yzSOSXaj1C/tTK/4do6rtjhP8QA3vbDdVdaFciwEVAcuXs
skipping to change at page 49, line 27 skipping to change at page 51, line 28
X9dOVj3CMjCP66RSHa/ea0wYTRRNYA/G+kdP8DSUcqYAAAE/hZPX6nFIqk7AVnf6 X9dOVj3CMjCP66RSHa/ea0wYTRRNYA/G+kdP8DSUcqYAAAE/hZPX6nFIqk7AVnf6
IpWHUPTelNUJpzUp5Ou+q/5P7ZAsn+cSAuF2YWtVjCf+SQmBR13p2EYYWHoxlA2/ IpWHUPTelNUJpzUp5Ou+q/5P7ZAsn+cSAuF2YWtVjCf+SQmBR13p2EYYWHoxlA2/
GgKADYe4M3JSwOtqwU8zUJF3FIfk7vsxmSqtUQrRQaiIhqNyG7KxJt4YjWnEjF5E GgKADYe4M3JSwOtqwU8zUJF3FIfk7vsxmSqtUQrRQaiIhqNyG7KxJt4YjWnEjF5E
WUIPhvyGFMJaeQXIyGRYZAYvKKklyAJcm29zLACxU5alX4M25lHQd9FR9Zmq6Jed WUIPhvyGFMJaeQXIyGRYZAYvKKklyAJcm29zLACxU5alX4M25lHQd9FR9Zmq6Jed
wbWvia6cAIfsvlZ9JGocmQYF7pcuz5pnczqP+/yvRqFJtDGD/v3s++G2R+ViVYJO wbWvia6cAIfsvlZ9JGocmQYF7pcuz5pnczqP+/yvRqFJtDGD/v3s++G2R+ViVYJO
z/lxGUZaM4IWBCf+4DUjNanZM0oxAE28NjaIZ0rrldDQmO8V9FtPKdHxkqA5iJP+ z/lxGUZaM4IWBCf+4DUjNanZM0oxAE28NjaIZ0rrldDQmO8V9FtPKdHxkqA5iJP+
6vGOFti1Ak4kmEz0vM/Nsv7kkubTFhRl05OiJIGr9S1UhenlZv9l6RuXsOY/EwH2 6vGOFti1Ak4kmEz0vM/Nsv7kkubTFhRl05OiJIGr9S1UhenlZv9l6RuXsOY/EwH2
z8X9N4MhMyXEVuC9rt8/AUhmVQ== z8X9N4MhMyXEVuC9rt8/AUhmVQ==
=bOW+ =bOW+
Figure 10: PGP Encryption Example
Since proxies can base their forwarding decision on any combination
of SIP header fields, there is no guarantee that an encrypted request
"hiding" header fields will reach the same destination as an
otherwise identical un-encrypted request.
6.20 Expires
The Expires entity-header field gives the date and time after which
the message content expires.
This header field is currently defined only for the REGISTER and
INVITE methods. For REGISTER, it is a request and response-header
field. In a REGISTER request, the client indicates how long it wishes
the registration to be valid. In the response, the server indicates
the earliest expiration time of all registrations. The server MAY
choose a shorter time interval than that requested by the client, but
SHOULD NOT choose a longer one. SHOULD NOT choose a longer one.
For INVITE requests, it is a request and response-header field. In a For INVITE requests, it is a request and response-header field. In a
request, the caller can limit the validity of an invitation, for request, the caller can limit the validity of an invitation, for
example, if a client wants to limit the time duration of a search or example, if a client wants to limit the time duration of a search or
a conference invitation. A user interface MAY take this as a hint to a conference invitation. A user interface MAY take this as a hint to
leave the invitation window on the screen even if the user is not leave the invitation window on the screen even if the user is not
currently at the workstation. This also limits the duration of a currently at the workstation. This also limits the duration of a
search. If the request expires before the search completes, the proxy search. If the request expires before the search completes, the proxy
returns a 408 (Request Timeout) status. In a 302 (Moved Temporarily) returns a 408 (Request Timeout) status. In a 302 (Moved Temporarily)
response, a server can advise the client of the maximal duration of response, a server can advise the client of the maximal duration of
the redirection. the redirection.
The value of this field can be either an HTTP-date or an integer The value of this field can be either a SIP-date or an integer number
number of seconds (in decimal), measured from the receipt of the of seconds (in decimal), measured from the receipt of the request.
request. The latter approach is preferable for short durations, as it The latter approach is preferable for short durations, as it does not
does not depend on clients and servers sharing a synchronized clock. depend on clients and servers sharing a synchronized clock.
Implementations MAY treat values larger than 2**32-1 (4294967295 or
136 years) as equivalent to 2**32-1.
Expires = "Expires" ":" ( HTTP-date | delta-seconds ) Expires = "Expires" ":" ( SIP-date | delta-seconds )
Two examples of its use are Two examples of its use are
Expires: Thu, 01 Dec 1994 16:00:00 GMT Expires: Thu, 01 Dec 1994 16:00:00 GMT
Expires: 5 Expires: 5
6.21 From 6.21 From
Requests and responses MUST contain a From general-header field, Requests and responses MUST contain a From general-header field,
indicating the initiator of the request. The From field MAY contain indicating the initiator of the request. The From field MAY contain
the "tag" parameter. The server copies the From header field from the the "tag" parameter. The server copies the From header field from the
request to the response. The optional "display-name" is meant to be request to the response. The optional "display-name" is meant to be
rendered by a human-user interface. A system SHOULD use the display rendered by a human-user interface. A system SHOULD use the display
skipping to change at page 51, line 5 skipping to change at page 53, line 23
From: Anonymous <sip:c8oqz84zk7z@privacy.org> From: Anonymous <sip:c8oqz84zk7z@privacy.org>
The "tag" MAY appear in the From field of a request. It MUST be The "tag" MAY appear in the From field of a request. It MUST be
present when it is possible that two instances of a user sharing a present when it is possible that two instances of a user sharing a
SIP address can make call invitations with the same Call-ID. SIP address can make call invitations with the same Call-ID.
The "tag" value MUST be globally unique and cryptographically random The "tag" value MUST be globally unique and cryptographically random
with at least 32 bits of randomness. A single user maintains the same with at least 32 bits of randomness. A single user maintains the same
tag throughout the call identified by the Call-ID. tag throughout the call identified by the Call-ID.
Call-ID, To and From are needed to identify a call leg leg Call-ID, To and From are needed to identify a call leg.
matters in calls with multiple responses to a forked The distinction between call and call leg matters in calls
request. The format is similar to the equivalent RFC 822 with multiple responses to a forked request. The format is
[26] header, but with a URI instead of just an email similar to the equivalent RFC 822 [24] header, but with a
address. URI instead of just an email address.
6.22 Hide 6.22 Hide
A client uses the Hide request header field to indicate that it wants A client uses the Hide request header field to indicate that it wants
the path comprised of the Via header fields (Section 6.40) to be the path comprised of the Via header fields (Section 6.40) to be
hidden from subsequent proxies and user agents. It can take two hidden from subsequent proxies and user agents. It can take two
forms: Hide: route and Hide: hop. Hide header fields are typically forms: Hide: route and Hide: hop. Hide header fields are typically
added by the client user agent, but MAY be added by any proxy along added by the client user agent, but MAY be added by any proxy along
the path. the path.
skipping to change at page 52, line 27 skipping to change at page 55, line 5
The Hide header field has the following syntax: The Hide header field has the following syntax:
Hide = "Hide" ":" ( "route" | "hop" ) Hide = "Hide" ":" ( "route" | "hop" )
6.23 Max-Forwards 6.23 Max-Forwards
The Max-Forwards request-header field may be used with any SIP method The Max-Forwards request-header field may be used with any SIP method
to limit the number of proxies or gateways that can forward the to limit the number of proxies or gateways that can forward the
request to the next downstream server. This can also be useful when request to the next downstream server. This can also be useful when
the client is attempting to trace a request chain which appears to be the client is attempting to trace a request chain which appears to be
failing or looping in mid-chain. [H14.31] failing or looping in mid-chain.
Max-Forwards = "Max-Forwards" ":" 1*DIGIT Max-Forwards = "Max-Forwards" ":" 1*DIGIT
The Max-Forwards value is a decimal integer indicating the remaining The Max-Forwards value is a decimal integer indicating the remaining
number of times this request message is allowed to be forwarded. number of times this request message is allowed to be forwarded.
Each proxy or gateway recipient of a request containing a Max- Each proxy or gateway recipient of a request containing a Max-
Forwards header field MUST check and update its value prior to Forwards header field MUST check and update its value prior to
forwarding the request. If the received value is zero (0), the forwarding the request. If the received value is zero (0), the
recipient MUST NOT forward the request. Instead, for the OPTIONS and recipient MUST NOT forward the request. Instead, for the OPTIONS and
skipping to change at page 53, line 16 skipping to change at page 55, line 36
6.24 Organization 6.24 Organization
The Organization general-header field conveys the name of the The Organization general-header field conveys the name of the
organization to which the entity issuing the request or response organization to which the entity issuing the request or response
belongs. It MAY also be inserted by proxies at the boundary of an belongs. It MAY also be inserted by proxies at the boundary of an
organization. organization.
The field MAY be used by client software to filter calls. The field MAY be used by client software to filter calls.
Organization = "Organization" ":" *text Organization = "Organization" ":" *TEXT-UTF8
6.25 Priority 6.25 Priority
The Priority request-header field indicates the urgency of the The Priority request-header field indicates the urgency of the
request as perceived by the client. request as perceived by the client.
Priority = "Priority" ":" priority-value Priority = "Priority" ":" priority-value
priority-value = "emergency" | "urgent" | "normal" priority-value = "emergency" | "urgent" | "normal"
| "non-urgent" | "non-urgent"
skipping to change at page 54, line 10 skipping to change at page 56, line 28
Priority: non-urgent Priority: non-urgent
These are the values of RFC 2076 [30], with the addition of These are the values of RFC 2076 [30], with the addition of
"emergency". "emergency".
6.26 Proxy-Authenticate 6.26 Proxy-Authenticate
The Proxy-Authenticate response-header field MUST be included as part The Proxy-Authenticate response-header field MUST be included as part
of a 407 (Proxy Authentication Required) response. The field value of a 407 (Proxy Authentication Required) response. The field value
consists of a challenge that indicates the authentication scheme and consists of a challenge that indicates the authentication scheme and
parameters applicable to the proxy for this Request-URI. See [H14.33] parameters applicable to the proxy for this Request-URI.
for further details.
Unlike its usage within HTTP, the Proxy-Authenticate header MUST be
passed upstream in the response to tha UAC. In SIP, only UAC's can
authenticate themselves to proxies.
The syntax for this header is defined in [H14.33]. See 14 for further
details on its usage.
A client SHOULD cache the credentials used for a particular proxy A client SHOULD cache the credentials used for a particular proxy
server and realm for the next request to that server. Credentials server and realm for the next request to that server. Credentials
are, in general, valid for a specific value of the Request-URI at a are, in general, valid for a specific value of the Request-URI at a
particular proxy server. If a client contacts a proxy server that has particular proxy server. If a client contacts a proxy server that has
required authentication in the past, but the client does not have required authentication in the past, but the client does not have
credentials for the particular Request-URI, it MAY attempt to use the credentials for the particular Request-URI, it MAY attempt to use the
most-recently used credential. The server responds with 401 most-recently used credential. The server responds with 401
(Unauthorized) if the client guessed wrong. (Unauthorized) if the client guessed wrong.
skipping to change at page 54, line 34 skipping to change at page 57, line 15
likely that in most cases, all destinations require the likely that in most cases, all destinations require the
same password. Note that end-to-end authentication is same password. Note that end-to-end authentication is
likely to be destination-specific. likely to be destination-specific.
6.27 Proxy-Authorization 6.27 Proxy-Authorization
The Proxy-Authorization request-header field allows the client to The Proxy-Authorization request-header field allows the client to
identify itself (or its user) to a proxy which requires identify itself (or its user) to a proxy which requires
authentication. The Proxy-Authorization field value consists of authentication. The Proxy-Authorization field value consists of
credentials containing the authentication information of the user credentials containing the authentication information of the user
agent for the proxy and/or realm of the resource being requested. See agent for the proxy and/or realm of the resource being requested.
[H14.34] for further details.
Unlike Authorization, the Proxy-Authorization header field applies
only to the next outbound proxy that demanded authentication using
the Proxy- Authenticate field. When multiple proxies are used in a
chain, the Proxy-Authorization header field is consumed by the first
outbound proxy that was expecting to receive credentials. A proxy MAY
relay the credentials from the client request to the next proxy if
that is the mechanism by which the proxies cooperatively authenticate
a given request.
See [H14.34] for a definition of the syntax, and section 14 for a
discussion of its usage.
6.28 Proxy-Require 6.28 Proxy-Require
The Proxy-Require header field is used to indicate proxy-sensitive The Proxy-Require header field is used to indicate proxy-sensitive
features that MUST be supported by the proxy. Any Proxy-Require features that MUST be supported by the proxy. Any Proxy-Require
header field features that are not supported by the proxy MUST be header field features that are not supported by the proxy MUST be
negatively acknowledged by the proxy to the client if not supported. negatively acknowledged by the proxy to the client if not supported.
Servers treat this field identically to the Require field. Servers treat this field identically to the Require field.
See Section 6.30 for more details on the mechanics of this message See Section 6.30 for more details on the mechanics of this message
skipping to change at page 56, line 33 skipping to change at page 59, line 27
client-server pair, the interaction proceeds quickly, client-server pair, the interaction proceeds quickly,
saving a round-trip often required by negotiation saving a round-trip often required by negotiation
mechanisms. In addition, it also removes ambiguity when the mechanisms. In addition, it also removes ambiguity when the
client requires features that the server does not client requires features that the server does not
understand. Some features, such as call handling fields, understand. Some features, such as call handling fields,
are only of interest to end systems. are only of interest to end systems.
Proxy and redirect servers MUST ignore features that are not Proxy and redirect servers MUST ignore features that are not
understood. If a particular extension requires that intermediate understood. If a particular extension requires that intermediate
devices support it, the extension MUST be tagged in the Proxy-Require devices support it, the extension MUST be tagged in the Proxy-Require
field instead (see Section 6.28). field as well (see Section 6.28).
6.31 Response-Key 6.31 Response-Key
The Response-Key request-header field can be used by a client to The Response-Key request-header field can be used by a client to
request the key that the called user agent SHOULD use to encrypt the request the key that the called user agent SHOULD use to encrypt the
response with. The syntax is: response with. The syntax is:
Response-Key = "Response-Key" ":" key-scheme 1*SP #key-param Response-Key = "Response-Key" ":" key-scheme 1*SP #key-param
key-scheme = token key-scheme = token
key-param = token "=" ( token | quoted-string ) key-param = token "=" ( token | quoted-string )
skipping to change at page 57, line 22 skipping to change at page 60, line 16
procedures and return a 420 (Bad Extension) response. If this Require procedures and return a 420 (Bad Extension) response. If this Require
header field is not present, a server SHOULD still encrypt if it can. header field is not present, a server SHOULD still encrypt if it can.
6.32 Retry-After 6.32 Retry-After
The Retry-After general-header field can be used with a 503 (Service The Retry-After general-header field can be used with a 503 (Service
Unavailable) response to indicate how long the service is expected to Unavailable) response to indicate how long the service is expected to
be unavailable to the requesting client and with a 404 (Not Found), be unavailable to the requesting client and with a 404 (Not Found),
600 (Busy), or 603 (Decline) response to indicate when the called 600 (Busy), or 603 (Decline) response to indicate when the called
party anticipates being available again. The value of this field can party anticipates being available again. The value of this field can
be either an HTTP-date or an integer number of seconds (in decimal) be either an SIP-date or an integer number of seconds (in decimal)
after the time of the response. after the time of the response.
A REGISTER request MAY include this header field when deleting A REGISTER request MAY include this header field when deleting
registrations with Contact: * ;expires: 0. The Retry-After value then registrations with "Contact: * ;expires: 0". The Retry-After value
indicates when the user might again be reachable. The registrar MAY then indicates when the user might again be reachable. The registrar
then include this information in responses to future calls. MAY then include this information in responses to future calls.
An optional comment can be used to indicate additional information An optional comment can be used to indicate additional information
about the time of callback. An optional "duration" parameter about the time of callback. An optional "duration" parameter
indicates how long the called party will be reachable starting at the indicates how long the called party will be reachable starting at the
initial time of availability. If no duration parameter is given, the initial time of availability. If no duration parameter is given, the
service is assumed to be available indefinitely. service is assumed to be available indefinitely.
Retry-After = "Retry-After" ":" ( HTTP-date | delta-seconds ) Retry-After = "Retry-After" ":" ( SIP-date | delta-seconds )
[ comment ] [ ";duration" "=" delta-seconds ] [ comment ] [ ";" "duration" "=" delta-seconds ]
Examples of its use are Examples of its use are
Retry-After: Mon, 21 Jul 1997 18:48:34 GMT (I'm in a meeting) Retry-After: Mon, 21 Jul 1997 18:48:34 GMT (I'm in a meeting)
Retry-After: Mon, 1 Jan 9999 00:00:00 GMT Retry-After: Mon, 01 Jan 9999 00:00:00 GMT
(Dear John: Don't call me back, ever) (Dear John: Don't call me back, ever)
Retry-After: Fri, 26 Sep 1997 21:00:00 GMT;duration=3600 Retry-After: Fri, 26 Sep 1997 21:00:00 GMT;duration=3600
Retry-After: 120 Retry-After: 120
In the third example, the callee is reachable for one hour starting In the third example, the callee is reachable for one hour starting
at 21:00 GMT. In the last example, the delay is 2 minutes. at 21:00 GMT. In the last example, the delay is 2 minutes.
6.33 Route 6.33 Route
The Route request-header field determines the route taken by a The Route request-header field determines the route taken by a
request. Each host removes the first entry and then proxies the request. Each host removes the first entry and then proxies the
request to the host listed in that entry, also using it as the request to the host listed in that entry, also using it as the
Request-URI. The operation is further described in Section 6.29. Request-URI. The operation is further described in Section 6.29.
skipping to change at page 58, line 21 skipping to change at page 61, line 15
request to the host listed in that entry, also using it as the request to the host listed in that entry, also using it as the
Request-URI. The operation is further described in Section 6.29. Request-URI. The operation is further described in Section 6.29.
The Route header field has the following syntax: The Route header field has the following syntax:
Route = "Route" ":" 1# name-addr Route = "Route" ":" 1# name-addr
6.34 Server 6.34 Server
The Server response-header field contains information about the The Server response-header field contains information about the
software used by the user agent server to handle the request. See software used by the user agent server to handle the request. The
[H14.39]. syntax for this field is defined in [H14.39].
6.35 Subject 6.35 Subject
This is intended to provide a summary, or to indicate the nature, of This is intended to provide a summary, or to indicate the nature, of
the call, allowing call filtering without having to parse the session the call, allowing call filtering without having to parse the session
description. (Also, the session description does not have to use the description. (Also, the session description does not have to use the
same subject indication as the invitation.) same subject indication as the invitation.)
Subject = ( "Subject" | "s" ) ":" *text Subject = ( "Subject" | "s" ) ":" *TEXT-UTF8
Example: Example:
Subject: Tune in - they are talking about your work! Subject: Tune in - they are talking about your work!
6.36 Timestamp 6.36 Timestamp
The timestamp general-header field describes when the client sent the The timestamp general-header field describes when the client sent the
request to the server. The value of the timestamp is of significance request to the server. The value of the timestamp is of significance
only to the client and MAY use any timescale. The server MUST echo only to the client and MAY use any timescale. The server MUST echo
the exact same value and MAY, if it has accurate information about the exact same value and MAY, if it has accurate information about
this, add a floating point number indicating the number of seconds this, add a floating point number indicating the number of seconds
that have elapsed since it has received the request. The timestamp is that have elapsed since it has received the request. The timestamp is
used by the client to compute the round-trip time to the server so used by the client to compute the round-trip time to the server so
that it can adjust the timeout value for retransmissions. that it can adjust the timeout value for retransmissions.
Timestamp = "Timestamp" ":" *(DIGIT) [ "." *(DIGIT) ] [ delay ] Timestamp = "Timestamp" ":" *(DIGIT) [ "." *(DIGIT) ] [ delay ]
delay = *(DIGIT) [ "." *(DIGIT) ] delay = *(DIGIT) [ "." *(DIGIT) ]
Note that there MUST NOT be any LWS between a DIGIT and the decimal
point.
6.37 To 6.37 To
The To general-header field specifies recipient of the request, with The To general-header field specifies recipient of the request, with
the same SIP URL syntax as the From field. the same SIP URL syntax as the From field.
To = ( "To" | "t" ) ":" ( name-addr | addr-spec ) To = ( "To" | "t" ) ":" ( name-addr | addr-spec )
*( ";" addr-params ) *( ";" addr-params )
Requests and responses MUST contain a To general-header field, Requests and responses MUST contain a To general-header field,
indicating the desired recipient of the request. The optional indicating the desired recipient of the request. The optional
skipping to change at page 60, line 4 skipping to change at page 62, line 45
The "tag" parameter serves as a general mechanism to distinguish The "tag" parameter serves as a general mechanism to distinguish
multiple instances of a user identified by a single SIP URL. As multiple instances of a user identified by a single SIP URL. As
proxies can fork requests, the same request can reach multiple proxies can fork requests, the same request can reach multiple
instances of a user (mobile and home phones, for example). As each instances of a user (mobile and home phones, for example). As each
can respond, there needs to be a means to distinguish the responses can respond, there needs to be a means to distinguish the responses
from each at the caller. The situation also arises with multicast from each at the caller. The situation also arises with multicast
requests. The tag in the To header field serves to distinguish requests. The tag in the To header field serves to distinguish
responses at the UAC. It MUST be placed in the To field of the responses at the UAC. It MUST be placed in the To field of the
response by each instance when there is a possibility that the response by each instance when there is a possibility that the
request was forked at an intermediate proxy. This, in general, means request was forked at an intermediate proxy. The "tag" MUST be added
that the "tag" MUST be inserted when the URL in the To does not refer by UAS, registrars and redirect servers, but MUST NOT be inserted
to a fully qualified hostname. The "tag" MUST be added by UAS, into responses forwarded upstream by proxies. The "tag" is added for
registrars and redirect servers, but MUST NOT be inserted into all definitive responses for all methods, and MAY be added for
responses forwarded upstream by proxies. The "tag" is added for all
definitive responses for all methods, and MAY be added for
informational responses from a UAS or redirect server. All subsequent informational responses from a UAS or redirect server. All subsequent
transactions between two entities MUST include the "tag" parameter, transactions between two entities MUST include the "tag" parameter,
as described in Section 11. as described in Section 11.
See Section 6.21 for details of the "tag" parameter. See Section 6.21 for details of the "tag" parameter.
The "tag" parameter in To headers is ignored when matching responses The "tag" parameter in To headers is ignored when matching responses
to requests that did not contain a "tag" in their To header. to requests that did not contain a "tag" in their To header.
A SIP server returns a 400 (Bad Request) response if it receives a A SIP server returns a 400 (Bad Request) response if it receives a
request with a To header field containing a URI with a scheme it does request with a To header field containing a URI with a scheme it does
not recognize. not recognize.
Even if the "display-name" is empty, the "name-addr" form MUST be
used if the "addr-spec" contains a comma, question mark, or
semicolon.
The following are examples of valid To headers: The following are examples of valid To headers:
To: The Operator <sip:operator@cs.columbia.edu>;tag=287447 To: The Operator <sip:operator@cs.columbia.edu>;tag=287447
To: sip:+12125551212@server.phone2net.com To: sip:+12125551212@server.phone2net.com
Call-ID, To and From are needed to identify a call leg. Call-ID, To and From are needed to identify a call leg.
The distinction between call and call leg matters in calls The distinction between call and call leg matters in calls
with multiple responses from a forked request. The "tag" is with multiple responses from a forked request. The "tag" is
added to the To header field in the response to allow added to the To header field in the response to allow
forking of future requests for the same call by proxies, forking of future requests for the same call by proxies,
skipping to change at page 60, line 44 skipping to change at page 63, line 43
responding user agent servers. It also allows several responding user agent servers. It also allows several
instances of the callee to send requests that can be instances of the callee to send requests that can be
distinguished. distinguished.
6.38 Unsupported 6.38 Unsupported
The Unsupported response-header field lists the features not The Unsupported response-header field lists the features not
supported by the server. See Section 6.30 for a usage example and supported by the server. See Section 6.30 for a usage example and
motivation. motivation.
Syntax:
Unsupported = "Unsupported" ":" 1#option-tag
6.39 User-Agent 6.39 User-Agent
The User-Agent general-header field contains information about the The User-Agent general-header field contains information about the
client user agent originating the request. See [H14.42]. client user agent originating the request. The syntax and semantics
are defined in [H14.42].
6.40 Via 6.40 Via
The Via field indicates the path taken by the request so far. This The Via field indicates the path taken by the request so far. This
prevents request looping and ensures replies take the same path as prevents request looping and ensures replies take the same path as
the requests, which assists in firewall traversal and other unusual the requests, which assists in firewall traversal and other unusual
routing situations. routing situations.
6.40.1 Requests 6.40.1 Requests
The client originating the request MUST insert into the request a Via The client originating the request MUST insert into the request a Via
field containing its host name or network address and, if not the field containing its host name or network address and, if not the
default port number, the port number at which it wishes to receive default port number, the port number at which it wishes to receive
responses. (Note that this port number can differ from the UDP source responses. (Note that this port number can differ from the UDP source
port number of the request.) A fully-qualified domain name is port number of the request.) A fully-qualified domain name is
RECOMMENDED. Each subsequent proxy server that sends the request RECOMMENDED. Each subsequent proxy server that sends the request
onwards MUST add its own additional Via field before any existing Via onwards MUST add its own additional Via field before any existing Via
fields. A proxy that receives a redirection (3xx) response and then fields. A proxy that receives a redirection (3xx) response and then
searches recursively, MUST use the same Via headers as on the searches recursively, MUST use the same Via headers as on the
original request. original proxied request.
A proxy SHOULD check the top-most Via header field to ensure that it A proxy SHOULD check the top-most Via header field to ensure that it
contains the sender's correct network address, as seen from that contains the sender's correct network address, as seen from that
proxy. If the sender's address is incorrect, the proxy MUST add an proxy. If the sender's address is incorrect, the proxy MUST add an
additional "received" attribute, as described 6.40.2. additional "received" attribute, as described 6.40.2.
A host behind a network address translator (NAT) or A host behind a network address translator (NAT) or
firewall may not be able to insert a network address into firewall may not be able to insert a network address into
the Via header that can be reached by the next hop beyond the Via header that can be reached by the next hop beyond
the NAT. Hosts behind NATs or NAPTs MUST insert the local the NAT. Use of the received attribute allows SIP requests
port number of the outgoing socket, rather than the port to traverse NAT's which only modify the source IP address.
number for incoming requests, as NAPTs assume that NAT's which modify port numbers, called Network Address
responses return with reversed source and destination Port Translator's (NAPT) will not properly pass SIP when
ports. transported on UDP, in which case an application layer
gateway is required. When run over TCP, SIP stands a better
chance of traversing NAT's, since its port usage is
identical to HTTP in this case.
A proxy sending a request to a multicast address MUST add the "maddr" A proxy sending a request to a multicast address MUST add the "maddr"
parameter to its Via header field, and SHOULD add the "ttl" parameter to its Via header field, and SHOULD add the "ttl"
parameter. If a server receives a request which contained an "maddr" parameter. If a server receives a request which contained an "maddr"
parameter in the topmost Via field, it SHOULD send the response to parameter in the topmost Via field, it SHOULD send the response to
the multicast address listed in the "maddr" parameter. the multicast address listed in the "maddr" parameter.
If a proxy server receives a request which contains its own address If a proxy server receives a request which contains its own address
in the Via header value, it MUST respond with a 482 (Loop Detected) in the Via header value, it MUST respond with a 482 (Loop Detected)
status code. status code.
skipping to change at page 62, line 30 skipping to change at page 65, line 38
seen from that proxy. If the sender's address is incorrect, the proxy seen from that proxy. If the sender's address is incorrect, the proxy
MUST add a "received" parameter to the Via header field inserted by MUST add a "received" parameter to the Via header field inserted by
the previous hop. Such a modified Via header field is known as a the previous hop. Such a modified Via header field is known as a
receiver-tagged Via header field. An example is: receiver-tagged Via header field. An example is:
Via: SIP/2.0/UDP erlang.bell-telephone.com:5060 Via: SIP/2.0/UDP erlang.bell-telephone.com:5060
Via: SIP/2.0/UDP 10.0.0.1:5060 ;received=199.172.136.3 Via: SIP/2.0/UDP 10.0.0.1:5060 ;received=199.172.136.3
In this example, the message originated from 10.0.0.1 and traversed a In this example, the message originated from 10.0.0.1 and traversed a
NAT with the external address border.ieee.org (199.172.136.3) to NAT with the external address border.ieee.org (199.172.136.3) to
reach erlang.bell-telephone.com and added a parameter to the previous reach erlang.bell-telephone.com. The latter noticed the mismatch,
hop's Via header field, containing the address that the packet and added a parameter to the previous hop's Via header field,
actually came from. (Note that the NAT border.ieee.org is not a SIP containing the address that the packet actually came from. (Note that
server.) the NAT border.ieee.org is not a SIP server.)
6.40.3 Responses 6.40.3 Responses
Via header fields in responses are processed by a proxy or UAC Via header fields in responses are processed by a proxy or UAC
according to the following rules: according to the following rules:
1. The first Via header field should indicate the proxy or 1. The first Via header field should indicate the proxy or
client processing this response. If it does not, discard client processing this response. If it does not, discard
the message. Otherwise, remove this Via field. the message. Otherwise, remove this Via field.
skipping to change at page 63, line 50 skipping to change at page 67, line 12
treatment for receiver-tagged Via header fields (Section treatment for receiver-tagged Via header fields (Section
6.40.2). 6.40.2).
o If neither of these conditions is true, send the response to o If neither of these conditions is true, send the response to
the address contained in the "sent-by" value. If the request the address contained in the "sent-by" value. If the request
was sent using TCP, use the existing TCP connection if was sent using TCP, use the existing TCP connection if
available. available.
6.40.5 Syntax 6.40.5 Syntax
The format for a Via header field is shown in Fig. 10. The defaults The format for a Via header field is shown in Fig. 11. The defaults
for "protocol-name" and "transport" are "SIP" and "UDP", for "protocol-name" and "transport" are "SIP" and "UDP",
respectively. The "maddr" parameter, designating the multicast respectively. The "maddr" parameter, designating the multicast
address, and the "ttl" parameter, designating the time-to-live (TTL) address, and the "ttl" parameter, designating the time-to-live (TTL)
value, are included only if the request was sent via multicast. The value, are included only if the request was sent via multicast. The
"received" parameter is added only for receiver-added Via fields "received" parameter is added only for receiver-added Via fields
(Section 6.40.2). For reasons of privacy, a client or proxy may wish (Section 6.40.2). For reasons of privacy, a client or proxy may wish
to hide its Via information by encrypting it (see Section 6.22). The to hide its Via information by encrypting it (see Section 6.22). The
"hidden" parameter is included if this header field was hidden by the "hidden" parameter is included if this header field was hidden by the
upstream proxy (see 6.22). Note that privacy of the proxy relies on upstream proxy (see 6.22). Note that privacy of the proxy relies on
the cooperation of the next hop, as the next-hop proxy will, by the cooperation of the next hop, as the next-hop proxy will, by
necessity, know the IP address and port number of the source host. necessity, know the IP address and port number of the source host.
Via = ( "Via" $|$ "v") ":" 1#( sent-protocol sent-by Via = ( "Via" | "v") ":" 1#( sent-protocol sent-by
*( ";" via-params ) [ comment ] ) *( ";" via-params ) [ comment ] )
via-params = via-hidden | via-ttl | via-maddr via-params = via-hidden | via-ttl | via-maddr
| via-received | via-branch | via-received | via-branch
via-hidden = "hidden" via-hidden = "hidden"
via-ttl = "ttl" "=" ttl via-ttl = "ttl" "=" ttl
via-maddr = "maddr" "=" maddr via-maddr = "maddr" "=" maddr
via-received = "received" "=" host via-received = "received" "=" host
via-branch = "branch" "=" token via-branch = "branch" "=" token
sent-protocol = protocol-name "/" protocol-version "/" transport sent-protocol = protocol-name "/" protocol-version "/" transport
protocol-name = "SIP" $|$ token protocol-name = "SIP" | token
protocol-version = token protocol-version = token
transport = "UDP" $|$ "TCP" $|$ token transport = "UDP" | "TCP" | token
sent-by = ( host [ ":" port ] ) $|$ ( concealed-host ) sent-by = ( host [ ":" port ] ) | ( concealed-host )
concealed-host = token concealed-host = token
ttl = 1*3DIGIT ; 0 to 255 ttl = 1*3DIGIT ; 0 to 255
Figure 10: Syntax of Via header field Figure 11: Syntax of Via header field
The "branch" parameter is included by every forking proxy. The token The "branch" parameter is included by every forking proxy. The token
MUST be unique for each distinct request generated when a proxy MUST be unique for each distinct request generated when a proxy
forks. When a response arrives at the proxy it can use the branch forks. When a response arrives at the proxy it can use the branch
value to figure out which branch the response corresponds to. A proxy value to figure out which branch the response corresponds to. A proxy
which generates a single request (non-forking) MAY also insert the which generates a single request (non-forking) MAY also insert the
"branch" parameter. The identifier has to be unique only within a set "branch" parameter. The identifier has to be unique only within a set
of isomorphic requests. of isomorphic requests.
Via: SIP/2.0/UDP first.example.com:4000;ttl=16 Via: SIP/2.0/UDP first.example.com:4000;ttl=16
skipping to change at page 65, line 26 skipping to change at page 68, line 33
; the Warning header, for use in debugging ; the Warning header, for use in debugging
warn-text = quoted-string warn-text = quoted-string
A response MAY carry more than one Warning header. A response MAY carry more than one Warning header.
The "warn-text" should be in a natural language that is most likely The "warn-text" should be in a natural language that is most likely
to be intelligible to the human user receiving the response. This to be intelligible to the human user receiving the response. This
decision can be based on any available knowledge, such as the decision can be based on any available knowledge, such as the
location of the cache or user, the Accept-Language field in a location of the cache or user, the Accept-Language field in a
request, or the Content-Language field in a response. The default request, or the Content-Language field in a response. The default
language is English. language is i-default [31].
Any server MAY add Warning headers to a response. Proxy servers MUST Any server MAY add Warning headers to a response. Proxy servers MUST
place additional Warning headers before any Authorization headers. place additional Warning headers before any Authorization headers.
Within that constraint, Warning headers MUST be added after any Within that constraint, Warning headers MUST be added after any
existing Warning headers not covered by a signature. A proxy server existing Warning headers not covered by a signature. A proxy server
MUST NOT delete any Warning header field that it received with a MUST NOT delete any Warning header field that it received with a
response. response.
When multiple Warning headers are attached to a response, the user When multiple Warning headers are attached to a response, the user
agent SHOULD display as many of them as possible, in the order that agent SHOULD display as many of them as possible, in the order that
skipping to change at page 67, line 18 skipping to change at page 70, line 28
Examples: Examples:
Warning: 307 isi.edu "Session parameter 'foo' not understood" Warning: 307 isi.edu "Session parameter 'foo' not understood"
Warning: 301 isi.edu "Incompatible network address type 'E.164'" Warning: 301 isi.edu "Incompatible network address type 'E.164'"
6.42 WWW-Authenticate 6.42 WWW-Authenticate
The WWW-Authenticate response-header field MUST be included in 401 The WWW-Authenticate response-header field MUST be included in 401
(Unauthorized) response messages. The field value consists of at (Unauthorized) response messages. The field value consists of at
least one challenge that indicates the authentication scheme(s) and least one challenge that indicates the authentication scheme(s) and
parameters applicable to the Request-URI. See [H14.46] and [31]. parameters applicable to the Request-URI. See [H14.46] for a
definition of the syntax, and section 14 for an overview of usage.
The content of the "realm" parameter SHOULD be displayed to the user. The content of the "realm" parameter SHOULD be displayed to the user.
A user agent SHOULD cache the authorization credentials for a given A user agent SHOULD cache the authorization credentials for a given
value of the destination (To header) and "realm" and attempt to re- value of the destination (To header) and "realm" and attempt to re-
use these values on the next request for that destination. use these values on the next request for that destination.
In addition to the "basic" and "digest" authentication schemes In addition to the "basic" and "digest" authentication schemes
defined in the specifications cited above, SIP defines a new scheme, defined in the specifications cited above, SIP defines a new scheme,
PGP (RFC 2015, [32]), Section 14. Other schemes, such as S-MIME, are PGP (RFC 2015, [32]), Section 15. Other schemes, such as S/MIME, are
for further study. for further study.
7 Status Code Definitions 7 Status Code Definitions
The response codes are consistent with, and extend, HTTP/1.1 response The response codes are consistent with, and extend, HTTP/1.1 response
codes. Not all HTTP/1.1 response codes are appropriate, and only codes. Not all HTTP/1.1 response codes are appropriate, and only
those that are appropriate are given here. Other HTTP/1.1 response those that are appropriate are given here. Other HTTP/1.1 response
codes SHOULD NOT be used. Response codes not defined by HTTP/1.1 have codes SHOULD NOT be used. Response codes not defined by HTTP/1.1 have
codes x80 upwards to avoid clashes with future HTTP response codes. codes x80 upwards to avoid clashes with future HTTP response codes.
Also, SIP defines a new class, 6xx. The default behavior for unknown Also, SIP defines a new class, 6xx. The default behavior for unknown
skipping to change at page 68, line 22 skipping to change at page 71, line 34
located. located.
7.1.2 180 Ringing 7.1.2 180 Ringing
The called user agent has located a possible location where the user The called user agent has located a possible location where the user
has registered recently and is trying to alert the user. has registered recently and is trying to alert the user.
7.1.3 181 Call Is Being Forwarded 7.1.3 181 Call Is Being Forwarded
A proxy server MAY use this status code to indicate that the call is A proxy server MAY use this status code to indicate that the call is
being forwarded to a different set of destinations. The new being forwarded to a different set of destinations.
destinations are listed in Contact headers. Proxies SHOULD be
configurable not to reveal this information.
7.1.4 182 Queued 7.1.4 182 Queued
The called party is temporarily unavailable, but the callee has The called party is temporarily unavailable, but the callee has
decided to queue the call rather than reject it. When the callee decided to queue the call rather than reject it. When the callee
becomes available, it will return the appropriate final status becomes available, it will return the appropriate final status
response. The reason phrase MAY give further details about the status response. The reason phrase MAY give further details about the status
of the call, e.g., "5 calls queued; expected waiting time is 15 of the call, e.g., "5 calls queued; expected waiting time is 15
minutes". The server MAY issue several 182 responses to update the minutes". The server MAY issue several 182 responses to update the
caller about the status of the queued call. caller about the status of the queued call.
skipping to change at page 70, line 12 skipping to change at page 73, line 21
The user can no longer be found at the address in the Request-URI and The user can no longer be found at the address in the Request-URI and
the requesting client SHOULD retry at the new address given by the the requesting client SHOULD retry at the new address given by the
Contact header field (Section 6.13). The caller SHOULD update any Contact header field (Section 6.13). The caller SHOULD update any
local directories, address books and user location caches with this local directories, address books and user location caches with this
new value and redirect future requests to the address(es) listed. new value and redirect future requests to the address(es) listed.
7.3.3 302 Moved Temporarily 7.3.3 302 Moved Temporarily
The requesting client SHOULD retry the request at the new address(es) The requesting client SHOULD retry the request at the new address(es)
given by the Contact header field (Section 6.13). The duration of the given by the Contact header field (Section 6.13). The duration of
redirection can be indicated through an Expires (Section 6.20) the redirection can be indicated through an Expires (Section 6.20)
header. header.
7.3.4 380 Alternative Service 7.3.4 305 Use Proxy
The requested resource MUST be accessed through the proxy given by
the Contact field. The Contact field gives the URI of the proxy. The
recipient is expected to repeat this single request via the proxy.
305 responses MUST only be generated by user agent servers.
7.3.5 380 Alternative Service
The call was not successful, but alternative services are possible. The call was not successful, but alternative services are possible.
The alternative services are described in the message body of the The alternative services are described in the message body of the
response. Formats for such bodies are not defined here, and may be response. Formats for such bodies are not defined here, and may be
the subject of future standardization. the subject of future standardization.
7.4 Request Failure 4xx 7.4 Request Failure 4xx
4xx responses are definite failure responses from a particular 4xx responses are definite failure responses from a particular
server. The client SHOULD NOT retry the same request without server. The client SHOULD NOT retry the same request without
skipping to change at page 71, line 27 skipping to change at page 74, line 43
according to the accept headers sent in the request. according to the accept headers sent in the request.
7.4.8 407 Proxy Authentication Required 7.4.8 407 Proxy Authentication Required
This code is similar to 401 (Unauthorized), but indicates that the This code is similar to 401 (Unauthorized), but indicates that the
client MUST first authenticate itself with the proxy. The proxy MUST client MUST first authenticate itself with the proxy. The proxy MUST
return a Proxy-Authenticate header field (section 6.26) containing a return a Proxy-Authenticate header field (section 6.26) containing a
challenge applicable to the proxy for the requested resource. The challenge applicable to the proxy for the requested resource. The
client MAY repeat the request with a suitable Proxy-Authorization client MAY repeat the request with a suitable Proxy-Authorization
header field (section 6.27). SIP access authentication is explained header field (section 6.27). SIP access authentication is explained
in section 13.2 and [H11]. in section 13.2 and 14.
This status code is used for applications where access to the This status code is used for applications where access to the
communication channel (e.g., a telephony gateway) rather than the communication channel (e.g., a telephony gateway) rather than the
callee herself requires authentication. callee requires authentication.
7.4.9 408 Request Timeout 7.4.9 408 Request Timeout
The server could not produce a response, e.g., a user location, The server could not produce a response, e.g., a user location,
within the time indicated in the Expires request-header field. The within the time indicated in the Expires request-header field. The
client MAY repeat the request without modifications at any later client MAY repeat the request without modifications at any later
time. time.
7.4.10 409 Conflict 7.4.10 409 Conflict
skipping to change at page 72, line 34 skipping to change at page 75, line 50
7.4.14 414 Request-URI Too Long 7.4.14 414 Request-URI Too Long
The server is refusing to service the request because the Request-URI The server is refusing to service the request because the Request-URI
is longer than the server is willing to interpret. is longer than the server is willing to interpret.
7.4.15 415 Unsupported Media Type 7.4.15 415 Unsupported Media Type
The server is refusing to service the request because the message The server is refusing to service the request because the message
body of the request is in a format not supported by the requested body of the request is in a format not supported by the requested
resource for the requested method. resource for the requested method. The server SHOULD return a list of
acceptable formats using the Accept, Accept-Encoding and Accept-
The server SHOULD return a list of acceptable formats using the Language header fields.
Accept, Accept-Encoding and Accept-Language header fields.
7.4.16 420 Bad Extension 7.4.16 420 Bad Extension
The server did not understand the protocol extension specified in a The server did not understand the protocol extension specified in a
Require (Section 6.30) header field. Require (Section 6.30) header field.
7.4.17 480 Temporarily Unavailable 7.4.17 480 Temporarily Unavailable
The callee's end system was contacted successfully but the callee is The callee's end system was contacted successfully but the callee is
currently unavailable (e.g., not logged in or logged in in such a currently unavailable (e.g., not logged in or logged in in such a
manner as to preclude communication with the callee). The response manner as to preclude communication with the callee). The response
MAY indicate a better time to call in the Retry-After header. The MAY indicate a better time to call in the Retry-After header. The
user could also be available elsewhere (unbeknownst to this host), user could also be available elsewhere (unbeknownst to this host),
thus, this response does not terminate any searches. The reason thus, this response does not terminate any searches. The reason
phrase SHOULD indicate a more precise cause as to why the callee is phrase SHOULD indicate a more precise cause as to why the callee is
unavailable. This value SHOULD be setable by the user agent. Status unavailable. This value SHOULD be setable by the user agent. Status
486 (Busy Here) MAY be used to more precisely indicate a particular 486 (Busy Here) MAY be used to more precisely indicate a particular
reason for the call failure. reason for the call failure.
This status is also returned by a redirect server that recognizes the
user identified by the Request-URI, but does not currently have a
valid forwarding location for that user.
7.4.18 481 Call Leg/Transaction Does Not Exist 7.4.18 481 Call Leg/Transaction Does Not Exist
This status is returned under two conditions: The server received a This status is returned under two conditions: The server received a
BYE request that does not match any existing call leg or the server BYE request that does not match any existing call leg or the server
received a CANCEL request that does not match any existing received a CANCEL request that does not match any existing
transaction. (A server simply discards an ACK referring to an unknown transaction. (A server simply discards an ACK referring to an unknown
transaction.) transaction.)
7.4.19 482 Loop Detected 7.4.19 482 Loop Detected
skipping to change at page 75, line 24 skipping to change at page 78, line 39
temporary overloading or maintenance of the server. The implication temporary overloading or maintenance of the server. The implication
is that this is a temporary condition which will be alleviated after is that this is a temporary condition which will be alleviated after
some delay. If known, the length of the delay MAY be indicated in a some delay. If known, the length of the delay MAY be indicated in a
Retry-After header. If no Retry-After is given, the client MUST Retry-After header. If no Retry-After is given, the client MUST
handle the response as it would for a 500 response. handle the response as it would for a 500 response.
Note: The existence of the 503 status code does not imply that a Note: The existence of the 503 status code does not imply that a
server has to use it when becoming overloaded. Some servers MAY wish server has to use it when becoming overloaded. Some servers MAY wish
to simply refuse the connection. to simply refuse the connection.
7.5.5 504 Gateway Timeout 7.5.5 504 Gateway Time-out
The server, while acting as a gateway, did not receive a timely The server, while acting as a gateway, did not receive a timely
response from the server (e.g., a location server) it accessed in response from the server (e.g., a location server) it accessed in
attempting to complete the request. attempting to complete the request.
7.5.6 505 Version Not Supported 7.5.6 505 Version Not Supported
The server does not support, or refuses to support, the SIP protocol The server does not support, or refuses to support, the SIP protocol
version that was used in the request message. The server is version that was used in the request message. The server is
indicating that it is unable or unwilling to complete the request indicating that it is unable or unwilling to complete the request
using the same major version as the client, other than with this using the same major version as the client, other than with this
error message. The response MAY contain an entity describing why error message. The response MAY contain an entity describing why that
that version is not supported and what other protocols are supported version is not supported and what other protocols are supported by
by that server. The format for such an entity is not defined here and that server. The format for such an entity is not defined here and
may be the subject of future standardization. may be the subject of future standardization.
7.6 Global Failures 6xx 7.6 Global Failures 6xx
6xx responses indicate that a server has definitive information about 6xx responses indicate that a server has definitive information about
a particular user, not just the particular instance indicated in the a particular user, not just the particular instance indicated in the
Request-URI. All further searches for this user are doomed to failure Request-URI. All further searches for this user are doomed to failure
and pending searches SHOULD be terminated. and pending searches SHOULD be terminated.
7.6.1 600 Busy Everywhere 7.6.1 600 Busy Everywhere
skipping to change at page 77, line 5 skipping to change at page 80, line 21
this specification, the BYE request MUST NOT contain a message body. this specification, the BYE request MUST NOT contain a message body.
For ACK, INVITE and OPTIONS, the message body is always a session For ACK, INVITE and OPTIONS, the message body is always a session
description. The use of message bodies for REGISTER requests is for description. The use of message bodies for REGISTER requests is for
further study. further study.
For response messages, the request method and the response status For response messages, the request method and the response status
code determine the type and interpretation of any message body. All code determine the type and interpretation of any message body. All
responses MAY include a body. Message bodies for 1xx responses responses MAY include a body. Message bodies for 1xx responses
contain advisory information about the progress of the request. 2xx contain advisory information about the progress of the request. 2xx
responses to INVITE requests contain session descriptions. In 3xx responses to INVITE requests contain session descriptions. In 3xx
respones, the message body MAY contain the description of alternative responses, the message body MAY contain the description of
destinations or services, as described in Section 7.3. For responses alternative destinations or services, as described in Section 7.3.
with status 400 or greater, the message body MAY contain additional, For responses with status 400 or greater, the message body MAY
human-readable information about the reasons for failure. It is contain additional, human-readable information about the reasons for
RECOMMENDED that information in 1xx and 300 and greater responses be failure. It is RECOMMENDED that information in 1xx and 300 and
of type text/plain or text/html greater responses be of type text/plain or text/html
8.2 Message Body Type 8.2 Message Body Type
The Internet media type of the message body MUST be given by the The Internet media type of the message body MUST be given by the
Content-Type header field. If the body has undergone any encoding Content-Type header field. If the body has undergone any encoding
(such as compression) then this MUST be indicated by the Content- (such as compression) then this MUST be indicated by the Content-
Encoding header field, otherwise Content-Encoding MUST be omitted. If Encoding header field, otherwise Content-Encoding MUST be omitted. If
applicable, the character set of the message body is indicated as applicable, the character set of the message body is indicated as
part of the Content-Type header-field value. part of the Content-Type header-field value.
skipping to change at page 78, line 4 skipping to change at page 81, line 17
short field name long field name note short field name long field name note
c Content-Type c Content-Type
e Content-Encoding e Content-Encoding
f From f From
i Call-ID i Call-ID
m Contact from "moved" m Contact from "moved"
l Content-Length l Content-Length
s Subject s Subject
t To t To
v Via v Via
Thus, the message in section 15.2 could also be written:
Thus, the message in section 16.2 could also be written:
INVITE sip:schooler@vlsi.caltech.edu SIP/2.0 INVITE sip:schooler@vlsi.caltech.edu SIP/2.0
v:SIP/2.0/UDP 131.215.131.131;maddr=239.128.16.254;ttl=16 v:SIP/2.0/UDP 131.215.131.131;maddr=239.128.16.254;ttl=16
v:SIP/2.0/UDP 128.16.64.19 v:SIP/2.0/UDP 128.16.64.19
f:sip:mjh@isi.edu f:sip:mjh@isi.edu
t:sip:schooler@cs.caltech.edu t:sip:schooler@cs.caltech.edu
i:62729-27@128.16.64.19 i:62729-27@128.16.64.19
c:application/sdp c:application/sdp
CSeq: 4711 INVITE CSeq: 4711 INVITE
l:187 l:187
skipping to change at page 79, line 19 skipping to change at page 82, line 35
matches the value for an existing call leg, the server compares the matches the value for an existing call leg, the server compares the
CSeq header field value. If less than or equal to the current CSeq header field value. If less than or equal to the current
sequence number, the request is a retransmission. Otherwise, it is a sequence number, the request is a retransmission. Otherwise, it is a
new request. If the From header does not match an existing call leg, new request. If the From header does not match an existing call leg,
a new call leg is created. a new call leg is created.
If the Call-ID was not found, a new call leg is created, with entries If the Call-ID was not found, a new call leg is created, with entries
for the To, From and Call-ID headers. In this case, the To header for the To, From and Call-ID headers. In this case, the To header
field should not have contained a tag. The server returns a response field should not have contained a tag. The server returns a response
containing the same To value, but with a unique tag added. The tag containing the same To value, but with a unique tag added. The tag
MAY be omitted if the To refers to a fully qualified host name. MAY be omitted if the request contained only one Via header field.
10.1.2 Responses 10.1.2 Responses
A server MAY issue one or more provisional responses at any time A server MAY issue one or more provisional responses at any time
before sending a final response. If a stateful proxy, user agent before sending a final response. If a stateful proxy, user agent
server, redirect server or registrar cannot respond to a request with server, redirect server or registrar cannot respond to a request with
a final response within 200 ms, it MUST issue a provisional (1xx) a final response within 200 ms, it SHOULD issue a provisional (1xx)
response as soon as possible. Stateless proxies MUST NOT issue response as soon as possible. Stateless proxies MUST NOT issue
provisional responses on their own. provisional responses on their own.
Responses are mapped to requests by the matching To, From, Call-ID, Responses are mapped to requests by the matching To, From, Call-ID,
CSeq headers and the branch parameter of the first Via header. CSeq headers and the branch parameter of the first Via header.
Responses terminate request retransmissions even if they have Via Responses terminate request retransmissions even if they have Via
headers that cause them to be delivered to an upstream client. headers that cause them to be delivered to an upstream client.
A stateful proxy may receive a response that it does not have state A stateful proxy may receive a response that it does not have state
for, that is, where it has no a record of an associated request. If for, that is, where it has no a record of an associated request. If
skipping to change at page 80, line 31 skipping to change at page 83, line 47
Recall that responses are not generated by the next-hop Recall that responses are not generated by the next-hop
stateless server, but generated by either a proxy server or stateless server, but generated by either a proxy server or
the user agent server. Thus, the stateless proxy can only the user agent server. Thus, the stateless proxy can only
use the Via header field to forward the response. use the Via header field to forward the response.
10.2.2 Multicast UDP 10.2.2 Multicast UDP
Requests MAY be multicast; multicast requests likely feature a host- Requests MAY be multicast; multicast requests likely feature a host-
independent Request-URI. This request SHOULD be scoped to ensure it independent Request-URI. This request SHOULD be scoped to ensure it
is not forwarded beyond the boundaries of the administrative system. is not forwarded beyond the boundaries of the administrative system.
This MAY be done with either TTL or administrative scopes[27], This MAY be done with either TTL or administrative scopes[25],
depending on what is implemented in the network. However, use of depending on what is implemented in the network.
administrative scoping is RECOMMENDED.
A client receiving a multicast query does not have to check whether A client receiving a multicast query does not have to check whether
the host part of the Request-URI matches its own host or domain name. the host part of the Request-URI matches its own host or domain name.
If the request was received via multicast, the response is also If the request was received via multicast, the response is also
returned via multicast. Responses to multicast requests are multicast returned via multicast. Responses to multicast requests are multicast
with the same TTL as the request, where the TTL is derived from the with the same TTL as the request, where the TTL is derived from the
ttl parameter in the Via header (Section 6.40). ttl parameter in the Via header (Section 6.40).
To avoid response implosion, servers MUST NOT answer multicast To avoid response implosion, servers MUST NOT answer multicast
requests with a status code other than 2xx or 6xx. The server delays requests with a status code other than 2xx or 6xx. The server delays
its response by a random interval uniformly distributed between zero its response by a random interval uniformly distributed between zero
and one second. Servers MAY suppress responses if they hear a and one second. Servers MAY suppress responses if they hear a lower-
lower-numbered or 6xx response from another group member prior to numbered or 6xx response from another group member prior to sending.
sending. Servers do not respond to CANCEL requests received via Servers do not respond to CANCEL requests received via multicast to
multicast to avoid request implosion. A proxy or UAC SHOULD send a avoid request implosion. A proxy or UAC SHOULD send a CANCEL on
CANCEL on receiving the first 2xx or 6xx response to a multicast receiving the first 2xx or 6xx response to a multicast request.
request.
Server response suppression is a MAY since it requires a Server response suppression is a MAY since it requires a
server to violate some basic message processing rules. Lets server to violate some basic message processing rules. Lets
say A sends a multicast request, and it is received by B,C, say A sends a multicast request, and it is received by B,C,
and D. B sends a 200 response. The topmost Via field in the and D. B sends a 200 response. The topmost Via field in the
response will contain the address of A. C will also receive response will contain the address of A. C will also receive
this response, and could use it to suppress its own this response, and could use it to suppress its own
response. However, C would normally not examine this response. However, C would normally not examine this
response, as the topmost Via is not its own. Normally, a response, as the topmost Via is not its own. Normally, a
response received with an incorrect topmost Via MUST be response received with an incorrect topmost Via MUST be
skipping to change at page 82, line 20 skipping to change at page 85, line 37
A SIP client using UDP SHOULD retransmit a BYE, CANCEL, OPTIONS, or A SIP client using UDP SHOULD retransmit a BYE, CANCEL, OPTIONS, or
REGISTER request with an exponential backoff, starting at a T1 second REGISTER request with an exponential backoff, starting at a T1 second
interval, doubling the interval for each packet, and capping off at a interval, doubling the interval for each packet, and capping off at a
T2 second interval. This means that after the first packet is sent, T2 second interval. This means that after the first packet is sent,
the second is sent T1 seconds later, the next 2*T1 seconds after the second is sent T1 seconds later, the next 2*T1 seconds after
that, the next 4*T1 seconds after that, and so on, until the interval that, the next 4*T1 seconds after that, and so on, until the interval
hits T2. Subsequent retransmissions are spaced by T2 seconds. If the hits T2. Subsequent retransmissions are spaced by T2 seconds. If the
client receives a provisional response, it continues to retransmit client receives a provisional response, it continues to retransmit
the request, but with an interval of T2 seconds. Retransmissions the request, but with an interval of T2 seconds. Retransmissions
cease when the client has sent a total of eleven packets, or receives cease when the client has sent a total of eleven packets, or receives
a definitive response. Default values for T1 and T2 are 500ms and 4s, a definitive response. Default values for T1 and T2 are 500 ms and 4
respectively. Clients MAY use larger values, but SHOULD NOT use s, respectively. Clients MAY use larger values, but SHOULD NOT use
smaller ones. After the server sends a final response, it cannot be smaller ones. Servers retransmit the response upon receipt of a
sure the client has received the response, and thus SHOULD cache the request retransmission. After the server sends a final response, it
results for at least 10*T2 seconds to avoid having to, for example, cannot be sure the client has received the response, and thus SHOULD
contact the user or location server again upon receiving a cache the results for at least 10*T2 seconds to avoid having to, for
retransmission. example, contact the user or location server again upon receiving a
request retransmission.
Use of the exponential backoff is for congestion control Use of the exponential backoff is for congestion control
purposes. However, the back-off must cap off, since request purposes. However, the back-off must cap off, since request
retransmissions are used to trigger response retransmissions are used to trigger response
retransmissions at the server. Without a cap, the loss of a retransmissions at the server. Without a cap, the loss of a
single response could significantly increase transaction single response could significantly increase transaction
latencies. latencies.
The value of the initial retransmission timer is smaller than that The value of the initial retransmission timer is smaller than that
that for TCP since it is expected that network paths suitable for that for TCP since it is expected that network paths suitable for
skipping to change at page 84, line 9 skipping to change at page 87, line 28
For UDP, A SIP client SHOULD retransmit a SIP INVITE request with an For UDP, A SIP client SHOULD retransmit a SIP INVITE request with an
interval that starts at T1 seconds, and doubles after each packet interval that starts at T1 seconds, and doubles after each packet
transmission. The client ceases retransmissions if it receives a transmission. The client ceases retransmissions if it receives a
provisional or definitive response, or once it has sent a total of 7 provisional or definitive response, or once it has sent a total of 7
request packets. request packets.
A server which transmits a provisional response should retransmit it A server which transmits a provisional response should retransmit it
upon reception of a duplicate request. A server which transmits a upon reception of a duplicate request. A server which transmits a
final response should retransmit it with an interval that starts at final response should retransmit it with an interval that starts at
T1 seconds, and doubles for each subsequent packet. Retransmissions T1 seconds, and doubles for each subsequent packet. Response
cease when any one of the following occurs: retransmissions cease when any one of the following occurs:
1. An ACK request for the same transaction is received; 1. An ACK request for the same transaction is received;
2. a BYE request for the same call leg is received; 2. a BYE request for the same call leg is received;
3. a CANCEL request for the same call leg is received and the 3. a CANCEL request for the same call leg is received and the
final response status was equal or greater to 300; final response status was equal or greater to 300;
4. the response has been transmitted 7 times. 4. the response has been transmitted 7 times.
skipping to change at page 84, line 36 skipping to change at page 88, line 7
the same destination as the original INVITE request. ACKs for final the same destination as the original INVITE request. ACKs for final
responses other than 2xx are sent to the same server that the responses other than 2xx are sent to the same server that the
original request was sent to, using the same Request-URI as the original request was sent to, using the same Request-URI as the
original request. Note, however, that the To header field in the ACK original request. Note, however, that the To header field in the ACK
is copied from the response being acknowledged, not the request, and is copied from the response being acknowledged, not the request, and
thus MAY additionally contain the tag parameter. Also note than thus MAY additionally contain the tag parameter. Also note than
unlike 2xx final responses, a proxy generates an ACK for non-2xx unlike 2xx final responses, a proxy generates an ACK for non-2xx
final responses. final responses.
The ACK request MUST NOT be acknowledged to prevent a response-ACK The ACK request MUST NOT be acknowledged to prevent a response-ACK
feedback loop. Fig. 11 and 12 show the client and server state feedback loop. Fig. 12 and 13 show the client and server state
diagram for invitations. diagram for invitations.
The mechanism in Sec. 10.4 would not work well for INVITE The mechanism in Sec. 10.4 would not work well for INVITE
because of the long delays between INVITE and a final because of the long delays between INVITE and a final
response. If the 200 response were to get lost, the callee response. If the 200 response were to get lost, the callee
would believe the call to exist, but the voice path would would believe the call to exist, but the voice path would
be dead since the caller does not know that the callee has be dead since the caller does not know that the callee has
picked up. Thus, the INVITE retransmission interval would picked up. Thus, the INVITE retransmission interval would
have to be on the order of a second or two to limit the have to be on the order of a second or two to limit the
duration of this state confusion. Retransmitting the duration of this state confusion. Retransmitting the
response with an exponential back-off helps ensure that the response with an exponential back-off helps ensure that the
response is received, without placing an undue burden on response is received, without placing an undue burden on
the network.
10.5.2 TCP
A user agent using TCP MUST NOT retransmit requests, but uses the
same algorithm as for UDP (Section 10.5.1) to retransmit responses
until it receives an ACK.
It is necessary to retransmit 2xx responses as their
reliability is assured end-to-end only. If the chain of
proxies has a UDP link in the middle, it could lose the
response, with no possibility of recovery. For simplicity,
we also retransmit non-2xx responses, although that is not
strictly necessary.
10.6 Reliability for ACK Requests
The ACK request does not generate responses. It is only generated
when a response to an INVITE request arrives (see Section 10.5). This
behavior is independent of the transport protocol. Note that the ACK
request MAY take a different path than the original INVITE request,
and MAY even cause a new TCP connection to be opened in order to send
it.
10.7 ICMP Handling
Handling of ICMP messages in the case of UDP messages is
straightforward. For requests, a host, network, port, or protocol
+===========+ +===========+
* * * *
...........>* Initial *<;;;;;;;;;; ...........>* Initial *<;;;;;;;;;;
: 7 pkts * * ; : 7 INVITE * * ;
: sent +===========+ ; : sent +===========+ ;
: | ; : | ;
: | - ; : | - ;
: | INVITE ; : | INVITE ;
: | ; : | ;
: v ; : v ;
: ************* ; : ************* ;
: timer <--* * ; : T1*2^n <--* * ;
: INVITE -->* Calling *--------+ ; : INVITE -->* Calling *--------+ ;
: * * | ; : * * | ;
: ************* | ; : ************* | ;
: : | | ; : : | | ;
:.............: | 1xx xxx | ; :.............: | 1xx xxx | ;
| - ACK | ; | - ACK | ;
| | ; | | ;
v | ; v | ;
************* | ; ************* | ;
* * | ; * * | ;
skipping to change at page 85, line 38 skipping to change at page 89, line 38
************* | ; ************* | ;
| | ; | | ;
|<-------------+ ; |<-------------+ ;
| ; | ;
v ; v ;
************* ; ************* ;
xxx <--* * ; xxx <--* * ;
ACK -->* Completed * ; ACK -->* Completed * ;
* * ; * * ;
************* ; ************* ;
; 32s ; ; 32s (for proxy);
;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;
event (xxx=status) event (xxx=status)
message message
Figure 11: State transition diagram of client for INVITE method Figure 12: State transition diagram of client for INVITE method
the network.
10.5.2 TCP
7 pkts sent +===============+ 7 pkts sent +===============+
+-------------->* * +-------------->* *
| * Initial *<............... | * Initial *<...............
|;;;;;;;;;;;;;;>* * |;;;;;;;;;;;;;;>* *
|; +===============+ : |; +===============+ :
|; CANCEL ! : |; CANCEL ! :
|; 200 ! : |; 200 ! :
|; ! INVITE : |; ! INVITE :
|; ! 1xx : |; ! 1xx :
|; ! : |; ! :
skipping to change at page 86, line 27 skipping to change at page 90, line 27
|; 1xx <--* Call proceed. *..............>: |; 1xx <--* Call proceed. *..............>:
|; * * : |; * * :
|;;;;;;;;;;;;;;;***************** : |;;;;;;;;;;;;;;;***************** :
|; ! ! : |; ! ! :
|: ! ! : |: ! ! :
|; failure ! ! picks up : |; failure ! ! picks up :
|; >= 300 ! ! 200 : |; >= 300 ! ! 200 :
|; +-------+ +-------+ : |; +-------+ +-------+ :
|; v v : |; v v :
|; *********** *********** : |; *********** *********** :
|;INVITE<* *< timer->* *>INVITE : |;INVITE<* *<T1*2^n->* *>INVITE :
|;status>* failure *>status<-* success *<status : |;status>* failure *>status<-* success *<status :
|; * * * * : |; * * * * :
|;;;;;;;;*********** *********** : |;;;;;;;;*********** *********** :
| ! : | | ! : : | ! : | | ! : :
| ! : | | ! : : | ! : | | ! : :
+-------------!-:-+------------+ ! : : +-------------!-:-+------------+ ! : :
! :.................!..:.........>: ! :.................!..:.........>:
! ! BYE : ! ! BYE :
+---------+---------+ 200 : +---------+---------+ 200 :
! ACK : ! ACK :
skipping to change at page 86, line 50 skipping to change at page 90, line 50
***************** : ***************** :
V---* * : V---* * :
ACK * Confirmed * : ACK * Confirmed * :
|-->* * : |-->* * :
***************** . ***************** .
: : : :
:......................>: :......................>:
event event
message sent message sent
Figure 12: State transition diagram of server for INVITE method Figure 13: State transition diagram of server for INVITE method
A client using TCP MUST NOT retransmit requests, but uses the same
algorithm as for UDP (Section 10.5.1) to retransmit responses until
it receives an ACK.
It is necessary to retransmit 2xx responses as their
reliability is assured end-to-end only. If the chain of
proxies has a UDP link in the middle, it could lose the
response, with no possibility of recovery. For simplicity,
we also retransmit non-2xx responses, although that is not
strictly necessary.
10.6 Reliability for ACK Requests
The ACK request does not generate responses. It is only generated
when a response to an INVITE request arrives (see Section 10.5). This
behavior is independent of the transport protocol. Note that the ACK
request MAY take a different path than the original INVITE request,
and MAY even cause a new TCP connection to be opened in order to send
it.
10.7 ICMP Handling
Handling of ICMP messages in the case of UDP messages is
straightforward. For requests, a host, network, port, or protocol
unreachable error SHOULD be treated as if a 400-class response was unreachable error SHOULD be treated as if a 400-class response was
received. For responses, these errors SHOULD cause the server to received. For responses, these errors SHOULD cause the server to
cease retransmitting the response. cease retransmitting the response.
Source quench ICMP messages SHOULD be ignored. TTL exceeded errors Source quench ICMP messages SHOULD be ignored. TTL exceeded errors
SHOULD be ignored. Parameter problem errors SHOULD be treated as if a SHOULD be ignored. Parameter problem errors SHOULD be treated as if a
400-class response was received. 400-class response was received.
11 Behavior of SIP User Agents 11 Behavior of SIP User Agents
skipping to change at page 88, line 13 skipping to change at page 91, line 36
like to be contacted for transactions from the callee back to the like to be contacted for transactions from the callee back to the
caller. caller.
11.2 Callee Issues Response 11.2 Callee Issues Response
When the initial INVITE request is received at the callee, the callee When the initial INVITE request is received at the callee, the callee
can accept, redirect, or reject the call. In all of these cases, it can accept, redirect, or reject the call. In all of these cases, it
formulates a response. The response MUST copy the To, From, Call-ID, formulates a response. The response MUST copy the To, From, Call-ID,
CSeq and Via fields from the request. Additionally, the responding CSeq and Via fields from the request. Additionally, the responding
UAS MUST add the tag parameter to the To field in the response if the UAS MUST add the tag parameter to the To field in the response if the
To field in the request was not the fully-qualified hostname of the request contained more than one Via header field. Since a request
UAS. Since a request from a UAC may fork and arrive at multiple from a UAC may fork and arrive at multiple hosts, the tag parameter
hosts, the tag parameter serves to distinguish, at the UAC, multiple serves to distinguish, at the UAC, multiple responses from different
responses from different UAS's. The UAS MAY add a Contact header UAS's. The UAS MAY add a Contact header field in the response. It
field in the response. It contains an address where the callee would contains an address where the callee would like to be contacted for
like to be contacted for subsequent transactions, including the ACK subsequent transactions, including the ACK for the current INVITE.
for the current INVITE. The UAS stores the values of the To and From The UAS stores the values of the To and From field, including any
field, including any tags. These become the local and remote tags. These become the local and remote addresses of the call leg,
addresses of the call leg, respectively. respectively.
11.3 Caller Receives Response to Initial Request 11.3 Caller Receives Response to Initial Request
Multiple responses may arrive at the UAC for a single INVITE request, Multiple responses may arrive at the UAC for a single INVITE request,
due to a forking proxy. Each response is distinguished by the "tag" due to a forking proxy. Each response is distinguished by the "tag"
parameter in the To header field, and each represents a distinct call parameter in the To header field, and each represents a distinct call
leg. The caller MAY choose to acknowledge or terminate the call with leg. The caller MAY choose to acknowledge or terminate the call with
each responding UAS. To acknowledge, it sends an ACK request, and to each responding UAS. To acknowledge, it sends an ACK request, and to
terminate it sends a BYE request. The To header field in the ACK or terminate it sends a BYE request. The To header field in the ACK or
BYE MUST be the same as the To field in the 200 response, including BYE MUST be the same as the To field in the 200 response, including
skipping to change at page 90, line 14 skipping to change at page 93, line 37
server can either be stateful or stateless. When stateful, a proxy server can either be stateful or stateless. When stateful, a proxy
remembers the incoming request which generated outgoing requests, and remembers the incoming request which generated outgoing requests, and
the outgoing requests. A stateless proxy forgets all information once the outgoing requests. A stateless proxy forgets all information once
an outgoing request is generated. A forking proxy SHOULD be stateful. an outgoing request is generated. A forking proxy SHOULD be stateful.
Proxies that accept TCP connections MUST be stateful. Proxies that accept TCP connections MUST be stateful.
Otherwise, if the proxy were to lose a request, the TCP Otherwise, if the proxy were to lose a request, the TCP
client would never retransmit it. client would never retransmit it.
A stateful proxy SHOULD NOT become stateless until after it sends a A stateful proxy SHOULD NOT become stateless until after it sends a
definitive response upstream, at least 32 seconds after it definitive response upstream, and at least 32 seconds after it
received a definitive response. received a definitive response.
A stateful proxy acts as a virtual UAS/UAC. It implements the server A stateful proxy acts as a virtual UAS/UAC. It implements the server
state machine when receiving requests, and the client state machine state machine when receiving requests, and the client state machine
for generating outgoing requests, with the exception of receiving a for generating outgoing requests, with the exception of receiving a
2xx response to an INVITE. Instead of generating an ACK, the 2xx 2xx response to an INVITE. Instead of generating an ACK, the 2xx
response is always forwarded upstream towards the caller. response is always forwarded upstream towards the caller.
Furthermore, ACK's for 200 responses to INVITE's are always proxied Furthermore, ACK's for 200 responses to INVITE's are always proxied
downstream towards the UAS, as they would be for a stateless proxy. downstream towards the UAS, as they would be for a stateless proxy.
skipping to change at page 92, line 4 skipping to change at page 95, line 27
requests. If there is no match, the response is forwarded upstream to requests. If there is no match, the response is forwarded upstream to
the address listed in the Via field. If there is a match, the the address listed in the Via field. If there is a match, the
"branch" tag in the Via field is examined. If it matches a known "branch" tag in the Via field is examined. If it matches a known
branch identifier, the response is for the given branch, and branch identifier, the response is for the given branch, and
processed by the virtual client for the given branch. Otherwise, the processed by the virtual client for the given branch. Otherwise, the
response is dropped. response is dropped.
A stateful proxy should obey the rules in Section 12.4 to determine A stateful proxy should obey the rules in Section 12.4 to determine
if the response should be proxied upstream. If it is to be proxied, if the response should be proxied upstream. If it is to be proxied,
the same rules for stateless proxies above are followed, with the the same rules for stateless proxies above are followed, with the
following addition for TCP. If request was received via TCP following addition for TCP. If a request was received via TCP
(indicated by the protocol in the top Via header, the proxy checks to (indicated by the protocol in the top Via header), the proxy checks
see if it has a connection currently open to that address. If so, the to see if it has a connection currently open to that address. If so,
response is sent on that connection. Otherwise, a new TCP connection the response is sent on that connection. Otherwise, a new TCP
is opened to the address and port in the Via field, and the response connection is opened to the address and port in the Via field, and
is sent there. Note that this implies that a UAC or proxy MUST be the response is sent there. Note that this implies that a UAC or
prepared to receive responses on the incoming side of a TCP proxy MUST be prepared to receive responses on the incoming side of a
connection. Definitive non 200-class responses MUST be retransmitted TCP connection. Definitive non 200-class responses MUST be
by the proxy, even over a TCP connection. retransmitted by the proxy, even over a TCP connection.
12.3.7 Stateless, Non-Forking Proxy 12.3.7 Stateless, Non-Forking Proxy
Proxies in this category issue at most a single unicast request for Proxies in this category issue at most a single unicast request for
each incoming SIP request, that is, they do not "fork" requests. each incoming SIP request, that is, they do not "fork" requests.
However, servers MAY choose to always operate in a mode that allows However, servers MAY choose to always operate in a mode that allows
issuing of several requests, as described in Section 12.4. issuing of several requests, as described in Section 12.4.
The server can forward the request and any responses. It does not The server can forward the request and any responses. It does not
have to maintain any state for the SIP transaction. Reliability is have to maintain any state for the SIP transaction. Reliability is
skipping to change at page 92, line 30 skipping to change at page 96, line 4
The server can forward the request and any responses. It does not The server can forward the request and any responses. It does not
have to maintain any state for the SIP transaction. Reliability is have to maintain any state for the SIP transaction. Reliability is
assured by the next redirect or stateful proxy server in the server assured by the next redirect or stateful proxy server in the server
chain. chain.
A proxy server SHOULD cache the result of any address translations A proxy server SHOULD cache the result of any address translations
and the response to speed forwarding of retransmissions. After the and the response to speed forwarding of retransmissions. After the
cache entry has been expired, the server cannot tell whether an cache entry has been expired, the server cannot tell whether an
incoming request is actually a retransmission of an older request. incoming request is actually a retransmission of an older request.
The server will treat it as a new request and commence another The server will treat it as a new request and commence another
search. search.
12.4 Forking Proxy 12.4 Forking Proxy
The server MUST respond to the request immediately with a 100 The server MUST respond to the request immediately with a 100
(Trying) response. (Trying) response.
Successful responses to an INVITE request SHOULD contain a Contact Successful responses to an INVITE request MAY contain a Contact
header field so that the following ACK or BYE bypasses the proxy header field so that the following ACK or BYE bypasses the proxy
search mechanism. If the proxy requires future requests to be routed search mechanism. If the proxy requires future requests to be routed
through it, it adds a Record-Route header to the request (Section through it, it adds a Record-Route header to the request (Section
6.29). 6.29).
The following C-code describes the behavior of a proxy server issuing The following C-code describes the behavior of a proxy server issuing
several requests in response to an incoming INVITE request. The several requests in response to an incoming INVITE request. The
function request(r, a, b) sends a SIP request of type r to address a, function request(r, a, b) sends a SIP request of type r to address a,
with branch id b. await_response() waits until a response is received with branch id b. await_response() waits until a response is received
and returns the response. close(a) closes the TCP connection to and returns the response. close(a) closes the TCP connection to
skipping to change at page 97, line 38 skipping to change at page 101, line 12
plaintext include destination address (To) and the forwarding path plaintext include destination address (To) and the forwarding path
(Via) of the call. The Authorization header field MUST remain in the (Via) of the call. The Authorization header field MUST remain in the
clear if it contains a digital signature as the signature is clear if it contains a digital signature as the signature is
generated after encryption, but MAY be encrypted if it contains generated after encryption, but MAY be encrypted if it contains
"basic" or "digest" authentication. The From header field SHOULD "basic" or "digest" authentication. The From header field SHOULD
normally remain in the clear, but MAY be encrypted if required, in normally remain in the clear, but MAY be encrypted if required, in
which case some proxies MAY return a 401 (Unauthorized) status if which case some proxies MAY return a 401 (Unauthorized) status if
they require a From field. they require a From field.
Other header fields MAY be encrypted or MAY travel in the clear as Other header fields MAY be encrypted or MAY travel in the clear as
desired by the sender. The Subject, Allow, Call-ID, and Content-Type desired by the sender. The Subject, Allow and Content-Type header
header fields will typically be encrypted. The Accept, Accept- fields will typically be encrypted. The Accept, Accept-Language,
Language, Date, Expires, Priority, Require, Cseq, and Timestamp Date, Expires, Priority, Require, Call-ID, Cseq, and Timestamp header
header fields will remain in the clear. fields will remain in the clear.
All fields that will remain in the clear MUST precede those that will All fields that will remain in the clear MUST precede those that will
be encrypted. The message is encrypted starting with the first be encrypted. The message is encrypted starting with the first
character of the first header field that will be encrypted and character of the first header field that will be encrypted and
continuing through to the end of the message body. If no header continuing through to the end of the message body. If no header
fields are to be encrypted, encrypting starts with the second CRLF fields are to be encrypted, encrypting starts with the second CRLF
pair after the last header field, as shown below. Carriage return and pair after the last header field, as shown below. Carriage return and
line feed characters have been made visible as "$", and the encrypted line feed characters have been made visible as "$", and the encrypted
part of the message is outlined. part of the message is outlined.
INVITE sip:watson@boston.bell-telephone.com SIP/2.0$ INVITE sip:watson@boston.bell-telephone.com SIP/2.0$
Via: SIP/2.0/UDP 169.130.12.5$ Via: SIP/2.0/UDP 169.130.12.5$
To: T. A. Watson <sip:watson@bell-telephone.com>$ To: T. A. Watson <sip:watson@bell-telephone.com>$
From: A. Bell <sip:a.g.bell@bell-telephone.com>$ From: A. Bell <sip:a.g.bell@bell-telephone.com>$
Encryption: PGP version=5.0$ Encryption: PGP version=5.0$
Content-Length: 224$ Content-Length: 224$
Call-ID: 187602141351@worcester.bell-telephone.com$
CSeq: 488$ CSeq: 488$
$ $
******************************************************* *******************************************************
* Call-ID: 187602141351@worcester.bell-telephone.com$ *
* Subject: Mr. Watson, come here.$ * * Subject: Mr. Watson, come here.$ *
* Content-Type: application/sdp$ * * Content-Type: application/sdp$ *
* $ * * $ *
* v=0$ * * v=0$ *
* o=bell 53655765 2353687637 IN IP4 128.3.4.5$ * * o=bell 53655765 2353687637 IN IP4 128.3.4.5$ *
* c=IN IP4 135.180.144.94$ * * c=IN IP4 135.180.144.94$ *
* m=audio 3456 RTP/AVP 0 3 4 5$ * * m=audio 3456 RTP/AVP 0 3 4 5$ *
******************************************************* *******************************************************
An Encryption header field MUST be added to indicate the encryption An Encryption header field MUST be added to indicate the encryption
skipping to change at page 99, line 45 skipping to change at page 103, line 21
Normally, proxies are not allowed to alter end-to-end header fields Normally, proxies are not allowed to alter end-to-end header fields
and message bodies. Proxies MAY, however, encrypt an unsigned request and message bodies. Proxies MAY, however, encrypt an unsigned request
or response with the key of the call recipient. or response with the key of the call recipient.
Proxies need to encrypt a SIP request if the end system Proxies need to encrypt a SIP request if the end system
cannot perform encryption or to enforce organizational cannot perform encryption or to enforce organizational
security policies. security policies.
13.1.4 Hop-by-Hop Encryption 13.1.4 Hop-by-Hop Encryption
It is RECOMMENDED that SIP requests and responses are also protected SIP requests and responses MAY also be protected by security
by security mechanisms at the transport or network layer. mechanisms at the transport or network layer. No particular mechanism
is defined or recommended here. Two possibilities are IPSEC [34] or
TLS [35]. The use of a particular mechanism will generally need to be
specified out of band, through manual configuration, for example.
13.1.5 Via field encryption 13.1.5 Via field encryption
When Via fields are to be hidden, a proxy that receives a request
containing an appropriate "Hide: hop" header field (as specified in
section 6.22) SHOULD encrypt the header field. As only the proxy that
encrypts the field will decrypt it, the algorithm chosen is entirely
up to the proxy implementor. Two methods satisfy these requirements:
o The server keeps a cache of Via fields and the associated To When Via header fields are to be hidden, a proxy that receives a
field, and replaces the Via field with an index into the request containing an appropriate "Hide: hop" header field (as
cache. On the reverse path, take the Via field from the cache specified in section 6.22) SHOULD encrypt the header field. As only
rather than the message. the proxy that encrypts the field will decrypt it, the algorithm
chosen is entirely up to the proxy implementor. Two methods satisfy
these requirements:
o The server keeps a cache of Via header fields and the
associated To header field, and replaces the Via header field
with an index into the cache. On the reverse path, take the
Via header field from the cache rather than the message.
This is insufficient to prevent message looping, and so an This is insufficient to prevent message looping, and so an
additional ID MUST be added so that the proxy can detect loops. additional ID MUST be added so that the proxy can detect loops.
This SHOULD NOT normally be the address of the proxy as the goal This SHOULD NOT normally be the address of the proxy as the goal
is to hide the route, so instead a sufficiently large random is to hide the route, so instead a sufficiently large random
number SHOULD be used by the proxy and maintained in the cache. number SHOULD be used by the proxy and maintained in the cache.
It is possible for replies to get directed to the wrong It is possible for replies to get directed to the wrong
originator if the cache entry gets reused, so great care needs originator if the cache entry gets reused, so great care needs
to be taken to ensure this does not happen. to be taken to ensure this does not happen.
skipping to change at page 100, line 47 skipping to change at page 104, line 27
cryptographic measures that are used to ensure the authenticity of cryptographic measures that are used to ensure the authenticity of
the SIP message also serve to authenticate the originator of the the SIP message also serve to authenticate the originator of the
message. However, the "basic" and "digest" authentication mechanism message. However, the "basic" and "digest" authentication mechanism
offer authentication only, without message integrity. offer authentication only, without message integrity.
Transport-layer or network-layer authentication MAY be used for hop- Transport-layer or network-layer authentication MAY be used for hop-
by-hop authentication. SIP also extends the HTTP WWW-Authenticate by-hop authentication. SIP also extends the HTTP WWW-Authenticate
(Section 6.42) and Authorization (Section 6.11) header field and (Section 6.42) and Authorization (Section 6.11) header field and
their Proxy counterparts to include cryptographically strong their Proxy counterparts to include cryptographically strong
signatures. SIP also supports the HTTP "basic" and "digest" schemes signatures. SIP also supports the HTTP "basic" and "digest" schemes
and other HTTP authentication schemes to be defined that offer a (see Section 14) and other HTTP authentication schemes to be defined
rudimentary mechanism of ascertaining the identity of the caller. that offer a rudimentary mechanism of ascertaining the identity of
the caller.
Since SIP requests are often sent to parties with which no Since SIP requests are often sent to parties with which no
prior communication relationship has existed, we do not prior communication relationship has existed, we do not
specify authentication based on shared secrets. specify authentication based on shared secrets.
SIP requests MAY be authenticated using the Authorization header SIP requests MAY be authenticated using the Authorization header
field to include a digital signature of certain header fields, the field to include a digital signature of certain header fields, the
request method and version number and the payload, none of which are request method and version number and the payload, none of which are
modified between client and called user agent. The Authorization modified between client and called user agent. The Authorization
header field is used in requests to authenticate the request header field is used in requests to authenticate the request
originator end-to-end to proxies and the called user agent, and in originator end-to-end to proxies and the called user agent, and in
responses to authenticate the called user agent or proxies returning responses to authenticate the called user agent or proxies returning
their own failure codes. If required, hop-by-hop authentication can their own failure codes. If required, hop-by-hop authentication can
be provided, for example, by the IPSEC Authentication Header. be provided, for example, by the IPSEC Authentication Header.
SIP does not dictate which digital signature scheme is used for SIP does not dictate which digital signature scheme is used for
authentication, but does define how to provide authentication using authentication, but does define how to provide authentication using
PGP in Section 14. As indicated above, SIP implementations MAY also PGP in Section 15. As indicated above, SIP implementations MAY also
use "basic" and "digest" authentication and other authentication use "basic" and "digest" authentication and other authentication
mechanisms defined for HTTP. Note that "basic" authentication has mechanisms defined for HTTP. Note that "basic" authentication has
severe security limitations. The following does not apply to these severe security limitations. The following does not apply to these
schemes. schemes.
To cryptographically sign a SIP request, the order of the SIP header To cryptographically sign a SIP request, the order of the SIP header
fields is important. When an Authorization header field is present, fields is important. When an Authorization header field is present,
it indicates that all header fields following the Authorization it indicates that all header fields following the Authorization
header field have been included in the signature. Therefore, hop- header field have been included in the signature. Therefore, hop-
by-hop header fields which MUST or SHOULD be modified by proxies MUST by-hop header fields which MUST or SHOULD be modified by proxies MUST
precede the Authorization header field as they will generally be precede the Authorization header field as they will generally be
modified or added-to by proxy servers. Hop-by-hop header fields modified or added-to by proxy servers. Hop-by-hop header fields
which MAY be modified by a proxy MAY appear before or after the which MAY be modified by a proxy MAY appear before or after the
Authorization header. When the appear before, the MAY be modified by Authorization header. When they appear before, they MAY be modified
a proxy. When they appear after, they MUST NOT be modified by a by a proxy. When they appear after, they MUST NOT be modified by a
proxy. To sign a request, a client constructs a message from the proxy. To sign a request, a client constructs a message from the
request method (in upper case) followed, without LWS, by the SIP request method (in upper case) followed, without LWS, by the SIP
version number, followed, again without LWS, by the request headers version number, followed, again without LWS, by the request headers
to be signed and the message body. The message thus constructed is to be signed and the message body. The message thus constructed is
then signed. then signed.
For example, if the SIP request is to be: For example, if the SIP request is to be:
INVITE sip:watson@boston.bell-telephone.com SIP/2.0 INVITE sip:watson@boston.bell-telephone.com SIP/2.0
Via: SIP/2.0/UDP 169.130.12.5 Via: SIP/2.0/UDP 169.130.12.5
skipping to change at page 102, line 23 skipping to change at page 106, line 4
To: T. A. Watson <sip:watson@bell-telephone.com> To: T. A. Watson <sip:watson@bell-telephone.com>
Call-ID: 187602141351@worcester.bell-telephone.com Call-ID: 187602141351@worcester.bell-telephone.com
Subject: Mr. Watson, come here. Subject: Mr. Watson, come here.
Content-Type: application/sdp Content-Type: application/sdp
Content-Length: ... Content-Length: ...
v=0 v=0
o=bell 53655765 2353687637 IN IP4 128.3.4.5 o=bell 53655765 2353687637 IN IP4 128.3.4.5
c=IN IP4 135.180.144.94 c=IN IP4 135.180.144.94
m=audio 3456 RTP/AVP 0 3 4 5 m=audio 3456 RTP/AVP 0 3 4 5
Clients wishing to authenticate requests MUST construct the portion Clients wishing to authenticate requests MUST construct the portion
of the mesage below the Authorization header using a canonical form. of the message below the Authorization header using a canonical form.
This allows a proxy to parse the message, take it apart, and This allows a proxy to parse the message, take it apart, and
reconstruct it, without causing an authentication failure due to reconstruct it, without causing an authentication failure due to
extra white space, for example. Canonical form consists of the extra white space, for example. Canonical form consists of the
following rules: following rules:
o No short form header fields
o Header field names are capitalized as shown in this document o Header field names are capitalized as shown in this document
o No white space between the header name and the colon o No white space between the header name and the colon
o A single space after the colon o A single space after the colon
o No white space before or after a semicolon separating o Line termination with a CRLF
parameters
o No white space before or after an equal sign separating a
parameter from its value
o No line folding o No line folding
o No comma separated lists of header values; each must appear as o No comma separated lists of header values; each must appear as
a separate header a separate header
o Only a single SP between tokens, between tokens and quoted
strings, and between quoted strings; no SP after last token or
quoted string
o No LWS between tokens and separators, except as described
above for after the colon in header fields
Note that if a message is encrypted and authenticated using a digital Note that if a message is encrypted and authenticated using a digital
signature, when the message is generated encryption is performed signature, when the message is generated encryption is performed
before the digital signature is generated. On receipt, the digital before the digital signature is generated. On receipt, the digital
signature is checked before decryption. signature is checked before decryption.
A client MAY require that a server sign its response by including a A client MAY require that a server sign its response by including a
Require: org.ietf.sip.signed-response request header field. The Require: org.ietf.sip.signed-response request header field. The
client indicates the desired authentication method via the WWW- client indicates the desired authentication method via the WWW-
Authenticate header. Authenticate header.
skipping to change at page 104, line 22 skipping to change at page 108, line 4
normal Require response of 420 (Bad Extension). normal Require response of 420 (Bad Extension).
13.3 Callee Privacy 13.3 Callee Privacy
User location and SIP-initiated calls can violate a callee's privacy. User location and SIP-initiated calls can violate a callee's privacy.
An implementation SHOULD be able to restrict, on a per-user basis, An implementation SHOULD be able to restrict, on a per-user basis,
what kind of location and availability information is given out to what kind of location and availability information is given out to
certain classes of callers. certain classes of callers.
13.4 Known Security Problems 13.4 Known Security Problems
With either TCP or UDP, a denial of service attack exists by a rogue With either TCP or UDP, a denial of service attack exists by a rogue
proxy sending 6xx responses. Although a client SHOULD choose to proxy sending 6xx responses. Although a client SHOULD choose to
ignore such responses if it requested authentication, a proxy cannot ignore such responses if it requested authentication, a proxy cannot
do so. It is obliged to forward the 6xx response back to the client. do so. It is obliged to forward the 6xx response back to the client.
The client can then ignore the response, but if it repeats the The client can then ignore the response, but if it repeats the
request it will probably reach the same rogue proxy again, and the request it will probably reach the same rogue proxy again, and the
process will repeat. process will repeat.
14 SIP Security Using PGP 14 SIP Authentication using HTTP Basic and Digest Schemes
14.1 PGP Authentication Scheme SIP implementations MAY use HTTP's basic and digest authentication
mechanisms to provide a rudimentary form of security. This section
overviews usage of these mechanisms in SIP. The basic operation is
almost completely identical to that for HTTP [36]. This section
outlines this operation, pointing to [36] for details, and noting the
differences when used in SIP.
14.1 Framework
The framework for SIP authentication parallels that for HTTP [36]. In
particular, the BNF for auth-scheme, auth-param, challenge, realm,
realm-value, and credentials is identical. The 401 response is used
by user agent servers in SIP to challenge the authorization of a user
agent client. Additionally, registrars and redirect servers MAY make
use of 401 responses for authorization, but proxies MUST NOT, and
instead MAY use the 407 response. The requirements for inclusion of
the Proxy-Authenticate, Proxy-Authorization, WWW-Authenticate, and
Authorization in the various messages is identical to [36].
Since SIP does not have the concept of a canonical root URL, the
notion of protections spaces are interpreted differently for SIP. The
realm is a protection domain for all SIP URIs with the same value for
the userinfo, host and port part of the SIP Request-URI. For example:
INVITE sip:alice.wonderland@example.com SIP/2.0
WWW-Authenticate: Basic realm="business"
and
INVITE sip:aw@example.com SIP/2.0
WWW-Authenticate: Basic realm="business"
define different protection realms according to this rule.
When a UAC resubmits a request with its credentials after receiving a
401 or 407 response, it MUST increment the CSeq header field as it
would normally do when sending an updated request.
14.2 Basic Authentication
The rules for basic authentication follow those defined in [36], but
with the words "origin server" replaced with "user agent server,
redirect server , or registrar".
Since SIP URIs are not hierarchical, the paragraph in [36] that
states that "all paths at or deeper than the depth of the last
symbolic element in the path field of the Request-URI also are within
the protection space specified by the Basic realm value of the
current challenge" does not apply for SIP. SIP clients MAY
preemptively send the corresponding Authorization header with
requests for SIP URIs within the same protection realm (as defined
above) without receipt of another challenge from the server.
14.3 Digest Authentication
The rules for digest authentication follow those defined in [36],
with "HTTP 1.1" replaced by "SIP/2.0" in addition to the following
differences:
1. The URI included in the challenge has the following BNF:
URI = SIP-URL
2. The BNF for digest-uri-value is:
digest-uri-value = Request-URI ; a defined in Section
4.3
3. The example procedure for choosing a nonce based on Etag
does not work for SIP.
4. The Authentication-Info and Proxy-Authentication-Info
fields are not used in SIP.
5. The text in [36] regarding cache operation does not apply
to SIP.
6. [36] requires that a server check that the URI in the
request line, and the URI included in the Authorization
header, point to the same resource. In a SIP context, these
two URI's may actually refer to different users, due to
forwarding at some proxy. Therefore, in SIP, a server MAY
check that the request-uri in the Authorization header
corresponds to a user that the server is willing to accept
forwarded or direct calls for.
14.4 Proxy-Authentication
The use of the Proxy-Authentication and Proxy-Authorization parallel
that as described in [36], with one difference. Proxies MUST NOT add
the Proxy-Authorization header. 407 responses MUST be forwarded
upstream towards the client following the procedures for any other
response. It is the client's responsibility to add the Proxy-
Authorization header containing credentials for the proxy which has
asked for authentication.
If a proxy were to resubmit a request with a Proxy-
Authorization header field, it would need to increment the
CSeq in the new request. However, this would mean that the
UAC which submitted the original request would discard a
response from the UAS, as the CSeq value would be
different.
See sections 6.26 and 6.27 for additional information on usage of
these fields as they apply to SIP.
15 SIP Security Using PGP
15.1 PGP Authentication Scheme
The "pgp" authentication scheme is based on the model that the client The "pgp" authentication scheme is based on the model that the client
authenticates itself with a request signed with the client's private authenticates itself with a request signed with the client's private
key. The server can then ascertain the origin of the request if it key. The server can then ascertain the origin of the request if it
has access to the public key, preferably signed by a trusted third has access to the public key, preferably signed by a trusted third
party. party.
14.1.1 The WWW-Authenticate Response Header 15.1.1 The WWW-Authenticate Response Header
WWW-Authenticate = "WWW-Authenticate" ":" "pgp" pgp-challenge WWW-Authenticate = "WWW-Authenticate" ":" "pgp" pgp-challenge
pgp-challenge = * (";" pgp-params ) pgp-challenge = * (";" pgp-params )
pgp-params = realm | pgp-version | pgp-algorithm pgp-params = realm | pgp-version | pgp-algorithm | nonce
realm = "realm" "=" realm-value realm = "realm" "=" realm-value
realm-value = quoted-string realm-value = quoted-string
pgp-version = "version" "=" digit *( "." digit ) *letter pgp-version =
"version" "=" <"> digit *( "." digit ) *letter <">
pgp-algorithm = "algorithm" "=" ( "md5" | "sha1" | token ) pgp-algorithm = "algorithm" "=" ( "md5" | "sha1" | token )
nonce = "nonce" "=" nonce-value
nonce-value = quoted-string
The meanings of the values of the parameters used above are as The meanings of the values of the parameters used above are as
follows: follows:
realm: A string to be displayed to users so they know which identity realm: A string to be displayed to users so they know which identity
to use. This string SHOULD contain at least the name of the host to use. This string SHOULD contain at least the name of the host
performing the authentication and MAY additionally indicate the performing the authentication and MAY additionally indicate the
collection of users who might have access. An example might be " collection of users who might have access. An example might be "
Users with call-out privileges ". Users with call-out privileges ".
pgp-algorithm: The value of this parameter indicates the PGP message pgp-algorithm: The value of this parameter indicates the PGP message
integrity check (MIC) to be used to produce the signature. If integrity check (MIC) to be used to produce the signature. If
this not present it is assumed to be "md5". The currently this not present it is assumed to be "md5". The currently
defined values are "md5" for the MD5 checksum, and "sha1" for defined values are "md5" for the MD5 checksum, and "sha1" for
the SHA.1 algorithm. the SHA.1 algorithm.
pgp-version: The version of PGP that the client MUST use. Common pgp-version: The version of PGP that the client MUST use. Common
values are "2.6.2" and "5.0". The default is 5.0. values are "2.6.2" and "5.0". The default is 5.0.
nonce: A server-specified data string which should be uniquely
generated each time a 401 response is made. It is RECOMMENDED
that this string be base64 or hexadecimal data. Specifically,
since the string is passed in the header lines as a quoted
string, the double-quote character is not allowed. The contents
of the nonce are implementation dependent. The quality of the
implementation depends on a good choice. Since the nonce is used
only to prevent replay attacks and is signed, a time stamp in
units convenient to the server is sufficient.
Replay attacks within the duration of the call setup are of
limited interest, so that timestamps with a resolution of a
few seconds are often should be sufficient. In that case,
the server does not have to keep a record of the nonces.
Example: Example:
WWW-Authenticate: pgp ;version="5.0" WWW-Authenticate: pgp ;version="5.0"
;realm="Your Startrek identity, please" ;algorithm="md5" ;realm="Your Startrek identity, please" ;algorithm=md5
;nonce="913082051"
14.1.2 The Authorization Request Header 15.1.2 The Authorization Request Header
The client is expected to retry the request, passing an Authorization The client is expected to retry the request, passing an Authorization
header line, which is defined as follows. header line, which is defined as follows.
Authorization = "Authorization" ":" "pgp" *( ";" pgp-response ) Authorization = "Authorization" ":" "pgp" *( ";" pgp-response )
pgp-response = realm | pgp-version | pgp-signature | signed-by pgp-response = realm | pgp-version | pgp-signature
| signed-by | nonce
pgp-signature = "signature" "=" quoted-string pgp-signature = "signature" "=" quoted-string
signed-by = "signed-by" "=" <"> URI <"> signed-by = "signed-by" "=" <"> URI <">
The signature MUST correspond to the From header of the request The client MUST increment the CSeq header before resubmitting the
unless the signed-by parameter is provided. request. The signature MUST correspond to the From header of the
request unless the signed-by parameter is provided.
pgp-signature: The PGP ASCII-armored signature [33], as it appears pgp-signature: The PGP ASCII-armored signature [33], as it appears
between the "BEGIN PGP MESSAGE" and "END PGP MESSAGE" between the "BEGIN PGP MESSAGE" and "END PGP MESSAGE"
delimiters, without the version indication. The signature is delimiters, without the version indication. The signature is
included without any linebreaks. included without any linebreaks.
The signature is computed across the request method, request version The signature is computed across the nonce (if present), request
and header fields following the Authorization header and the message method, request version and header fields following the Authorization
body, in the same order as they appear in the message. The request header and the message body, in the same order as they appear in the
method and version are prepended to the header fields without any message. The request method and version are prepended to the header
white space. The signature is computed across the headers as sent, fields without any white space. The signature is computed across the
including any folding (folding is the insertion of a CR-LF followed headers as sent, and the terminating CRLF. The CRLF following the
by a space to allow headers to span multiple lines in a message) and Authorization header is NOT included in the signature.
the terminating CRLF. The CRLF following the Authorization header is
NOT included in the signature. A server MAY be configured not to generate nonces only if replay
attacks are not a concern.
Not generating nonces avoids the additional set of request,
401 response and possibly ACK messages and reduces delay by
one round-trip time.
Using the ASCII-armored version is about 25% less space- Using the ASCII-armored version is about 25% less space-
efficient than including the binary signature, but it is efficient than including the binary signature, but it is
significantly easier for the receiver to piece together. significantly easier for the receiver to piece together.
Versions of the PGP program always include the full Versions of the PGP program always include the full
(compressed) signed text in their output unless ASCII- (compressed) signed text in their output unless ASCII-
armored mode ( -sta ) is specified. Typical signatures are armored mode ( -sta ) is specified. Typical signatures are
about 200 bytes long. -- The PGP signature mechanism allows about 200 bytes long. -- The PGP signature mechanism allows
the client to simply pass the request to an external PGP the client to simply pass the request to an external PGP
program. This relies on the requirement that proxy servers program. This relies on the requirement that proxy servers
skipping to change at page 106, line 38 skipping to change at page 113, line 22
name of the signing entity, expressed as a URI. name of the signing entity, expressed as a URI.
Receivers of signed SIP messages SHOULD discard any end-to-end header Receivers of signed SIP messages SHOULD discard any end-to-end header
fields above the Authorization header, as they may have been fields above the Authorization header, as they may have been
maliciously added en route by a proxy. maliciously added en route by a proxy.
Example: Example:
Authorization: pgp version="5.0" Authorization: pgp version="5.0"
;realm="Your Startrek identity, please" ;realm="Your Startrek identity, please"
;nonce="913082051"
;signature="iQB1AwUBNNJiUaYBnHmiiQh1AQFYsgL/Wt3dk6TWK81/b0gcNDf ;signature="iQB1AwUBNNJiUaYBnHmiiQh1AQFYsgL/Wt3dk6TWK81/b0gcNDf
VAUGU4rhEBW972IPxFSOZ94L1qhCLInTPaqhHFw1cb3lB01rA0RhpV4t5yCdUt VAUGU4rhEBW972IPxFSOZ94L1qhCLInTPaqhHFw1cb3lB01rA0RhpV4t5yCdUt
SRYBSkOK29o5e1KlFeW23EzYPVUm2TlDAhbcjbMdfC+KLFX SRYBSkOK29o5e1KlFeW23EzYPVUm2TlDAhbcjbMdfC+KLFX
=aIrx" =aIrx"
14.2 PGP Encryption Scheme 15.2 PGP Encryption Scheme
The PGP encryption scheme uses the following syntax: The PGP encryption scheme uses the following syntax:
Encryption = "Encryption" ":" "pgp" pgp-eparams Encryption = "Encryption" ":" "pgp" pgp-eparams
pgp-eparams = 1# ( pgp-version | pgp-encoding ) pgp-eparams = 1# ( pgp-version | pgp-encoding )
pgp-encoding = "encoding" "=" "ascii" | token pgp-encoding = "encoding" "=" "ascii" | token
encoding: Describes the encoding or "armor" used by PGP. The value encoding: Describes the encoding or "armor" used by PGP. The value
"ascii" refers to the standard PGP ASCII armor, without the "ascii" refers to the standard PGP ASCII armor, without the
lines containing "BEGIN PGP MESSAGE" and "END PGP MESSAGE" and lines containing "BEGIN PGP MESSAGE" and "END PGP MESSAGE" and
without the version identifier. By default, the encrypted part without the version identifier. By default, the encrypted part
is included as binary. is included as binary.
Example: Example:
Encryption: pgp version="2.6.2", encoding="ascii" Encryption: pgp version="2.6.2", encoding="ascii"
14.3 Response-Key Header Field for PGP 15.3 Response-Key Header Field for PGP
Response-Key = "Response-Key" ":" "pgp" pgp-eparams Response-Key = "Response-Key" ":" "pgp" pgp-eparams
pgp-eparams = 1# ( pgp-version | pgp-encoding | pgp-key) pgp-eparams = 1# ( pgp-version | pgp-encoding | pgp-key)
pgp-key = "key" "=" quoted-string pgp-key = "key" "=" quoted-string
If ASCII encoding has been requested via the encoding parameter, the If ASCII encoding has been requested via the encoding parameter, the
key parameter contains the user's public key as extracted from the key parameter contains the user's public key as extracted from the
pgp key ring with the "pgp -kxa user ". pgp key ring with the "pgp -kxa user ".
Example: Example:
Response-Key: pgp version="2.6.2", encoding="ascii", Response-Key: pgp version="2.6.2", encoding="ascii",
key="mQBtAzNWHNYAAAEDAL7QvAdK2utY05wuUG+ItYK5tCF8HNJM60sU4rLaV+eUnkMk key="mQBtAzNWHNYAAAEDAL7QvAdK2utY05wuUG+ItYK5tCF8HNJM60sU4rLaV+eUnkMk
mOmJWtc2wXcZx1XaXb2lkydTQOesrUR75IwNXBuZXPEIMThEa5WLsT7VLme7njnx mOmJWtc2wXcZx1XaXb2lkydTQOesrUR75IwNXBuZXPEIMThEa5WLsT7VLme7njnx
sE86SgWmAZx5ookIdQAFEbQxSGVubmluZyBTY2h1bHpyaW5uZSA8c2NodWx6cmlu sE86SgWmAZx5ookIdQAFEbQxSGVubmluZyBTY2h1bHpyaW5uZSA8c2NodWx6cmlu
bmVAY3MuY29sdW1iaWEuZWR1Pg== bmVAY3MuY29sdW1iaWEuZWR1Pg==
=+y19" =+y19"
15 Examples 16 Examples
In the following examples, we often omit the message body and the In the following examples, we often omit the message body and the
corresponding Content-Length and Content-Type headers for brevity. corresponding Content-Length and Content-Type headers for brevity.
15.1 Registration 16.1 Registration
A user at host saturn.bell-tel.com registers on start-up, via A user at host saturn.bell-tel.com registers on start-up, via
multicast, with the local SIP server named bell-tel.com. In the multicast, with the local SIP server named bell-tel.com. In the
example, the user agent on saturn expects to receive SIP requests on example, the user agent on saturn expects to receive SIP requests on
UDP port 3890. UDP port 3890.
C->S: REGISTER sip:bell-tel.com SIP/2.0 C->S: REGISTER sip:bell-tel.com SIP/2.0
Via: SIP/2.0/UDP saturn.bell-tel.com Via: SIP/2.0/UDP saturn.bell-tel.com
From: sip:watson@bell-tel.com From: sip:watson@bell-tel.com
To: sip:watson@bell-tel.com To: sip:watson@bell-tel.com
Call-ID: 70710@saturn.bell-tel.com Call-ID: 70710@saturn.bell-tel.com
skipping to change at page 109, line 4 skipping to change at page 115, line 30
C->S: REGISTER sip:bell-tel.com SIP/2.0 C->S: REGISTER sip:bell-tel.com SIP/2.0
Via: SIP/2.0/UDP saturn.bell-tel.com Via: SIP/2.0/UDP saturn.bell-tel.com
From: sip:watson@bell-tel.com From: sip:watson@bell-tel.com
To: sip:watson@bell-tel.com To: sip:watson@bell-tel.com
Call-ID: 70710@saturn.bell-tel.com Call-ID: 70710@saturn.bell-tel.com
CSeq: 3 REGISTER CSeq: 3 REGISTER
Contact: sip:tawatson@example.com Contact: sip:tawatson@example.com
Now, the server will forward any request for Watson to the server at Now, the server will forward any request for Watson to the server at
example.com, using the Request-URI tawatson@example.com. example.com, using the Request-URI tawatson@example.com. For the
server at example.com to reach Watson, he will need to send a
REGISTER there, or inform the server of his current location through
some other means.
It is possible to use third-party registration. Here, the secretary It is possible to use third-party registration. Here, the secretary
jon.diligent registers his boss, T. Watson: jon.diligent registers his boss, T. Watson:
C->S: REGISTER sip:bell-tel.com SIP/2.0 C->S: REGISTER sip:bell-tel.com SIP/2.0
Via: SIP/2.0/UDP pluto.bell-tel.com Via: SIP/2.0/UDP pluto.bell-tel.com
From: sip:jon.diligent@bell-tel.com From: sip:jon.diligent@bell-tel.com
To: sip:watson@bell-tel.com To: sip:watson@bell-tel.com
Call-ID: 17320@pluto.bell-tel.com Call-ID: 17320@pluto.bell-tel.com
CSeq: 1 REGISTER CSeq: 1 REGISTER
Contact: sip:tawatson@example.com Contact: sip:tawatson@example.com
The request could be send to either the registrar at bell-tel.com or The request could be send to either the registrar at bell-tel.com or
the server at example.com. In the latter case, the server at the server at example.com. In the latter case, the server at
example.com would proxy the request to the address indicated in the example.com would proxy the request to the address indicated in the
Request-URI. Then, Max-Forwards header could be used to restrict the Request-URI. Then, Max-Forwards header could be used to restrict the
registration to that server. registration to that server.
15.2 Invitation to a Multicast Conference 16.2 Invitation to a Multicast Conference
The first example invites schooler@vlsi.cs.caltech.edu to a multicast The first example invites schooler@vlsi.cs.caltech.edu to a multicast
session. All examples use the Session Description Protocol (SDP) (RFC session. All examples use the Session Description Protocol (SDP) (RFC
2327 [6]) as the session description format. 2327 [6]) as the session description format.
15.2.1 Request 16.2.1 Request
C->S: INVITE sip:schooler@cs.caltech.edu SIP/2.0 C->S: INVITE sip:schooler@cs.caltech.edu SIP/2.0
Via: SIP/2.0/UDP csvax.cs.caltech.edu;branch=8348 Via: SIP/2.0/UDP csvax.cs.caltech.edu;branch=8348
;maddr=239.128.16.254;ttl=16 ;maddr=239.128.16.254;ttl=16
Via: SIP/2.0/UDP north.east.isi.edu Via: SIP/2.0/UDP north.east.isi.edu
From: Mark Handley <sip:mjh@isi.edu> From: Mark Handley <sip:mjh@isi.edu>
To: Eve Schooler <sip:schooler@caltech.edu> To: Eve Schooler <sip:schooler@caltech.edu>
Call-ID: 2963313058@north.east.isi.edu Call-ID: 2963313058@north.east.isi.edu
CSeq: 1 INVITE CSeq: 1 INVITE
Subject: SIP will be discussed, too Subject: SIP will be discussed, too
skipping to change at page 110, line 27 skipping to change at page 117, line 11
indicates that the request is currently being being addressed to indicates that the request is currently being being addressed to
schooler@cs.caltech.edu, the local address that csvax looked up for schooler@cs.caltech.edu, the local address that csvax looked up for
the callee. the callee.
In this case, the session description is using the Session In this case, the session description is using the Session
Description Protocol (SDP), as stated in the Content-Type header. Description Protocol (SDP), as stated in the Content-Type header.
The header is terminated by an empty line and is followed by a The header is terminated by an empty line and is followed by a
message body containing the session description. message body containing the session description.
15.2.2 Response 16.2.2 Response
The called user agent, directly or indirectly through proxy servers, The called user agent, directly or indirectly through proxy servers,
indicates that it is alerting ("ringing") the called party: indicates that it is alerting ("ringing") the called party:
S->C: SIP/2.0 180 Ringing S->C: SIP/2.0 180 Ringing
Via: SIP/2.0/UDP csvax.cs.caltech.edu;branch=8348 Via: SIP/2.0/UDP csvax.cs.caltech.edu;branch=8348
;maddr=239.128.16.254;ttl=16 ;maddr=239.128.16.254;ttl=16
Via: SIP/2.0/UDP north.east.isi.edu Via: SIP/2.0/UDP north.east.isi.edu
From: Mark Handley <sip:mjh@isi.edu> From: Mark Handley <sip:mjh@isi.edu>
To: Eve Schooler <sip:schooler@caltech.edu> ;tag=9883472 To: Eve Schooler <sip:schooler@caltech.edu> ;tag=9883472
skipping to change at page 111, line 33 skipping to change at page 118, line 14
The caller confirms the invitation by sending an ACK request to the The caller confirms the invitation by sending an ACK request to the
location named in the Contact header: location named in the Contact header:
C->S: ACK sip:es@jove.cs.caltech.edu SIP/2.0 C->S: ACK sip:es@jove.cs.caltech.edu SIP/2.0
Via: SIP/2.0/UDP north.east.isi.edu Via: SIP/2.0/UDP north.east.isi.edu
From: Mark Handley <sip:mjh@isi.edu> From: Mark Handley <sip:mjh@isi.edu>
To: Eve Schooler <sip:schooler@caltech.edu> ;tag=9883472 To: Eve Schooler <sip:schooler@caltech.edu> ;tag=9883472
Call-ID: 2963313058@north.east.isi.edu Call-ID: 2963313058@north.east.isi.edu
CSeq: 1 ACK CSeq: 1 ACK
15.3 Two-party Call 16.3 Two-party Call
For two-party Internet phone calls, the response must contain a For two-party Internet phone calls, the response must contain a
description of where to send the data. In the example below, Bell description of where to send the data. In the example below, Bell
calls Watson. Bell indicates that he can receive RTP audio codings 0 calls Watson. Bell indicates that he can receive RTP audio codings 0
(PCMU), 3 (GSM), 4 (G.723) and 5 (DVI4). (PCMU), 3 (GSM), 4 (G.723) and 5 (DVI4).
C->S: INVITE sip:watson@boston.bell-tel.com SIP/2.0 C->S: INVITE sip:watson@boston.bell-tel.com SIP/2.0
Via: SIP/2.0/UDP kton.bell-tel.com Via: SIP/2.0/UDP kton.bell-tel.com
From: A. Bell <sip:a.g.bell@bell-tel.com> From: A. Bell <sip:a.g.bell@bell-tel.com>
To: T. Watson <sip:watson@bell-tel.com> To: T. Watson <sip:watson@bell-tel.com>
skipping to change at page 113, line 41 skipping to change at page 120, line 18
Since the two sides have agreed on the set of media, Bell confirms Since the two sides have agreed on the set of media, Bell confirms
the call without enclosing another session description: the call without enclosing another session description:
C->S: ACK sip:watson@boston.bell-tel.com SIP/2.0 C->S: ACK sip:watson@boston.bell-tel.com SIP/2.0
Via: SIP/2.0/UDP kton.bell-tel.com Via: SIP/2.0/UDP kton.bell-tel.com
From: A. Bell <sip:a.g.bell@bell-tel.com> From: A. Bell <sip:a.g.bell@bell-tel.com>
To: T. Watson <sip:watson@bell-tel.com> ;tag=37462311 To: T. Watson <sip:watson@bell-tel.com> ;tag=37462311
Call-ID: 3298420296@kton.bell-tel.com Call-ID: 3298420296@kton.bell-tel.com
CSeq: 1 ACK CSeq: 1 ACK
15.4 Terminating a Call 16.4 Terminating a Call
To terminate a call, caller or callee can send a BYE request: To terminate a call, caller or callee can send a BYE request:
C->S: BYE sip:watson@boston.bell-tel.com SIP/2.0 C->S: BYE sip:watson@boston.bell-tel.com SIP/2.0
Via: SIP/2.0/UDP kton.bell-tel.com Via: SIP/2.0/UDP kton.bell-tel.com
From: A. Bell <sip:a.g.bell@bell-tel.com> From: A. Bell <sip:a.g.bell@bell-tel.com>
To: T. A. Watson <sip:watson@bell-tel.com> ;tag=37462311 To: T. A. Watson <sip:watson@bell-tel.com> ;tag=37462311
Call-ID: 3298420296@kton.bell-tel.com Call-ID: 3298420296@kton.bell-tel.com
CSeq: 2 BYE CSeq: 2 BYE
If the callee wants to abort the call, it simply reverses the To and If the callee wants to abort the call, it simply reverses the To and
From fields. Note that it is unlikely that a BYE from the callee will From fields. Note that it is unlikely that a BYE from the callee will
traverse the same proxies as the original INVITE. traverse the same proxies as the original INVITE.
15.5 Forking Proxy 16.5 Forking Proxy
In this example, Bell (a.g.bell@bell-tel.com) (C), currently seated In this example, Bell (a.g.bell@bell-tel.com) (C), currently seated
at host c.bell-tel.com wants to call Watson (t.watson@ieee.org). At at host c.bell-tel.com wants to call Watson (t.watson@ieee.org). At
the time of the call, Watson is logged in at two workstations, the time of the call, Watson is logged in at two workstations,
t.watson@x.bell-tel.com (X) and watson@y.bell-tel.com (Y), and has t.watson@x.bell-tel.com (X) and watson@y.bell-tel.com (Y), and has
registered with the IEEE proxy server (P) called sip.ieee.org. The registered with the IEEE proxy server (P) called sip.ieee.org. The
IEEE server also has a registration for the home machine of Watson, IEEE server also has a registration for the home machine of Watson,
at watson@h.bell-tel.com (H), as well as a permanent registration at at watson@h.bell-tel.com (H), as well as a permanent registration at
watson@acm.org (A). For brevity, the examples omit the session watson@acm.org (A). For brevity, the examples omit the session
description and Via header fields. description and Via header fields.
skipping to change at page 118, line 23 skipping to change at page 124, line 34
Call-ID: 31415@c.bell-tel.com Call-ID: 31415@c.bell-tel.com
CSeq: 2 BYE CSeq: 2 BYE
Y->C: SIP/2.0 200 OK Y->C: SIP/2.0 200 OK
Via: SIP/2.0/UDP c.bell-tel.com Via: SIP/2.0/UDP c.bell-tel.com
From: A. Bell <sip:a.g.bell@bell-tel.com> From: A. Bell <sip:a.g.bell@bell-tel.com>
To: T. Watson <sip:t.watson@ieee.org>;tag=35253448 To: T. Watson <sip:t.watson@ieee.org>;tag=35253448
Call-ID: 31415@c.bell-tel.com Call-ID: 31415@c.bell-tel.com
CSeq: 2 BYE CSeq: 2 BYE
15.6 Redirects 16.6 Redirects
Replies with status codes 301 (Moved Permanently) or 302 (Moved Replies with status codes 301 (Moved Permanently) or 302 (Moved
Temporarily) specify another location using the Contact field. Temporarily) specify another location using the Contact field.
Continuing our earlier example, the server P at ieee.org decides to Continuing our earlier example, the server P at ieee.org decides to
redirect rather than proxy the request: redirect rather than proxy the request:
P->C: SIP/2.0 302 Moved temporarily P->C: SIP/2.0 302 Moved temporarily
Via: SIP/2.0/UDP c.bell-tel.com Via: SIP/2.0/UDP c.bell-tel.com
From: A. Bell <sip:a.g.bell@bell-tel.com> From: A. Bell <sip:a.g.bell@bell-tel.com>
To: T. Watson <sip:t.watson@ieee.org>;tag=72538263 To: T. Watson <sip:t.watson@ieee.org>;tag=72538263
skipping to change at page 119, line 16 skipping to change at page 125, line 25
A->C: SIP/2.0 302 Moved temporarily A->C: SIP/2.0 302 Moved temporarily
From: Charlie <sip:charlie@caller.com> From: Charlie <sip:charlie@caller.com>
To: Alice <sip:alice@anywhere.com> ;tag=2332462 To: Alice <sip:alice@anywhere.com> ;tag=2332462
Call-ID: 27182@caller.com Call-ID: 27182@caller.com
Contact: sip:bob@anywhere.com Contact: sip:bob@anywhere.com
Expires: Wed, 29 Jul 1998 9:00:00 GMT Expires: Wed, 29 Jul 1998 9:00:00 GMT
CSeq: 1 INVITE CSeq: 1 INVITE
Charlie then sends the following request to the SIP server of the Charlie then sends the following request to the SIP server of the
anywhere.com domain. anywhere.com domain. Note that the server at anywhere.com forwards
the request to Bob based on the Request-URI.
Note that the server at anywhere.com forwards the request to Bob
based on the Request-URI.
C->B: INVITE sip:bob@anywhere.com SIP/2.0 C->B: INVITE sip:bob@anywhere.com SIP/2.0
From: sip:charlie@caller.com From: sip:charlie@caller.com
To: sip:alice@anywhere.com To: sip:alice@anywhere.com
Call-ID: 27182@caller.com Call-ID: 27182@caller.com
CSeq: 2 INVITE CSeq: 2 INVITE
In the third redirection example, we assume that all outgoing In the third redirection example, we assume that all outgoing
requests are directed through a local firewall F at caller.com, with requests are directed through a local firewall F at caller.com, with
Charlie again inviting Alice: Charlie again inviting Alice:
skipping to change at page 120, line 22 skipping to change at page 126, line 24
Based on this response, Charlie directs the same invitation to the Based on this response, Charlie directs the same invitation to the
secondary server spare.caller.com at port 5080, but maintains the secondary server spare.caller.com at port 5080, but maintains the
same Request-URI as before: same Request-URI as before:
C->S: INVITE sip:alice@anywhere.com SIP/2.0 C->S: INVITE sip:alice@anywhere.com SIP/2.0
From: sip:charlie@caller.com From: sip:charlie@caller.com
To: Alice <sip:alice@anywhere.com> To: Alice <sip:alice@anywhere.com>
Call-ID: 27182@caller.com Call-ID: 27182@caller.com
CSeq: 2 INVITE CSeq: 2 INVITE
15.7 Negotiation 16.7 Negotiation
An example of a 606 (Not Acceptable) response is: An example of a 606 (Not Acceptable) response is:
S->C: SIP/2.0 606 Not Acceptable S->C: SIP/2.0 606 Not Acceptable
From: sip:mjh@isi.edu From: sip:mjh@isi.edu
To: <sip:schooler@cs.caltech.edu> ;tag=7434264 To: <sip:schooler@cs.caltech.edu> ;tag=7434264
Call-ID: 14142@north.east.isi.edu Call-ID: 14142@north.east.isi.edu
CSeq: 1 INVITE CSeq: 1 INVITE
Contact: sip:mjh@north.east.isi.edu Contact: sip:mjh@north.east.isi.edu
Warning: 370 "Insufficient bandwidth (only have ISDN)", Warning: 370 "Insufficient bandwidth (only have ISDN)",
skipping to change at page 121, line 14 skipping to change at page 127, line 16
In this example, the original request specified a bandwidth that was In this example, the original request specified a bandwidth that was
higher than the access link could support, requested multicast, and higher than the access link could support, requested multicast, and
requested a set of media encodings. The response states that only 128 requested a set of media encodings. The response states that only 128
kb/s is available and that (only) DVI, PCM or LPC audio could be kb/s is available and that (only) DVI, PCM or LPC audio could be
supported in order of preference. supported in order of preference.
The response also states that multicast is not available. In such a The response also states that multicast is not available. In such a
case, it might be appropriate to set up a transcoding gateway and case, it might be appropriate to set up a transcoding gateway and
re-invite the user. re-invite the user.
15.8 OPTIONS Request 16.8 OPTIONS Request
A caller Alice can use an OPTIONS request to find out the A caller Alice can use an OPTIONS request to find out the
capabilities of a potential callee Bob, without "ringing" the capabilities of a potential callee Bob, without "ringing" the
designated address. Bob returns a description indicating that he is designated address. Bob returns a description indicating that he is
capable of receiving audio encodings PCM Ulaw (payload type 0), 1016 capable of receiving audio encodings PCM Ulaw (payload type 0), 1016
(payload type 1), GSM (payload type 3), and SX7300/8000 (dynamic (payload type 1), GSM (payload type 3), and SX7300/8000 (dynamic
payload type 99), and video encodings H.261 (payload type 31) and payload type 99), and video encodings H.261 (payload type 31) and
H.263 (payload type 34). H.263 (payload type 34).
C->S: OPTIONS sip:bob@example.com SIP/2.0 C->S: OPTIONS sip:bob@example.com SIP/2.0
skipping to change at page 122, line 4 skipping to change at page 128, line 8
v=0 v=0
m=audio 0 RTP/AVP 0 1 3 99 m=audio 0 RTP/AVP 0 1 3 99
m=video 0 RTP/AVP 31 34 m=video 0 RTP/AVP 31 34
a=rtpmap:99 SX7300/8000 a=rtpmap:99 SX7300/8000
A Minimal Implementation A Minimal Implementation
A.1 Client A.1 Client
All clients MUST be able to generate the INVITE and ACK requests. All clients MUST be able to generate the INVITE and ACK requests.
Clients MUST generate and parse the Call-ID, Content-Length, Clients MUST generate and parse the Call-ID, Content-Length,
Content-Type, CSeq, From and To headers. Clients MUST also parse the Content-Type, CSeq, From and To headers. Clients MUST also parse the
Require header. A minimal implementation MUST understand SDP (RFC Require header. A minimal implementation MUST understand SDP (RFC
2327, [6]). It MUST be able to recognize the status code classes 1 2327, [6]). It MUST be able to recognize the status code classes 1
through 6 and act accordingly. through 6 and act accordingly.
The following capability sets build on top of the minimal The following capability sets build on top of the minimal
implementation described in the previous paragraph: implementation described in the previous paragraph. In general, each
capability listed below builds on the ones above it:
Basic: A basic implementation adds support for the BYE method to Basic: A basic implementation adds support for the BYE method to
allow the interruption of a pending call attempt. It includes a allow the interruption of a pending call attempt. It includes a
User-Agent header in its requests and indicate its preferred User-Agent header in its requests and indicate its preferred
language in the Accept-Language header. language in the Accept-Language header.
Redirection: To support call forwarding, a client needs to be able to Redirection: To support call forwarding, a client needs to be able to
understand the Contact header, but only the SIP-URL part, not understand the Contact header, but only the SIP-URL part, not
the parameters. the parameters.
Firewall-friendly: A firewall-friendly client understands the Route
and Record-Route header fields and can be configured to use a
local proxy for all outgoing requests.
Negotiation: A client MUST be able to request the OPTIONS method and Negotiation: A client MUST be able to request the OPTIONS method and
understand the 380 (Alternative Service) status and the Contact understand the 380 (Alternative Service) status and the Contact
parameters to participate in terminal and media negotiation. It parameters to participate in terminal and media negotiation. It
SHOULD be able to parse the Warning response header to provide SHOULD be able to parse the Warning response header to provide
useful feedback to the caller. useful feedback to the caller.
Authentication: If a client wishes to invite callees that require Authentication: If a client wishes to invite callees that require
caller authentication, it MUST be able to recognize the 401 caller authentication, it MUST be able to recognize the 401
(Unauthorized) status code, MUST be able to generate the (Unauthorized) status code, MUST be able to generate the
Authorization request header and MUST understand the WWW- Authorization request header and MUST understand the WWW-
skipping to change at page 123, line 7 skipping to change at page 129, line 15
Forwards, Require, To and Via headers. It MUST echo the CSeq and Forwards, Require, To and Via headers. It MUST echo the CSeq and
Timestamp headers in the response. It SHOULD include the Server Timestamp headers in the response. It SHOULD include the Server
header in its responses. header in its responses.
A.3 Header Processing A.3 Header Processing
Table 6 lists the headers that different implementations support. UAC Table 6 lists the headers that different implementations support. UAC
refers to a user-agent client (calling user agent), UAS to a user- refers to a user-agent client (calling user agent), UAS to a user-
agent server (called user-agent). agent server (called user-agent).
type UAC proxy UAS The fields in the table have the following meaning. Type is as in
__________________________________________________ Table 4 and 5. "-" indicates the field is not meaningful to this
Accept R - o o system (although it might be generated by it). "m" indicates the
Accept-Language R - b b field MUST be understood. "b" indicates the field SHOULD be
Allow 405 o - - understood by a Basic implementation. "r" indicates the field SHOULD
Authorization R a o a be understood if the system claims to understand redirection. "a"
Call-ID g m m m indicates the field SHOULD be understood if the system claims to
Content-Length g m m m support authentication. "e" indicates the field SHOULD be understood
Content-Type g m - m if the system claims to support encryption. "o" indicates support of
CSeq g m m m the field is purely optional. Headers whose support is optional for
Encryption g e - e all implementations are not shown.
Expires g - o o
From g m o m
Contact R - - -
Contact r r r -
Max-Forwards R - b -
Proxy-Authenticate 407 a - -
Proxy-Authorization R - a -
Proxy-Require R - m -
Require R m - m
Response-Key R - - e
Timestamp g o o m
To g m m m
Unsupported r b b -
Via g m m m
WWW-Authenticate 401 a - -
Table 6: This table indicates which systems parse which header B Usage of the Session Description Protocol (SDP)
fields. Type is as in Table 4 and 5. "-" indicates the field is not
meaningful to this system (although it might be generated by it). "m"
indicates the field MUST be understood. "b" indicates the field
SHOULD be understood by a Basic implementation. "r" indicates the
field SHOULD be understood if the system claims to understand
redirection. "a" indicates the field SHOULD be understood if the
system claims to support authentication. "e" indicates the field
SHOULD be understood if the system claims to support encryption. "o"
indicates support of the field is purely optional. Headers whose
support is optional for all implementations are not shown.
B Usage of SDP This section describes the use of the Session Description Protocol
(SDP) (RFC 2327 [6]).
The nth media session in a unicast INVITE request will become a B.1 Configuring Media Streams
single RTP session with the nth media session in the response. Thus,
the callee should be careful to order media descriptions
appropriately.
It is assumed that if caller or callee include a particular media The caller and callee align their media descriptions so that the nth
type, they want to both send and receive media data. If the callee media stream ("m=" line) in the caller's session description
does not want to send a particular media type, it marks the media corresponds to the nth media stream in the callee's description.
entry as recvonly receive a particular media type, it may mark it as
sendonly wants to neither receive nor send a particular media type,
it sets the port to zero. (RTCP ports are not needed in this case.)
The caller includes all media types that it is willing to send so All media descriptions SHOULD contain "a=rtpmap" mappings from RTP
that the receiver can provide matching media descriptions. payload types to encodings.
The callee sets the port to zero if callee and caller only want to This allows easier migration away from static payload
receive a media type. types.
Either party can set the "c" destination address to zero (0.0.0.0) if If the callee wants to neither send nor receive a stream offered by
it wants to signal to the other party to stop sending media data. the caller, the callee sets the port number of that stream to zero in
This implements a (far-side) "mute" or "hold" functionality. its media description.
The SDP fields "s" and the SIP Subject header have There currently is no other way than port zero for the
different meanings when inviting to a multicast session. callee to refuse a bidirectional stream offered by the
The SDP field describes the subject of the multicast type UAC proxy UAS registrar
session, while the SIP Subject header describes the reason _____________________________________________________
for the invitation. The example in Section 15.2 illustrates Accept R - o m m
this point. For invitations to two-party sessions, the SDP Accept-Encoding R - - m m
"s" field MAY be left empty. The "o" field is not strictly Accept-Language R - b b b
necessary for two-party sessions, but MUST be present to Allow 405 o - - -
allow re-use of SDP-based tools. Authorization R a o a a
Call-ID g m m m m
Content-Encoding g m - m m
Content-Length g m m m m
Content-Type g m - m m
CSeq g m m m m
Encryption g e - e e
Expires g - o o m
From g m o m m
Hide R - m - -
Contact R - - - m
Contact r r r - -
Max-Forwards R - b - -
Proxy-Authenticate 407 a - - -
Proxy-Authorization R - a - -
Proxy-Require R - m - -
Require R m - m m
Response-Key R - - e e
Route R - m - -
Timestamp g o o m m
To g m m m m
Unsupported r b b - -
User-Agent g b - b -
Via g m m m m
WWW-Authenticate 401 a - - -
Table 6: Header Field Processing Requirements
caller. Both caller and callee need to be aware what media
tools are to be started.
For example, assume that the caller Alice has included the following
description in her INVITE request. It includes an audio stream and
two bidirectional video streams, using H.261 (payload type 31) and
MPEG (payload type 32).
v=0
o=alice 2890844526 2890844526 IN IP4 host.anywhere.com
c=IN IP4 host.anywhere.com
m=audio 49170 RTP/AVP 0
a=rtpmap:0 PCMU/8000
m=video 51372 RTP/AVP 31
a=rtpmap:31 H261/90000
m=video 53000 RTP/AVP 32
a=rtpmap:32 MPV/90000
The callee, Bob, does not want to receive or send the first video
stream, so it returns the media description below:
v=0
o=bob 2890844730 2890844730 IN IP4 host.example.com
c=IN IP4 host.example.com
m=audio 47920 RTP/AVP 0 1
a=rtpmap:0 PCMU/8000
a=rtpmap:1 1016/8000
m=video 0 RTP/AVP 31
m=video 53000 RTP/AVP 32
a=rtpmap:32 MPV/90000
B.2 Setting SDP Values for Unicast
If a session description from a caller contains a media stream which
is listed as send (receive) only, it means that the caller is only
willing to send (receive) this stream, not receive (send). The same
is true for the callee.
For receive-only and send-or-receive streams, the port number and
address in the session description indicate where the media stream
should be sent to by the recipient of the session description, either
caller or callee. For send-only streams, the address and port number
have no significance and SHOULD be set to zero.
The list of payload types for each media stream conveys two pieces of
information, namely the set of codecs that the caller or callee is
capable of sending or receiving, and the RTP payload type numbers
used to identify those codecs. For receive-only or send-and-receive
media streams, a caller SHOULD list all of the codecs it is capable
of supporting in the session description in an INVITE or ACK. For
send-only streams, the caller SHOULD indicate only those it wishes to
send for this session. For receive-only streams, the payload type
numbers indicate the value of the payload type field in RTP packets
the caller is expecting to receive for that codec type. For send-only
streams, the payload type numbers indicate the value of the payload
type field in RTP packets the caller is planning to send for that
codec type. For send-and-receive streams, the payload type numbers
indicate the value of the payload type field the caller expects to
both send and receive.
If a media stream is listed as receive-only by the caller, the callee
lists, in the response, those codecs it intends to use from among the
ones listed in the request. If a media stream is listed as send-only
by the caller, the callee lists, in the response, those codecs it is
willing to receive among the ones listed in the the request. If the
media stream is listed as both send and receive, the callee lists
those codecs it is capable of sending or receiving among the ones
listed by the caller in the INVITE. The actual payload type numbers
in the callee's session description corresponding to a particular
codec MUST be the same as the caller's session description.
If caller and callee have no media formats in common for a particular
stream, the callee MUST return a session description containing the
particular "m=" line, but with the port number set to zero, and no
payload types listed.
If there are no media formats in common for all streams, the callee
SHOULD return a 400 response, with a 304 Warning header field.
B.3 Multicast Operation
The interpretation of send-only and receive-only for multicast media
sessions differs from that for unicast sessions. For multicast,
send-only means that the recipient of the session description (caller
or callee) SHOULD only send media streams to the address and port
indicated. Receive-only means that the recipient of the session
description SHOULD only receive media on the address and port
indicated.
For multicast, receive and send multicast addresses are the same and
all parties use the same port numbers to receive media data. If the
session description provided by the caller is acceptable to the
callee, the callee can choose not to include a session description or
MAY echo the description in the response.
A callee MAY, in the response, return a session description with some
of the payload types removed, or port numbers set to zero (but no
other value). This indicates to the caller that the callee does not
support the given stream or media types which were removed. A callee
MUST NOT change whether a given stream is send-only, receive-only, or
send-and-receive.
If a callee does not support multicast at all, it SHOULD return a 400
status response and include a 330 Warning.
B.4 Delayed Media Streams
In some cases, a caller may not know the set of media formats which
it can support at the time it would like to issue an invitation. This
is the case when the caller is actually a gateway to another protocol
which performs media format negotiation after call setup. When this
occurs, a caller MAY issue an INVITE with a session description that
contains no media lines. The callee SHOULD interpret this to mean
that the caller wishes to participate in a multimedia session
described by the session description, but that the media streams are
not yet known. The callee SHOULD return a session description
indicating the streams and media formats it is willing to support,
however. The caller MAY update the session description either in the
ACK request or in a re-INVITE at a later time, once the streams are
known.
B.5 Putting Media Streams on Hold
If a party in a call wants to put the other party "on hold", i.e.,
request that it temporarily stops sending one or more media streams,
a party re-invites the other by sending an INVITE request with a
modified session description. The session description is the same as
in the original invitation (or response), but the "c" destination
addresses for the media streams to be put on hold are set to zero
(0.0.0.0).
B.6 Subject and SDP "s=" Line
The SDP "s=" line and the SIP Subject header field have different
meanings when inviting to a multicast session. The session
description line describes the subject of the multicast session,
while the SIP Subject header field describes the reason for the
invitation. The example in Section 16.2 illustrates this point. For
invitations to two-party sessions, the SDP "s=" line MAY be left
empty.
B.7 The SDP "o=" Line
The "o=" line is not strictly necessary for two-party sessions, but
MUST be present to allow re-use of SDP-based tools.
C Summary of Augmented BNF C Summary of Augmented BNF
In this specification we use the Augmented Backus-Naur Form notation All of the mechanisms specified in this document are described in
described in RFC 2234 [23]. For quick reference, the following is a both prose and an augmented Backus-Naur Form (BNF) similar to that
brief summary of the main features of this ABNF. used by RFC 822 [9]. Implementors will need to be familiar with the
notation in order to understand this specification. The augmented BNF
includes the following constructs:
"abc" name = definition
The case-insensitive string of characters "abc" (or "Abc",
"aBC", etc.);
%d32 The name of a rule is simply the name itself (without any enclosing
The character with ASCII code decimal 32 (space); "<" and ">") and is separated from its definition by the equal "="
character. White space is only significant in that indentation of
continuation lines is used to indicate a rule definition that spans
more than one line. Certain basic rules are in uppercase, such as SP,
LWS, HT, CRLF, DIGIT, ALPHA, etc. Angle brackets are used within
definitions whenever their presence will facilitate discerning the
use of rule names.
*term "literal"
zero of more instances of term;
3*term Quotation marks surround literal text. Unless stated otherwise, the
three or more instances of term; text is case-insensitive.
2*4term rule1 | rule2
two, three or four instances of term;
[ term ] Elements separated by a bar ("|") are alternatives, e.g., "yes | no"
term is optional; will accept yes or no.
term1 term2 term3 (rule1 rule2)
set notation: term1, term2 and term3 must all appear in the
order listed;
term1 | term2 Elements enclosed in parentheses are treated as a single element.
either term1 or term2 may appear but not both; Thus, "(elem (foo | bar) elem)" allows the token sequences "elem foo
elem" and "elem bar elem".
#term *rule
A construct "#" is defined, similar to "*", for defining lists
of elements. The full form is "<n>#<m> element" indicating at The character "*" preceding an element indicates repetition. The full
least <n> and at most <m> elements, each separated by one or form is "<n>*<m>element" indicating at least <n> and at most <m>
more commas (",") and OPTIONAL linear white space (LWS). This occurrences of element. Default values are 0 and infinity so that
makes the usual form of lists very easy; a rule such as "*(element)" allows any number, including zero; "1*element" requires
at least one; and "1*2element" allows one or two.
[rule]
Square brackets enclose optional elements; "[foo bar]" is equivalent
to "*1(foo bar)".
N rule
Specific repetition: "<n>(element)" is equivalent to
"<n>*<n>(element)"; that is, exactly <n> occurrences of (element).
Thus 2DIGIT is a 2-digit number, and 3ALPHA is a string of three
alphabetic characters.
#rule
A construct "#" is defined, similar to "*", for defining lists of
elements. The full form is "<n>#<m> element" indicating at least <n>
and at most <m> elements, each separated by one or more commas (",")
and OPTIONAL linear white space (LWS). This makes the usual form of
lists very easy; a rule such as
( *LWS element *( *LWS "," *LWS element )) ( *LWS element *( *LWS "," *LWS element ))
can be shown as 1# element. Wherever this construct is can be shown as 1# element. Wherever this construct is used, null
used, null elements are allowed, but do not contribute to elements are allowed, but do not contribute to the count of elements
the count of elements present. That is, "(element), , present. That is, "(element), , (element)" is permitted, but counts
(element)" is permitted, but counts as only two elements. as only two elements. Therefore, where at least one element is
Therefore, where at least one element is required, at least required, at least one non-null element MUST be present. Default
one non-null element MUST be present. Default values are 0 values are 0 and infinity so that "#element" allows any number,
and infinity so that "#element" allows any number, including zero; "1#element" requires at least one; and "1#2element"
including zero; "1#element" requires at least one; and allows one or two.
"1#2element" allows one or two.
Common Tokens ; comment
Certain tokens are used frequently in the BNF of this document, and A semi-colon, set off some distance to the right of rule text, starts
not defined elsewhere. Their meaning is well understood but we a comment that continues to the end of line. This is a simple way of
include it here for completeness. including useful notes in parallel with the specifications.
implied *LWS
The grammar described by this specification is word-based. Except
where noted otherwise, linear white space (LWS) can be included
between any two adjacent words (token or quoted-string), and between
adjacent tokens and separators, without changing the interpretation
of a field. At least one delimiter (LWS and/or separators) MUST exist
between any two tokens (for the definition of "token" below), since
they would otherwise be interpreted as a single token.
C.1 Basic Rules
The following rules are used throughout this specification to
describe basic parsing constructs. The US-ASCII coded character set
is defined by ANSI X3.4-1986.
OCTET = <any 8-bit sequence of data>
CHAR = <any US-ASCII character (octets 0 - 127)>
upalpha = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" |
"J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" |
"S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z"
lowalpha = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" |
"j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" |
"s" | "t" | "u" | "v" | "w" | "x" | "y" | "z"
alpha = lowalpha | upalpha
digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" |
"8" | "9"
alphanum = alpha | digit
CTL = <any US-ASCII control character
(octets 0 -- 31) and DEL (127)>
CR = %d13 ; US-ASCII CR, carriage return character CR = %d13 ; US-ASCII CR, carriage return character
LF = %d10 ; US-ASCII LF, line feed character LF = %d10 ; US-ASCII LF, line feed character
CRLF = CR LF ; typically the end of a line
SP = %d32 ; US-ASCII SP, space character SP = %d32 ; US-ASCII SP, space character
HT = %d09 ; US-ASCII HT, horizontal tab character HT = %d09 ; US-ASCII HT, horizontal tab character
LWS = [CRLF] 1*( SP | HT ) ; linear whitespace CRLF = CR LF ; typically the end of a line
DIGIT = "0" .. "9" ; a single decimal digit
CHAR = <any US-ASCII character (octets 0 - 127)> The following are defined in RFC 2396 [12] for the SIP URI:
CTL = <any US-ASCII control character
(octets 0 -- 31) and DEL (127)>
OCTET = <any 8-bit sequence of data>
TEXT = <any OCTET except CTLs, but including LWS>
unreserved = alphanum | mark unreserved = alphanum | mark
mark = "-" | "_" | "." | "!" | "~" | "*" | "'" mark = "-" | "_" | "." | "!" | "~" | "*" | "'"
| "(" | ")" | "(" | ")"
separators = "(" | ")" | "<" | ">" | "@" |
"," | ";" | ":" | "backslash" | <"> |
"/" | "[" | "]" | "?" | "=" |
"" | "" | SP | HT
escaped = "%" hex hex escaped = "%" hex hex
hex = digit | "A" | "B" | "C" | "D" | "E" | "F" | SIP header field values can be folded onto multiple lines if the
"a" | "b" | "c" | "d" | "e" | "f" continuation line begins with a space or horizontal tab. All linear
alphanum = alpha | digit white space, including folding, has the same semantics as SP. A
alpha = lowalpha | upalpha recipient MAY replace any linear white space with a single SP before
lowalpha = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | interpreting the field value or forwarding the message downstream.
"j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" |
"s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" LWS = [CRLF] 1*( SP | HT ) ; linear whitespace
upalpha = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" |
"J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | The TEXT-UTF8 rule is only used for descriptive field contents and
"S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" values that are not intended to be interpreted by the message parser.
digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | Words of *TEXT-UTF8 contain characters from the UTF-8 character set
"8" | "9" (RFC 2279 [21]). In this regard, SIP differs from HTTP, which uses
the ISO 8859-1 character set.
TEXT-UTF8 = <any UTF-8 character encoding, except CTLs,
but including LWS>
A CRLF is allowed in the definition of TEXT-UTF8 only as part of a
header field continuation. It is expected that the folding LWS will
be replaced with a single SP before interpretation of the TEXT-UTF8
value.
Hexadecimal numeric characters are used in several protocol elements.
hex = "A" | "B" | "C" | "D" | "E" | "F"
| "a" | "b" | "c" | "d" | "e" | "f" | digit
Many SIP header field values consist of words separated by LWS or
special characters. These special characters MUST be in a quoted
string to be used within a parameter value.
token = 1*< any CHAR except CTL's or separators> token = 1*< any CHAR except CTL's or separators>
quoted-pair = "\" CHAR separators = "(" | ")" | "<" | ">" | "@" |
"," | ";" | ":" | "\" | <"> |
"/" | "[" | "]" | "?" | "=" |
"{" | "}" | SP | HT
Comments can be included in some SIP header fields by surrounding the
comment text with parentheses. Comments are only allowed in fields
containing "comment" as part of their field value definition. In all
other fields, parentheses are considered part of the field value.
comment = "(" *(ctext | quoted-pair | comment) ")" comment = "(" *(ctext | quoted-pair | comment) ")"
ctext = < any TEXT excluding "(" and ")"> ctext = < any TEXT-UTF8 excluding "(" and ")">
D IANA Considerations A string of text is parsed as a single word if it is quoted using
double-quote marks.
quoted-string = ( <"> *(qdtext | quoted-pair ) <"> )
qdtext = <any TEXT-UTF8 except <">>
The backslash character ("\") MAY be used as a single-character
quoting mechanism only within quoted-string and comment constructs.
quoted-pair = " \ " CHAR
D Using SRV DNS Records
The following procedure is experimental and relies on DNS SRV records
(RFC 2052 [14]).
To determine the IP address of a SIP server to deliver a request to,
the following steps are followed. The Request-URI is examined. If it
does not specify a protocol (TCP or UDP), the client queries the name
server for SRV records for both UDP (if supported by the client) and
TCP (if supported by the client) SIP servers. The format of these
queries is defined in RFC 2052 [14]. Otherwise, the client queries
the name server for SIP servers available through the protocol
specified in the Request-URI. If the client does not support the
protocol specified in the Request-URI, it gives up. The results of
the query or queries are merged together and ordered based on
priority. Then, the searching technique outlined in RFC 2052 [14] is
used to select servers in order. The user then attempts to contact
each server in the order listed. If no port number is specified in
the Request-URI, the client uses the port number returned in the DNS
response, not port 5060.
E IANA Considerations
Section 4.4 describes a name space and mechanism for registering SIP Section 4.4 describes a name space and mechanism for registering SIP
options. options.
Section 6.41 describes the name space for registering SIP warn-codes. Section 6.41 describes the name space for registering SIP warn-codes.
E Changes in Version -10 F Changes in Version -11
Since version -09, the following changes have been made. Since version -10, the following changes have been made. These
changes reflect IESG comments.
o Content-Encoding changed to "optional" in Table 4. o Respecting DNS TTL's for cacheing of queries changed from
SHOULD to MUST.
o URL element hname element now set to 1*uric instead of *uric. o Default MTU for UDP requests changed from 1400 to 1500.
o Call-ID local-id element now set to 1*uric instead of *uric. o Added note to status 480 indicating that a redirect server
could use this as well to indicate that it doesn't know where
the user is, for example, because all of the user's contact
information has expired.
o Reference to DNS MX records removed. o Added description for status 305. (May need to consider
whether we need both Location and Contact here, for
compatibility with HTTP.)
o signed-by value enclosed in quotation marks to avoid ambiguity o