Package gov.nist.javax.sip

Examples of gov.nist.javax.sip.ListeningPointImpl


        /*
         * Add a via header for the outbound request based on the transport of the message
         * processor.
         */

        ListeningPointImpl lp = (ListeningPointImpl) this.sipProvider
                .getListeningPoint(topMostViaTransport);
        if (lp == null) {
            if (sipStack.isLoggingEnabled())
                sipStack.getStackLogger().logError(
                        "Cannot find listening point for transport "
                                + topMostViaTransport);
            throw new SipException("Cannot find listening point for transport "
                    + topMostViaTransport);
        }
        Via via = lp.getViaHeader();

        From from = new From();
        from.setAddress(this.getLocalParty());
        To to = new To();
        to.setAddress(this.getRemoteParty());
        SIPRequest sipRequest = createRequest(sipUri, via, cseq, from, to);

        /*
         * The default contact header is obtained from the provider. The application can override
         * this.
         *
         * JvB: Should only do this for target refresh requests, ie not for BYE, PRACK, etc
         */

        if (SIPRequest.isTargetRefresh(method)) {
            ContactHeader contactHeader = ((ListeningPointImpl) this.sipProvider
                    .getListeningPoint(lp.getTransport())).createContactHeader();

            ((SipURI) contactHeader.getAddress().getURI()).setSecure(this.isSecure());
            sipRequest.setHeader(contactHeader);
        }

View Full Code Here


            } else { // should be !=null, checked above
                uri4transport = ((SipURI) this.getRemoteTarget().getURI());
            }

            String transport = uri4transport.getTransportParam();
            ListeningPointImpl lp;
            if (transport != null) {
               lp = (ListeningPointImpl) sipProvider.getListeningPoint(transport);
            }
            else
            {
View Full Code Here

    } catch (ParseException e1) {
      throw new SipException("failed to set local tag", e1);
    }

    final String transport = request.getTopmostViaHeader().getTransport();
    final ListeningPointImpl listeningPointImpl = (ListeningPointImpl) sipProvider.getListeningPoint(transport);

    final ViaList viaList = new ViaList();
    viaList.add((Via) listeningPointImpl.createViaHeader());
    request.setVia(viaList);
   
    try {
      request.setHeader(headerFactory.createMaxForwardsHeader(70));
    } catch (InvalidArgumentException e) {
      throw new SipException("Failed to create max forwards header",e);
    }
    request.setHeader((Header) outgoingDialogCallId.clone());
    // note: cseq will be set by dialog when sending
    // set contact if the original response had it
    if (origRequest.getHeader(ContactHeader.NAME) != null) {
      request.setHeader(listeningPointImpl.createContactHeader());
    }

    /*
     * Route header fields of the upstream request MAY be copied in the
     * downstream request, except the topmost Route header if it is under
     * the responsibility of the B2BUA. Additional Route header fields MAY
     * also be added to the downstream request.
     */
    if (outgoingDialog == null || outgoingDialog.getState() == null) {
      // first request, no route available
      final RouteList routeList = request.getRouteHeaders();
      if (routeList != null) {
        final RouteHeader topRoute = routeList.get(0);
        final URI topRouteURI = topRoute.getAddress().getURI();
        if (topRouteURI.isSipURI()) {
          final SipURI topRouteSipURI = (SipURI) topRouteURI;
          if (topRouteSipURI.getHost().equals(listeningPointImpl.getIPAddress())
              && topRouteSipURI.getPort() == listeningPointImpl.getPort()) {
            if (routeList.size() > 1) {
              routeList.remove(0);
            }
            else {
              request.removeHeader(RouteHeader.NAME);
View Full Code Here

    } catch (ParseException e1) {
      throw new SipException("failed to set local tag", e1);
    }

    final String transport = request.getTopmostViaHeader().getTransport();
    final ListeningPointImpl listeningPointImpl = (ListeningPointImpl) sipProvider.getListeningPoint(transport);

    final ViaList viaList = new ViaList();
    viaList.add((Via) listeningPointImpl.createViaHeader());
    request.setVia(viaList);
   
    try {
      request.setHeader(headerFactory.createMaxForwardsHeader(70));
    } catch (InvalidArgumentException e) {
      throw new SipException("Failed to create max forwards header",e);
    }
    request.setHeader((Header) outgoingDialogCallId.clone());
    // note: cseq will be set by dialog when sending
    // set contact if the original response had it
    if (origRequest.getHeader(ContactHeader.NAME) != null) {
      request.setHeader(listeningPointImpl.createContactHeader());
    }

    /*
     * Route header fields of the upstream request MAY be copied in the
     * downstream request, except the topmost Route header if it is under
     * the responsibility of the B2BUA. Additional Route header fields MAY
     * also be added to the downstream request.
     */
    if (outgoingDialog == null || outgoingDialog.getState() == null) {
      // first request, no route available
      final RouteList routeList = request.getRouteHeaders();
      if (routeList != null) {
        final RouteHeader topRoute = routeList.get(0);
        final URI topRouteURI = topRoute.getAddress().getURI();
        if (topRouteURI.isSipURI()) {
          final SipURI topRouteSipURI = (SipURI) topRouteURI;
          if (topRouteSipURI.getHost().equals(listeningPointImpl.getIPAddress())
              && topRouteSipURI.getPort() == listeningPointImpl.getPort()) {
            if (routeList.size() > 1) {
              routeList.remove(0);
            }
            else {
              request.removeHeader(RouteHeader.NAME);
View Full Code Here

        if (hop == null)
            throw new SipException("No route!");
        try {
            if (sipStack.isLoggingEnabled())
                sipStack.getStackLogger().logDebug("hop = " + hop);
            ListeningPointImpl lp = (ListeningPointImpl) this.sipProvider.getListeningPoint(hop
                    .getTransport());
            if (lp == null)
                throw new SipException("No listening point for this provider registered at "
                        + hop);
            InetAddress inetAddress = InetAddress.getByName(hop.getHost());
            MessageChannel messageChannel = lp.getMessageProcessor().createMessageChannel(
                    inetAddress, hop.getPort());
            boolean releaseAckSem = false;
            long cseqNo = ((SIPRequest)request).getCSeq().getSeqNumber();
            if (!this.isAckSent(cseqNo)) {
                releaseAckSem = true;
View Full Code Here

        /*
         * Add a via header for the outbound request based on the transport of the message
         * processor.
         */

        ListeningPointImpl lp = (ListeningPointImpl) this.sipProvider
                .getListeningPoint(topMostViaTransport);
        if (lp == null) {
            if (sipStack.isLoggingEnabled())
                sipStack.getStackLogger().logError(
                        "Cannot find listening point for transport "
                                + topMostViaTransport);
            throw new SipException("Cannot find listening point for transport "
                    + topMostViaTransport);
        }
        Via via = lp.getViaHeader();

        From from = new From();
        from.setAddress(this.getLocalParty());
        To to = new To();
        to.setAddress(this.getRemoteParty());
        SIPRequest sipRequest = createRequest(sipUri, via, cseq, from, to);

        /*
         * The default contact header is obtained from the provider. The application can override
         * this.
         *
         * JvB: Should only do this for target refresh requests, ie not for BYE, PRACK, etc
         */

        if (SIPRequest.isTargetRefresh(method)) {
            ContactHeader contactHeader = ((ListeningPointImpl) this.sipProvider
                    .getListeningPoint(lp.getTransport())).createContactHeader();

            ((SipURI) contactHeader.getAddress().getURI()).setSecure(this.isSecure());
            sipRequest.setHeader(contactHeader);
        }

View Full Code Here

            String transport = uri4transport.getTransportParam();
            if (transport == null) {
                // JvB fix: also support TLS
                transport = uri4transport.isSecure() ? ListeningPoint.TLS : ListeningPoint.UDP;
            }
            ListeningPointImpl lp = (ListeningPointImpl) sipProvider.getListeningPoint(transport);
            if (lp == null) {
              if (sipStack.isLoggingEnabled()) {
                sipStack.getStackLogger().logError(
                        "remoteTargetURI " + this.getRemoteTarget().getURI());
                  sipStack.getStackLogger().logError("uri4transport = " + uri4transport);
View Full Code Here

        if (hop == null)
            throw new SipException("No route!");
        try {
            if (sipStack.isLoggingEnabled(LogWriter.TRACE_DEBUG))
                sipStack.getStackLogger().logDebug("hop = " + hop);
            ListeningPointImpl lp = (ListeningPointImpl) this.sipProvider.getListeningPoint(hop
                    .getTransport());
            if (lp == null)
                throw new SipException("No listening point for this provider registered at "
                        + hop);
            InetAddress inetAddress = InetAddress.getByName(hop.getHost());
            MessageChannel messageChannel = lp.getMessageProcessor().createMessageChannel(
                    inetAddress, hop.getPort());
            boolean releaseAckSem = false;
            long cseqNo = ((SIPRequest)request).getCSeq().getSeqNumber();
            if (!this.isAckSent(cseqNo)) {
                releaseAckSem = true;
View Full Code Here

        /*
         * Add a via header for the outbound request based on the transport of the message
         * processor.
         */

        ListeningPointImpl lp = (ListeningPointImpl) this.sipProvider
                .getListeningPoint(topMostViaTransport);
        if (lp == null) {
            if (sipStack.isLoggingEnabled())
                sipStack.getStackLogger().logError(
                        "Cannot find listening point for transport "
                                + topMostViaTransport);
            throw new SipException("Cannot find listening point for transport "
                    + topMostViaTransport);
        }
        Via via = lp.getViaHeader();

        From from = new From();
        from.setAddress(this.getLocalParty());
        To to = new To();
        to.setAddress(this.getRemoteParty());
        SIPRequest sipRequest = createRequest(sipUri, via, cseq, from, to);

        /*
         * The default contact header is obtained from the provider. The application can override
         * this.
         *
         * JvB: Should only do this for target refresh requests, ie not for BYE, PRACK, etc
         */

        if (SIPRequest.isTargetRefresh(method)) {
            ContactHeader contactHeader = ((ListeningPointImpl) this.sipProvider
                    .getListeningPoint(lp.getTransport())).createContactHeader();

            ((SipURI) contactHeader.getAddress().getURI()).setSecure(this.isSecure());
            sipRequest.setHeader(contactHeader);
        }

View Full Code Here

            String transport = uri4transport.getTransportParam();
            if (transport == null) {
                // JvB fix: also support TLS
                transport = uri4transport.isSecure() ? ListeningPoint.TLS : ListeningPoint.UDP;
            }
            ListeningPointImpl lp = (ListeningPointImpl) sipProvider.getListeningPoint(transport);
            if (lp == null) {
              if (sipStack.isLoggingEnabled()) {
                sipStack.getStackLogger().logError(
                        "remoteTargetURI " + this.getRemoteTarget().getURI());
                  sipStack.getStackLogger().logError("uri4transport = " + uri4transport);
View Full Code Here

TOP

Related Classes of gov.nist.javax.sip.ListeningPointImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.