Examples of Via


Examples of gov.nist.javax.sip.header.Via

            SIPRequest transactionRequest;

            transactionRequest = (SIPRequest) messageToSend;

            // Set the branch id for the top via header.
            Via topVia = (Via) transactionRequest.getViaHeaders().getFirst();
            // Tack on a branch identifier to match responses.
            try {
                topVia.setBranch(getBranch());
            } catch (java.text.ParseException ex) {
            }

            if (sipStack.isLoggingEnabled(LogWriter.TRACE_DEBUG)) {
                sipStack.getStackLogger().logDebug("Sending Message " + messageToSend);
View Full Code Here

Examples of gov.nist.javax.sip.header.Via

            return SIPConstants.BRANCH_MAGIC_COOKIE + "-"
                + this.signature + "-" + Utils.toHexString(bid);
    }

    public boolean responseBelongsToUs(SIPResponse response) {
        Via topmostVia = response.getTopmostVia();
        String branch = topmostVia.getBranch();
        return branch != null && branch.startsWith(
                   SIPConstants.BRANCH_MAGIC_COOKIE + "-" + this.signature);
    }
View Full Code Here

Examples of gov.nist.javax.sip.header.Via

                        "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());
View Full Code Here

Examples of gov.nist.javax.sip.header.Via

                        "BYE already sent for " + this);
            throw new SipException("Cannot send request; BYE already sent");
        }

        if (dialogRequest.getTopmostVia() == null) {
            Via via = ((SIPClientTransaction) clientTransactionId)
                    .getOutgoingViaHeader();
            dialogRequest.addHeader(via);
        }
        if (!this.getCallId().getCallId().equalsIgnoreCase(
                dialogRequest.getCallId().getCallId())) {
View Full Code Here

Examples of gov.nist.javax.sip.header.Via

            // so use the via header extracted from the response for the ACK =>
            // https://jain-sip.dev.java.net/issues/show_bug.cgi?id=205
            // strip the params from the via of the response and use the params
            // from the
            // original request
            Via via = this.lastResponseTopMostVia;
            via.removeParameters();
            if (originalRequest != null
                    && originalRequest.getTopmostVia() != null) {
                NameValueList originalRequestParameters = originalRequest
                        .getTopmostVia().getParameters();
                if (originalRequestParameters != null
                        && originalRequestParameters.size() > 0) {
                    via.setParameters((NameValueList) originalRequestParameters
                            .clone());
                }
            }
            via.setBranch(Utils.getInstance().generateBranchId()); // new branch
            vias.add(via);
            sipRequest.setVia(vias);
            From from = new From();
            from.setAddress(this.getLocalParty());
            from.setTag(this.myTag);
View Full Code Here

Examples of org.apache.sling.models.annotations.Via

        String viaPropertyName = null;
        if (processor != null) {
            viaPropertyName = processor.getVia();
        }
        if (viaPropertyName == null) {
            Via viaAnnotation = point.getAnnotation(Via.class);
            if (viaAnnotation == null) {
                return adaptable;
            }
            viaPropertyName = viaAnnotation.value();
        }
        try {
            return PropertyUtils.getProperty(adaptable, viaPropertyName);
        } catch (Exception e) {
            log.error("Unable to execution projection " + viaPropertyName, e);
View Full Code Here

Examples of org.cipango.sip.Via

      int port = target.getPort();
      if (port == -1)
        port = SipConnectors.getDefaultPort(transport);
   

      Via via = new Via(SipVersions.SIP_2_0, null, null);
      via.setBranch(getBranch());
      customizeVia(via);
      _request.pushVia(via);
     
      SipConnection connection = getServer().getConnectorManager().sendRequest(
          _request,
View Full Code Here

Examples of org.cipango.sip.Via

        }
    }
 
  public Via removeTopVia()
  {
    Via via = _fields.getVia();
    _fields.removeFirst(SipHeaders.VIA_BUFFER);
    return via;
  }
View Full Code Here

Examples of org.cipango.sip.Via

       
        if (preValidateMessage((SipMessage) message))
    {
          if (msg.isRequest())
            {
                Via via = msg.getTopVia();
                String remoteAddr = msg.getRemoteAddr();
               
                String host = via.getHost();
                if (host.indexOf('[') != -1)
                {
                  // As there is multiple presentation of an IPv6 address, normalize it.
                  host = InetAddress.getByName(host).getHostAddress();
                }
               
                if (!host.equals(remoteAddr))
                    via.setReceived(remoteAddr);

                if (via.getRport() != null)
                    via.setRport(Integer.toString(message.getRemotePort()));
            }

            getServer().handle(msg);
    }
    else
View Full Code Here

Examples of org.cipango.sip.Via

   
    public SipConnection sendRequest(SipRequest request, int transport, InetAddress address, int port) throws IOException
    {  
      SipConnector connector = findConnector(transport, address);
     
        Via via = request.getTopVia();
       
        via.setTransport(connector.getTransport());
        via.setHost(connector.getSipUri().getHost());
        via.setPort(connector.getSipUri().getPort());
               
        // TODO mtu

        SipConnection connection = connector.getConnection(address, port);
        send(request, connection);
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.