Examples of Hop


Examples of javax.sip.address.Hop

                        // RFC 3263 PROCEDURE TO BE DONE HERE
                        host = via.getHost();
                    }
                }

                Hop hop = sipStack.addressResolver.resolveAddress(new HopImpl(host, port,
                        transport));

                MessageChannel messageChannel = ((SIPTransactionStack) getSIPStack())
                        .createRawMessageChannel(this.getSipProvider().getListeningPoint(
                                hop.getTransport()).getIPAddress(), this.getPort(), hop);
                if (messageChannel != null) {
                    messageChannel.sendMessage(transactionResponse);
                    lastResponseHost = host;
                    lastResponsePort = port;
                    lastResponseTransport = transport;
                } else {
                    throw new IOException("Could not create a message channel for " + hop + " with source IP:Port "+
                        this.getSipProvider().getListeningPoint(
                                    hop.getTransport()).getIPAddress() + ":" + this.getPort());
                }

            }
            lastResponseAsBytes = transactionResponse.encodeAsBytes(this.getTransport());
            lastResponse = null;
View Full Code Here

Examples of javax.sip.address.Hop

//              return;
//            }
          if(isReliable()) {
            getMessageChannel().sendMessage(lastResponseAsBytes, this.getPeerInetAddress(), this.getPeerPort(), false);
          } else {
            Hop hop = sipStack.addressResolver.resolveAddress(new HopImpl(lastResponseHost, lastResponsePort,
                        lastResponseTransport));
   
                MessageChannel messageChannel = ((SIPTransactionStack) getSIPStack())
                        .createRawMessageChannel(this.getSipProvider().getListeningPoint(
                                hop.getTransport()).getIPAddress(), this.getPort(), hop);
                if (messageChannel != null) {
                    messageChannel.sendMessage(lastResponseAsBytes, InetAddress.getByName(hop.getHost()), hop.getPort(), false);                               
                } else {
                    throw new IOException("Could not create a message channel for " + hop + " with source IP:Port "+
                        this.getSipProvider().getListeningPoint(
                                    hop.getTransport()).getIPAddress() + ":" + this.getPort());
                }                       
          }
          }
      } else {
        getMessageChannel().sendMessage(pendingReliableResponseAsBytes, this.getPeerInetAddress(), this.getPeerPort(), false);
View Full Code Here

Examples of javax.sip.address.Hop

       
            /* Resolve this to the next hop based on the previous lookup. If we are not using
             * lose routing (RFC2543) then just attach hop as a maddr param.
             */
            if ( challengedRequest.getRouteHeaders() == null ) {
                Hop hop   = ((SIPClientTransaction) challengedTransaction).getNextHop();
                SipURI sipUri = (SipURI) reoriginatedRequest.getRequestURI();
                sipUri.setMAddrParam(hop.getHost());
                if ( hop.getPort() != -1 ) sipUri.setPort(hop.getPort());
            }
            ClientTransaction retryTran = transactionCreator
            .getNewClientTransaction(reoriginatedRequest);
           
            WWWAuthenticateHeader authHeader = null;
View Full Code Here

Examples of javax.sip.address.Hop

              + ((SIPRequest) request).getFirstLine()
              + " creating a new one ");

    // Could not find a dialog or the route is not set in dialog.

    Hop hop = null;
    try {
      hop = sipStack.getNextHop((SIPRequest) request);
      if (hop == null)
        throw new TransactionUnavailableException(
            "Cannot resolve next hop -- transaction unavailable");
    } catch (SipException ex) {
      throw new TransactionUnavailableException(
          "Cannot resolve next hop -- transaction unavailable", ex);
    }
    String transport = hop.getTransport();
        ListeningPointImpl listeningPoint = (ListeningPointImpl) this
                .getListeningPoint(transport);
       
    String dialogId = sipRequest.getDialogId(false);
    SIPDialog dialog = sipStack.getDialog(dialogId);
View Full Code Here

Examples of javax.sip.address.Hop

        sipStack.getLogWriter().logWarning(
            "Dialog exists -- you may want to use Dialog.sendAck() "
                + dialog.getState());
      }
    }
    Hop hop = sipStack.getRouter((SIPRequest) request).getNextHop(request);
    if (hop == null)
      throw new SipException("could not determine next hop!");
    SIPRequest sipRequest = (SIPRequest) request;
    // Check if we have a valid via.
    // Null request is used to send default proxy keepalive messages.
    if ((!sipRequest.isNullRequest()) && sipRequest.getTopmostVia() == null)
      throw new SipException("Invalid SipRequest -- no via header!");

    try {
      /*
       * JvB: Via branch should already be OK, dont touch it here? Some
       * apps forward statelessly, and then it's not set. So set only when
       * not set already, dont overwrite CANCEL branch here..
       */
      if (!sipRequest.isNullRequest()) {
        Via via = sipRequest.getTopmostVia();
        String branch = via.getBranch();
        if (branch == null || branch.length() == 0) {
          via.setBranch(sipRequest.getTransactionId());
        }
      }
      MessageChannel messageChannel = null;
      if (this.listeningPoints.containsKey(hop.getTransport()
          .toUpperCase()))
        messageChannel = sipStack.createRawMessageChannel(
            this.getListeningPoint(hop.getTransport()).getIPAddress(),
            this.getListeningPoint(hop.getTransport()).getPort(), hop);
      if (messageChannel != null) {
        messageChannel.sendMessage((SIPMessage) sipRequest,hop);
      } else {
        throw new SipException(
            "Could not create a message channel for "
                + hop.toString());
      }
    } catch (IOException ex) {
      if (sipStack.isLoggingEnabled()) {
        sipStack.getLogWriter().logException(ex);
      }
View Full Code Here

Examples of javax.sip.address.Hop

    // for correct management of IPv6 addresses.
    if (host.indexOf(":") > 0)
      if (host.indexOf("[") < 0)
        host = "[" + host + "]";

    Hop hop = sipStack.getAddressResolver().resolveAddress(
        new HopImpl(host, port, transport));

    try {
      ListeningPointImpl listeningPoint = (ListeningPointImpl) this
          .getListeningPoint(transport);
      if (listeningPoint == null)
        throw new SipException(
            "whoopsa daisy! no listening point found for transport "
                + transport);
      MessageChannel messageChannel = sipStack.createRawMessageChannel(
          this.getListeningPoint(hop.getTransport()).getIPAddress(),
          listeningPoint.port, hop);
      messageChannel.sendMessage(sipResponse);
    } catch (IOException ex) {
      throw new SipException(ex.getMessage());
    }
View Full Code Here

Examples of javax.sip.address.Hop

      if (errorObject instanceof SIPServerTransaction) {
        ev = new TimeoutEvent(this, (ServerTransaction) errorObject,
            timeout);
      } else {
          SIPClientTransaction clientTx = (SIPClientTransaction) errorObject;
          Hop hop = clientTx.getNextHop();
          if ( sipStack.getRouter() instanceof RouterExt ) {
              ((RouterExt) sipStack.getRouter()).transactionTimeout(hop);
          }
        ev = new TimeoutEvent(this, (ClientTransaction) errorObject,
            timeout);
      }
      // Handling transport error like timeout
      this.handleEvent(ev, (SIPTransaction) errorObject);
    } else if (transactionErrorEvent.getErrorID() == SIPTransactionErrorEvent.TIMEOUT_ERROR) {
      // This is a timeout event.
      Object errorObject = transactionErrorEvent.getSource();
      Timeout timeout = Timeout.TRANSACTION;
      TimeoutEvent ev = null;

      if (errorObject instanceof SIPServerTransaction) {
        ev = new TimeoutEvent(this, (ServerTransaction) errorObject,
            timeout);
      } else {
          SIPClientTransaction clientTx = (SIPClientTransaction) errorObject;
                Hop hop = clientTx.getNextHop();
                if ( sipStack.getRouter() instanceof RouterExt ) {
                    ((RouterExt) sipStack.getRouter()).transactionTimeout(hop);
                }
           
        ev = new TimeoutEvent(this, (ClientTransaction) errorObject,
View Full Code Here

Examples of javax.sip.address.Hop

            // first via header tells where the message is coming from.
            // For response, this has already been recorded in the outgoing
            // message.
            if (sipMessage instanceof SIPRequest) {
                Via v = (Via) viaList.getFirst();
                Hop hop = sipStack.addressResolver.resolveAddress(v.getHop());
                this.peerPort = hop.getPort();
                this.peerProtocol = v.getTransport();
                try {
                    this.peerAddress = mySock.getInetAddress();
                    // Check to see if the received parameter matches
                    // the peer address and tag it appropriately.

                    // JvB: dont do this. It is both costly and incorrect
                    // Must set received also when it is a FQDN, regardless
                    // whether
                    // it resolves to the correct IP address
                    // InetAddress sentByAddress =
                    // InetAddress.getByName(hop.getHost());
                    // JvB: if sender added 'rport', must always set received
                    if (v.hasParameter(Via.RPORT)
                            || !hop.getHost().equals(this.peerAddress.getHostAddress())) {
                        v.setParameter(Via.RECEIVED, this.peerAddress.getHostAddress());
                    }
                    // @@@ hagai
                    // JvB: technically, may only do this when Via already
                    // contains
View Full Code Here

Examples of javax.sip.address.Hop

    // For a request first via header tells where the message
    // is coming from.
    // For response, just get the port from the packet.
    if (sipMessage instanceof SIPRequest) {
      Via v = (Via) viaList.getFirst();
      Hop hop = sipStack.addressResolver.resolveAddress(v.getHop());
      this.peerPort = hop.getPort();
      this.peerProtocol = v.getTransport();

      this.peerPacketSourceAddress = packet.getAddress();
      this.peerPacketSourcePort = packet.getPort();
      try {
        this.peerAddress = packet.getAddress();
        // Check to see if the received parameter matches
        // the peer address and tag it appropriately.

       
        boolean hasRPort = v.hasParameter(Via.RPORT);
        if (hasRPort
            || !hop.getHost().equals(
                this.peerAddress.getHostAddress())) {
          v.setParameter(Via.RECEIVED, this.peerAddress
              .getHostAddress());
        }
View Full Code Here

Examples of javax.sip.address.Hop

            // message.

            if (sipMessage instanceof SIPRequest) {
                Via v = (Via) viaList.getFirst();
                // the peer address and tag it appropriately.
                Hop hop = sipStack.addressResolver.resolveAddress(v.getHop());
                this.peerPort = hop.getPort();
                this.peerProtocol = v.getTransport();
                try {
                    this.peerAddress = mySock.getInetAddress();
                    // Check to see if the received parameter matches
                    // JvB: dont do this. It is both costly and incorrect
                    // Must set received also when it is a FQDN, regardless whether
                    // it resolves to the correct IP address
                    // InetAddress sentByAddress = InetAddress.getByName(hop.getHost());
                    // JvB: if sender added 'rport', must always set received
                    if (v.hasParameter(Via.RPORT)
                            || !hop.getHost().equals(this.peerAddress.getHostAddress())) {
                        v.setParameter(Via.RECEIVED, this.peerAddress.getHostAddress());
                    }
                    // @@@ hagai
                    // JvB: technically, may only do this when Via already contains
                    // rport
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.