/** * Populate the attributes stored in the distributed store to local * transient ones. */ protected void populateAttributes() { Map map = proxy_.getSipSessionAttributes(sipApplicationSessionKey.getId(), getHaId()); // Preserve any local attributes that were excluded from replication Map excluded = removeExcludedAttributes(attributes_); if (excluded != null) map.putAll(excluded); attributes_ = Collections.synchronizedMap(map); attrModifiedMap_.clear(); attrRemovedMap_.clear(); }
/** * Removes a sip application session from the manager by its key * @param key the identifier for this session * @return the sip application session that had just been removed, null otherwise */ public MobicentsSipApplicationSession removeSipApplicationSession(final MobicentsSipApplicationSessionKey key) { if(logger.isDebugEnabled()) { logger.debug("Removing a sip application session with the key : " + key); } MobicentsSipApplicationSession sipApplicationSession = sipApplicationSessions.remove(key); if(sipApplicationSession != null) { final String appGeneratedKey = sipApplicationSession.getKey().getAppGeneratedKey(); if(appGeneratedKey != null) { sipApplicationSessionsByAppGeneratedKey.remove(appGeneratedKey); } } return sipApplicationSession; }
/** * @return the sipSession */ private MobicentsSipSession getSipSession() { // lazy loading the session, useful for HA if(sipSession == null){ if(logger.isDebugEnabled()) { logger.debug("Trying to load the session from the deserialized session facade with the key " + sipSessionKey); } SipContext sipContext = StaticServiceHolder.sipStandardService .getSipApplicationDispatcher().findSipApplication(sipAppSessionKey.getApplicationName()); MobicentsSipApplicationSession sipApplicationSession = sipContext.getSipManager().getSipApplicationSession(sipAppSessionKey, false); sipSession = sipContext.getSipManager().getSipSession(sipSessionKey, false, null, sipApplicationSession); if(sipSession == null) throw new NullPointerException( "We just tried to pull a SipSession from the distributed cache and it's null, key=" + sipSessionKey); } return sipSession; }
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) {
addInfoForRoutingBackToContainer(routerInfo, session.getSipApplicationSession().getKey().getId(), session.getKey().getApplicationName()); addDNSRoute = false; 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)) { if(sipConnector != null && sipConnector.isUseStaticAddress()) {
public void removeMyselfLocal() { // Need to evict attribute first before session to clean up everything. // BRIAN -- the attributes *are* already evicted, but we leave the // removeAttributesLocal call here in order to evict the ATTRIBUTE node. // Otherwise empty nodes for the session root and child ATTRIBUTE will // remain in the tree and screw up our list of session names. proxy_.removeSipSessionAttributesLocal(sipApplicationSessionKey.getId(), getHaId()); proxy_.removeSipSessionLocal(sipApplicationSessionKey.getId(), getHaId()); }
final String branch = JainSipUtils.createBranch(session.getSipApplicationSession().getKey().getId(), sipApplicationDispatcher.getHashFromApplicationName(session.getSipApplicationSession().getKey().getApplicationName())); ViaHeader viaHeader = JainSipUtils.createViaHeader( sipFactoryImpl.getSipNetworkInterfaceManager(), prackRequest, branch, session.getOutboundInterface());
public void removeMyself() { // This is a shortcut to remove session and it's child attributes. proxy_.removeSipSession(sipApplicationSessionKey.getId(), getHaId()); }
.getSipApplicationSession(); newFromHeader.setTag(ApplicationRoutingHeaderComposer.getHash(sipFactoryImpl.getSipApplicationDispatcher(), originalSession.getKey().getApplicationName(), appSession.getKey().getId())); final MobicentsSipSessionKey key = SessionManagerUtil.getSipSessionKey(appSession.getKey().getId(), originalSession.getKey().getApplicationName(), newRequest, false); final MobicentsSipSession session = appSession.getSipContext().getSipManager().getSipSession(key, true, sipFactoryImpl, appSession); session.setHandler(originalSession.getHandler()); final String branch = JainSipUtils.createBranch(appSession.getKey().getId(), sipApplicationDispatcher.getHashFromApplicationName(appSession.getKey().getApplicationName())); ViaHeader viaHeader = JainSipUtils.createViaHeader( sipFactoryImpl.getSipNetworkInterfaceManager(), newRequest, branch, session.getOutboundInterface());
public void removeMyself() { proxy_.removeSipSession(sipApplicationSessionKey.getId(), getHaId()); }
if(nextApp != null) { final MobicentsSipApplicationSessionKey sipAppKey = originalRequest.getSipSession().getSipApplicationSession().getKey(); final String thisApp = sipFactoryImpl.getSipApplicationDispatcher().getHashFromApplicationName(sipAppKey.getApplicationName()); nextSipAppId.equals(sipAppKey.getId())) { clonedRequest.removeFirst(RouteHeader.NAME); final String appName = sipFactoryImpl.getSipApplicationDispatcher().getHashFromApplicationName(sipAppKey.getApplicationName()); final SipServletRequestImpl proxyBranchMatchingRequest = (SipServletRequestImpl) proxyBranch.getMatchingRequest(originalRequest); branchId = JainSipUtils.createBranch(sipAppKey.getId(), appName); branchId = JainSipUtils.createBranch(sipAppKey.getId(), appName); inboundRURI.setParameter(MessageDispatcher.RR_PARAM_PROXY_APP, "true"); inboundRURI.setParameter(MessageDispatcher.APP_ID, sipAppKey.getId()); inboundRURI.setLrParam(); rrURI.setParameter(MessageDispatcher.RR_PARAM_PROXY_APP, "true"); rrURI.setParameter(MessageDispatcher.APP_ID, sipAppKey.getId()); rrURI.setLrParam();
public void removeMyselfLocal() { proxy_.removeSipSessionLocal(sipApplicationSessionKey.getId(), getHaId()); }
fromHeader.setTag(ApplicationRoutingHeaderComposer.getHash(sipApplicationDispatcher, sipAppSession.getApplicationName(), sipApplicationSessionKey.getId())); } else { fromHeader.setTag(fromTagToUse); mobicentsSipApplicationSession.getKey().getId(), mobicentsSipApplicationSession.getKey().getApplicationName(), requestToWrap, false); MobicentsSipSession session = mobicentsSipApplicationSession.getSipContext().getSipManager(). getSipSession(key, true, this, mobicentsSipApplicationSession); final String branch = JainSipUtils.createBranch(sipApplicationSessionKey.getId(), sipApplicationDispatcher.getHashFromApplicationName(sipApplicationSessionKey.getApplicationName())); ViaHeader viaHeader = JainSipUtils.createViaHeader( getSipNetworkInterfaceManager(), requestToWrap, branch, session.getOutboundInterface());
final String sipAppSessionKey = sipApplicationSessionKey.getId(); final String sipSessionKey = getHaId();
final String sipAppSessionKey = sipApplicationSessionKey.getId(); final String sipSessionKey = getHaId();
final String sipAppSessionKey = sipApplicationSessionKey.getId(); final String sipSessionKey = getHaId(); if (logger.isDebugEnabled()) {
+ "version from: " + getVersion() + " and replicate."); final String sipAppSessionKey = sipApplicationSessionKey.getId(); final String sipSessionKey = getHaId(); if(isNew) {
public void putSipSession(String realId, ClusteredSipSession session) { Fqn fqn = getSipSessionFqn(session.getSipApplicationSession().getKey().getId(), realId); if (session.getReplicateSessionBody()) { if(log_.isDebugEnabled()) { log_.debug("Session is dirty or new and is being fully replicated " + session.toString()); } Map map = new HashMap(); // if (useTreeCacheMarshalling_) // map.put(realId, session); // else map.put(realId, externalizeSipSession(session)); // Put in (VERSION_KEY, version) after the real put for cache invalidation map.put(VERSION_KEY, new Integer(session.getVersion())); cacheWrapper_.put(fqn, map); } else { if(log_.isDebugEnabled()) { log_.debug("Session is not being replicated right now, but the version is being updated and remote nodes will pull it on demand when they notice or other event forces full replication. Only the version field is updated now. " + session.toString()); } // Invalidate the remote caches cacheWrapper_.put(fqn, VERSION_KEY, new Integer(session.getVersion())); } }
final String branch = JainSipUtils.createBranch(sipApplicationSession.getKey().getId(), sipFactoryImpl.getSipApplicationDispatcher().getHashFromApplicationName(session.getKey().getApplicationName())); viaHeader.setBranch(branch);
applicationSessionId = sipApplicationSessionImpl.getKey().getId(); } else { applicationSessionId = key.getApplicationSessionId();