SIP Methods

SIP Servers:

Proxy Servers: 

- A stateless proxy server processes each SIP request or response based solely on the message contents. Once the message has been parsed, processed, and forwarded or responded to,no information about the message is stored—no dialog information is stored. A stateless proxy never re-transmits a message, and does not use any SIP timers.


- A stateful proxy server keeps track of requests and responses received in the past and uses that information in processing future requests and responses. For example, a stateful proxy server starts a timer when a request is forwarded. If no response to the request is received within the timer period, the proxy will

re-transmit the request, relieving the user agent of this task. Also, a stateful proxy can require user agent authentication.


Back-to-Back User Agents (B2BUA):
An B2BUA is a type of SIP device that receives the SIP request, that reformulates the request and send it out as new request. Response to the request are reformulated and sent back to the UA in opposite direction. 

SIP Methods (Request):

1.) INVITE: The INVITE is used to establish the media session between the users. An Invite usually has a message body containing the media session information as SDP. it also contains other information like QoS and security information. If INVITE does not contain the media information, the ACK message contains the media information of the UAC. 
   A media session is considered established when the INVITE, 200 OK, and ACK messages have been exchanged between the UAC and the UAS. If the media information contained in the ACK is not acceptable, then the called party must send a BYE to cancel the session, a CANCEL cannot be sent because the session is already established.  A UAC that originates an INVITE to establish a dialog creates a globally unique Call-ID that is used for the duration of the call. A CSeq count is initialized (which need not be set to 1, but must be an integer) and incremented for each new request for the same Call-ID. The To and From headers are populated with the remote and local addresses. A From tag is included in the INVITE, and the UAS includes a To tag in any responses. A To tag in a 200 OK response to an INVITE is used in the To header field of the ACK and all future requests within the dialog. The combination of the To tag, From tag, and Call-ID is the unique identifier for the dialog.

Re-Invite: An INVITE sent for an existing dialog references the same Call-ID as the original INVITE and contains the same To and From tags. Sometimes called a re-INVITE, the request is used to change the session characteristics or refresh the state of the dialog. The CSeq command sequence number is incremented so that a UAS can distinguish the re-INVITE from a re-transmission of the original INVITE.

UPDATE: A re-INVITE must not be sent by a UAC until a final response to the initial INVITE has been received instead, an UPDATE request can be sent. 

An Expires header in an INVITE indicates to the UAS how long the call request is valid. For example, the UAS could leave an unanswered INVITE request displayed on a screen for the duration of specified in the Expires header. Once a session is established, the Expires header has no meaning, the expiration of the time does not terminate the media session. Instead, a Session-Expires header  can be used to place a time limit on an established session

2.) REGISTER: REGISTER message used to register the Address of record to Registrar server. The REGISTER method is used by a user agent to notify a SIP network of its current Contact URI (IP address) and the URI that should have requests routed to this Contact.The registrar binds the SIP URI of marconi and the IP address of the device in a database that can be used.


----------------------------------------------------------
REGISTER sip:registrar.text.com SIP/2.0
Via: SIP/2.0/UDP 200.201.202.203:5060;branch=z9hG4bKus1812
Max-Forwards: 70
To: Marconi <sip:marconi@text.com>
From: Marconi <sip:marconi@text.com>
;tag=3431
Call-ID: 1232134@200.201.202.203
CSeq: 1 REGISTER
Contact: sip:marconi@200.201.202.203
Content-Length: 0
--------------------------------------------------------
SIP/2.0 200 OK
Via: SIP/2.0/UDP 200.201.202.203:5060;branch=z9hG4bKus19
To: Marconi <sip:marconi@text.com>;tag=8771
From: Marconi <sip:marconi@text.com>
;tag=3431
Call-ID: 23@200.201.202.203
CSeq: 1 REGISTER
Contact:Marconi <sip:marconi@text.com>;expires=3600
Content-Length: 0
--------------------------------------------------------
The Contact URI is returned along with an expires parameter, which indicates how long the registration is valid, which in this case is 1 hour (3,600 seconds).

Marconi                                  Registrar Server
=================================
--------------REGISTER--------------------->
<---------------200 OK-----------------------

3.) BYE: The BYE method is used to terminate an established media session. BYE is sent only by user agents participating in the session, never by proxies or other third parties. It is an end-to-end method, so responses are only generated by the other user agent.


BYE sip:marconi@test.com SIP/2.0
Via: SIP/2.0/UDP 100.120.100.100:5060;branch=z9hG4bK3145r
Max-Forwards:70
To: Marconi <sip:marconi@test.com>;tag=63104
From: Tela <sip:tesla@text.com>;tag=9341123
Call-ID: 2342324324@100.120.100.100
CSeq: 12 BYE
Content-Length: 0


4.) ACK: The ACK method is used to acknowledge final responses to INVITE requests. Final responses to all other requests are never acknowledged. Final responses are defined as 2xx, 3xx, 4xx, 5xx, or 6xx class responses. The CSeq number is never incremented for an ACK, but the CSeq method is changed to ACK. This is so that a UAS can match the CSeq number of the ACK with the number of the corresponding INVITE.

An ACK may contain an application/sdp message body. This is permitted if the initial INVITE did not contain a SDP message body. If the INVITE contained a message body, the ACK may not contain a message body. The ACK may not be used to modify a media description that has already been sent in the initial INVITE; a re-INVITE must be used for this purpose.

For 2xx responses, the ACK is end-to-end, but for all other final responses it is done on a hop-by-hop basis when stateful proxies are involved. The end-toend nature of ACKs to 2xx responses allows a message body to be transported. A hop-by-hop ACK reuses the same branch ID as the INVITE since it is considered part of the same transaction. An end-to-end ACK uses a different branch ID as it is considered a new transaction.


ACK sip:marconi@text.com SIP/2.0
Via: SIP/2.0/TCP 100.200.102.100:5060;branch=z9hG4bK1234
Max-Forwards:70
To: Marconi <sip:marconi@text.com>;tag=902332
From: Tesla <sip:tesla@test.com>;tag=887823
Call-ID: 123213213213@100.200.102.100
CSeq: 3 ACK
Content-Type: application/sdp
Content-Length: 100

(SDP not shown)


5.) CANCEL: The CANCEL method is used to terminate pending call attempts. It can be generated by either user agents or proxy servers provided that a 1xx response containing a tag has been received, but no final response has been received. CANCEL is a hop-by-hop request and receives a response generated by the next stateful element. The CSeq is not incremented for this method so that proxies and user agents can match the CSeq of the CANCEL with the CSeq of the pending INVITE to which it corresponds. The branch ID for a CANCEL matches the INVITE that it is canceling.


CANCEL sip:marconi@text.com SIP/2.0
Via: SIP/2.0/UDP 100.100.122.122:5060;branch=z9hG4bK3134324
Max-Forwards:70
To: Marconi <sip:marconi@text.com>
From: Tesla <sip:Tesl@test.com>;tag=034324
Call-ID: 123213@12321321321.com
CSeq: 1 CANCEL
Content-Length: 0

6.) OPTIONS:  The OPTIONS method is used to query a user agent or server about its capabilities and discover its current availability. The response to the request lists the
capabilities of the user agent or server. A proxy never generates an OPTIONS request.

OPTIONS sip:marconi@text.com SIP/2.0
Via: SIP/2.0/UDP 100.200.100.100
;branch=z9hG4bK1834
Max-Forwards:70
To: Marconi <sip:marconi@text.com>
From: Tesla <tesla@text.com>
;tag=34
Call-ID: 9352812@100.200.100.100
CSeq: 1 OPTIONS
Content-Length: 0


7.) REFER: The REFER method  is used by a user agent to request another user agent to access a URI or URL resource. The resource is identified by a URI or URL in the required Refer-To header field. When the URI is a sip or sips URI, the REFER is probably being used to implement a call transfer service. REFER can also used to implement peer-to-peer call control.


REFER sip:marconi@test.com SIP/2.0
Via SIP/2.0/UDP test.com:5060;branch=z9hG4bK9323249
Max-Forwards: 69
To: <sip:marconi@test.com>;tag=324234
From: Tesla <sip:tesla@test.com>;tag=44432
Call-ID: 3419fak32343243s1A9dkl
CSeq: 5412 REFER
Refer-To: <sip:info@test.com>
Content-Length: 0

8.) SUBSCRIBE: The SUBSCRIBE method is used by a user agent to establish a subscription for the purpose of receiving notifications (via the NOTIFY method) about a particular event. The subscription request contains an Expires header field, which indicates the desired duration of the existence of the subscription. After this time period passes, the subscription is automatically terminated. The subscription can be refreshed by sending another SUBSCRIBE within the dialog before the expiration time. A server accepting a subscription returns a 200 OK response also obtaining an Expires header field. There is no “UNSUBSCRIBE” method used in SIP—instead a SUBSCRIBE with Expires:0 requests the termination of a subscription and hence the dialog. A terminated subscription (either due to timeout out or a termination request) will result in a final NOTIFY indicating that the subscription has been terminated.

UA                               Proxy-Server                        Presence Agent
====================================
------------Subscribe----------->
                                                 -----------Subscribe-------------->
                                                 <-----202 Accepted---------------
<-----------------202 Accepted---
<------------------------------------NOTIFY------------------------------
-----------------------200 OK--------------------------------------------->
----------------------------Subscribe-------------------------------------->
<-----------------------------------200 OK-------------------------------


SUBSCRIBE sip:marconi@text.com SIP/2.0
Via SIP/2.0/UDP 200:200:200:201:5060;branch=z9hG4bKABDA ;received=192.0.3.4
Max-Forwards: 69
To: <sip:Ptolemy@rosettastone.org>
From: Tesla <sip:tela@text.com>;tag=1814
Call-ID: 452k59252058234924lk34
CSeq: 3412 SUBSCRIBE
Allow-Events: dialog
Contact: <sip:tesla@200:200:200:201>
Event: dialog
Content-Length: 0

9.) NOTIFY: The NOTIFY method is used by a user agent to convey information about the occurrence of a particular event. A NOTIFY is always sent within a dialog, when a subscription exists between the subscriber and the notifier. A NOTIFY request normally receives a 200 OK response to indicate that it has been received.
A NOTIFY requests contain an Event header field indicating the package and a Subscription-State header field indicating the current state of the subscription. The Event header field will contain the package name used in the subscription.
A NOTIFY is always sent at the start of a subscription and at the termination of a subscription.




Comments

  1. Hey!Amazing work. With full of knowledge. Our Team resolve any glitches occurring while utilizing the software. Looking for Quickbooks Customer Service Number Contact us : +1 888-210-4052.Our experts will assist you to fulfil your accounting needs. The solutions are accurate and time-saving.

    ReplyDelete
  2. QuickBooks customers can dial a toll-free Quickbooks Customer Service +1 855-885-5111 to get answers to their questions. The phone line is free and the live operators are trained to handle many QuickBooks-related issues.

    ReplyDelete
  3. cakesncakesshop.com is the best cake shop in Mohali. We have a variety of cakes .We made organic & healthy cakes. We made yummy & delicious Birthday cakes at an affordable price.
    , cakes in 199rs mohali.

    ReplyDelete
  4. When you or your company need help with QuickBooks or any other aspect of your business, dial Quickbooks Support Phone Number +1 888-210-4052.

    ReplyDelete
  5. Thank you for sharing this post, you have given very good information in this post jvatec.in so that you can understand it better in reading, and more information you can visit my website.

    ReplyDelete
  6. Manual testing is a traditional method of testing. Software testers have to write test cases and then execute them manually. Manual tests are very useful in finding basic functional issues in the software being tested, for example in finding out what can be done on each screen, or even in the application being used by the user. Lasts long enough or not. Click to read this article : Manual Testing and software testing

    ReplyDelete
  7. I read your website. It's so good. Keep doing best wishes from us. Anyone interested in astrology takes a look at the best astrologer Raghuram.astorloger in Bangalore

    ReplyDelete

  8. Sanity Test vs Smoke Test are simple software testing techniques in which smoke testing is done by creating artificial conditions that cause an application to behave abnormally and sanitizing the test environment before all the functionalities of the application are tested.

    ReplyDelete

  9. Webomates has a team of experienced DevOps testing with the expertise to build automated tests for your cloud-based applications, APIs and infrastructure. Our DevOps specialists have a holistic view of testing for Dev, Stage and Production environments and are adept at creating efficient automation test suites to support DevOps.

    ReplyDelete
  10. Great post.
    Softcron Technology is a team of talented youth quided by the expertise of Digital Marketing Website Designer, Website Developers and Graphic Desiqners, Digital Marketing we put our best effort on every single website project considering it as our own site. We aim to deliver best services to our clients and helo them to grow in the competitive industry. We focus on taking your business to the next level with the help of right branding strategies and online marketing campaigns.
    Digital Marketing
    Build online presence
    Digital Marketing company
    Digital Marketing services
    Digital Marketing Agency
    IT company services
    Web Service provider
    IT web services in India
    SEO Services

    ReplyDelete
  11. Great post.
    Bansal Packers and Movers (P) Ltd has been providing the best warehousing and storage services in Bangalore. For a decade, we have provided excellent Household Goods Storage, Documents storage in services whitefield Commercial Goods Storage, Packers and Movers, Electronic Goods Storage, 4 Wheeler Storage, Two Wheeler Storage, Document Storage or more to our customers. Bansal Packers and Movers (P) Ltd has been a stupendous moving company that endeavors to provide a rich quality service to satisfy our consumers' requirements and demands. We value our consumers' opinions, thoughts, and ways of thinking similar to their household goods and products.
    Household Goods Storage and Relocation Services in Bangalore
    Commercial Goods Storage services in Bangalore
    Storage facility for Short and Long Term inBangalore
    Electronic Goods Storage services in Bangalore
    Four Wheeler Vehicle Shifting Services in Bangalore
    Documents Storage Services in Bangalore
    Packers and Movers Services in Bangalore
    Two Wheeler Shifting Service in Bangalore
    Documents storage Services in whitefield
    household goods storage Services in whitefield
    two wheeler stoarge Services in whitefield
    4 wheeler storage Services in whitefield
    electronic goods storage Services in whitefield
    storage for short and long term Services in whitefield
    packers and movers Services in whitefield
    commercial goods storage Services in Whitefield

    ReplyDelete
  12. Free GST Query through GST Experts of better GST compliances and handle GST interpretations.

    ReplyDelete
  13. Custom perfume boxes are used to attract customers.wholesale perfume boxes Perfumes, colognes, and such fragrances are highlighted on the shelves by packing in an innovative package. These luxe items are packed in enticing boxes.

    ReplyDelete
  14. This comment has been removed by the author.

    ReplyDelete
  15. This comment has been removed by the author.

    ReplyDelete
  16. Science Assignment Help is dedicated to providing thorough assistance to ensure the successful completion of your university assignments, aiming for an A+ grade.

    ReplyDelete

Post a Comment

Popular posts from this blog

SRVCC - Single Radio Voice Call Continuity

Intelligent Networks (IN) and CAMEL

Diameter Messages