SipServletRequestImpl originalSipServletRequestImpl = (SipServletRequestImpl) linkedSession.getSessionCreatingTransactionRequest(); String newToTag = ApplicationRoutingHeaderComposer.getHash(sipFactoryImpl.getSipApplicationDispatcher(),sipSessionKey.getApplicationName(), sipSessionKey.getApplicationSessionId()); if(logger.isDebugEnabled()) { logger.debug("derived session " + mobicentsSipSession + " has no linked forked session yet, lazily creating one with new ToTag " + newToTag); sipSessionKey = new SipSessionKey(sipSessionKey.getFromTag(), newToTag, sipSessionKey.getCallId(), sipSessionKey.getApplicationSessionId(), sipSessionKey.getApplicationName()); linkedSession = sipManager.getSipSession(sipSessionKey, false, null, mobicentsSipSession.getSipApplicationSession());
.next(); MobicentsSipSessionKey sessionKey = mobicentsSipSession.getKey(); if(sessionKey.getCallId().trim().equals(dialog.getCallId().getCallId())) { if(logger.isDebugEnabled()) { logger.debug("found session with the same Call Id " + sessionKey + ", to Tag " + sessionKey.getToTag()); logger.debug("dialog localParty = " + dialog.getLocalParty().getURI() + ", localTag " + dialog.getLocalTag()); logger.debug("dialog remoteParty = " + dialog.getRemoteParty().getURI() + ", remoteTag " + dialog.getRemoteTag()); if(sessionKey.getFromTag().equals(dialog.getLocalTag()) && sessionKey.getToTag().equals(dialog.getRemoteTag())) { if(mobicentsSipSession.getProxy() == null) { return mobicentsSipSession; } else if (sessionKey.getFromTag().equals(dialog.getRemoteTag()) && sessionKey.getToTag().equals(dialog.getLocalTag())){ if(mobicentsSipSession.getProxy() == null) { return mobicentsSipSession;
protected MobicentsSipSession setToTag(final SipSessionKey key, final MobicentsSipSession sipSession) { final String currentKeyToTag = key.getToTag(); final MobicentsSipSessionKey existingKey = sipSession.getKey(); final String toTag = existingKey.getToTag(); if(logger.isDebugEnabled()) { logger.debug("Totag " + toTag + existingKey.setToTag(currentKeyToTag, false); if(logger.isDebugEnabled()) { logger.debug("Setting the To tag " + currentKeyToTag +
logger.debug("session is null, trying to load the session from the sessionKey " + sessionKey); final String applicationName = sessionKey.getApplicationName(); final SipContext sipContext = sipFactoryImpl.getSipApplicationDispatcher().findSipApplication(applicationName); SipApplicationSessionKey sipApplicationSessionKey = new SipApplicationSessionKey(sessionKey.getApplicationSessionId(), sessionKey.getApplicationName(), null); MobicentsSipApplicationSession sipApplicationSession = sipContext.getSipManager().getSipApplicationSession(sipApplicationSessionKey, false); sipSession = sipContext.getSipManager().getSipSession(sessionKey, false, sipFactoryImpl, sipApplicationSession);
" to following App/ruby controller => " + response.getSipSession().getKey().getApplicationName()+ "/" + sipContext.getSipRubyController().getName()); if(logger.isDebugEnabled()) { logger.debug("Dispatching response " + response.toString() + " to following App/servlet => " + session.getKey().getApplicationName()+ "/" + session.getHandler() + " on following sip session " + session.getId());
&& session.getKey().getToTag() != null && session.getKey().getToTag().length() >0) { if(!dialog.getLocalTag().equals(session.getKey().getToTag())) { logger.debug("setting session ToTag: " + session.getKey().getToTag()); toHeader.setTag(session.getKey().getToTag()); } else { if(logger.isDebugEnabled()) { String toTag = sipSessionKey.getToTag(); if(logger.isDebugEnabled()) { logger.debug("sipSessionKey ToTag : " + toTag); toTag = ApplicationRoutingHeaderComposer.getHash(sipFactoryImpl.getSipApplicationDispatcher(),sipSessionKey.getApplicationName(), sipAppSessionKey.getId()); session.getKey().setToTag(toTag, false);
public void addDerivedSipSessions(MobicentsSipSession derivedSession) { if(derivedSipSessions == null) { this.derivedSipSessions = new ConcurrentHashMap<String, MobicentsSipSession>(); } derivedSipSessions.putIfAbsent(derivedSession.getKey().getToTag(), derivedSession); } /*
applicationName = sessionKey.getApplicationName(); } else { if(this instanceof SipServletRequestImpl && isOrphan()) { sessionKey.getApplicationSessionId(), null); if(logger.isDebugEnabled()) { logger.debug("trying to load the sip app session with Key " + sipApplicationSessionKey + " and create = " + true);
SipContext sipContext = findSipApplication(sipSessionKey.getApplicationName());
@Override public boolean equals(Object obj) { if(obj instanceof MobicentsSipSession) { MobicentsSipSession sipSession = (MobicentsSipSession)obj; if(sipSession.getKey().equals(getKey())) { // Issue 2365 : Derived Sessions should be equal only if their to tag is equal if(sipSession.getKey().getToTag() == null && getKey().getToTag() == null) { return true; } if(sipSession.getKey().getToTag() != null && getKey().getToTag() != null && sipSession.getKey().getToTag().equals(getKey().getToTag())) { return true; } else { return false; } } else { return false; } } return false; } @Override
SipContext sipContext = findSipApplication(sipSessionKey.getApplicationName()); final SipManager sipManager = sipContext.getSipManager(); final SipApplicationSessionKey sipApplicationSessionKey = SessionManagerUtil.getSipApplicationSessionKey( sipSessionKey.getApplicationName(), sipSessionKey.getApplicationSessionId(), null);
if(logger.isDebugEnabled()) { logger.debug("Dispatching request " + request.toString() + " to following App/servlet => " + session.getKey().getApplicationName()+ "/" + session.getHandler() + " on following sip session " + session.getId()); " to following App/ruby controller => " + request.getSipSession().getKey().getApplicationName()+ "/" + sipContext.getSipRubyController().getName());
try { final String branch = JainSipUtils.createBranch( sipSession.getKey().getApplicationSessionId(), sipApplicationDispatcher.getHashFromApplicationName(sipSession.getKey().getApplicationName())); viaHeader.setBranch(branch); } catch (ParseException pe) {
routeAppName = sipFactoryImpl.getSipApplicationDispatcher().getApplicationNameFromHash(routeAppNameHashed); if(routeAppName == null || !sipFactoryImpl.getSipApplicationDispatcher().getApplicationServerId().equalsIgnoreCase(serverId) || !routeAppName.equals(getSipSession().getKey().getApplicationName())) { ackRequest.addHeader(routeHeader);
final String branch = JainSipUtils.createBranch(sipApplicationSession.getKey().getId(), sipFactoryImpl.getSipApplicationDispatcher().getHashFromApplicationName(session.getKey().getApplicationName())); viaHeader.setBranch(branch);
removeTx = false; SipContext sipContext = findSipApplication(sipSessionKey.getApplicationName());
SipContext sipContext = findSipApplication(sipSessionKey.getApplicationName());
addInfoForRoutingBackToContainer(routerInfo, session.getSipApplicationSession().getKey().getId(), session.getKey().getApplicationName()); addDNSRoute = false;
sipTargetedRequestType = SipTargetedRequestType.REPLACES; joinReplacesTargetedRequestInfo = new SipTargetedRequestInfo(sipTargetedRequestType, joinReplacesCorrespondingSession.getKey().getApplicationName()); } else {
routeAppName = sipFactoryImpl.getSipApplicationDispatcher().getApplicationNameFromHash(routeAppNameHashed); if(routeAppName == null || !sipFactoryImpl.getSipApplicationDispatcher().getApplicationServerId().equalsIgnoreCase(serverId) || !routeAppName.equals(getSipSession().getKey().getApplicationName())) { prackRequest.addHeader(routeHeader);