Using Persistence Hints in SIP Applications
Converged Application Server provides a simple API to provide "hints" as to when the Coherence cache should persist call state data. You can use the API to disable persistence for specific calls or SIP requests, or to persist data more frequently than the default setting (at SIP dialog boundaries).
To use the API, simply obtain a WlssSipApplicationSession
instance and use the setPersist
method to enable or disable persistence. Note
that you can enable or disable persistence either to an RDBMS store, or to as
geographically-redundant Converged Application Server installation (see Configuring Geographically-Redundant Installations).
For example, some SIP-aware load balancing products use the SIP OPTIONS message
to determine if a SIP Server is active. To avoid persisting these messages to an RDBMS and to
a geographically-redundant site, a Servlet might implement a doOptions
method
to echo the request and turn off persistence for the message, as shown below.
Example 1-7 Disabling RDBMS Persistence for Option Methods
protected void doOptions(SipServletRequest req) throws IOException { WlssSipApplicationSession session = (WlssSipApplicationSession) req.getApplicationSession(); session.setPersist(WlssSipApplicationSession.PersistenceType.DATABASE, false); session.setPersist(WlssSipApplicationSession.PersistenceType.GEO_REDUNDANCY, false); req.createResponse(200).send(); }