Esempio n. 1
0
 /**
  * Creates an Address with the new display name and URI attribute values.
  *
  * @param displayName - the new string value of the display name of the address. A <code>null
  *     </code> value does not set the display name.
  * @param uri - the new URI value of the address.
  * @throws ParseException which signals that an error has been reached unexpectedly while parsing
  *     the displayName value.
  */
 public javax.sip.address.Address createAddress(String displayName, javax.sip.address.URI uri) {
   if (uri == null) throw new NullPointerException("null  URI");
   AddressImpl addressImpl = new AddressImpl();
   if (displayName != null) addressImpl.setDisplayName(displayName);
   addressImpl.setURI(uri);
   return addressImpl;
 }
Esempio n. 2
0
  /**
   * Creates an Address with the new address string value. The address string is parsed in order to
   * create the new Address instance. Create with a String value of "*" creates a wildcard address.
   * The wildcard can be determined if <code>((SipURI)Address.getURI).getUser() == *;</code>.
   *
   * @param address - the new string value of the address.
   * @throws ParseException which signals that an error has been reached unexpectedly while parsing
   *     the address value.
   */
  public javax.sip.address.Address createAddress(String address) throws java.text.ParseException {
    if (address == null) throw new NullPointerException("null address");

    if (address.equals("*")) {
      AddressImpl addressImpl = new AddressImpl();
      addressImpl.setAddressType(AddressImpl.WILD_CARD);
      SipURI uri = new SipUri();
      uri.setUser("*");
      addressImpl.setURI(uri);
      return addressImpl;
    } else {
      StringMsgParser smp = new StringMsgParser();
      return smp.parseAddress(address);
    }
  }
Esempio n. 3
0
  /**
   * Performs strict router fix according to RFC3261 section 16.6 step 6
   *
   * <p>pre: top route header in request has no 'lr' parameter in URI post: request-URI added as
   * last route header, new req-URI = top-route-URI
   */
  public void fixStrictRouting(SIPRequest req) {

    RouteList routes = req.getRouteHeaders();
    Route first = (Route) routes.getFirst();
    SipUri firstUri = (SipUri) first.getAddress().getURI();
    routes.removeFirst();

    // Add request-URI as last Route entry
    AddressImpl addr = new AddressImpl();
    addr.setAddess(req.getRequestURI()); // don't clone it
    Route route = new Route(addr);

    routes.add(route); // as last one
    req.setRequestURI(firstUri);
    if (sipStack.isLoggingEnabled()) {
      sipStack.getStackLogger().logDebug("post: fixStrictRouting" + req);
    }
  }
Esempio n. 4
0
 public javax.sip.address.Address createAddress(javax.sip.address.URI uri) {
   if (uri == null) throw new NullPointerException("null address");
   AddressImpl addressImpl = new AddressImpl();
   addressImpl.setURI(uri);
   return addressImpl;
 }