public interface SipFactory
Modifier and Type | Method and Description |
---|---|
Address |
createAddress(String sipAddress)
Returns an
Address corresponding to the specified string. |
Address |
createAddress(URI uri) |
Address |
createAddress(URI uri,
String displayName) |
Parameterable |
createParameterable(String value) |
OutgoingSipRequest |
createRequest(IncomingSipRequest origRequest,
boolean sameCallId)
Creates a new request object belonging to a new
SipSession . |
OutgoingSipRequest |
createRequest(String method,
Address from,
Address to)
Returns a new request object with the specified request method, From, and To headers.
|
OutgoingSipRequest |
createRequest(String method,
String from,
String to)
Returns a new request object with the specified request method, From, and To headers.
|
OutgoingSipRequest |
createRequest(String method,
URI from,
URI to)
Returns a new request object with the specified request method, From, and To headers.
|
SipURI |
createSipURI(String user,
String host) |
URI |
createURI(String uri) |
SipMessage |
decodeMessage(DataInput in)
Decode a
SipMessage from an input stream that was previously encoded by
encodeMessage(SipMessage, DataOutput) . |
void |
encodeMessage(SipMessage message,
DataOutput out)
Encode a
SipMessage to an output stream, for storage in CMP. |
SipURI |
getInternalASURI()
Get a URI that uniquely identifies this AS including it node and cluster IDs, for use when directing inter-node
traffic.
|
SipURI |
getLocalSipURI(String transport)
Convenience method for obtaining a SIP URI addressed to the calling service on this host.
|
SipSession |
getSipSession(String id)
Lookup a
SipSession by its session ID. |
boolean |
isInternalASURI(String uri)
Check if a URI matches this node's internal AS URI.
|
boolean |
isInternalASURI(URI uri)
Check if a URI matches this node's internal AS URI.
|
boolean |
isLocalSipURI(SipURI uri)
Determine if a URI is local to this SIS instance, .
|
URI createURI(String uri) throws SipParseException
SipParseException
SipURI createSipURI(String user, String host) throws SipParseException
SipParseException
SipURI getLocalSipURI(String transport)
transport
- a case-insensitive transport name, such as "udp", "tcp" or "tls". This will be used
as the transport
parameter in the resulting
SipURI
, unless transport
is "tls", in which case the RA Entity shall return a
secure sips:
URI. If transport
is null
, no transport parameter
will be used in the URI.SipURI
addressed to the calling service on this SIP RA Entity.boolean isLocalSipURI(SipURI uri)
true
if the host and port in the URI match an endpoint that
this SIS instance is listening on (or a configured virtual address), otherwise false
.Address createAddress(String sipAddress) throws SipParseException
Address
corresponding to the specified string. The resulting object can be used,
for example, as the value of From
or To
headers of locally initiated SIP requests.
The special argument "*" results in a wildcard Address being returned, that is, an Address
for which isWildcard returns true. Such addresses are for use in Contact
headers only.
sipAddress
- a valid SIP address from a From or To header.Address
SipParseException
- if parsing failsParameterable createParameterable(String value) throws SipParseException
SipParseException
OutgoingSipRequest createRequest(String method, Address from, Address to) throws SipException
SipSession
activity, accessible using SipMessage.getSession()
.
SBBs must attach to the session in order to receive responses.This method is used by SBBs acting as SIP clients in order to send a request in a new call leg. The RA is responsible for assigning the request appropriate Call-ID and CSeq headers, as well as Contact header if the method is not REGISTER.
This method makes a copy of the from and to arguments and associates them with the new SipSession.
Any component of the from and to URIs not allowed in the context of SIP From and To headers are removed
from the copies. This includes, headers and various parameters. Also, a "tag" parameter in either of the
copied from or to is also removed, as it is illegal in an initial To header and the RA will choose it's
own tag for the From header. The copied from and to addresses can be obtained from the SipSession
but must not be modified by applications.
method
- the method of the new request, e.g. "INVITE"from
- value of the From headerto
- value of the To headerIllegalArgumentException
- if the method is "ACK" or "CANCEL"SipException
- if unable to create the request or session activityOutgoingSipRequest createRequest(String method, URI from, URI to) throws SipException
SipSession
activity, accessible using SipMessage.getSession()
.
SBBs must attach to the session in order to receive responses.This method is used by SBBs acting as SIP clients in order to send a request in a new call leg. The RA is responsible for assigning the request appropriate Call-ID and CSeq headers, as well as Contact header if the method is not REGISTER.
This method makes a copy of the from and to arguments and associates them with the new SipSession.
Any component of the from and to URIs not allowed in the context of SIP From and To headers are removed
from the copies. This includes, headers and various parameters. Also, a "tag" parameter in either of the
copied from or to is also removed, as it is illegal in an initial To header and the RA will choose it's
own tag for the From header. The copied from and to addresses can be obtained from the SipSession
but must not be modified by applications.
method
- the method of the new request, e.g. "INVITE"from
- value of the From headerto
- value of the To headerIllegalArgumentException
- if the method is "ACK" or "CANCEL"SipException
- if unable to create the request or session activityOutgoingSipRequest createRequest(String method, String from, String to) throws SipException, SipParseException
SipSession
activity, accessible using SipMessage.getSession()
.
SBBs must attach to the session in order to receive responses.This method is used by SBBs acting as SIP clients in order to send a request in a new call leg. The RA is responsible for assigning the request appropriate Call-ID and CSeq headers, as well as Contact header if the method is not REGISTER.
This method makes a copy of the from and to arguments and associates them with the new SipSession.
Any component of the from and to URIs not allowed in the context of SIP From and To headers are removed
from the copies. This includes, headers and various parameters. Also, a "tag" parameter in either of the
copied from or to is also removed, as it is illegal in an initial To header and the RA will choose it's
own tag for the From header. The copied from and to addresses can be obtained from the SipSession
but must not be modified by applications.
method
- the method of the new request, e.g. "INVITE"from
- value of the From header, this must be a valid Addressto
- value of the To header, this must be a valid AddressIllegalArgumentException
- if the method is "ACK" or "CANCEL"SipParseException
- if the URI scheme of the from or to argument is unknown or if parsing failedSipException
- if unable to create the request or session activityOutgoingSipRequest createRequest(IncomingSipRequest origRequest, boolean sameCallId) throws SipException
SipSession
. The new request is similar to the specified
origRequest
in that the method and the majority of header fields are copied from origRequest to the
new request.This method satisfies the following rules:
sameCallId
argument is false
, the new request (and the corresponding SipSession
)
is assigned a new Call-ID.
SipSession.createRequest(java.lang.String)
as usual.origRequest
- request to be "copied".sameCallId
- whether or not to use the same Call-ID for the new dialog.SipException
- if unable to create the request or session activitySipSession getSipSession(String id)
SipSession
by its session ID.id
- a session ID string from SipSession.getId()
SipSession
, or null if no matching session exists.IllegalArgumentException
- if id is not a string returned by SipSession.getId()
void encodeMessage(SipMessage message, DataOutput out) throws IOException
SipMessage
to an output stream, for storage in CMP.
The encoding format is internal to the SIS and is only suitable for
decoding via decodeMessage(DataInput)
.message
- the message to encodeout
- the data output streamIOException
- if unable to encode the messageSipMessage decodeMessage(DataInput in) throws IOException
SipMessage
from an input stream that was previously encoded by
encodeMessage(SipMessage, DataOutput)
. The decoded message will implement
the same interface as the original message (IncomingSipRequest
, OutgoingSipRequest
,
etc) but will not implement any methods with side effects such as OutgoingSipRequest.send()
.
But the original message headers and body are fully accessible, and the message may
be encoded
and decoded
over and over again indefinitely.in
- the data input streamSipMessage
of the same type as the originally encoded messageIOException
- if unable to encode the messageSipURI getInternalASURI()
boolean isInternalASURI(URI uri)
uri
- The URI to checkboolean isInternalASURI(String uri)
uri
- The URI to check