public class SipURIImpl extends URIImpl implements SipURI
Modifier | Constructor and Description |
---|---|
protected |
SipURIImpl(boolean isSips,
Buffer userInfo,
Buffer host,
Buffer port,
Buffer paramsHeaders,
Buffer original) |
Modifier and Type | Method and Description |
---|---|
static SipURI |
frame(Buffer buffer)
Frame a sip or sips-uri, which according to RFC3261 is:
|
void |
getBytes(Buffer dst)
Write the bytes of this URI into the destination buffer
|
Buffer |
getHost()
Get the host portion of this URI.
|
int |
getPort()
Get the port.
|
Buffer |
getUser()
Get the user portion of this URI.
|
boolean |
isSecure()
Check whether this is a sips URI.
|
boolean |
isSipURI()
Check whether this
URI is a "sip" or "sips" URI. |
void |
setPort(int port)
Set the port.
|
Buffer |
toBuffer()
|
String |
toString() |
protected SipURIImpl(boolean isSips, Buffer userInfo, Buffer host, Buffer port, Buffer paramsHeaders, Buffer original)
isSips
- whether this is a sip or sips URLuserInfo
- contains the so-called "userinfo" portion. Typically this is
just the user but can optionally contain a password as well.
See SipParser.consumeUserInfoHostPort(Buffer)
for more
information.hostPort
- contains the so-called "hostport", which is the domain +
optional port.paramsHeaders
- any uri-parameters or headers that were on the SIP uri will be
in this buffer. If empty or null then there were none.original
- the original buffer just because as long as no one is changing
the content we can just return this buffer fast and easy.public boolean isSipURI()
URI
is a "sip" or "sips" URI.public boolean isSecure()
public void getBytes(Buffer dst)
URI
public Buffer getUser()
public Buffer getHost()
public int getPort()
public void setPort(int port)
SipURI
public static SipURI frame(Buffer buffer) throws SipParseException, IndexOutOfBoundsException, IOException
SIP-URI = "sip:" [ userinfo ] hostport uri-parameters [ headers ] SIPS-URI = "sips:" [ userinfo ] hostport uri-parameters [ headers ]Remember though that all these frame-functions will only do a basic verification that all things are ok so just because this function return without an exception doesn't mean that you actually framed a valid URI. Everything is done lazily so things may blow up later. Also note that this function assumes that someone else has already determined the boundaries for this sip(s)-uri and as such, this function do not expect '<' etc.
buffer
- SipParseException
IOException
IndexOutOfBoundsException
Copyright © 2013. All Rights Reserved.