createAckRequest(ToHeader responseToHeader) Creates a default ACK Request message for this original request.
Note that the defaultACK Request does not include the
content of the original Request.
createBYERequest(boolean switchHeaders) Creates a BYE request from this request.
Parameters: switchHeaders - is a boolean flag that causes from andisServerTransaction to headers to be swapped.
(1) Invite options and bye requests can only have SIP URIs in the
contact headers.
(2) Request must have cseq, to and from and via headers.
(3) Method in request URI must match that in CSEQ.
Creates an ACK request from this request. This is suitable for
generating an ACK for an INVITE client transaction.
an ACK request that is generated from this request. throws: SipException - if the request can't be created.
Creates a default ACK Request message for this original request.
Note that the defaultACK Request does not include the
content of the original Request. If responseToHeader
is null then the toHeader of this request is used to
construct the ACK. Note that tag fields are just copied
from the original SIP Request. Added by Jeff Keyser.
Parameters: responseToHeader - To header to use for this request. A Request with an ACK method. throws: SipException - if the request can't be created.
Creates a BYE request from this request.
Parameters: switchHeaders - is a boolean flag that causes from andisServerTransaction to headers to be swapped. Set thisto true if you are the server of the dialog and are generatinga BYE request for the dialog. a new default BYE request. throws: SipException - if the request can't be created.
Creates a default SIPResquest message that would cancel
this request. Note that tag assignment and removal of
is left to the caller (we use whatever tags are present in the
original request). Acknowledgement: Added by Jeff Keyser.
A CANCEL Request with a copy all the original headersfrom this request except for Require, ProxyRequire. throws: SipException - if the request can't be created.
Creates a new default Request from the original request. Warning:
the newly created Request, shares the headers of
this request but we generate any new headers that we need to modify
so the original request is umodified. However, if you modify the
shared headers after this request is created, then the newly
created request will also be modified.
If you want to modify the original request
without affecting the returned Request
make sure you clone it before calling this method.
Following are the differences between the original request headers
and the generated request headers.
Contact headers are not included in the newly created request.
Setting the appropriate sequence number is the responsibility of
the caller.
RouteList is not copied for ACK and CANCEL
Note that we DO NOT copy the body of the
argument into the returned header. We do not copy the content
type header from the original request either. These have to be
added seperately and the content length has to be correctly set
if necessary the content length is set to 0 in the returned header.
Contact List is not copied from the original request.
RecordRoute List is not included from original request.
Via header is not included from the original request.
Parameters: requestLine - is the new request line. Parameters: switchHeaders - is a boolean flag that causes to and fromheaders to switch (set this to true if you are theserver of the transaction and are generating a BYErequest). If the headers are switched, we generatenew FromHeader and To headers otherwise we just use theincoming headers. a new Default SIP Request which has the requestLine specified. throws: SipException - if the request can't be created.
Creates a default Response message for this request. Note
You must add the necessary tags to outgoing responses if need
be. For efficiency, this method does not clone the incoming
request. If you want to modify the outgoing response, be sure
to clone the incoming request as the headers are shared and
any modification to the headers of the outgoing response will
result in a modification of the incoming request.
Tag fields are just copied from the incoming request.
Contact headers are removed from the incoming request.
Added by Jeff Keyser.
Parameters: statusCode - Status code for the response.Reason phrase is generated. A Response with the status and reason supplied, and a copyof all the original headers from this request.
Creates a default Response message for this request. Note
You must add the necessary tags to outgoing responses if need
be. For efficiency, this method does not clone the incoming
request. If you want to modify the outgoing response, be sure
to clone the incoming request as the headers are shared and
any modification to the headers of the outgoing response will
result in a modification of the incoming request.
Tag fields are just copied from the incoming request.
Contact headers are removed from the incoming request.
Added by Jeff Keyser. Route headers are not added to the
response.
Parameters: statusCode - Status code for the response. Parameters: reasonPhrase - Reason phrase for this response. A Response with the status and reason supplied. throws: IllegalArgumentException - if some argument has an invalid value.
Encodes this into a byte array.
This is used when the body has been set as a binary array
and you want to encode the body as a byte array for transmission.
a byte array containing the Request encoded as a bytearray.
Sets the RequestURI of Request. The Request-URI is a SIP or
SIPS URI or a general URI. It indicates the user or service to which
this request is being addressed. SIP elements MAY support
Request-URIs with schemes other than "sip" and "sips", for
example the "tel" URI scheme. SIP elements MAY translate
non-SIP URIs using any mechanism at their disposal, resulting
in SIP URI, SIPS URI, or some other scheme.
Parameters: uri - the new Request URI of this request message