Session Initiation Protocol (SIP) – Overview -3 (messages-1)

SIP is a text-based protocol with syntax similar to that of HTTP. There are two different types of SIP messages: requests and responses. The first line of a request has a method, defining the nature of the request, and a Request-URI, indicating where the request should be sent. The first line of a response has a response code.

SIP request

For SIP requests, RFC 3261 defines the following methods:

  • REGISTER: Used by a UA to register to the registrar.
  • INVITE: Used to establish a media session between user agents.
  • ACK: Confirms reliable message exchanges.
  • CANCEL: Terminates a pending request.
  • BYE: Terminates an existing session.
  • OPTIONS: Requests information about the capabilities of a caller without the need to set up a session. Often used as keepalive messages.
  • REFER: indicates that the recipient (identified by the Request-URI) should contact a third party using the contact information provided in the request. (call transfer)

A new method has been introduced in SIP in RFC 3262:

  • PRACK (Provisional Response Acknowledgement): PRACK improves network reliability by adding an acknowledgement system to the provisional responses (1xx). PRACK is sent in response to provisional response (1xx).

Request Methods

SIP requests are the codes used to establish a communication. To complement them, there are SIP responses that generally indicate whether a request succeeded or failed.

There are commands known as METHODS that make a 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 establish a media session between the user agents.

    • INVITE can contain the media information of the caller in the message body.
    • A session is considered established if an INVITE has received a success response (2xx) or an ACK has been sent.

Invite

  • A successful INVITE request establishes a dialog between the two user agents which continues until a BYE is sent to terminate the session.
  • An INVITE sent within an established dialog is known as a re-INVITE.
  • Re-INVITE is used to change the session characteristics or refresh the state of a dialog.

BYE

BYE is the method used to terminate an established 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 unestablished 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 (3600 sec).
  • 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 an unestablished session. User agents use this request to cancel a pending call attempt initiated earlier.

  • 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.

Hop By Hop

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.

SDP Ack

    • ACK may not be used to modify the media description that has already been sent in the initial INVITE.

SDP Acknowledgement

  • 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.

OPTION

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

Extension Methods

Subscribe

SUBSCRIBE is used by user agents to establish a subscription for the purpose of getting notification about a particular event.

  • It has a time period in the Expires header field that indicates the desired duration of existence of a subscription.
  • After the specified time period passes, the subscription is automatically terminated.
  • A successful subscription establishes a dialog between the user agents.
  • A subscription can be refreshed by sending another SUBSCRIBE within the dialog before the expiration time.
  • The server accepting a subscription returns a 200 OK.
  • Users can unsubscribe by sending another SUBSCRIBE method with Expires value 0 (zero).

Example Subscribe

NOTIFY

NOTIFY is used by user agents to convey 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 200 OK response is received for every NOTIFY to indicate that it has been received.
  • NOTIFY requests contain an Event header field indicating the package and a subscription-state header field indicating the current state of the subscription.
  • A NOTIFY is always sent at the start of a subscription and at the termination of a subscription.

PUBLISH

PUBLISH is used by a user agent to send event state information to a server known as an event state compositor.

Publish

  • 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 signalling information to another user agent with which it has established a media session. This is an end-to-end request and never generate by proxies. A proxy will always forward an INFO request.

UPDATE

UPDATE is used to modify the state of a session without changing the state of the dialog. UPDATE is used if a session is not established and the user wants to change the codec.

Update

IF a session is established, a re-Invite is used to change/update the session.

PRACK

PRACK is used to acknowledge the receipt of a reliable transfer of provisional response (1XX).

  • PRACK is generated by a user agent client when a provisional response has been received containing an RSeq reliable sequence number and asupported:100rel header.
  • PRACK contains (RSeq + CSeq) value in the rack header.
  • A PRACK may contain a message body; it may be used for offer/answer exchange.

MESSAGE

It is used to send an instant message or IM using SIP. An IM usually consists of short messages exchanged in real time by participants engaged in text conversation.

Message

  • MESSAGE can be sent within a dialog or outside a dialog.
  • The contents of a MESSAGE are carried in the message body as a MIMEattachment.
  • A 200 OK response is normally received to indicate that the message has been delivered at its destination.

 

2 Comments

Leave a Reply

Leave a Reply

Your email address will not be published. Required fields are marked *