Chapter 1. Introduction to Session Initiation Protocol (SIP) 17
Figure 1-6 SIP dialog
1.3.5 A sample SIP call flow
Figure 1-7 on page 19 illustrates the message flow in a simple SIP call between
two user agents. It shows a user Alice establishing a call with another user Bob.
The steps in the following description correspond to the numbering in Figure 1-7
on page 19.
Step 1 - 2
This is the first request that a UA sends. It is a REGISTER message. It
provides the server with an address at which Alice can be reached for SIP
sessions. In this message Alice is registering herself, though it is possible that
one SIP user can register on behalf of another user. As can be seen in the
REGISTER message (and all other messages from Alice) each message
goes through the Proxy Server.
Caller
Caller
Callee
Callee
INViTE
INViTE
100 Trying
100 Trying
180 Ringing
180 Ringing
200 OK
200 OK
ACK
ACK
BYE
BYE
200 OK
200 OK
Transaction 1
Transaction 1
Transaction 2
Transaction 2
Dialog
Dialog
18 Developing SIP and IP Multimedia Subsystem (IMS) Applications
Step 3 - 4
The response to the REGISTER message is positive, which is indicated by
the 200 (OK) message.
Step 5 - 6
Alice sends a SIP INVITE to Bob. Let us assume that Alice doesn't know
where Bob has registered, and hence the To address field in the SIP INVITE
header is left blank.
Step 7 - 8
The Redirect Server responds with a status code 302 (moved temporarily).
This response has field Contact in the header which is filled with an address
where Alice should try as an alternative. Though not shown in the diagram, it
is assumed that Bob has pre-registered before the call flow.
Step 9 - 10
Alice acknowledges (ACK) the 302 message.
Step 11
Alice now sends a new SIP INVITE message for Bob.
Step 12
The role of the proxy server for this message becomes crucial. The proxy
server may map the Request-URI message to a different address, if it knows
that the recipient is at a different address. In our case, Alice knows Bob
address, and hence this won't be necessary. In this case, the Proxy server
just inspects the domain part of the received Request-URI and determines
the next hop in the path from the caller (Alice) to the callee (Bob). After the
initial INVITE request and response, it is possible that subsequent messages
are sent end to end (without traversing a Proxy Server). However, a proxy
server can also ensure that it remains in the signaling path for all subsequent
requests as well.
Step 13
The Proxy Server sends a Trying message. Any 1XX response is a
provisional response and it indicates that a session has not yet been
established, but a dialog is on. This is an early state of a dialog. There could
also be an optional SIP 180 Ringing Message (Not shown in this call flow).
Step 14 - 15
Bob answers the call with a 200 OK response, indicating that he is ready to
take a call.
Chapter 1. Introduction to Session Initiation Protocol (SIP) 19
Step 16 - 17
Alice sends an ACK to confirm that she has received Bob's OK response.
This ends the three way handshake between the two parties. Once Alice
sends the ACK, both parties are ready to exchange media.
Step 18 - 19
Any party can initiate a BYE request to terminate a session. In this case, Alice
sends a BYE message to terminate the session.
Step 20 - 21
Bob responds to the completion of the call with an OK response to the BYE.
Figure 1-7 A simple SIP call flow
(1) SIP REGISTER
(1) SIP REGISTER
Alice’s
Alice’s
SIP UA
SIP UA
SIP
SIP
Proxy
Proxy
SIP
SIP
Reg
Reg
istrar
istrar
Redirect
Redirect
Server
Server
Bob’s
Bob’s
SIP UA
SIP UA
(2) SIP REGISTER
(2) SIP REGISTER
(3) SIP 200 OK
(3) SIP 200 OK
(4) SIP 200 OK
(4) SIP 200 OK
(5) SIP INVITE
(5) SIP INVITE
(6) SIP INVITE
(6) SIP INVITE
(7) SIP 302 MOVED TEMPORARILY
(7) SIP 302 MOVED TEMPORARILY
(8) SIP 302 MOVED TEMPORARILY
(8) SIP 302 MOVED TEMPORARILY
(9) SIP ACK
(9) SIP ACK
(10) SIP ACK
(10) SIP ACK
(11) SIP INVITE
(11) SIP INVITE
(12) SIP INVITE
(12) SIP INVITE
(13) SIP 100 TRYING
(13) SIP 100 TRYING
(14) SIP 200 OK
(14) SIP 200 OK
(15) SIP 200 OK
(15) SIP 200 OK
(16) SIP ACK
(16) SIP ACK
(17) SIP ACK
(17) SIP ACK
(21) SIP 200 OK
(21) SIP 200 OK
(19) SIP BYE
(19) SIP BYE
(18) SIP BYE
(18) SIP BYE
(20) SIP 200 OK
(20) SIP 200 OK
RTP Media dataflow
RTP Media dataflow

Get Developing SIP and IP Multimedia Subsystem (IMS) Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.