public SipApplicationSession getApplicationSession() { MobicentsSipApplicationSession sipApplicationSession = getSipApplicationSession(); if(sipApplicationSession == null) { return null; } else { return sipApplicationSession.getFacade(); } }
/** * {@inheritDoc} */ public ServletContext getServletContext() { return getSipApplicationSession().getSipContext().getServletContext(); }
public MobicentsSipSessionFacade getFacade() { MobicentsSipApplicationSession sipApplicationSession = getSipApplicationSession(); if (facade == null && sipApplicationSession != null){ SipContext sipContext = sipApplicationSession.getSipContext(); if (sipContext.isPackageProtectionEnabled()){ final MobicentsSipSession fsession = this; facade = (MobicentsSipSessionFacade)AccessController.doPrivileged(new PrivilegedAction(){ public Object run(){ return new MobicentsSipSessionFacade(fsession); } }); } else { facade = new MobicentsSipSessionFacade(this); } } return (facade); } @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); } } }
SipListeners sipListenersHolder = this.getSipApplicationSession().getSipContext().getListeners(); List<SipSessionAttributeListener> listenersList = sipListenersHolder.getSipSessionAttributeListeners(); if(listenersList.size() > 0) {
SipListeners sipListenersHolder = this.getSipApplicationSession().getSipContext().getListeners(); List<SipSessionAttributeListener> listenersList = sipListenersHolder.getSipSessionAttributeListeners(); if(listenersList.size() > 0) {
MobicentsSipApplicationSession sipApplicationSession = getSipApplicationSession(); if(sipApplicationSession != null) { SipContext sipContext = sipApplicationSession.getSipContext();
final MobicentsSipApplicationSession sipApplicationSession = getSipApplicationSession(); SipManager manager = sipApplicationSession.getSipContext().getSipManager();
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())); final String originalCallId = ((CallIdHeader)originalRequest.getHeader(CallIdHeader.NAME)).getCallId(); sipServletRequest =(SipServletRequestImpl) sipFactory.createRequest( getSipApplicationSession(), method, currentLocalParty,