Code2Compile
Get A Hold On What You Code !!!



SIP Messages


As you must be already aware by now there are two types of SIP Messages.
a) Requests -> sent from client to server.
b) Response -> sent from server to client.


Any SIP Message consists of :-
a)  Start Line - can be a request line or status line(see below for details)
b)  One or more header fields
c)  An empty line indicating the end of the header fields.
d)  Message body(optional)


Request and Response messages use the basic format specified in RFC 2822 and uses a UTF-8 charset (RFC 2279).


SIP Request

Start line for a request is actually distinguished by a Request-Line. A Request-Line consists of :-
a)  Method Name
b)  REQUEST URI - for indicating a user or a service for which this request is being sent.
c)  Protocol Version separated by a single space character

A Request-Line ends with CRLF and no Linear White Spaces (LWS) are allowed in any of the elements.


Example:
Some of the basic SIP Signalling Methods are as below:
  1. REGISTER - performs binding of permanent address and current location. May convey user data.
  2. INVITE - initiates sessions and may contain SDP (Session Description Protocol) in message body.
  3. ACK - confirms session establishment and can only be used with INVITE.
  4. BYE - terminates sessions.
  5. CANCEL - this cancels a pending INVITE.
  6. OPTIONS - queries the capability of an endpoint.

For details please refer the SIP Methods section. Some more SIP Signalling extension Methods are:
  1. UPDATE - it allows a client to update parameters of a session such as media streams and their                              codecs. But it does not have any impact on the state of a dialog (RFC 3311).
  2. PRACK - provisional reliable responses acknowledgement (RFC 3262).
  3. SUBSCRIBE/NOTIFY - involves an event package subscription and SIP nodes receives notification for                                        that event from a remote SIP node.
  4. MESSAGE - used for Instant Messaging (RFC 3428).
 

SIP Response

It is distinguished from requests by having a Status-Line as their start-line. A Status-Line consists of :-
a)  Protocol Version - SIP Version "SIP/2.0". The Sip version string is case sensitive and the Version Number                                      is also treated as a literal string.
b)  Numeric Status Code - it is a 3-digit integer number which indicates the output of an attempt to                                                             understand and satisfy a request. First digit is for defining the 
"class of response".                                             Last two digits are intended to be used by automata.
c)  Reason Phrase - Textual description of the Status Code that a human user can understand.


Example:

Some SIP Signalling Response Codes and their respective class are shown as below :-
  1. 1xx - Class is "Provisional or Informational Responses".
  2. 2xx - Class is "Success". It shows that the action/request has been successfully received, understood            and accepted.
  3. 3xx - Class is "Redirection". The user is not available at the requested location but somewhere else.              Thus, further action is required in order to complete the request.
  4. 4xx - Class is "Client Error". The request contains some bad syntax or cannot be completed at this                  server.
  5. 5xx - Class is "Server Error". The request is valid but the server failed to fulfill it.
  6. 6xx - Class is "Global Failure". This request cannot be fulfilled at any server. 

More Info on Response Class 1xx
 - This response code shows that the server contacted is performing some further action and as of now does not have a definite response. A server sends a 1xx response if it expects to take time > 200ms before it can dispatch a final response. Note that 1xx responses are not transmitted reliably and they never cause a client to send an ACK. They can also carry SDP in their message bodies.


For detailed description on header fields and methods continue reading ...........




SIP Trapezoid & SIP Entities <==                                                ==> SIP Headers

How do you find this SIP Tutorial?
 
pollcode.com free polls
Linkedin          Code2CompileTwitter          Code2CompileGooglePlus
 
About Me    |    Blog    |    Contact Us    |    Member Login
 
┬ęCode2Compile.com -- Taking the initiative of helping out people suffering from The Interview Misery