public SipServletRequest createRequest(SipApplicationSession sipAppSession, String method, String from, String to, String handler) throws ServletParseException { if (logger.isDebugEnabled()) { logger .debug("Creating new SipServletRequest for SipApplicationSession[" + sipAppSession + "] METHOD[" + method + "] FROM[" + from + "] TO[" + to + "]"); } validateCreation(method, sipAppSession); Address toA = this.createAddress(to); Address fromA = this.createAddress(from); return createSipServletRequest(sipAppSession, method, fromA, toA, handler, null, null); }
/** * {@inheritDoc} */ public AuthInfo createAuthInfo() { return sipFactoryImpl.createAuthInfo(); }
public Parameterable createParameterable(String s) throws ServletParseException { return sipFactoryImpl.createParameterable(s); }
if(sipFactory.isUseLoadBalancer()) { MobicentsExtendedListeningPoint listeningPoint = JainSipUtils.findListeningPoint(sipFactory.getSipNetworkInterfaceManager(), methodRequest, outboundInterface); if(listeningPoint != null && listeningPoint.isUseLoadBalancer()) { loadBalancerToUse = sipFactory.getLoadBalancerToUse(); if(logger.isDebugEnabled()) { logger.debug("Using listeningPoint " + listeningPoint + " for global load balancer " + sipFactory.getLoadBalancerToUse()); contactHeader = JainSipUtils.createContactHeader(sipFactory.getSipNetworkInterfaceManager(), methodRequest, displayName, userName, outboundInterface); contactHeader = JainSipUtils.createContactHeader(sipFactory.getSipNetworkInterfaceManager(), methodRequest, displayName, userName, outboundInterface); final SipApplicationDispatcher sipApplicationDispatcher = sipFactory.getSipApplicationDispatcher(); final String branch = JainSipUtils.createBranch(getSipApplicationSession().getKey().getId(), sipApplicationDispatcher.getHashFromApplicationName(getKey().getApplicationName())); ViaHeader viaHeader = JainSipUtils.createViaHeader( sipFactory.getSipNetworkInterfaceManager(), methodRequest, branch, outboundInterface); methodRequest.addHeader(viaHeader); sipServletRequest = (SipServletRequestImpl) sipFactory.getMobicentsSipServletMessageFactory().createSipServletRequest( methodRequest, this, null, sessionCreatingDialog, false); final SipNetworkInterfaceManager sipNetworkInterfaceManager = sipFactory.getSipNetworkInterfaceManager(); final SipProvider sipProvider = sipNetworkInterfaceManager.findMatchingListeningPoint( JainSipUtils.findTransport(request), false).getSipProvider(); final SipApplicationDispatcher sipApplicationDispatcher = sipFactory.getSipApplicationDispatcher(); final String branch = JainSipUtils.createBranch(getSipApplicationSession().getKey().getId(), sipApplicationDispatcher.getHashFromApplicationName(getKey().getApplicationName()));
final MobicentsSipSession session = getSipSession(); final String sessionTransport = session.getTransport(); final SipNetworkInterfaceManager sipNetworkInterfaceManager = sipFactoryImpl.getSipNetworkInterfaceManager(); final MobicentsSipApplicationSession sipApplicationSession = session.getSipApplicationSession(); final SipApplicationRouterInfo routerInfo = sipFactoryImpl.getNextInterestedApplication(this); if(routerInfo.getNextApplicationName() != null) { if(logger.isDebugEnabled()) { logger.debug("bypassLoadBalancer: " + session.getBypassLoadBalancer() + ", sipFactoryImpl UseLoadBalancer: " + sipFactoryImpl.isUseLoadBalancer() + ", matchingListeningPoint: " + matchingListeningPoint); if(!session.getBypassLoadBalancer() && sipFactoryImpl.isUseLoadBalancer()) { if(matchingListeningPoint != null && matchingListeningPoint.isUseLoadBalancer()) { sipFactoryImpl.addLoadBalancerRouteHeader(request, matchingListeningPoint); addDNSRoute = false; if(logger.isDebugEnabled()) { sipFactoryImpl.addLoadBalancerRouteHeader(request, null); addDNSRoute = false; if(logger.isDebugEnabled()) { JainSipUtils.setTransactionTimers((TransactionExt) ctx, sipFactoryImpl.getSipApplicationDispatcher()); Dialog dialog = null; if(session.getProxy() != null) { String nextApp = sipUri.getParameter(MessageDispatcher.RR_PARAM_APPLICATION_NAME); final MobicentsSipApplicationSessionKey sipAppKey = getSipSession().getSipApplicationSession().getKey(); final String thisApp = sipFactoryImpl.getSipApplicationDispatcher().getHashFromApplicationName(sipAppKey.getApplicationName());
public SipServletRequest createRequest(SipApplicationSession sipAppSession, String method, Address from, Address to, String handler, String originalCallId, String fromTagToUse) { if (logger.isDebugEnabled()) { logger .debug("Creating new SipServletRequest for SipApplicationSession[" + sipAppSession + "] METHOD[" + method + "] FROM_A[" + from + "] TO_A[" + to + "]"); } validateCreation(method, sipAppSession); try { //javadoc specifies that a copy of the address should be done hence the clone return createSipServletRequest(sipAppSession, method, (Address)from.clone(), (Address)to.clone(), handler, originalCallId, fromTagToUse); } catch (ServletParseException e) { logger.error("Error creating sipServletRequest", e); return null; } }
public SipServletRequest createRequest(SipServletRequest origRequest, boolean sameCallId) { SipServletRequest sipServletRequest = sipFactoryImpl.createRequest(origRequest, sameCallId); checkHandler(sipServletRequest); return sipServletRequest; }
@Override public SipServletRequest createRequestWithCallID(SipApplicationSession appSession, String method, String from, String to, String callID) throws ServletParseException { SipServletRequest sipServletRequest = sipFactoryImpl.createRequestWithCallID(appSession, method, from, to, callID); return sipServletRequest; }
public Address createAddress(URI uri) { return sipFactoryImpl.createAddress(uri); }
public SipApplicationSession createApplicationSessionByAppName( String sipAppName, boolean isContainerManaged) { if (logger.isDebugEnabled()) { logger.debug("Creating new application session for application name " + sipAppName); } SipContext sipContext = sipApplicationDispatcher.findSipApplication(sipAppName); if(sipContext == null) { throw new IllegalArgumentException("The specified application "+sipAppName+" is not currently deployed"); } MobicentsSipApplicationSession sipApplicationSession = createApplicationSession(sipContext); // make sure to acquire this app session and add it to the set of app sessions we monitor in the context of the application // to release them all when we exit application code sipContext.enterSipApp(sipApplicationSession, null, true, isContainerManaged); return sipApplicationSession; }
/** * */ public SipApplicationDispatcherImpl() { resetStatsCounters(); applicationDeployed = new ConcurrentHashMap<String, SipContext>(); mdToApplicationName = new ConcurrentHashMap<String, String>(); applicationNameToMd = new ConcurrentHashMap<String, String>(); sipFactoryImpl = new SipFactoryImpl(this); hostNames = new CopyOnWriteArraySet<String>(); sipNetworkInterfaceManager = new SipNetworkInterfaceManagerImpl(this); maxMemory = Runtime.getRuntime().maxMemory() / (double) 1024; congestionControlPolicy = CongestionControlPolicy.ErrorResponse; fsm = new DispatcherFSM(this); }
public SipApplicationSession createApplicationSession(boolean managed) { MobicentsSipApplicationSession sipApplicationSessionImpl = null; HttpSession httpSession = threadLocalHttpSession.get(); // make sure we don't create a new sip app session if the http session has already one associated if(httpSession != null) { ConvergedSession convergedSession = (ConvergedSession) httpSession; sipApplicationSessionImpl = convergedSession.getApplicationSession(false); } if(sipApplicationSessionImpl == null) { sipApplicationSessionImpl = (MobicentsSipApplicationSession)sipFactoryImpl.createApplicationSessionByAppName(sipContext.getApplicationName(), managed); associateHttpSession(sipApplicationSessionImpl); } return sipApplicationSessionImpl; }
@Override public SipServletRequest createRequestWithCallID(SipApplicationSession sipAppSession, String method, Address from, Address to, String callID){ if (logger.isDebugEnabled()) { logger .debug("Creating new SipServletRequest for SipApplicationSession[" + sipAppSession + "] METHOD[" + method + "] FROM_A[" + from + "] TO_A[" + to + "]"); } validateCreation(method, sipAppSession); try { String handler = ((MobicentsSipApplicationSession)sipAppSession).getCurrentRequestHandler(); //javadoc specifies that a copy of the address should be done hence the clone return createSipServletRequest(sipAppSession, method, (Address)from.clone(), (Address)to.clone(), handler, callID, null); } catch (ServletParseException e) { logger.error("Error creating sipServletRequest", e); return null; } }
public SipServletRequest createRequest(SipApplicationSession appSession, String method, URI from, URI to) { SipServletRequest sipServletRequest = sipFactoryImpl.createRequest(appSession, method, from, to, ((MobicentsSipApplicationSession)appSession).getCurrentRequestHandler()); return sipServletRequest; }
@Override public SipServletRequest createRequestWithCallID(SipApplicationSession appSession, String method, Address from, Address to, String callID) { SipServletRequest sipServletRequest = sipFactoryImpl.createRequestWithCallID(appSession, method, from, to, callID); return sipServletRequest; }
public Address createAddress(URI uri, String displayName) { return sipFactoryImpl.createAddress(uri, displayName); }
@Override public SipServletRequest createRequestWithCallID(SipApplicationSession sipAppSession, String method, String from, String to, String callID) throws ServletParseException{ if (logger.isDebugEnabled()) { logger .debug("Creating new SipServletRequest for SipApplicationSession[" + sipAppSession + "] METHOD[" + method + "] FROM[" + from + "] TO[" + to + "]"); } validateCreation(method, sipAppSession); Address toA = this.createAddress(to); Address fromA = this.createAddress(from); String handler = ((MobicentsSipApplicationSession)sipAppSession).getCurrentRequestHandler(); return createSipServletRequest(sipAppSession, method, fromA, toA, handler, callID, null); }
public SipServletRequest createRequest(SipApplicationSession appSession, String method, Address from, Address to) { SipServletRequest sipServletRequest = sipFactoryImpl.createRequest(appSession, method, from, to, ((MobicentsSipApplicationSession)appSession).getCurrentRequestHandler(), null, null); return sipServletRequest; }
@Override public SipServletRequest createRequestWithCallID(SipApplicationSession appSession, String method, URI from, URI to, String callID) { SipServletRequest sipServletRequest = sipFactoryImpl.createRequestWithCallID(appSession, method, from, to, callID); return sipServletRequest; }
public Address createAddress(String sipAddress) throws ServletParseException { return sipFactoryImpl.createAddress(sipAddress); }