Interface WlssSipFactory
- All Superinterfaces:
javax.servlet.sip.SipFactory
SipFactory
interface.- Author:
- Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
- See Also:
-
SipFactory
-
Method Summary
Modifier and TypeMethodDescriptionjavax.servlet.sip.SipServletRequestcreateRequest(javax.servlet.sip.SipServletRequest origRequest, Map headerMap, boolean sameCallId) Creates a new request object belonging to a new SipSession.javax.servlet.sip.SipServletMessageparse(byte[] input) Provides access to the SIP Servlet message parser.Methods inherited from interface javax.servlet.sip.SipFactory
createAddress, createAddress, createAddress, createApplicationSession, createApplicationSessionByKey, createAuthInfo, createParameterable, createRequest, createRequest, createRequest, createRequest, createSipURI, createURI
-
Method Details
-
createRequest
javax.servlet.sip.SipServletRequest createRequest(javax.servlet.sip.SipServletRequest origRequest, Map headerMap, boolean sameCallId) Creates a new request object belonging to a new SipSession. The new request is similar to the specifiedorigRequestin that the method and the majority of header fields are copied fromorigRequestto the new request.The headerMap parameter can contain "From" and "To" headers and any non system header. The entries in the map are used to overwrite the headers in the newly created request. The values in the headerMap are expected to be java.lang.String or java.util.Set of java.lang.Strings for multi-valued headers. Note that since the new values will replace the existing values, if you wish to append to the existing set, include the old values in the new set as well. If you wish to remove an existing non system header simply pass the value as null or an empty set.
The SipSession created for the new request also shares the same SipApplicationSession associated with the original request.
This method satisfies the following rules:
- Irrespective of whether the "From" header is overridden through the headerMap or not, the "From" header field of the new request has a new tag chosen by the container.
- The "To" header field of the new request has no tag.
- If the sameCallId argument is false, the new request (and the corresponding SipSession) is assigned a new Call-ID.
- Record-Route and Via header fields are not copied. As usual, the container will add its own Via header field to the request when it's actually sent outside the application server.
- For non-REGISTER requests, the Contact header field is not copied but is populated by the container as usual.
This method provides a convenient and efficient way of constructing the second "leg" of a B2BUA application, giving the additional flexibility of changing the headers including To and From. It is used only for the initial request. Subsequent requests in either leg must be created using
SipSession.createRequest(java.lang.String)as usual.- Parameters:
origRequest- request to be "copied"headerMap- a simple map containing header names and their values to be overridden in the new request. The values are expected to be java.lang.String or java.util.Set of java.lang.Strings for multi-valued headers.sameCallId- whether or not to use same Call-ID for the new dialog- Returns:
- the "copied" request object
- Throws:
IllegalArgumentException- if the headerMap contains a system header other than From/To.
-
parse
javax.servlet.sip.SipServletMessage parse(byte[] input) throws javax.servlet.sip.ServletParseException Provides access to the SIP Servlet message parser. Parses a SIP message contained in a byte[] array and parses it into a SipServletMessage.- Parameters:
input- SIP Servlet Message as a byte array- Returns:
- SipServletMessage parsed output
- Throws:
javax.servlet.sip.ServletParseException- If the message cannot be parsed
-