@@ -0,0 +1,799 @@
+package com.voxeo.moho.sip;%0A%0Aimport javax.servlet.sip.SipSessionEvent;%0Aimport javax.servlet.sip.SipSessionListener;%0Aimport javax.servlet.sip.annotation.SipListener;%0A%0Aimport com.voxeo.moho.event.EventSource;%0Aimport com.voxeo.moho.util.SessionUtils;%0A%0A@SipListener%0Apublic class ClearResourceSessionListener implements SipSessionListener %7B%0A%0A  @Override%0A  public void sessionCreated(SipSessionEvent sipsessionevent) %7B%0A%0A  %7D%0A%0A  @Override%0A  public void sessionDestroyed(SipSessionEvent sipsessionevent) %7B%0A    final EventSource source = SessionUtils.getEventSource(sipsessionevent.getSession());%0A%0A    if (source != null && source instanceof SIPCallImpl) %7B%0A      ((SIPCallImpl) source).disconnect(true);%0A    %7D%0A  %7D%0A%0A  @Override%0A  public void sessionReadyToInvalidate(SipSessionEvent sipsessionevent) %7B%0A%0A  %7D%0A%0A%7D%0A

add clear resource listener to clear resource when sip session is invalidated.