Chapter 1. Introduction to Session Initiation Protocol (SIP) 23
RFC 3265
SIP Specific Event Notification - this extension provides the
framework for requesting notification when certain events occur
RFC 3311
Session Initiation Protocol (SIP) UPDATE Method - this extension allow for
the updating of session parameters prior to the final response
RFC 3326
The Reason header field for SIP - the addition of this field enable the ability to
know why a SIP request was issued
RFC 3428
SIP extension for instant messaging - this extension introduces the
MESSAGE method to allow for the transfer of Instant Messages
RFC 3515
The SIP Refer method - this extension requests that the recipient refer to a
resource provided in the request
1.4.2 SIP Servlet API
SIP Servlet specification was developed through the Java Community Process
(JSR 116). It presents an abstract view of SIP that is based on the Java servlet
API. SIP Servlets are Java based component applications that typically run in
servlet containers on network servers. Where JAIN SIP API provides access to
the full SIP protocol, the SIP servlet and container hide SIP protocol complexities
by providing an environment where services are prevented from violating the
protocol or performing restricted operations.
The SIP container performs many of the same functions in order to simplify the
creation of SIP applications. Servlet container manages the life cycle of a servlet
and support interaction between servlets and SIP clients (user agents) by
exchanging SIP request and response messages. For instance, a servlet
container can perform message queuing, dispatching and state management.
Like HTTP servlets, SIP Servlets extend base javax.servlet.GenericServlet class.
The SipServletRequest and SipServletResponse classes are similar to the
HttpServletRequest and HttpServletResponse classes. All messages come in
through the service method which calls doRequest or doResponse for incoming
requests and responses, respectively. Depending on the request method or
status code the call is dispatched to one of the following methods:
24 Developing SIP and IP Multimedia Subsystem (IMS) Applications
Table 1-4 SIP servlet request /response methods
The SIP Servlet API includes a set of objects and interfaces that provide
high-level abstraction of many of the SIP concepts. Table 1-5 lists the key items
in the API.
Method Request/Response message
Requests
doInvite SIP INVITE requests
doAck SIP ACK requests
doOptions SIP OPTIONS requests
doBye SIP BYE requests
doCancel SIP CANCEL requests
doRegister SIP REGISTER requests
doSubscribe SIP SUBSCRIBE requests
doNotify SIP NOTIFY requests
doMessage SIP MESSAGE requests
doInfo SIP INFO requests
doPrack SIP PRACK requests
Responses
doProvisionalResponse SIP 1xx informational responses
doSuccessResponse SIP 2xx responses
doRedirectResponse SIP 3xx responses
doErrorResponse SIP 4xx, 5xx, and 6xx responses
Note: Despite being derived from a common base class, there are differences
between SIP Servlets and HTTP Servlets. While HTTP is a synchronous
request/response protocol, SIP is asynchronous, and there is not necessarily
one response, or any responses to every SIP request dispatched to a SIP
Servlet. Also, SIP programming model allow applications to act as a client or
proxy to other servers or proxies.
Chapter 1. Introduction to Session Initiation Protocol (SIP) 25
Table 1-5 SIP servlet objects and interfaces
SIP servlet supports the baseline SIP protocol functionality as described in RFC
3261 “SIP: Session Initiation Protocol”.
SIP servlet also supports the following SIP extensions:
RFC 3265
Session Initiation Protocol (SIP)-Specific Event Notification - this extension
provides the framework by which SIP nodes can be notified of events that
occur at remote nodes.
RFC 3428
SIP extension for instant messaging - this extension introduces the
MESSAGE method to allow for the transfer of Instant Messages.
Interface/Object Description
SipServlet The base servlet object, it receives incoming messages
through the service method, which calls doRequest or
doResponse.
ServletConfig Used by the servlet container to pass configuration
information to a servlet during initialization.
ServletContext Used by a servlet to communicate with its container.
SipServletMessage Defines common aspects of SIP requests and responses.
SipServletRequest Provides high-level access to SIP request messages.
Created and passed to the handling servlet when the
container processes incoming requests.
SipServletResponse Provides high-level access to a SIP response message.
Instances of SipServletResponse are passed to servlets
when the container receives incoming SIP responses.
SipFactory Factory interface for a variety of servlet API abstractions.
SipAddress Represents SIP From and To header.
SipSession Represents SIP point-to-point relationships, and maintains
dialog state for UAs.
SipApplicationSession Represents application instances, acts as a store for
application data and provides access to contained protocol
sessions.
Proxy Represents the operation of proxying a SIP request and
provides control over how that proxying is carried out.

Get Developing SIP and IP Multimedia Subsystem (IMS) Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.