public MobicentsProxy getProxy() { return getSipSession().getProxy(); }
public Proxy getProxy() { if(proxyBranch != null) { return proxyBranch.getProxy(); } else { return getSipSession().getProxy(); } }
/** * Pushes a route header on initial request based on the jain sip sipUri given on parameter * @param sipUri the jain sip sip uri to use to construct the route header to push on the request */ private void pushRoute(javax.sip.address.SipURI sipUri) { if(!isInitial() && getSipSession().getProxy() == null) { //as per JSR 289 Section 11.1.3 Pushing Route Header Field Values // pushRoute can only be done on the initial requests. // Subsequent requests within a dialog follow the route set. // Any attempt to do a pushRoute on a subsequent request in a dialog // MUST throw and IllegalStateException. throw new IllegalStateException("Cannot push route on subsequent requests, only intial ones"); } else { if (logger.isDebugEnabled()) logger.debug("Pushing route into message of value [" + sipUri + "]"); sipUri.setLrParam(); try { javax.sip.header.Header p = SipFactoryImpl.headerFactory .createRouteHeader(SipFactoryImpl.addressFactory .createAddress(sipUri)); this.message.addFirst(p); } catch (SipException e) { logger.error("Error while pushing route [" + sipUri + "]"); throw new IllegalArgumentException("Error pushing route ", e); } } }
public void setContent(Object content, String contentType) throws UnsupportedEncodingException { if(getSipSession().getProxy() == null) { checkMessageState();
/** * @param session * @throws SipException */ private void checkSubscriptionStateHeaders(final MobicentsSipSession session) throws SipException { if(Request.NOTIFY.equals(getMethod()) && session.getProxy() == null) { final SubscriptionStateHeader subscriptionStateHeader = (SubscriptionStateHeader) getMessage().getHeader(SubscriptionStateHeader.NAME); // RFC 3265 : If a matching NOTIFY request contains a "Subscription-State" of "active" or "pending", it creates // a new subscription and a new dialog (unless they have already been // created by a matching response, as described above). if (subscriptionStateHeader != null && (SubscriptionStateHeader.ACTIVE.equalsIgnoreCase(subscriptionStateHeader.getState()) || SubscriptionStateHeader.PENDING.equalsIgnoreCase(subscriptionStateHeader.getState()))) { session.addSubscription(this); } // A subscription is destroyed when a notifier sends a NOTIFY request // with a "Subscription-State" of "terminated". if (subscriptionStateHeader != null && SubscriptionStateHeader.TERMINATED.equalsIgnoreCase(subscriptionStateHeader.getState())) { session.removeSubscription(this); } } }
SipServletResponseImpl lastInfoResponse = (SipServletResponseImpl) ((SipServletRequestImpl)sipServletMessage).getLastInformationalResponse(); final MobicentsProxy proxy = sipSession.getProxy(); if(logger.isDebugEnabled()) { logger.debug("checkForPrackNotReceived : last Informational Response " + lastInfoResponse);
final SipServletResponseImpl lastFinalResponse = (SipServletResponseImpl) ((SipServletRequestImpl)sipServletMessage).getLastFinalResponse(); final MobicentsProxy proxy = sipSession.getProxy(); if(logger.isDebugEnabled()) { logger.debug("checkForAckNotReceived : request " + sipServletMessage + " last Final Response " + lastFinalResponse); if(!notifiedApplication && sipSession.getProxy() == null &&
public B2buaHelper getB2buaHelper() { checkReadOnly(); final MobicentsSipSession session = getSipSession(); if (session.getProxy() != null) throw new IllegalStateException("Proxy already present"); MobicentsB2BUAHelper b2buaHelper = session.getB2buaHelper(); if (b2buaHelper != null) return b2buaHelper; b2buaHelper = new B2buaHelperImpl(); b2buaHelper.setMobicentsSipFactory(sipFactoryImpl); b2buaHelper.setSipManager(session.getSipApplicationSession().getSipContext().getSipManager()); if(JainSipUtils.DIALOG_CREATING_METHODS.contains(getMethod())) { this.createDialog = true; // flag that we want to create a dialog for outgoing request. } session.setB2buaHelper(b2buaHelper); return b2buaHelper; }
if(Request.SUBSCRIBE.equals(sipServletResponse.getMethod()) && status >= 200 && status <= 300 && session.getProxy() == null) { session.addSubscription(sipServletResponse); if(session.getProxy() != null) { proxyBranch = session.getProxy().getFinalBranchForSubsequentRequests(); session.getProxy().getTransactionMap().get(branch); if(session.getProxy().getSupervised() && status != Response.TRYING) { callServlet(sipServletResponse); proxyBranch.setResponse(sipServletResponse); final ProxyImpl proxy = (ProxyImpl) session.getProxy();
try { sipContext.enterSipApp(sipApplicationSession, sipSession, false, true); final MobicentsProxy proxy = sipSession.getProxy(); if(proxy != null) { if(logger.isDebugEnabled()) {
final MobicentsSipSession session = getSipSession(); final MobicentsSipApplicationSession sipApplicationSession = session.getSipApplicationSession(); final MobicentsProxy proxy = session.getProxy(); ViaHeader viaHeader = (ViaHeader) request.getHeader(ViaHeader.NAME);
tad.cleanUp(); transaction.setApplicationData(null); if(b2buaHelperImpl == null && sipSession.getProxy() == null) { tad.cleanUpMessage();
final MobicentsProxy proxy = sipSessionImpl.getProxy(); if(!invalidateProxySession && (proxy == null || (proxy != null &&
SipConnector sipConnector = StaticServiceHolder.sipStandardService.findSipConnector(transport); if(sipConnector != null && sipConnector.isUseStaticAddress()) { if(session != null && session.getProxy() == null) { boolean sipURI = contactHeader.getAddress().getURI().isSipURI(); if(sipURI) {
final MobicentsSipApplicationSession sipApplicationSession = session.getSipApplicationSession(); final MobicentsSipApplicationSessionKey sipAppSessionKey = sipApplicationSession.getKey(); final MobicentsProxy proxy = session.getProxy(); if(Request.SUBSCRIBE.equals(getMethod()) && statusCode >= 200 && statusCode <= 300 && session.getProxy() == null) { session.addSubscription(this);
if(session.getProxy() == null && session.getTransport() != null && uriToResolve.isSipURI() && uriToResolveTransport == null &&
sipSessionImpl.setProxy(parentSipSession.getProxy()); if(parentSipSession.getSipSubscriberURI() != null) { sipSessionImpl.setSipSubscriberURI(parentSipSession.getSipSubscriberURI());
final String requestMethod = getMethod(); final MobicentsSipSession session = getSipSession(); final MobicentsProxy proxy = session.getProxy();