uuid = leftover.substring(0, indexOfComma); String applicationName = leftover.substring(indexOfComma + 1, leftover.length()); sipApplicationSessionKey = getSipApplicationSessionKey(applicationName, uuid, appGeneratedKey); } else { String applicationName = leftover; sipApplicationSessionKey = getSipApplicationSessionKey(applicationName, uuid, null);
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); }
if (sessionKeyString.length() > 0) { try { sessionKey = SessionManagerUtil.parseSipSessionKey(sessionKeyString); } catch (ParseException e) { throw new IllegalArgumentException("SIP Sesion Key " + sessionKeyString + " previously serialized could not be reparsed", e);
sessionKey = SessionManagerUtil.getSipSessionKey( SessionManagerUtil.getSipApplicationSessionKey(applicationName, getAppSessionId(), null).getId(), applicationName, message, false); final SipContext sipContext = sipFactoryImpl.getSipApplicationDispatcher().findSipApplication(applicationName); final SipApplicationSessionKey sipApplicationSessionKey = SessionManagerUtil.getSipApplicationSessionKey( applicationName, sessionKey.getApplicationSessionId(), null);
SipSessionKey sipSessionKey = SessionManagerUtil.getSipSessionKey(previousAppId, previousAppName, request, false); sipSessionImpl = sipContext.getSipManager().getSipSession(sipSessionKey, false, sipFactoryImpl, null);
ClusteredSipSession session = null; try { SipSessionKey sipSessionKey = SessionManagerUtil.parseHaSipSessionKey(sipSessionId, sessId, sipApplicationName); session = manager_.findLocalSipSession(sipSessionKey, false, sipApplicationSession); if (session == null)
protected ClusteredSipSession(SipSessionKey key, SipFactoryImpl sipFactoryImpl, MobicentsSipApplicationSession mobicentsSipApplicationSession, boolean useJK) { super(key, sipFactoryImpl, mobicentsSipApplicationSession); if(mobicentsSipApplicationSession.getSipContext() != null) { manager = ((JBossCacheSipManager)mobicentsSipApplicationSession.getSipContext().getSipManager()); invalidationPolicy = manager.getInvalidateSessionPolicy(); } this.useJK = useJK; this.firstAccess = true; isNew = true; // it starts with true so that it gets replicated when first created sessionMetadataDirty = true; checkAlwaysReplicateMetadata(); haId = SessionManagerUtil.getSipSessionHaKey(key); }
SipSessionKey sessionKey = SessionManagerUtil.getSipSessionKey(appId, appName, response, inverted); if(logger.isDebugEnabled()) { logger.debug("Trying to find session with following session key " + sessionKey); final SipApplicationSessionKey sipApplicationSessionKey = SessionManagerUtil.getSipApplicationSessionKey( appName, appId, sessionKey = SessionManagerUtil.getSipSessionKey(appId, appName, response, !inverted); if(logger.isDebugEnabled()) { logger.debug("Trying to find session with following session key " + sessionKey);
public SipSession getSession(boolean create) { MobicentsSipSession session = getSipSession(); if (session == null && create) { MobicentsSipApplicationSession sipApplicationSessionImpl = (MobicentsSipApplicationSession)getSipApplicationSession(create); MobicentsSipSessionKey sessionKey = SessionManagerUtil.getSipSessionKey(sipApplicationSessionImpl.getKey().getId(), currentApplicationName, message, false); session = sipApplicationSessionImpl.getSipContext().getSipManager().getSipSession(sessionKey, create, sipFactoryImpl, sipApplicationSessionImpl); session.setSessionCreatingTransactionRequest(this); session.setOrphan(isOrphan()); sessionKey = session.getKey(); } if(session != null) { return session.getFacade(); } return null; }
String sessId = getSipSessionIdFromFqn(fqn, isBuddy); try { SipSessionKey sipSessionKey = SessionManagerUtil.parseHaSipSessionKey(sessId, sipAppSessId, sipApplicationName); manager_.processRemoteSipSessionInvalidation(sipSessionKey); } catch (ParseException e) { attrKey = getSipSessionIdPojoKeyFromFqn(fqn, isBuddy); try { SipSessionKey sipSessionKey = SessionManagerUtil.parseHaSipSessionKey(sessId, sipAppSessId, sipApplicationName); manager_.processRemoteSipSessionAttributeRemoval(sipSessionKey, attrKey); } catch (ParseException e) { sessId = getSipSessionIdFromFqn(fqn, isBuddy); try { SipSessionKey sipSessionKey = SessionManagerUtil.parseHaSipSessionKey(sessId, sipAppSessId, sipApplicationName); manager_.processSipSessionLocalPojoModification(sipSessionKey); } catch (ParseException e) {
Object sessionData = proxy_.getSipSessionData(applicationSessionId, SessionManagerUtil.getSipSessionHaKey(key)); if(sessionData != null) { if (session == null && sipApplicationSessionImpl != null) {
SipApplicationSessionKey sipApplicationSessionKey = SessionManagerUtil.getSipApplicationSessionKey( applicationName, null,
@Override public void scheduleAsynchronousWork(String sipApplicationSessionId, SipApplicationSessionAsynchronousWork work) { SipApplicationSessionKey applicationSessionKey; try { applicationSessionKey = SessionManagerUtil.parseSipApplicationSessionKey(sipApplicationSessionId ); } catch (ParseException e) { throw new IllegalArgumentException("the given application session id : " + sipApplicationSessionId + " couldn't be parsed correctly ",e); } sipContext.getSipApplicationDispatcher().getAsynchronousExecutor().execute(new SipApplicationSessionAsyncTask(applicationSessionKey, work, sipContext.getSipApplicationDispatcher().getSipFactory())); } }
final MobicentsSipApplicationSessionKey sipApplicationSessionKey = SessionManagerUtil.getSipApplicationSessionKey( applicationName, applicationId, SipSessionKey key = SessionManagerUtil.getSipSessionKey(sipApplicationSession.getKey().getId(), applicationName, request, inverted); if(logger.isDebugEnabled()) { logger.debug("Trying to find the corresponding sip session with key " + key + " to this subsequent request " + request + " with the following popped route header " + sipServletRequest.getPoppedRoute() + ". Trying inverted."); key = SessionManagerUtil.getSipSessionKey(sipApplicationSession.getKey().getId(), applicationName, request, !inverted); tmpSipSession = sipManager.getSipSession(key, false, sipFactoryImpl, sipApplicationSession);
@Override public void scheduleAsynchronousWork(String sipSessionId, SipSessionAsynchronousWork work) { SipSessionKey sipSessionKey; try { sipSessionKey = SessionManagerUtil.parseSipSessionKey(sipSessionId); } catch (ParseException e) { throw new IllegalArgumentException("the given application session id : " + sipSessionId + " couldn't be parsed correctly ",e); } sipContext.getSipApplicationDispatcher().getAsynchronousExecutor().execute(new SipSessionAsyncTask(sipSessionKey, work, sipContext.getSipApplicationDispatcher().getSipFactory())); }
final MobicentsSipSessionKey key = SessionManagerUtil.getSipSessionKey(originalAppSession.getKey().getId(), originalAppSession.getKey().getApplicationName(), newRequest, false); final MobicentsSipSession session = originalAppSession.getSipContext().getSipManager().getSipSession(key, true, this, originalAppSession); if(originalSession != null) {
sessId = getSipSessionIdFromFqn(fqn, isBuddy); try { SipSessionKey sipSessionKey = SessionManagerUtil.parseHaSipSessionKey(sessId, sipAppSessId, sipApplicationName); manager_.processSipSessionLocalPojoModification(sipSessionKey); } catch (ParseException e) {
/** * Creates an application session associated with the context * @param sipContext * @return */ public MobicentsSipApplicationSession createApplicationSession(SipContext sipContext) { if (logger.isDebugEnabled()) { logger.debug("Creating new application session for sip context "+ sipContext.getApplicationName()); } //call id not needed anymore since the sipappsessionkey is not a callid anymore but a random uuid SipApplicationSessionKey sipApplicationSessionKey = SessionManagerUtil.getSipApplicationSessionKey( sipContext.getApplicationName(), null, null); MobicentsSipApplicationSession sipApplicationSession = sipContext.getSipManager().getSipApplicationSession( sipApplicationSessionKey, true); if(StaticServiceHolder.sipStandardService.isHttpFollowsSip()) { String jvmRoute = StaticServiceHolder.sipStandardService.getJvmRoute(); if(jvmRoute != null) { sipApplicationSession.setJvmRoute(jvmRoute); } } return sipApplicationSession.getFacade(); }
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; } }
public SipSession getSipSession(String id) { if(!isValid()) { throw new IllegalStateException("SipApplicationSession already invalidated !"); } if(logger.isDebugEnabled()) { logger.debug("Trying to find a session with the id " + id); dumpSipSessions(); } boolean isPresent = false; SipSessionKey sipSessionKey = null; try { sipSessionKey = SessionManagerUtil.parseSipSessionKey(id); isPresent = sipSessions.contains(sipSessionKey); } catch (ParseException e) { //can happen if the id passed is invalid } if(isPresent) { return sipContext.getSipManager().getSipSession(sipSessionKey, false, null, this).getFacade(); } else { return null; } }