next up previous contents
Next: SIP Reliability Up: Section Initiation Protocol (SIP) Previous: Section Initiation Protocol (SIP)

SIP Protocol Details

SIP is a text-based protocol with syntax much like the Hyper-Text Transfer Protocol (HTTP) and Real-Time Streaming Protocol (RTSP). A SIP INVITE request looks something like this:


Typically the payload is an SDP description of the session the caller wishes to set up. The Via fields indicate the path taken by the request through proxies so far, with the first via field indicating the most recent proxy traversed and the last one indicating the caller's host. In this case Eve sent the message from, it has traversed and, and is currently being sent to as indicated in the request URL.

A response to this message indicating that mjh does want to talk might look like:


The response code 200 indicates success (many other response codes are possible). When sent this response, it removed the first via field ( and then sent the response to east. In this way the response retraces the path through a chain of proxies that the request took.

SIP supports several request methods as shown below. The use of INVITE, BYE, ACK and REGISTER methods is shown in figures 6.3 to 6.6.

Request Method Purpose
INVITE Invite the callee into a session
OPTIONS Discover the capabilities of the receiver
BYE Terminate a call or call request
CANCEL Terminate incomplete call requests
ACK Acknowledge a successful response
REGISTER Register the current location of a user

In response to a request, a server sends a SIP response which gives a response code indicating how the request was processed. Response codes are divided into six categories depending on the general form of behaviour expected. These categories are shown below.

Response Class Meaning Example
1XX Information about call status 180 RINGING
2XX Success 200 OK
3XX Redirection to another server 301 MOVED TEMPORARILY
4XX Client did something wrong 401 UNAUTHORISED
5XX Server did something wrong 500 INTERNAL SERVER ERROR
6XX Global failure (don't resend same request) 606 NOT ACCEPTABLE

The normal progress of a SIP call involves sending an INVITE request, getting a 180 RINGING response, followed by a ``200 OK'' response when the callee answers, then sending an ACK request to confirm the connected call.

After either party hangs up, a BYE request is sent, which elicits a ``200 OK'' response, which in turn causes a final ACK request to be sent.

This whole process in illustrated in figure 6.5.

The CANCEL method is used when a call is made to more than one destination at the same time. For example, a proxy server may respond indicating that someone might be at one of server locations. My client can either call these one-by-one, or call all of them simultaneously. If it does the latter, then when the callee answers at one of these locations, my client sends a CANCEL request to all the other locations to stop the phone (or whatever it is) ringing there.

next up previous contents
Next: SIP Reliability Up: Section Initiation Protocol (SIP) Previous: Section Initiation Protocol (SIP)