SipSessionListener
The SipSessionListener interface allows implementations to receive notifications about changes to the list of active SipSession instances within a SIP servlet application. These notifications are triggered by events such as session creation, invalidation, or lifecycle state changes.
To receive these notification events, the implementation class must be registered in the SIP application’s deployment descriptor (sip.xml). By implementing this interface, applications can monitor and manage SipSession lifecycles, enabling better resource management and session tracking.
Methods:
sessionCreated
void sessionCreated(SipSessionEvent se)
This method is called to notify that a new SipSession has been created. It allows applications to take actions such as initializing resources or tracking the session.
Parameters:
se: The SipSessionEvent object providing details about the newly created session.
sessionDestroyed
void sessionDestroyed(SipSessionEvent se)
This method is called to notify that a SipSession has been destroyed. This can occur due to session timeout, explicit invalidation, or other lifecycle changes. Applications can use this callback to perform cleanup operations.
Parameters:
se: The SipSessionEvent object providing details about the destroyed session.
sessionReadyToInvalidate
void sessionReadyToInvalidate(SipSessionEvent se)
This method is called to notify that a SipSession has entered the ready-to-invalidate state. Unless the listener explicitly calls SipSessionEvent.getSession().setInvalidateWhenReady(false), the container will invalidate the session after this callback. This allows applications to determine if additional processing or delays are necessary before invalidation.
Parameters:
se: The SipSessionEvent object providing details about the session in the ready-to-invalidate state.
@SipListener annotation allows you to register listener classes without explicitly defining them in sip.xml.
Start innovating with Mobius
What's next? Let's talk!