Package org.cipango.sip

Examples of org.cipango.sip.SipURIImpl


        "1"));
  }

  protected void testRouterInfo(SipApplicationRouterInfo routerInfo) throws Exception
  {
    SipURI uri = new SipURIImpl(null, "localhost", 5060);
    RouterInfoUtil.encode(uri, routerInfo);
    //System.out.println(uri);
    assertEquals(routerInfo, RouterInfoUtil.decode(new SipURIImpl(uri.toString())));
  }
View Full Code Here


    _connectorManager.start();
   
   
    for (int i = 0; i < MATCHING_LOCAL_URI.length; i++)
      assertTrue("Not match on " + MATCHING_LOCAL_URI[i],
          _connectorManager.isLocalUri(new SipURIImpl(MATCHING_LOCAL_URI[i])));
   
    for (int i = 0; i < NO_MATCHING_LOCAL_URI.length; i++)
      assertFalse("Match on " + NO_MATCHING_LOCAL_URI[i],
          _connectorManager.isLocalUri(new SipURIImpl(NO_MATCHING_LOCAL_URI[i])));
    _connectorManager.stop();
  }
View Full Code Here

    TestConnector connector = new TestConnector("intern.cipango.org", "192.168.1.1", 5060);
    connector.setExternalHost("cipango.org");
    _connectorManager.addConnector(connector);
    _connectorManager.start();
   
    assertTrue(_connectorManager.isLocalUri(new SipURIImpl("sip:cipango.org;lr")));
    assertFalse(_connectorManager.isLocalUri(new SipURIImpl("sip:intern.cipango.org;lr")));
   
    _connectorManager.stop();
  }
View Full Code Here

  }

  @Test
  public void testSipUri() throws Exception
  {
    SipURI orig = new SipURIImpl("sip:foo@bar.com;transport=tcp?to=sip:bob%40biloxi.com");
    SipURI readOnly = new ReadOnlySipURI((SipURI) orig.clone());
   
    assertEquals(orig, readOnly);
    try { readOnly.setParameter("foo", "bar"); fail();} catch (IllegalStateException e) {}
    try { readOnly.removeParameter("transport"); fail();} catch (IllegalStateException e) {} 
    try { readOnly.setHeader("subject", "toto"); fail();} catch (IllegalStateException e) {}
    try { readOnly.removeHeader("to"); fail();} catch (IllegalStateException e) {}
    assertEquals(orig, readOnly);
    assertEquals(readOnly, orig);
    assertEquals(orig.toString(), readOnly.toString());
    URI clone = (URI) readOnly.clone();
    clone.setParameter("a", "b");
    testSerializable(readOnly);
  }
View Full Code Here

          request.getStateInfo());
     
      if (routerInfo != null && routerInfo.getNextApplicationName() != null)
      {
        SipConnector connector = _connectorManager.getDefaultConnector();
        SipURI route = new SipURIImpl(null, connector.getHost(), connector.getPort());
        RouterInfoUtil.encode(route, routerInfo);
        route.setLrParam(true);
       
        request.pushRoute(route);
      }
    }
View Full Code Here

          Log.ignore(e);
          _host = "127.0.0.1";
        }
      }
     
      _sipUri = new SipURIImpl(_name,
          _externalHost != null ? _externalHost : _host,
          _externalPort != -1 ? _externalPort : _port);
       
        if (_threadPool == null && getServer() != null)
          _threadPool = getServer().getSipThreadPool();
View Full Code Here

     
      if (connectors != null)
      {
        for (SipConnector connector : connectors)
        {
          SipURI uri = new SipURIImpl(null, connector.getAddr().getHostAddress(), connector.getLocalPort());
          if (!outbounds.contains(uri))
            outbounds.add(new ReadOnlySipURI(uri));
          if (!externals.contains(connector.getSipUri()))
            externals.add(new ReadOnlySipURI(connector.getSipUri()));
        }
View Full Code Here

            return URIFactory.parseURI(uri);
        }

        public SipURI createSipURI(String user, String host)
        {
            return new SipURIImpl(user, host, -1);
        }
View Full Code Here

        }
      }
      else if (SipRouteModifier.ROUTE_BACK == routerInfo.getRouteModifier() && routes != null)
      {
        SipConnector defaultConnector = getConnectorManager().getDefaultConnector();
          SipURI ownRoute = new SipURIImpl(null, defaultConnector.getHost(), defaultConnector.getPort());
          RouterInfoUtil.encode(ownRoute, routerInfo);

          ownRoute.setLrParam(true);
        request.pushRoute(ownRoute);
        for (int i = routes.length; i >= 0; --i)
          request.pushRoute(new NameAddr(routes[i]));
        request.send();
        return true;
View Full Code Here

TOP

Related Classes of org.cipango.sip.SipURIImpl

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.