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:email@example.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:firstname.lastname@example.org>;tag=312345 To: Bob Smith <sip:email@example.com> Call-ID: 105637921 CSeq: 1 INVITE Contact: sip:alice@[5555::1:2:3:4] Content-Type: application/sdp Content-Length: 159 [body]
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, ...