Examples of SipURI


Examples of javax.servlet.sip.SipURI

  public Object extract(Object input)
  {
    URI uri = (URI) input;
    if (uri.isSipURI())
    {
          SipURI sipuri = (SipURI) uri;
          if ("phone".equals(sipuri.getParameter("user")))
              return stripVisuals(sipuri.getUser());
      }
    else if ("tel".equals(uri.getScheme()))
    {
          return stripVisuals(((TelURL) uri).getPhoneNumber());
      }
View Full Code Here

Examples of javax.servlet.sip.SipURI

  {
    _fields.setAddress(SipHeaders.FROM_BUFFER, new NameAddr("sip:foo@bar.com"));
   
    assertEquals("<sip:foo@bar.com>", _fields.getString("from"));
   
    SipURI uri = (SipURI) _fields.getAddress("from").getURI();
    assertEquals("foo", uri.getUser());
    assertEquals("bar.com", uri.getHost());
   
    _fields.addAddress("route", new NameAddr("sip:route1"), false);
    _fields.addAddress(SipHeaders.ROUTE_BUFFER, new NameAddr("sip:route2"), false);
   
    Iterator<Address> it = _fields.getAddressValues("route");
View Full Code Here

Examples of javax.servlet.sip.SipURI

 
  private SipURI newProxyURI(boolean applicationId)
  {
    SipConnector connector = _tx.getRequest().getConnection().getConnector();
           
    SipURI rrUri = (SipURI) connector.getSipUri().clone();
    rrUri.setParameter("lr", "");
   
    if (applicationId)
    {
      AppSession appSession = _tx.getRequest().appSession();
      rrUri.setParameter(ID.APP_SESSION_ID_PARAMETER, appSession.getAppId());
    }

    return rrUri;
  }
View Full Code Here

Examples of javax.servlet.sip.SipURI

  protected Branch addTarget(URI uri)
  {
    URI target = uri.clone();
    if (target.isSipURI())
    {
      SipURI sipUri = (SipURI) target;
      sipUri.removeParameter("method");
      Iterator<String> it = sipUri.getHeaderNames();
      while (it.hasNext())
      {
        it.remove();
      }
    }
View Full Code Here

Examples of javax.servlet.sip.SipURI

    if (session == null)
      register = createRequest(SipMethods.REGISTER, _localAddress);
    else
      register = createRequest(session, SipMethods.REGISTER);
     
    SipURI registrar = _factory.createSipURI(null, ((SipURI) _localAddress.getURI()).getHost());
    register.setRequestURI(registrar);
    register.setAddressHeader(SipHeaders.CONTACT, _contact);
    register.setExpires(3600);
   
    return register;
View Full Code Here

Examples of javax.servlet.sip.SipURI

          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

Examples of javax.servlet.sip.SipURI

    return null;
  }
 
  public void addAgent(UserAgent agent)
  {
    SipURI contact = (SipURI) getContact().clone();
   
    agent.setFactory(_context.getSipFactory());
    agent.setContact(new NameAddr(contact));
   
    synchronized(_userAgents)
View Full Code Here

Examples of javax.servlet.sip.SipURI

 
  public static void mergeContact(String src, Address dest) throws ServletParseException
  {
    NameAddr source = new NameAddr(src);
   
    SipURI srcUri = (SipURI) source.getURI();
    SipURI destUri = (SipURI) dest.getURI();
   
    String user = srcUri.getUser();
    if (user != null)
      destUri.setUser(user);
   
    Iterator<String> it = srcUri.getHeaderNames();
    while (it.hasNext())
    {
      String name = it.next();
      destUri.setHeader(name, srcUri.getHeader(name));
    }
   
    it = srcUri.getParameterNames();
    while (it.hasNext())
    {
      String name = it.next();
      if (!ContactAddress.isReservedUriParam(name))
        destUri.setParameter(name, srcUri.getParameter(name));
    }
    String displayName = source.getDisplayName();
    if (displayName != null)
      dest.setDisplayName(displayName);
   
View Full Code Here

Examples of javax.servlet.sip.SipURI

  public Object extract(Object input)
  {
    URI uri = (URI) input;
    if (uri.isSipURI())
    {
          SipURI sipuri = (SipURI) uri;
          int port = sipuri.getPort();
          if (port < 0)
          {
              String scheme = sipuri.getScheme();
              if (scheme.equals("sips"))
                  return "5061";
              else
                  return "5060";
          }
View Full Code Here

Examples of javax.servlet.sip.SipURI

        uri = _request.getRequestURI();
     
      if (!uri.isSipURI())
        throw new IOException("Cannot route on URI: " + uri);
     
      SipURI target = (SipURI) uri;
     
      InetAddress address = InetAddress.getByName(target.getHost()); // TODO 3263
      int transport = SipConnectors.getOrdinal(target.getTransportParam()); // TODO opt
     
      if (transport == -1)
        transport = SipConnectors.UDP_ORDINAL;
     
      int port = target.getPort();
      if (port == -1)
        port = SipConnectors.getDefaultPort(transport);
   

      Via via = new Via(SipVersions.SIP_2_0, null, null);
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.