|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SipFactory
Factory interface for a variety of SIP Servlet API abstractions.
SIP servlet containers are requried to make a
SipFactory
instance available to applications
through a ServletContext
attribute with name
javax.servlet.sip.SipFactory
.
Method Summary | |
---|---|
Address |
createAddress(java.lang.String addr)
Returns a Address corresponding to the specified
string. |
Address |
createAddress(URI uri)
Returns an Address with the specified URI and no
display name. |
Address |
createAddress(URI uri,
java.lang.String displayName)
Returns a new Address with the specified
URI and display name. |
SipApplicationSession |
createApplicationSession()
Returns a new SipApplicationSession . |
SipApplicationSession |
createApplicationSessionByKey(java.lang.String sipApplicationKey)
Returns a new SipApplicationSession identified by the specified
SipApplicationKey. |
AuthInfo |
createAuthInfo()
Creates a new AuthInfo object that can be used to provide authentication information on servlet initiated requests. |
Parameterable |
createParameterable(java.lang.String s)
Creates a new Parameterable parsed from the specified
string. |
SipServletRequest |
createRequest(SipApplicationSession appSession,
java.lang.String method,
Address from,
Address to)
Returns a new request object with the specified request method, From, and To headers. |
SipServletRequest |
createRequest(SipApplicationSession appSession,
java.lang.String method,
java.lang.String from,
java.lang.String to)
Returns a new request object with the specified request method, From, and To headers. |
SipServletRequest |
createRequest(SipApplicationSession appSession,
java.lang.String method,
URI from,
URI to)
Returns a new request object with the specified request method, From, and To headers. |
SipServletRequest |
createRequest(SipServletRequest origRequest,
boolean sameCallId)
Deprecated. usage of this method is deprecated. Setting the sameCallId flag to "true" actually breaks the provisions of [RFC 3261] where the Call-ID value is to be unique accross dialogs. Instead use a more general method defined on the B2buaHelper B2buaHelper.createRequest(SipServletRequest) |
SipURI |
createSipURI(java.lang.String user,
java.lang.String host)
Constructs a SipURI with the specified user and host
components. |
URI |
createURI(java.lang.String uri)
Returns a URI object corresponding to the specified
string, which should represent an escaped SIP, SIPS, or tel URI. |
Method Detail |
---|
URI createURI(java.lang.String uri) throws ServletParseException
URI
object corresponding to the specified
string, which should represent an escaped SIP, SIPS, or tel URI.
The URI
may then be used as request URI in
SIP requests or as the URI component of Address
objects.
Implementations must be able to represent URIs of any scheme.
This method returns a SipURI
object if the specified
string is a sip
or a sips
URI, and a
TelURL
object if it's a tel
URL.
If the specified URI string contains any reserved characters, then the container is responsible for escaping them, in accordance with RFC2396.
uri
- the SIP, SIPS, or tel string to parse
URI
object
ServletParseException
- if the URI scheme
is unknown or parsing failedSipURI createSipURI(java.lang.String user, java.lang.String host)
SipURI
with the specified user and host
components. The scheme will initially be sip
but the
application may change it to sips
by calling
setSecure(true)
on the returned SipURI
.
Likewise, the port number of the new URI is left unspecified but
may subsequently be set by calling setPort
on the
returned SipURI
.
If the specified URI string contains any reserved characters, then the container is responsible for escaping them, in accordance with RFC2396.
user
- user part of the new SipURI
host
- host part of the new SipURI
SipURI
with the specified
user and host partsAddress createAddress(java.lang.String addr) throws ServletParseException
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.
The specified address string must be UTF-8 encoded. Furthermore,
if the URI component of the address string contains any reserved
characters then the container is responsible for escaping them
in accordance with RFC2396 as indicated
for createURI(String)
addr
- valid value of SIP From or To header
Address
ServletParseException
- if parsing failedAddress createAddress(URI uri)
Address
with the specified URI and no
display name.
uri
- the URI
of the returned Address
Address
whose URI
component is the argumentAddress createAddress(URI uri, java.lang.String displayName)
Address
with the specified
URI
and display name.
uri
- URI
of the new Address
displayName
- display name of the new Address
Parameterable createParameterable(java.lang.String s) throws ServletParseException
Parameterable
parsed from the specified
string. The string must be in the following format:
field-value *(;parameter-name[=parameter-value])where the field-value may be in name-addr or addr-spec format as defined in RFC 3261 or may be any sequence of tokens till the first semicolon.
s
- the header field string
Parameterable
ServletParseException
- if parsing failedSipServletRequest createRequest(SipApplicationSession appSession, java.lang.String method, Address from, Address to)
SipSession
which belongs to the specified
SipApplicationSession
.
This method is used by servlets acting as SIP clients in order to send a request in a new call leg. The container 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 [refer Table 1, Section 19.1.1, RFC3261].
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 container 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.
appSession
- the application session to which the new
SipSession
and SipServletRequest
belongsmethod
- the method of the new request, e.g. "INVITE"from
- value of the From headerto
- value of the To header
java.lang.IllegalArgumentException
- if the method is "ACK" or "CANCEL",
or the specified SipApplicationSession is invalid.SipServletRequest createRequest(SipApplicationSession appSession, java.lang.String method, URI from, URI to)
SipSession
which belongs to the specified
SipApplicationSession
.
This method is used by servlets acting as SIP clients in order to send a request in a new call leg. The container 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 [refer Table 1, Section 19.1.1, RFC3261].
This includes,
headers and various parameters.
The from and to addresses can subsequently be obtained from the
SipSession or the returned request object but must not be modified
by applications.
appSession
- the application session to which the new
SipSession
and SipServletRequest
belongsmethod
- the method of the new request, e.g. "INVITE"from
- value of the From headerto
- value of the To header
java.lang.IllegalArgumentException
- if the method is "ACK" or "CANCEL",
or the specified SipApplicationSession is invalid.SipServletRequest createRequest(SipApplicationSession appSession, java.lang.String method, java.lang.String from, java.lang.String to) throws ServletParseException
SipSession
which belongs to the specified
SipApplicationSession
.
This method is used by servlets acting as SIP clients in order to send a request in a new call leg. The container 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 is functionally equivalent to:
createRequest(method, f.createAddress(from), f.createAddress(to));Note that this implies that if either of the from or to argument is a SIP URI containing parameters, the URI must be enclosed in angle brackets. Otherwise the address will be parsed as if the parameter belongs to the address and not the URI.
appSession
- the application session to which the new
SipSession
and SipServletRequest
belongsmethod
- the method of the new request, e.g. "INVITE"from
- value of the From header -- this must be a
valid Address
to
- value of the To header -- this must be a
valid Address
ServletParseException
- if the URI scheme of
the from or to argument is unknown or if parsing failed
java.lang.IllegalArgumentException
- if the method is "ACK" or "CANCEL",
or the specified SipApplicationSession is invalid.SipServletRequest createRequest(SipServletRequest origRequest, boolean sameCallId)
B2buaHelper.createRequest(SipServletRequest)
origRequest
in that the method and the majority of header fields are copied
from origRequest
to the new request. The SipSession
created for the new request also shares the same SipApplicationSession
associated with the original request.
This method satisfies the following rules:
sameCallId
argument is false, the new
request (and the corresponding SipSession
)is
assigned a new Call-ID.
This method provides a convenient and efficient way of
constructing the second "leg" of a B2BUA application. It is used
only for the initial request. Subsequent requests in either leg
must be created using SipSession.createRequest(java.lang.String)
as usual.
origRequest
- request to be "copied"sameCallId
- whether or not to use same Call-ID for the new
dialog
SipApplicationSession createApplicationSession()
SipApplicationSession
. This is useful,
for example, when an application is being initialized and wishes
to perform some signaling action.
SipApplicationSession
objectSipApplicationSession createApplicationSessionByKey(java.lang.String sipApplicationKey)
SipApplicationSession
identified by the specified
SipApplicationKey. This is same as the one generated by the method annotated
with @SipApplicationKey annotation.
This allows a way to associate incoming requests to an
already existing SipApplicationSession.
sipApplicationKey
- id for the SipApplicationSession
SipApplicationSession
object with the specified idAuthInfo createAuthInfo()
AuthInfo
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |