/** * Returns a media proxy session with the specified ID. * * @param sid the session ID. * @return the session or <tt>null</tt> if the session doesn't exist. */ public MediaProxySession getSession(String sid) { MediaProxySession proxySession = sessions.get(sid); if (proxySession != null) { if (Log.isDebugEnabled()) { Log.debug("MediaProxy: SID: " + sid + " agentSID: " + proxySession.getSID()); return proxySession; } } return null; }
/** Stop every running sessions. */ void stopProxy() { for (MediaProxySession session : getSessions()) { try { session.clearAgentListeners(); session.stopAgent(); } catch (Exception e) { Log.error("Error cleaning up media proxy sessions", e); } } sessions.clear(); }
/** * Implements Session Listener stopAgent event. Remove the stopped session from the sessions list. * * @param session the session that stopped */ public void sessionClosed(MediaProxySession session) { sessions.remove(session.getSID()); if (Log.isDebugEnabled()) { Log.debug("MediaProxy: Session: " + session.getSID() + " removed."); } }