public boolean addHttpSession(HttpSession httpSession) { return this.sipApplicationSession.addHttpSession(httpSession); }
public void access() { this.sipApplicationSession.access(); }
public void acquire() { sipApplicationSession.acquire(); }
protected void setSipApplicationSession( MobicentsSipApplicationSession sipApplicationSession) { if (sipApplicationSession != null) { this.sipApplicationSessionKey = sipApplicationSession.getKey(); sipApplicationSession.addSipSession(this); } }
/** * Constructor for repeating times * * @param info * Information about the timer * @param delay * Delay until first execution * @param fixedDelay * Whether fixed delay mode should be used * @param period * Period between execution * @param listener * Listener that will get timeout events. */ public ServletTimerImpl(Serializable info, long delay, boolean fixedDelay, long period, TimerListener listener, MobicentsSipApplicationSession appSession) { this.id = UUID.randomUUID().toString(); this.info = info; this.delay = delay; this.scheduledExecutionTime = delay + System.currentTimeMillis(); this.fixedDelay = fixedDelay; this.period = period; this.listener = listener; this.appSessionKey = appSession.getKey(); this.sipManager= appSession.getSipContext().getSipManager(); }
MobicentsSipApplicationSession appSession = appSessions.next(); result += "[APPLICATION SESSION] ID = " + appSession.getId() + ", Handler = " + appSession.getCurrentRequestHandler() + "\n"+ "([APPLICATION SESSION])\n"; Iterator<String> attribNames = appSession.getAttributeNames(); while(attribNames.hasNext()) { String attrib = attribNames.next(); result += " ATTRIBUTE(" + attrib + ") -> " + appSession.getAttribute(attrib) + "\n"; Set<MobicentsSipSession> sipSessions = appSession.getSipSessions(); for(MobicentsSipSession sipSession : sipSessions) { Enumeration<String> attributeNames = sipSession.getAttributeNames();
httpSession.setAttribute(APPLICATION_SESSION_ID_ATTRIBUTE_NAME, sipApplicationSession.getKey()); sipApplicationSession.addHttpSession(httpSession); return sipApplicationSession.getFacade(); } else { return null;
public void setApplicationSession(MobicentsSipApplicationSession sipApplicationSession) { if(sipApplicationSession != null) { synchronized (TIMER_LOCK) { this.appSessionKey = sipApplicationSession.getKey(); } } }
addInfoForRoutingBackToContainer(routerInfo, session.getSipApplicationSession().getKey().getId(), session.getKey().getApplicationName()); addDNSRoute = false; getSipSession().getSipApplicationSession().getSipContext().getSipManager().dumpSipSessions(); String serverId = sipUri.getParameter(MessageDispatcher.RR_PARAM_SERVER_NAME); String nextApp = sipUri.getParameter(MessageDispatcher.RR_PARAM_APPLICATION_NAME); final MobicentsSipApplicationSessionKey sipAppKey = getSipSession().getSipApplicationSession().getKey(); final String thisApp = sipFactoryImpl.getSipApplicationDispatcher().getHashFromApplicationName(sipAppKey.getApplicationName()); if(sipFactoryImpl.getSipApplicationDispatcher().getApplicationServerId().equalsIgnoreCase(serverId) && thisApp.equals(nextApp)) { sipApplicationSession.access(); Dialog dialog = getDialog(); if(session.getProxy() != null) dialog = null; final ClassLoader cl = sipApplicationSession.getSipContext().getClass().getClassLoader(); Thread.currentThread().setContextClassLoader(cl);
public void tryToInvalidate() { this.sipApplicationSession.tryToInvalidate(); }
sipContext.enterSipApp(sipApplicationSession, null, false, true); if(logger.isDebugEnabled()) { logger.debug("sip app session " + sipApplicationSession.getKey() + " is valid ? :" + sipApplicationSession.isValidInternal()); if(sipApplicationSession.isValidInternal()) { logger.debug("Sip app session " + sipApplicationSession.getKey() + " is ready to be invalidated ? :" + sipApplicationSession.isReadyToInvalidate()); if(sipApplicationSession.isValidInternal() && sipApplicationSession.isReadyToInvalidate()) { sipApplicationSession.tryToInvalidate();
public void release() { sipApplicationSession.release(); }
public MobicentsSipApplicationSession getFacade() { return sipApplicationSession.getFacade(); }
final String branch = JainSipUtils.createBranch(originalAppSession.getKey().getId(), sipApplicationDispatcher.getHashFromApplicationName(originalAppSession.getKey().getApplicationName())); ViaHeader viaHeader = JainSipUtils.createViaHeader( getSipNetworkInterfaceManager(), newRequest, branch, null); newFromHeader.setTag(ApplicationRoutingHeaderComposer.getHash(getSipApplicationDispatcher(), originalAppSession.getKey().getApplicationName(), originalAppSession.getKey().getId())); 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) { session.setHandler(originalSession.getHandler()); } else if(originalAppSession.getCurrentRequestHandler() != null) { session.setHandler(originalAppSession.getCurrentRequestHandler());
logger.debug("Reusing the application session from the Join/Replaces " + sipApplicationSession.getId()); sipContext.getSipSessionsUtil().addCorrespondingSipApplicationSession(sipApplicationSessionKey, sipApplicationSession.getKey(), headerName); } else if(sipApplicationSession == null) { String jvmRoute = StaticServiceHolder.sipStandardService.getJvmRoute(); if(jvmRoute != null) { sipApplicationSession.setJvmRoute(jvmRoute); final SipSessionKey sessionKey = SessionManagerUtil.getSipSessionKey(appSession.getKey().getId(), nextApplicationName, request, false); final MobicentsSipSession sipSessionImpl = sipManager.getSipSession(sessionKey, true, sipFactoryImpl, appSession); sipServletRequest.setSipSession(sipSessionImpl);
if(sipApplicationSession == null || sipApplicationSession.isOrphan()) { if(logger.isDebugEnabled()) { logger.debug("routeOrphanRequests = " + routeOrphanRequests + " for context " + sipContext.getApplicationName() + " appSession=" + sipApplicationSession); String jvmRoute = StaticServiceHolder.sipStandardService.getJvmRoute(); if(jvmRoute != null) { sipApplicationSession.setJvmRoute(jvmRoute); 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); boolean orphan = sipSession.isOrphan() || sipApplicationSession.isOrphan(); sipServletRequest.setOrphan(orphan); if(sipSession.getProxy() == null && !orphan) {
final ClassLoader cl = sipApplicationSession.getSipContext().getClass().getClassLoader(); Thread.currentThread().setContextClassLoader(cl); if(sipConnector != null && // Initial requests already use local address in RouteHeader. sipApplicationSession.access(); if(logger.isDebugEnabled()) { logger.debug("Sending the ACK request " + request);
/** * 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 Object getAttribute(String name) { return this.sipApplicationSession.getAttribute(name); }
sipApplicationSession.getKey()); sipApplicationSession.addHttpSession(httpSession); return sipApplicationSession.getFacade(); } else { return null;