public MobicentsSipApplicationSession getSipApplicationSession() { if(sipApplicationSession == null) { final String applicationName = key.getApplicationName(); final SipContext sipContext = sipFactory.getSipApplicationDispatcher().findSipApplication(applicationName); if(sipContext != null) { sipApplicationSession = sipContext.getSipManager().getSipApplicationSession(sipApplicationSessionKey, false); } } return sipApplicationSession; }
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); } } }
public void run() { final SipContext sipContext = sipFactoryImpl.getSipApplicationDispatcher().findSipApplication(key.getApplicationName()); if(sipContext != null) { SipManager sipManager = sipContext.getSipManager(); final SipApplicationSessionKey sipApplicationSessionKey = SessionManagerUtil.getSipApplicationSessionKey( key.getApplicationName(), key.getApplicationSessionId(), null);
if(logger.isDebugEnabled()) { logger.debug("notifying sip session listener " + sipSessionListener.getClass().getName() + " of context " + key.getApplicationName() + " of following event " + sipSessionEventType);
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);