![]() ![]() ![]() ![]() ![]() ![]() |
The following sections describe how to develop converged HTTP and SIP applications with WebLogic SIP Server:
In a converged application, SIP protocol functionality is combined with other protocols (generally HTTP) to provide a unified communication service. For example, an online push-to-talk application might enable a customer to initiate a voice call to ask questions about products in their shopping cart. The SIP session initiated for the call is associated with the customer's HTTP session, which enables the employee answering the call to view customer's shopping cart contents or purchasing history.
You assemble converged applications using the basic SIP Servlet directory structure outlined in JSR 116. Converged applications require both a sip.xml
and a web.xml
deployment descriptor files.
The HTTP and SIP sessions used in a converged application can be accessed programmatically via a common application session object. WebLogic SIP Server provides an extended API to help you associate HTTP sessions with an application session.
JSR 116 fully describes the requirements and restrictions for assembling converged applications. The following statements summarize the information in the SIP Servlet specification:
WEB-INF
subdirectory; this ensures that the files are not served up as static files by an HTTP Servlet.sip.xml
and web.xml
descriptors are required. A weblogic.xml
deployment descriptor may also be included to configure Servlet functionality in the WebLogic SIP Server container.distributable
tag must be present in both sip.xml
and web.xml
, or it must be omitted entirely.context-param
elements are shared for a given converged application. If you define the same context-param
element in sip.xml
and in web.xml
, the parameter must have the same value in each definition.display-name
or icons
element is required, the element must be defined in both sip.xml
and web.xml
, and it must be configured with the same value in each location.
As shown in Figure 4-1, each application deployed to the WebLogic SIP Server container has a single SipApplicationSession
, which can contain one or more SipSession
and HttpSession
objects. The basic API provided by javax.servlet.SipApplicationSession
enables you to iterate through all available sessions available in a given SipApplicationSession
. However, the basic API specified by JSR 116 does not define methods to obtain a given SipApplicationSession
or to create or associate HTTP sessions with a SipApplicationSession
.
WebLogic SIP Server extends the basic API to provide methods for:
These extended API methods are available in the utility class com.bea.wcp.util.Sessions
. Table 4-1 provides a summary of each method. See the
JavaDoc for more details on this utility class.
When using a replicated domain, WebLogic SIP Server automatically provides concurrency control when a SIP Servlet modifies a SipApplicationSession
object. In other words, when a SIP Servlet modifies the SipApplicationSession
object, the SIP container automatically locks other applications from modifying the object at the same time.
Non-SIP applications, such as HTTP Servlets, must themselves ensure that the application call state is locked before modifying it in a replicated environment. This is also required if a single SIP Servlet needs to modify other call state objects, such as when a conferencing Servlet joins multiple calls.
To help application developers manage concurrent access to the application session object, WebLogic SIP Server extends the standard SipApplicationSession
object with com.bea.wcp.sip.WlssSipApplicationSession
, and adds a new interface, com.bea.wcp.sip.WlssAction
to encapsulate changes to the session. When these APIs are used, the SIP container ensures that all business logic contained within the WlssAction
object is executed on a locked copy of the associated SipApplicationSession
instance.
SipApplicationSession appSession = ...;
WlssSipApplicationSession wlssAppSession = (WlssSipApplicationSession) appSession;
wlssAppSession.doAction(new WlssAction() {
public Object run() throws Exception {
// Add all business logic here.
appSession.setAttribute("counter", latestCounterValue);
sipSession.setAttribute("currentState", latestAppState);
// The SIP container ensures that the run method is invoked
// while the application session is locked.
return null;
}
});
WebLogic SIP Server includes a sample converged application that uses the com.bea.wcp.util.Sessions
API. All source code, deployment descriptors, and build files for the example are installed in WLSS_HOME\samples\server\examples\src\converged
. See the readme.html
file in the example directory for instructions about how to build and run the example.
![]() ![]() ![]() |