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

138

SIP: Understanding the Session Initiation Protocol

Call-ID must be unique across calls, except in the case of a Call-ID in registration requests. All registrations for a user agent should use the same Call-ID. A Call-ID is always created by a user agent and is never modified by a server.

The Call-ID must be a cryptographically random identifier. Some security is provided by the randomness of the Call-ID, because this prevents a third party from guessing a Call-ID and presenting false requests. Older UAs generate CallIDs containing an IP address or host name. However, this is not recommended as it forces topology hiding B2BUAs to rewrite the Call-ID. The compact form of the Call-ID header field is i.

Examples of Call-ID are shown here:

Call-ID: 34a5d553192cc35

Call-ID: 44fer23ei4291dekfer34231232

i:35866383092031257

6.1.9Contact

The Contact header field is used to convey a URI that identifies the resource requested or the request originator, depending on whether it is present in a request or response. Once a Contact header field has been received, the URI can be cached and used for routing future requests within a dialog. For example, a Contact header field in a 200 OK response to an INVITE can allow the acknowledgment ACK message and all future requests during this call to bypass proxies and go directly to the called party. However, the presence of Record-Route header fields in an earlier request or default proxy routing configuration in a user agent may override that behavior. When a Contact URI is used in a Request-URI, all URI parameters are allowed with the exception of the method parameter, which is ignored.

Contact header fields must be present in INVITE requests and 200 OK responses to invitations. In some cases, the Contact URI may not resolve directly to the user agent. For example, a UA behind a firewall ALG will need to use a Contact URI that resolves to the firewall ALG address. Otherwise, the use of the user agent’s URI will result in the call failing because of the firewall blocking any direct routed SIP requests. Contact header fields may also be present in 1xx, 2xx, 3xx, and 485 responses. Only in a REGISTER request, a special Contact:*, along with an Expires: 0, header field is used to remove all existing registrations. Examples of Contact header fields in registrations are shown in Table 4.3. Otherwise, wild carding is not allowed. A Contact header field may contain a display name that can be in quotes. If a display name is present, the URI will be enclosed in < >. If any header field parameters are present, the URI will also be

SIP Header Fields

139

enclosed in < > along with any URI parameters, with the header field parameters outside the < >, even if no display name is present.

There are three additional parameters defined for use in Contact header fields: q, action, and expires. They are placed at the end of the URI and separated by semicolons. The q value parameter is used to indicate relative preference, which is represented by a decimal number in the range 0 to 1. The q value is not a probability, and there is no requirement that the q values for a given list of Contacts add up to 1. (The action parameter defined in RFC 2543 has been deprecated and is not used in RFC 3261. It was only used in registration Contact header fields, and is used to specify proxy or redirect operations by the server.) The expires parameter indicates how long the URI is valid and is also only used in registrations. The parameter either contains an integer number of seconds or a date in SIP form (see Section 6.1.11). Examples are shown in Table 6.5.

The Contact header field may contain a feature tag [6], which can be used to indicate the capabilities of the device identified by the Contact URI. For example, the feature tag isfocus is used to indicate that the URI in the Contact header field is a conference URI, and that the dialog is associates with a focus. A focus is a SIP UA that hosts a particular instance of a conference, called a “bridge” or MCU in other protocols. The presence of the isfocus feature tag can be used by a SIP UA that supports advanced conferencing features to invoke certain call control operations [7] or subscribe to the conference package [8]. Section 9.7 has more on SIP conferencing.

Some other common feature tags are listed in Table 6.6. The compact form

is m.

Table 6.5

 

Examples of Contact Header Fields

Header Field

Meaning

 

 

Contact: sip:bell@telephone.com

A single SIP URI without a display

name.

 

 

A display name with the URI enclosed

Contact: Lentz <h.lentz@petersburg.edu:1234>

in < >; the display name is treated as

a token and ignored. Port 1234 is used

 

 

instead of the default 5060.

Contact: M. Faraday <faraday@effect.org>,

Two URIs are listed, the second being

a non-SIP URI with a display name

“Faraday” <mailto:faraday@pop.effect.org>

enclosed in quotes.

 

 

The compact form of the header field

 

contains a port number and a URI

m: <morse@telegraph.org;transport=tcp>;

parameter contained within the < >.

expires= “Fri, 13, Oct 1998 12:00:00 GMT”

An expires header field parameter

 

uses a SIP date enclosed in the

 

quotes.

 

 

140

SIP: Understanding the Session Initiation Protocol

 

 

Table 6.6

 

 

Boolean Feature Tags

 

 

 

 

 

Feature Tag

Meaning

 

 

 

 

 

 

attendant

Attendant, human or automata

 

 

automata

Nonhuman

 

 

image

Supports images

 

 

message

Supports messaging

 

 

text

Supports text media

 

 

audio

Supports audio media

 

 

video

Supports video media

 

 

voicemail

Is a voicemail server

 

 

isfocus

Is a focus, a conference server

 

6.1.10 CSeq

The command sequence CSeq header field is a required header field in every request. The CSeq header field contains a decimal number that increases for each request. Usually, it increases by 1 for each new request, with the exception of CANCEL and ACK requests, which use the CSeq number of the INVITE request to which it refers.

The CSeq count is used by UASs to determine out-of-sequence requests or to differentiate between a new request (different CSeq) or a retransmission (same CSeq). The CSeq header field is used by UACs to match a response to the request it references. For example, a UAC that sends an INVITE request then a CANCEL request can tell by the method in the CSeq of a 200 OK response if it is a response to the invitation or cancellation request. Examples are shown in Table 6.7.

Each user agent maintains its own command sequence number space. For example, consider the case where UA 1 establishes a session to UA 2 and initializes its CSeq count to 1. When user agent 2 initiates a request (such as INVITE or INFO, or even BYE) it will initialize its own CSeq space, totally independent of the CSeq count used by UA 1. The examples of Chapter 16 show this behavior

of CSeq.

 

Table 6.7

 

CSeq Header Field Examples

 

 

Header Field

Meaning

 

 

CSeq: 1 INVITE

The command sequence number has been initialized to 1 for this INVITE.

CSeq: 432 REFER

The command sequence number is set to 432 for this REFER request.

 

If this was the first request by the user agent for this dialog, then either

CSeq: 6787 INVITE

the CSeq was initialized to 6787, or the previous request generated for

this Call-ID (either an INVITE or another request) would have had a

 

 

CSeq of 6786 or lower.

 

 

SIP Header Fields

141

6.1.11 Date

The Date header field is used to convey the date when a request or response is sent. The format of a SIP date is based on HTTP dates, but allows only the preferred Internet date standard referenced by RFC 1123 [9]. To keep UA date and time logic simple, SIP only supports the use of the GMT time zone. This allows time entries that are stored in date form rather than second count to be easily converted into delta seconds without requiring knowledge of time zone offsets. Date is included in 200 OK responses to REGISTER requests. This allows UAs to automatically set their date and time.

A Date example is shown here:

Date: Fri, 13 Oct 1998 23:29:00 GM

6.1.12 Encryption

The Encryption header field was defined in RFC 2543 but is not included in RFC 3261. Instead, encryption using S/MIME is defined as discussed in Chapter 14.

6.1.13 Expires

The Expires header field is used to indicate the time interval in which the request or message contents are valid. When present in an INVITE request, the header field sets a time limit on the completion of the INVITE request. That is, the UAC must receive a final response (non-1xx) within the time period or the INVITE request is automatically canceled with a 408 Request Timeout response. Once the session is established, the value from the Expires header field in the original INVITE has no effect—the Session-Expires header field (Section 6.2.34) must be used for this purpose. When present in a REGISTER request, the header field sets the time limit on the URIs in Contact header fields that do not contain an expires parameter. Table 4.3 shows examples of the Expires header field in registration requests. Expires also is used in SUBSCRIBE requests to indicate the subscription duration. The header field may contain a SIP date or a number of seconds. Examples include:

Expires: 60

Expires: Fri, 15 Apr 2000 00:00:00 GMT

6.1.14 From

The From header field is a required header field that indicates the originator of the request. It is one of two addresses used to identify the dialog. The From

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