public interface SipURI extends URI, Parameters
sip:
or
sips:
scheme. All SIP implementations MUST support the sip:
URI scheme.
SIP and SIPS URIs are used for addressing. They are similar to email
addresses in that they are of the form
user@host
where user is either a user name or telephone number,
and host is a host or domain name, or a numeric IP address. Additionally,
SIP and SIPS URIs may contain parameters and headers (although headers are
not legal in all contexts). A SipURI can be embedded in web pages, business
cards or other hyperlinks to indicate that a particular user or service can
be called via SIP.
Within a SIP Message, SipURIs are used to indicate the source and intended destination of a Request, redirection addresses and the current destination of a Request. Normally all these Headers will contain SipURIs.
Syntactically, SIP and SIPS URIs are identical except for the name of the URI scheme. The semantics differs in that the SIPS scheme implies that the identified resource is to be contacted using TLS. Because SIP and SIPS URIs are syntactically identical and because they're used the same way, they're both represented by the SipURI interface.
The SipURI interface extends the generic URI interface and provides additional convenience methods for the following components of a SipURI address, above the generic URI interface:
sip:
or sips:
, where sips:
is secure.
FromHeader
,
ToHeader
,
ContactHeader
,
URI
Modifier and Type | Method and Description |
---|---|
String |
getHeader(String name)
Returns the value of the named header, or null if it is not set.
|
Iterator |
getHeaderNames()
Returns an Iterator over the String names of all headers present
in this SipURI.
|
String |
getHost()
Returns the host part of this SipURI.
|
String |
getMAddrParam()
Returns the value of the
maddr parameter, or null if this
is not set. |
String |
getMethodParam()
Returns the value of the
method parameter, or null if this
is not set. |
int |
getPort()
Returns the port part of this SipURI.
|
String |
getTransportParam()
Returns the value of the "transport" parameter, or null if this is not
set.
|
int |
getTTLParam()
Returns the value of the "ttl" parameter, or -1 if this is not set.
|
String |
getUser()
Returns the user part of this SipURI.
|
String |
getUserParam()
Returns the value of the
userParam , or null if this is not
set. |
String |
getUserPassword()
Gets user password of SipURI, or null if it is not set.
|
boolean |
hasLrParam()
Returns whether the the
lr parameter is set. |
boolean |
isSecure()
Returns true if this SipURI is secure i.e.
|
void |
removePort()
Removes the port part of this SipURI.
|
void |
setHeader(String name,
String value)
Sets the value of the specified header fields to be included in a
request constructed from the URI.
|
void |
setHost(String host)
Set the host part of this SipURI to the newly supplied
host
parameter. |
void |
setLrParam()
Sets the value of the
lr parameter of this SipURI. |
void |
setMAddrParam(String mAddr)
Sets the value of the
maddr parameter of this SipURI. |
void |
setMethodParam(String method)
Sets the value of the
method parameter. |
void |
setPort(int port)
Set the port part of this SipURI to the newly supplied port
parameter.
|
void |
setSecure(boolean secure)
Sets the scheme of this URI to sip or sips depending on whether the
argument is true or false.
|
void |
setTransportParam(String transport)
Sets the value of the "transport" parameter.
|
void |
setTTLParam(int ttl)
Sets the value of the
ttl parameter. |
void |
setUser(String user)
Sets the user of SipURI.
|
void |
setUserParam(String userParam)
Sets the value of the user parameter.
|
void |
setUserPassword(String userPassword)
Sets the user password associated with the user of SipURI.
|
String |
toString()
This method returns the URI as a string.
|
getParameter, getParameterNames, removeParameter, setParameter
void setUser(String user) throws ParseException
user
- - the new String value of the user.ParseException
- which signals that an error has been reached
unexpectedly while parsing the user value.String getUser()
void setUserPassword(String userPassword) throws ParseException
userPassword
- - the new String value of the user passwordParseException
- which signals that an error has been reached
unexpectedly while parsing the userPassword value.String getUserPassword()
boolean isSecure()
true
if this SipURI represents a sips URI, and
false
if it represents a sip URI.void setSecure(boolean secure)
secure
- - the boolean value indicating if the SipURI is secure.void setHost(String host) throws ParseException
host
parameter.host
- - the new interger value of the host of this SipURIParseException
- which signals that an error has been reached
unexpectedly while parsing the host value.String getHost()
void setPort(int port)
port
- - the new interger value of the port of this SipURIint getPort()
void removePort()
String getHeader(String name)
name
- name of header to retrievevoid setHeader(String name, String value) throws ParseException
name
- - a String specifying the header namevalue
- - a String specifying the header valueParseException
- which signals that an error has been reached
unexpectedly while parsing the name or value parameters.Iterator getHeaderNames()
String getTransportParam()
void setTransportParam(String transport) throws ParseException
ListeningPoint
.transport
- - new value for the "transport" parameterParseException
- which signals that an error has been reached
unexpectedly while parsing the transport value.int getTTLParam()
ttl
parametervoid setTTLParam(int ttl) throws InvalidArgumentException
ttl
parameter. The ttl parameter
specifies the time-to-live value when packets are sent using UDP
multicast. This is equivalent to setParameter("ttl", ttl).ttl
- - new value of the ttl
parameterInvalidArgumentException
- if supplied value is less than zero,
excluding -1 the default not set value.String getMethodParam()
method
parameter, or null if this
is not set. This is equivalent to getParameter("method").method
parametervoid setMethodParam(String method) throws ParseException
method
parameter. This specifies
which SIP method to use in requests directed at this URI. This is
equivalent to setParameter("method", method).method
- - new value String value of the method parameterParseException
- which signals that an error has been reached
unexpectedly while parsing the method value.void setUserParam(String userParam) throws ParseException
userParam
- - new value String value of the method parameterParseException
- which signals that an error has been reached
unexpectedly while parsing the userParam value.String getUserParam()
userParam
, or null if this is not
set.
This is equivalent to getParameter("user").
userParam
of the SipURIString getMAddrParam()
maddr
parameter, or null if this
is not set. This is equivalent to getParameter("maddr").maddr
parametervoid setMAddrParam(String mAddr) throws ParseException
maddr
parameter of this SipURI. The
maddr parameter indicates the server address to be contacted for this
user, overriding any address derived from the host field. This is
equivalent to setParameter("maddr", maddr).mAddr
- new value of the maddr
parameterParseException
- which signals that an error has been reached
unexpectedly while parsing the mAddr value.boolean hasLrParam()
lr
parameter is set. This is
equivalent to hasParameter("lr"). This interface has no getLrParam as
RFC3261 does not specify any values for the "lr" paramater.void setLrParam()
lr
parameter of this SipURI. The lr
parameter, when present, indicates that the element responsible for
this resource implements the routing mechanisms specified in RFC 3261.
This parameter will be used in the URIs proxies place in the
Record-Route header field values, and may appear in the URIs in a
pre-existing route set.Copyright © 2016. All Rights Reserved.