Internet Communications Using SIP : Delivering VoIP and Multimedia Services With Session Initiation Protocol {2Nd Ed.}

(Steven Felgate) #1

Session-Related Functions


Most SIP functions involve setting up sessions or occur during an established
session. Although some applications of SIP do not make any use of session-
related functions, most useful applications of SIP make use of these powerful
functions.

Session Setup

As the name of the protocol implies, session setupis the primary function of SIP.
Being a polite protocol, SIP uses an INVITErequest to setup a session between
two user agents. The INVITEmessage usually contains a message body that
describes the type of session the user agent wishes to establish.
A SIP user agent client initializes the To, Fromwith a tag parameter, and
Call-IDheaders at the start of the session. Each user agent that generates a
response adds a tag to the Toheader field. The combination of the Totag,
From tag, and Call-ID are then used to uniquely identify this session,
referred to as a “dialog” in SIP. These headers are never modified during a ses-
sion. This information, plus any required media information, represents the
minimum amount of “call state” that a user agent must maintain.
In the event of a user agent “crash” or reboot, the state information must be
recovered somehow for the call to continue; otherwise, the call will have to be
reinitiated. Note here that in harmony with the Internet architecture, the call
state can be maintained in the SIP endpoints, without any call state being kept
in the servers in the networks, if so desired. SIP proxy servers may, however,
keep transaction state during the call setup phase. Keeping the state in SIP
endpoints makes the call setup independent of transient failures in the net-
work, since the endpoints can use the state to retransmit messages for call
setup.
The SIP session setup is a three-way handshake—INVITE/200/ACKfor a
success, and INVITE/4xxor 5xxor 6xx/ACKfor a failure. INVITEis the only
method in SIP in which there is this three-way handshake involving ACK. All
other SIP requests are of the form REQUEST/200or REQUEST/4xxor 5xxor
6xxfor a failure. Figure 6.3 shows a successful session setup between two SIP
phones involving an INVITE, two provisional responses (100 Tryingand
180 Ringing), and a final response (200 0K), which receives an ACK. Zero or
more provisional (1xx) responses can be sent prior to a final response.
Once established, a media session continues indefinitely without requiring
a further SIP signaling message exchange. A SIP Session Timer can, however,
be used to terminate excessively long SIP sessions [4]. If one party to the ses-
sion wishes to modify or terminate the session, a new exchange of SIP signal-
ing messages ensues.
This three-way handshake allows for forking, which is a parallel search initi-
ated by a proxy, in which multiple successful responses can be returned for a
single INVITEin a reliable way, as will be discussed in a later chapter.

110 Chapter 6

Free download pdf