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

(Steven Felgate) #1
Session Termination and Cancellation

Session termination and cancellationare two separate operations in SIP but are
often confused. Session termination occurs when either user agent sends a BYE
referencing an existing call leg (that is, a session successfully established using
the INVITE/200/ACKexchange). This is shown in the example of Figure 6.5
Session cancellation occurs when a user agent ends a call prior to the call
setup completing and the call being established. The reader can think of the
analogy to the action of the cancel button on the browser. In this scenario, a
user agent that has sent an INVITE, but has not yet received a final response
(2xx, 3xx, 4xx, 5xx, or 6xx), sends a CANCELrequest. ACANCELcan also be
originated by a proxy to cancel individual legs in a forking proxy or parallel
search.
While INVITEand BYEare end-to-end methods, CANCELis an example of a
SIP request that is a hop-by-hop request. A proxy receiving a CANCELrequest
immediately responds with a 200 OKresponse, then proxies the CANCELon to
the same set of destinations to which the original INVITEwas sent.

Figure 6.5 Session termination example using BYE

SIP User Agent

1 INVITE

BYE tears down
an existing
media session.

Proxy Server SIP User Agent

8 ACK
9 ACK

2 INVITE

13 200 OK

10 BYE
11 BYE

Media Session

3 100 Trying
4 180 Ringing

6 200 OK

12 200 OK

5 180 Ringing
7 200 OK

No More Media Session

116 Chapter 6

Free download pdf