public SipURI getUri(String scheme, String userHostPort, String transportUriParameter,
      String methodUriParameter, Map<String, String> otherUriParameters, String joinUriHeader,
      String replacesUriHeader, String bodyUriHeader, Map<String, String> otherUriHeaders)
          throws ParseException {
    String address = scheme == null ? userHostPort : scheme + userHostPort;

    Address addr = getAddressFactory().createAddress(address);
    URI addrUri = addr.getURI();
    if (!addrUri.isSipURI()) {
      throw new ParseException("Non-SIP URI not supported: " + address, 0);
    }
    SipURI uri = (SipURI) addrUri;

    // handle URI parameters
    if (otherUriParameters == null) {
      otherUriParameters = new HashMap<>();
    }
    if (transportUriParameter != null) {
      otherUriParameters.put("transport", transportUriParameter);
    }
    if (methodUriParameter != null) {
      otherUriParameters.put("method", methodUriParameter);
    }
    for (Map.Entry<String, String> entry : otherUriParameters.entrySet()) {
      uri.setParameter(entry.getKey(), entry.getValue());
    }

    // handle URI headers
    if (otherUriHeaders == null) {
      otherUriHeaders = new HashMap<>();
    }
    if (joinUriHeader != null) {
      otherUriHeaders.put("Join", joinUriHeader);
    }
    if (replacesUriHeader != null) {
      otherUriHeaders.put("Replaces", replacesUriHeader);
    }
    if (bodyUriHeader != null) {
      otherUriHeaders.put("body", bodyUriHeader);
    }
    for (Map.Entry<String, String> entry : otherUriHeaders.entrySet()) {
      uri.setHeader(entry.getKey(), entry.getValue());
    }

    return uri;
  }
public SipURI getUri ( String scheme , String userHostPort , String transportUriParameter , String methodUriParameter , Map < String , String > otherUriParameters , String joinUriHeader , String replacesUriHeader , String bodyUriHeader , Map < String , String > otherUriHeaders ) throws ParseException { String address = scheme == null ? userHostPort : scheme + userHostPort ; Address addr = getAddressFactory ( ) . createAddress ( address ) ; URI addrUri = addr . getURI ( ) ; if ( ! addrUri . isSipURI ( ) ) { throw new ParseException ( "Non-SIP URI not supported: " + address , 0 ) ; } SipURI uri = ( SipURI ) addrUri ; if ( otherUriParameters == null ) { otherUriParameters = new HashMap < > ( ) ; } if ( transportUriParameter != null ) { otherUriParameters . put ( "transport" , transportUriParameter ) ; } if ( methodUriParameter != null ) { otherUriParameters . put ( "method" , methodUriParameter ) ; } for ( Map . Entry < String , String > entry : otherUriParameters . entrySet ( ) ) { uri . setParameter ( entry . getKey ( ) , entry . getValue ( ) ) ; } if ( otherUriHeaders == null ) { otherUriHeaders = new HashMap < > ( ) ; } if ( joinUriHeader != null ) { otherUriHeaders . put ( "Join" , joinUriHeader ) ; } if ( replacesUriHeader != null ) { otherUriHeaders . put ( "Replaces" , replacesUriHeader ) ; } if ( bodyUriHeader != null ) { otherUriHeaders . put ( "body" , bodyUriHeader ) ; } for ( Map . Entry < String , String > entry : otherUriHeaders . entrySet ( ) ) { uri . setHeader ( entry . getKey ( ) , entry . getValue ( ) ) ; } return uri ; }
Creates an URI object useful for passing into methods such as SipPhone.refer().

@param scheme "sip:" or "sips:" or null if the scheme is already included in the userHostPort
parameter.
@param userHostPort Addressing information in the form of: user@host:port. Port is not
required, and the scheme may optionally be included here instead of in the "scheme"
parameter. Examples: sipmaster@192.168.1.11:5060 and sip:alice@atlanta.sip.com.
@param transportUriParameter Specifies which transport protocol to use for sending requests and
responses to this URI, or null if not needed.
@param methodUriParameter Specifies which SIP method to use in requests directed at this URI
(ie, INVITE), or null if not applicable.
@param otherUriParameters Remaining URI parameters affecting a request constructed from this
URI (Lr, MAddr, TTL, etc), or null if not applicable. URI parameters are key-value
pairs. Any given parameter name (key) MUST NOT appear more than once.
@param joinUriHeader This value is the dialog ID for a Join header to be included in a request
constructed from this URI, or null if not applicable.
@param replacesUriHeader This value is the dialog ID for a Replaces header to be included in a
request constructed from this URI, or null if not applicable.
@param bodyUriHeader This value is the message body of a SIP request constructed from this URI,
or null if not applicable.
@param otherUriHeaders Remaining header fields to be included in a request constructed from
this URI, or null if not applicable. Header fields are key-value pairs.
@return A SipURI for passing into methods such as SipPhone.refer().
@throws ParseException On parse error due to invalid scheme or userHostPort parameters.