@Override public int hashCode() { return getKey().hashCode(); } @Override
@Override public String toString() { return getKey().toString(); } public SipApplicationRouterInfo getNextSipApplicationRouterInfo() {
@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
public void setHandler(String name) throws ServletException { if(!isValid()) { throw new IllegalStateException("the session has already been invalidated, no handler can be set on it anymore !"); } if(name != null && name.equals(handlerServlet)) { return ; } SipContext sipContext = getSipApplicationSession().getSipContext(); MobicentsSipServlet container = sipContext.findSipServletByName(name); if(container == null && sipContext.getSipRubyController() == null) { throw new ServletException("the sip servlet with the name "+ name + " doesn't exist in the sip application " + sipContext.getApplicationName()); } this.handlerServlet = name; getSipApplicationSession().setCurrentRequestHandler(handlerServlet); if(logger.isDebugEnabled()) { if(name !=null) { logger.debug("Session Handler for application " + getKey().getApplicationName() + " set to " + handlerServlet + " on sip session " + key); } else { logger.debug("Session Handler for application " + getKey().getApplicationName() + " set to " + sipContext.getSipRubyController() + " on sip session " + key); } } }
this.setState(State.TERMINATED); if(logger.isDebugEnabled()) { logger.debug("the following sip session " + getKey() + " has its state updated to " + state);
response.getStatus() >= 200 && response.getStatus() != 407 && response.getStatus() != 401) { if(logger.isDebugEnabled()) { logger.debug("Setting SipSession " + getKey() + " for response " + response.getStatus() + " to a non dialog creating or terminating request " + method + " in state " + state + " to ReadyToInvalidate=true"); logger.debug("the following sip session " + getKey() + " has its state updated to " + state); this.setState(State.EARLY); if(logger.isDebugEnabled()) { logger.debug("the following sip session " + getKey() + " has its state updated to " + state); logger.debug("the following sip session " + getKey() + " has its state updated to " + state); setState(State.TERMINATED); if(logger.isDebugEnabled()) { logger.debug("the following sip session " + getKey() + " has its state updated to " + state); logger.debug("the following sip session " + getKey() + " has " + subscriptions.size() + " subscriptions"); setState(State.TERMINATED); if(logger.isDebugEnabled()) { logger.debug("the following sip session " + getKey() + " has its state updated to " + state); logger.debug("the following sip session " + getKey() + " is ready to be invalidated "); logger.debug("the following sip session " + getKey() + " has its state updated to " + state);
final String branch = JainSipUtils.createBranch(getSipApplicationSession().getKey().getId(), sipApplicationDispatcher.getHashFromApplicationName(getKey().getApplicationName())); ViaHeader viaHeader = JainSipUtils.createViaHeader( sipFactory.getSipNetworkInterfaceManager(), methodRequest, branch, outboundInterface); JainSipUtils.findTransport(request), false).getSipProvider(); final SipApplicationDispatcher sipApplicationDispatcher = sipFactory.getSipApplicationDispatcher(); final String branch = JainSipUtils.createBranch(getSipApplicationSession().getKey().getId(), sipApplicationDispatcher.getHashFromApplicationName(getKey().getApplicationName())); !routeAppName.equals(getKey().getApplicationName())) { request.addHeader(routeHeader);