You can create your own adapter for logging SIP Message Inspection messages. This adapter must implement the org.jvnet.glassfish.comms.admin.reporter.smi.SmiLogMessageAdapter interface. You can use the example org.jvnet.glassfish.comms.admin.reporter.NullAdapter class as a template:
package org.jvnet.glassfish.comms.admin.reporter; import javax.servlet.sip.SipServletRequest; import javax.servlet.sip.SipServletResponse; public class NullAdapter implements SMILogMessageAdapter { public String getLogMessageIncomingRequest(SipServletRequest req) { return null; } public String getLogMessageIncomingResponse(SipServletResponse resp) { return null; } public String getLogMessageOutgoingRequest(SipServletRequest req) { return null; } public String getLogMessageOutgoingResponse(SipServletResponse resp) { return null; } public String getLogMessagePostIncomingRequest(SipServletRequest req, Exception exceptionInCaseOfException) { return null; } public String getLogMessagePostIncomingResponse(SipServletResponse resp, Exception exceptionInCaseOfException) { return null; } }
An adapter can log servlet or network manager messages. To determine the type of messages the adapter logs, set SIP Message Inspection properties in one of the following ways:
Use the asadmin set command as follows:
asadmin set config.sip-service.property.smiServletAdapter=classpath;classname asadmin set config.sip-service.property.smiNetworkManagerAdapter=classpath;classname |
The classpath and semicolon delimiter are optional. The classpath can be an additional classpath outside the container classpath or a local file system path to the class that doesn't include package names.
The class name must be fully qualified. Periods and other special characters must be escaped. For example:
asadmin set server-config.sip-service.property.smiServletAdapter=org\.mypkg\.myServletAdapterImpl |
For more information, see the Sun GlassFish Communications Server 2.0 Reference Manual.
Use the properties table in the SIP Service page in the Admin Console to set the smiServletAdapter and smiNetworkManagerAdapter properties. For more information, click the Help button in the Admin Console.
Here are some suggested uses of an adapter for SIP Message Inspection logging:
You can log or not for a certain interception method.
You can log only for a certain user.
You can collect information from some methods, store it temporarily (for example session attributes), then log it.
For more information about SIP Message Inspection logging, see SIP Message Inspection in Sun GlassFish Communications Server 2.0 Administration Guide.