public String getApplicationName() { return key.getApplicationName(); }
/** * */ public void dumpSipApplicationSessions() { if(logger.isDebugEnabled()) { logger.debug("sip application sessions present in the session manager"); Enumeration<SipApplicationSessionKey> keys = sipApplicationSessions.keys(); while(keys.hasMoreElements()) { SipApplicationSessionKey sipApplicationSessionKey = keys.nextElement(); logger.debug(sipApplicationSessionKey.toString() + "/hashed_app_name=" + sipFactoryImpl.getSipApplicationDispatcher().getHashFromApplicationName(sipApplicationSessionKey.getApplicationName())); } } }
public void readExternal(ObjectInput arg0) throws IOException, ClassNotFoundException { String sipApplicationSessionId = arg0.readUTF(); SipApplicationSessionKey key = null; try { key = SessionManagerUtil.parseSipApplicationSessionKey(sipApplicationSessionId); } catch (ParseException e) { logger.error("Couldn't parse the following sip application session key " + sipApplicationSessionId, e); throw new IllegalArgumentException("Couldn't parse the following sip application session key " + sipApplicationSessionId, e); } SipContext sipContext = StaticServiceHolder.sipStandardService .getSipApplicationDispatcher().findSipApplication(key.getApplicationName()); this.sipApplicationSession = sipContext.getSipManager().getSipApplicationSession( key, false); }
public void run() { final SipContext sipContext = sipFactoryImpl.getSipApplicationDispatcher().findSipApplication(key.getApplicationName()); if(sipContext != null) { SipManager sipManager = sipContext.getSipManager();
if(logger.isDebugEnabled()) { logger.debug("notifying sip application session listeners of context " + key.getApplicationName() + " of following event " + sipApplicationSessionEventType); if(logger.isDebugEnabled()) { logger.debug("notifying sip application session listener " + sipApplicationSessionListener.getClass().getName() + " of context " + key.getApplicationName() + " of following event " + sipApplicationSessionEventType);
public SipApplicationSession getApplicationSessionById(String applicationSessionId, boolean isContainerManaged) { if(applicationSessionId == null) { throw new NullPointerException("the given id is null !"); } SipApplicationSessionKey applicationSessionKey; try { applicationSessionKey = SessionManagerUtil.parseSipApplicationSessionKey(applicationSessionId); } catch (ParseException e) { logger.error("the given application session id : " + applicationSessionId + " couldn't be parsed correctly ",e); return null; } if(applicationSessionKey.getApplicationName().equals(sipContext.getApplicationName())) { MobicentsSipApplicationSession sipApplicationSession = sipContext.getSipManager().getSipApplicationSession(applicationSessionKey, false); if(sipApplicationSession == null) { return null; } else { // make sure to acquire this app session and add it to the set of app sessions we monitor in the context of the application // to release them all when we exit application code sipContext.enterSipApp(sipApplicationSession, null, true, isContainerManaged); return sipApplicationSession.getFacade(); } } else { logger.warn("the given application session id : " + applicationSessionId + " tried to be retrieved from incorret application " + sipContext.getApplicationName()); return null; } }
/** * Section 15.11.3 Encode URI Mechanism * The container MUST use the encoded URI to locate the targeted SipApplicationSession object. * If a valid SipApplicationSession is found, the container must determine * the name of the application that owns the SipApplicationSession object. * * @param targetedApplicationKey the encoded URI parameter * @return null if no corresponding SipApplicationSession could be found or * if the param is null, the SipTargetedRequestInfo completed otherwise */ private final MobicentsSipApplicationSession retrieveTargetedApplication( String targetedApplicationKey) { if( targetedApplicationKey != null && targetedApplicationKey.length() > 0) { targetedApplicationKey = RFC2396UrlDecoder.decode(targetedApplicationKey); SipApplicationSessionKey targetedApplicationSessionKey; try { targetedApplicationSessionKey = SessionManagerUtil.parseSipApplicationSessionKey(targetedApplicationKey); } catch (ParseException e) { logger.error("Couldn't parse the targeted application key " + targetedApplicationKey, e); return null; } SipContext sipContext = sipApplicationDispatcher.findSipApplication(targetedApplicationSessionKey.getApplicationName()); if(sipContext != null) { return sipContext.getSipManager().getSipApplicationSession(targetedApplicationSessionKey, false); } } return null; }