SIP is flagging convention used to Initiate,Modify and Tear down the Voice and Video sessions.

SIP is application layer convention (likewise called Signaling/Text- based convention). It is outlined by IETF. SIP was at first centered around Voice Communication  and later extended to Video, Instant messaging.....etc. Taste brings media transport through the RTP/ RTCP, SRTP.

SIP Trapezoid: 

SIP MESSAGES

Sip Messages are divided into two types:

  1. Sip Requests --> sent from client to sever.
  2. Sip Responses -->sent from server to client.
Message Syntax:

        Start line
        Message header
              CRLF- Carriage return line feed.
        Message body(SDP-Session Describestion Protocol ).

Message header:  It gives extra data, in regards to demands and reactions.
CRLF    : Empty line after header field.
Message body( SDP) : Typically depicts the kind of session to be established,including a portrayal of media to be traded.

Start Line:
    Start line can be request line or status line. Sip Requests start line:

   Syntax: Method Request URI SIP version
     Ex:  Invite  sip:bob@billoxi.com  sip/2.0

Sip Response start line:
  Syntax:Sip version Response code Responpharse
 Ex: sip/2.0  200   OK

Message header Syntax:
        
         Via
         To
         From
         Call Id
         C-seq
         Max-forward
         Contact

Message Body Syntax:

          V- Version SDP = 0
          O- Owner  = IPv4
          S- Session name = VOIP
          T- Time= Start and stop time
         M- Media =Audio/ Video
         A- Attributes =Send only/Recv only    
                

  • REQUESTS:   
  1.  Invite: It shows customer is welcome to take part in call session.
  2. Ack: It affirms customer has gotten last reaction to welcome solicitation.
  3. Bye: Ends the call and can be sent by either guest or callee. 
  4. Cancel: Wipes out any pending appeal.
  5. Options: Inquiries the capacities of server.
  6. Register: Registers the location recorded into header field with a Sip server.
  7. Prack: Temporary Acknowledgement.
  8. Refer: Requests that beneficiary issue SIP ask.
  9. Notify: Inform the endorser of another occasion.
  10. Subscribe:Subscribes for an occasion of notice from the notifier.
  11. Info : Sends mid-session data.
  12. Message:Transports texts utilizing SIP.
  13. Update: Alters the condition of a session without evolving.
  14. Publish: Distribute an occasion to the server.  


  • RESPONSES:

       1XX  -  Information Responses
       2XX -   Successful Responses
       3XX  -  Redirection Responses
       4XX -   Client failure Responses
       5XX  -  Server failure Responses
       6XX  -  Global failure Responses
        Examples:
             
       100  -  Trying
       180  -  Ringing
       181  -  Call being forwarded
       183  -  Session in progress
       200  -  Ok
       202  -  Accepted
       301  -  Moved permanently
       302  -  Moved temporarily
       401  -  Unauthorized
       404  -  Not found
       483  -  Too Many Hops
       486  -  Busy here
       407  -  Proxy authentication required
       408  -  Request timeout
       487  -  Request terminated
       491  -  Request pending
       503  -  Service unavailable
             


EXPLANATION OF MESSAGE HEADER Fields:

VIA: It contains the location at which client is hoping to get reaction to this  request.The Via header field esteem MUST contain a branch parameter.

This parameter is utilized to distinguish the exchange made by that demand.

It helps intermediaries to recognize circles.

The branch parameter esteem MUST be remarkable crosswise over space and time for all appeals sent by the UA. The special cases to this principle are CANCEL and ACK for non-2xx reactions. As examined underneath, a CANCEL solicitation will have the same estimation of the branch parameter as the appeal it cancels.* The branch ID embedded by a component dependably start with the characters "z9hG4bK". These 7 characters are utilized as an "Enchantment treat"

FROM :It contains presentation name and SIP URI that shows the originator of the  demand. The From field MUST contain another "label" parameter, picked by the UAC.

TO : It contains the presentation name and SIP URI towards which demand was initially coordinated. An appeal outside of a dialog MUST NOT contain a To label; the tag in the To field of a solicitation distinguishes the associate of the dialog. Since no dialog is made, no tag is available.

Label : Tag in "To" header are of no assistance since they are not known until reaction arrive.An beginning solicitation from a customer will contain a From Tag and the ensuing temporary reaction to it from the server will contain a To Tag.

Labels are utilized by the UAC to recognize numerous last reactions from diverse  UAS.

CALL-ID: It contains an all inclusive novel identifier for all appeals and reactions sent by either UA in a dialog,generated by the blend of irregular string and IPaddress.Note that when solicitation are retried after certain disappointment, These retried solicitations are not viewed as new requests,and along these lines needn't bother with new Call-ID.

* Implementations MAY utilize the structure "loclid@host".* It gives some assurance against session seizing and lessens.

CALL LEG : The mix of to tag, From label and call ID is called call leg/companion to  peer  association.

C- SEQ :It contains a grouping number and strategy Name. The c-seq is increased for  every new request.* It is utilized to recognize and request exchanges.

CONTACT :It contains a SIP URI that speaks to the direct course to contact client.

MAX-FORWARD:It serves to cutoff the quantity of jumps an appeal can make while in transit to destination. On the off chance that the Max-Forwards esteem achieves 0 preceding the solicitation achieves its destination, it will be dismisses with a 483(Too Many Hops) mistakes reaction.

CONTENT LENGTH :It contains an octet(byte) number of the message body.

Guest ID:It is given by the From SIP header containing the guest's name and number.

RECORD ROUTE: Record course header is embedded into solicitations by intermediaries that need to be in the  way of ensuing appeal for the same call-id. It is then utilized by client operators to course ensuing solicitations.

  SIP ENTITIES:

          
                                              SIP system comprises of four sorts of sensible SIP elements. Taste substance  as a customer (launchs demands),  and as a server (reacts to demands),  or as both.

Taking after are the four sorts of legitimate SIP Entities:

USER AGENT : User Agent (UA) is the endpoint legitimate substance. Client Agents start and end sessions by trading appeals and reactions.

User Agent Client (UAC)—

The customer application that starts SIP requests(Initiates a call).

It keeps going just for the span of that paticular exchange.

User Agent Server (UAS)—

It creates a reaction to a  SIP solicitation send by UAC.

It keeps going just for the span of that paticular exchange.

Note: The User Agent starting a call goes about as a UAC when sending the beginning SIP solicitation (INVITE) and as a UAS  when it gets a SIP BYE ask for from the callee.

A percentage of the gadgets that can have a UA work in a SIP system are: IP-telephones, telephony portals, call specialists, robotized voice-mail.

REGISTRAR SERVER:   Before endpoints convey (endpoints are the guest and the callee i.e UA) they ought to be enlisted to a SIP substance known as REGISTRAR SERVER. It is a UAS and a consistent entity.The endpoint registers to a REGISTRAR Sever and Contact Information of the client indicated in the appeal is redesigned  at  Location Server.

A Location Server is a database of areas of SIP User Agents. 

1)  It is  overhauled by SIP User Agents by Registration.
2)  It is utilized by Redirect/Proxy server to acquire data about a callee's conceivable locations.
3)  DNS question is utilized to inquiry area administration.

Note: In this both To & From location will be same.

REDIRECT SERVER:  Redirect Server is a server that acknowledges a SIP ask for and send 3XX Responses with  present area address after quieries with Location separate . Dissimilar to Proxy servers, Redirect Servers don't pass the appeal on to different servers.

Ex: 302 - Moved Temporarily,301 - Moved Permanently

PROXY SERVER:  A Proxy Server is a middle person element that goes about as both a server and a customer with the end goal of making demands in the interest of different customers. It additionally counsels database, for example, DNS and Location Server.

There are two sorts of poxies:Normal Proxy Sever(Sateless):  It just advances the got solicitations to flip side and send reactions in the interest of other.It simply perform steering logic,send message out.

B2BUA Sever(Statefull):  Proxy deciphers, and, if important, revamps an appeal message before sending it. It keep up state amid whole exchange. Ex: Forward on no reply,Forking.

DNS Server:  It stores address and its comparing name sets. On the off chance that  we send a site name in a solicitation  and it returns careful IP location of it.

User A launchs an INVITE ask for with Request-URI of B(atlanta.com). As welcome scopes "biloxi.xom" intermediary server it finds the poxy server at "atlanta.com"  perhaps by performing a specific kind of DNS lookup and discover the server that serves UserB. Since intermediary is giving "outbound administration" it is called Outbound Poxy.

After Invite comes to atlanta.com intermediary  server counsels database,generically called an area service,that contains the current IP location of UserB.Since intermediary is giving "Inbound administration" it is called Inbound Poxy.

A solitary intermediary can have the rationale to go about as an Outbound/Inbound intermediary for A to B c


Difference between H.323&SIP

                                                                
1. H.323 :It is designed by ITU                      
    SIP     :It is designed by IETF.

                                 
    2.  H.323 : H.323 is limited to conferencing.It define the basic set of funtionality that all devices                                       must support.
         SIP    :  SIP was initially focused ib voice connection and then expanded to video,instant messaging..etc

    3.  H.323 : Has defined a number of features to handle failures of N/W entities
         SIP     :  Has not defined for handling device failure. user agent has to send re-Invite.

     4.  H.323 : Encodes messages in a compact binary format.
          SIP     : Sip messages are encoded in ASCIT text format.
     5.  H.323 :  Media transport RTP/RTCP,SRTP.
           SIP     :  Media transport RTP/RTCP, SRTP.

      6. H.323 :  Addressing H.323 support these aliases:
                         * E.164 dialed digits
                         * Transport address
                         * Email address
                         * Party number
           SIP    :  SIP only understand URI- Style addresses.

      7. H.323 :  Call setup :  Setup Connect  Ack
          SIP      :  Call setup :  Invite 200Ok  Ack

      8.  H.323  :  H.323 fully support video and data conferencing.
           SIP      :  SIP has limited support for video and no support for data conferencing.

       9.  H.323 :  H.323 Support any codec standedized or propretory.
            SIP     :  SIP supports IANA registered codec.

      10.  H.323 : Most H.323 entities use a reliable transport for signalling.
             SIP     : Most SIP entities uses an unreliable transport for signalling.

      11.  H.323 : Routing gatekeepers can detect loops by looking at call identifier and destination address.
             SIP     : The via header facilitates detecting loops.

      12 . H.323 : Minimum ports for VOIP call 3  ( call signalling, RTP, RTCP )
             SIP     : Minimum ports for VOIP call 3  ( SIP, RTP, RTCP )