Examples of Via


Examples of org.cipango.sip.Via

   
    public void sendResponse(SipResponse response, SipConnection connection) throws IOException
    {
      if (connection == null || !connection.getConnector().isReliable() || !connection.isOpen())
      {
        Via via = response.getTopVia();
       
        SipConnector connector = null;
        InetAddress address = null;
       
        if (connection != null)
        {
          connector = connection.getConnector();
          address = connection.getRemoteAddress();
        }
        else
        {
          int transport = SipConnectors.getOrdinal(via.getTransport());
          address = InetAddress.getByName(via.getHost());
         
          connector = findConnector(transport, address);
        }
       
      int port = -1;
     
      String srport = via.getRport();
          if (srport != null)
          {
              port = Integer.parseInt(srport);
          }
          else
          {
              port = via.getPort();
              if (port == -1)
                  port = connection.getConnector().getDefaultPort();
          }
          connection = connector.getConnection(address, port);
      }
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.