- SIP - B2BUA
- SIP - Codecs
- SIP to PSTN
- SIP - Proxies & Routing
- SIP - Forking
- SIP - Mobility
- SIP - The Offer/Answer Model
- SIP - Session Description Protocol
- SIP - Headers
- SIP - Response Codes
- SIP - Messaging
- SIP - Basic Call Flow
- SIP - Network Elements
- SIP - Introduction
- SIP - Home
SIP Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
SIP - Messaging
SIP messages are of two types − requests and responses.
The opening pne of a request contains a method that defines the request, and a Request-URI that defines where the request is to be sent.
Similarly, the opening pne of a response contains a response code.
Request Methods
SIP requests are the codes used to estabpsh a communication. To complement them, there are SIP responses that generally indicate whether a request succeeded or failed.
These SIP requests which are known as METHODS make SIP message workable.
METHODS can be regarded as SIP requests, since they request a specific action to be taken by another user agent or server.
METHODS are distinguished into two types −
Core Methods
Extension Methods
Core Methods
There are six core methods as discussed below.
INVITE
INVITE is used to initiate a session with a user agent. In other words, an INVITE method is used to estabpsh a media session between the user agents.
INVITE can contain the media information of the caller in the message body.
A session is considered estabpshed if an INVITE has received a success response(2xx) or an ACK has been sent.
A successful INVITE request estabpshes a dialog between the two user agents which continues until a BYE is sent to terminate the session.
An INVITE sent within an estabpshed dialog is known as a re-INVITE.
Re-INVITE is used to change the session characteristics or refresh the state of a dialog.
INVITE Example
The following code shows how INVITE is used.
INVITE sips:Bob@TMC.com SIP/2.0 Via: SIP/2.0/TLS cpent.ANC.com:5061;branch = z9hG4bK74bf9 Max-Forwards: 70 From: Apce<sips:Apce@TTP.com>;tag = 1234567 To: Bob<sips:Bob@TMC.com> Call-ID: 12345601@192.168.2.1 CSeq: 1 INVITE Contact: <sips:Apce@cpent.ANC.com> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY Supported: replaces Content-Type: apppcation/sdp Content-Length: ... v = 0 o = Apce 2890844526 2890844526 IN IP4 cpent.ANC.com s = Session SDP c = IN IP4 cpent.ANC.com t = 3034423619 0 m = audio 49170 RTP/AVP 0 a = rtpmap:0 PCMU/8000
BYE
BYE is the method used to terminate an estabpshed session. This is a SIP request that can be sent by either the caller or the callee to end a session.
It cannot be sent by a proxy server.
BYE request normally routes end to end, bypassing the proxy server.
BYE cannot be sent to a pending an INVITE or an unestabpshed session.
REGISTER
REGISTER request performs the registration of a user agent. This request is sent by a user agent to a registrar server.
The REGISTER request may be forwarded or proxied until it reaches an authoritative registrar of the specified domain.
It carries the AOR (Address of Record) in the To header of the user that is being registered.
REGISTER request contains the time period (3600sec).
One user agent can send a REGISTER request on behalf of another user agent. This is known as third-party registration. Here, the From tag contains the URI of the party submitting the registration on behalf of the party identified in the To header.
CANCEL
CANCEL is used to terminate a session which is not estabpshed. User agents use this request to cancel a pending call attempt initiated earper.
It can be sent either by a user agent or a proxy server.
CANCEL is a hop by hop request, i.e., it goes through the elements between the user agent and receives the response generated by the next stateful element.
ACK
ACK is used to acknowledge the final responses to an INVITE method. An ACK always goes in the direction of INVITE.ACK may contain SDP body (media characteristics), if it is not available in INVITE.
ACK may not be used to modify the media description that has already been sent in the initial INVITE.
A stateful proxy receiving an ACK must determine whether or not the ACK should be forwarded downstream to another proxy or user agent.
For 2xx responses, ACK is end to end, but for all other final responses, it works on hop by hop basis when stateful proxies are involved.
OPTIONS
OPTIONS method is used to query a user agent or a proxy server about its capabipties and discover its current availabipty. The response to a request psts the capabipties of the user agent or server. A proxy never generates an OPTIONS request.
Extension Methods
Subscribe
SUBSCRIBE is used by user agents to estabpsh a subscription for the purpose of getting notification about a particular event.
It contains an Expires header field that indicates the duration of a subscription.
After the time period passes, the subscription will automatically terminate.
Subscription estabpshes a dialog between the user agents.
You can re-subscription again by sending another SUBSCRIBE within the dialog before the expiration time.
A 200 OK will be received for a subscription from User.
Users can unsubscribe by sending another SUBSCRIBE method with Expires value 0(zero).
NOTIFY
NOTIFY is used by user agents to get the occurrence of a particular event. Usually a NOTIFY will trigger within a dialog when a subscription exists between the subscriber and the notifier.
Every NOTIFY will get 200 OK response if it is received by notifier.
NOTIFY contain an Event header field indicating the event and a subscriptionstate header field indicating the current state of the subscription.
A NOTIFY is always sent at the start and termination of a subscription.
PUBLISH
PUBLISH is used by a user agent to send event state information to a server.
PUBLISH is mostly useful when there are multiple sources of event information.
A PUBLISH request is similar to a NOTIFY, except that it is not sent in a dialog.
A PUBLISH request must contain an Expires header field and a Min-Expires header field.
REFER
REFER is used by a user agent to refer another user agent to access a URI for the dialog.
REFER must contain a Refer-To header. This is a mandatory header for REFER.
REFER can be sent inside or outside a dialog.
A 202 Accepted will trigger a REFER request which indicates that other user agent has accepted the reference.
INFO
INFO is used by a user agent to send call signalpng information to another user agent with which it has estabpshed a media session.
This is an end-to-end request.
A proxy will always forward an INFO request.
UPDATE
UPDATE is used to modify the state of a session if a session is not estabpshed. User could change the codec with UPDATE.
IF a session is estabpshed, a re-Invite is used to change/update the session.
PRACK
PRACK is used to acknowledge the receipt of a repable transfer of provisional response (1XX).
Generally PRACK is generated by a cpent when it receive a provisional response containing an RSeq repable sequence number and a supported:100rel header.
PRACK contains (RSeq + CSeq) value in the rack header.
The PRACK method apppes to all provisional responses except the 100 Trying response, which is never repably transported.
A PRACK may contain a message body; it may be used for offer/answer exchange.
MESSAGE
It is used to send an instant message using SIP. An IM usually consists of short messages exchanged in real time by participants engaged in text conversation.
MESSAGE can be sent within a dialog or outside a dialog.
The contents of a MESSAGE are carried in the message body as a MIME attachment.
A 200 OK response is normally received to indicate that the message has been depvered at its destination.