12.4. Message format

As shown in Figure 12.3, the SIP message is made up of three parts: the start line, message headers and body.

The start line contents vary depending on whether the SIP message is a request or a response. For requests it is referred to as a "request line" and for responses it is referred to as a "status line".

An example SIP request looks like:

INVITE sip:bob.smith@nokia.com SIP/2.0
Via: SIP/2.0/UDP cscf1.example.com:5060;branch=z9hG4bK8542.1
Via: SIP/2.0/UDP [5555::1:2:3:4]:5060;branch=z9hG4bK45a35h76
Max-Forwards: 69
From: Alice <sip:alice@nokia.com>;tag=312345
To: Bob Smith <sip:bob.smith@nokia.com>
Call-ID: 105637921
CSeq: 1 INVITE Contact: sip:alice@[5555::1:2:3:4]
Content-Type: application/sdp
Content-Length: 159

[body]
Figure 12.3. SIP message format.

12.4.1. Requests

SIP requests are distinguished from responses using the start line. As indicated earlier, the start line in the request is often referred to as the request line. It has three components: a method name, a request-URI and the protocol version. They appear in that order and are separated by a single space character. The request line itself terminates with a Carriage Return–Line Feed (CRLF) pair:

  • Method – the method indicates the type of request. Six are defined in the base SIP specification [RFC3261]: the INVITE request, CANCEL request, ACK request and BYE request are used for session creation, ...

Get The IMS: IP Multimedia Concepts And Services, Second Edition 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.