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 BYESIP User Agent1 INVITEBYE tears down
an existing
media session.Proxy Server SIP User Agent8 ACK
9 ACK2 INVITE13 200 OK10 BYE
11 BYEMedia Session3 100 Trying
4 180 Ringing6 200 OK12 200 OK5 180 Ringing
7 200 OKNo More Media Session116 Chapter 6