diff --git a/src/main/java/org/cafesip/sipunit/SipCall.java b/src/main/java/org/cafesip/sipunit/SipCall.java index 8cc57d5ee7..8ca8a081de 100644 --- a/src/main/java/org/cafesip/sipunit/SipCall.java +++ b/src/main/java/org/cafesip/sipunit/SipCall.java @@ -1,6 +1,6 @@ /* * Created on Feb 19, 2005 - * + * * Copyright 2005 CafeSip.org * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except @@ -58,10 +58,10 @@ * connection from the telephone network to the phone being called. For a SIP call, the outbound leg * is the User Agent originating the call and the inbound leg is the User Agent receiving the call. * For each call leg, a separate SipCall object must be used. - * + * *
* A SipCall object is created by calling SipPhone.createSipCall() or SipPhone.makeCall(). - * + * *
* Many of the methods in this class return an object or true return value if successful. In case of * an error or caller-specified timeout, a null object or a false is returned. The @@ -75,10 +75,10 @@ * indicating the cause of the problem. If an exception was involved, this string will contain the * name of the Exception class and the exception message. This class has a method, format(), which * can be called to obtain a human-readable string containing all of this error information. - * + * * @author George Vagenas * @author Amit Chatterjee, Becky McElroy - * + * */ public class SipCall implements SipActionObject, MessageListener { @@ -118,8 +118,8 @@ public class SipCall implements SipActionObject, MessageListener { /** * A constructor for this class. - * - * + * + * */ protected SipCall(SipPhone phone, Address myAddress) { this.parent = phone; @@ -179,12 +179,12 @@ public void disposeNoBye() { * Start listening for an ACK request. This is a non-blocking call. Starting from the time this * method is called, any received request(s) for this UA are collected. After calling this method, * you can call waitForAck() to process the first ACK received since calling this method. - * + * *
* NOTE: it's not necessary to call this method if a previous listenForXyz() method has been * called and request listening has NOT been turned off since (ie, method * stopListeningForRequests() hasn't been called). - * + * * @return true unless an error is encountered, in which case false is returned. */ public boolean listenForAck() { @@ -195,7 +195,7 @@ public boolean listenForAck() { * Start listening for a BYE request. This is a non-blocking call. Starting from the time this * method is called, any received request(s) for this UA are collected. After calling this method, * call waitForDisconnect() to process the first BYE received since calling this method. - * + * * @return true unless an error is encountered, in which case false is returned. */ public boolean listenForDisconnect() { @@ -206,7 +206,7 @@ public boolean listenForDisconnect() { * Start listening for an INVITE request. This is a non-blocking call. Starting from the time this * method is called, any received request(s) for this UA are collected. After calling this method, * call waitForIncomingCall() to process the first INVITE received since calling this method. - * + * * @return true unless an error is encountered, in which case false is returned. */ public boolean listenForIncomingCall() { @@ -217,7 +217,7 @@ public boolean listenForIncomingCall() { * Start listening for a RE-INVITE request. This is a non-blocking call. Starting from the time * this method is called, any received request(s) for this UA are collected. After calling this * method, call waitForReinvite() to process the first INVITE received since calling this method. - * + * * @return true unless an error is encountered, in which case false is returned. */ public boolean listenForReinvite() { @@ -228,7 +228,7 @@ public boolean listenForReinvite() { * Start listening for a MESSAGE request. This is a non-blocking call. Starting from the time this * method is called, any received request(s) for this UA are collected. After calling this method, * call waitForMESSAGE() to process the first MESSAGE received since calling this method. - * + * * @return true unless an error is encountered, in which case false is returned. */ public boolean listenForMessage() { @@ -240,10 +240,10 @@ public boolean listenForMessage() { * listenForXxx()/waitForXxx() methods, when no longer looking for an incoming request. IT IS * RECOMMENDED THAT THE CALLING PROGRAM STOP LISTENING FOR REQUESTS WHILE NONE ARE EXPECTED. * Otherwise alot of overhead is used up and wasted. - * + * *
* If there are any pending requests (received but not processed yet), those are discarded. - * + * * @return true unless an error is encountered, in which case false is returned. */ public boolean stopListeningForRequests() { @@ -259,7 +259,7 @@ public boolean stopListeningForRequests() { /** * The waitForDisconnect() method waits for a BYE request addressed to this user agent to be * received from the network. Call this method after calling the listenForDisconnect() method. - * + * *
* This method blocks until one of the following occurs: 1) A BYE request message has been * received, addressed to this user agent. In this case, a value of true is returned. The @@ -267,11 +267,11 @@ public boolean stopListeningForRequests() { * request. Use the method respondToDisconnect() for responding to the received BYE request. 2) * The wait timeout period specified by the parameter to this method expires. false is returned in * this case. 3) An error occurs. false is returned in this case. - * + * *
* Any non-BYE requests received for this user agent are collected while waiting for a BYE message * and can be seen by calling getAllReceivedRequests() once this method returns. - * + * *
* Regardless of the outcome, incoming requests associated with this User Agent will continue to * be queued up until the stopListeningForRequests() method is called. IT IS RECOMMENDED THAT THE @@ -280,7 +280,7 @@ public boolean stopListeningForRequests() { * this method) and until the stopListeningForRequests() method is called, the calling program can * continue to retrieve specific subsequently received requests by calling one of the waitForXxx() * methods. - * + * * @param timeout The maximum amount of time to wait, in milliseconds. Use a value of 0 to wait * indefinitely. * @return false in the case of wait timeout or error; call getReturnCode() and/or @@ -346,7 +346,7 @@ public boolean waitForDisconnect(long timeout) { /** * The waitForIncomingCall() method waits for an INVITE request addressed to this user agent to be * received from the network. Call this method after calling the listenForIncomingCall() method. - * + * *
* This method blocks until one of the following occurs: 1) An INVITE message has been received, * addressed to this user agent. In this case, a value of true is returned. The @@ -354,11 +354,11 @@ public boolean waitForDisconnect(long timeout) { * request. Use the method sendIncomingCallResponse() for responding to the received INVITE. 2) * The wait timeout period specified by the parameter to this method expires. False is returned in * this case. 3) An error occurs. False is returned in this case. - * + * *
* Any non-INVITE requests received for this user agent are collected while waiting for an INVITE * message and can be seen by calling getAllReceivedRequests() once this method returns. - * + * *
* Regardless of the outcome, incoming requests associated with this User Agent will continue to * be queued up until the stopListeningForRequests() method is called. IT IS RECOMMENDED THAT THE @@ -367,7 +367,7 @@ public boolean waitForDisconnect(long timeout) { * this method) and until the stopListeningForRequests() method is called, the calling program can * continue to retrieve specific subsequently received requests by calling one of the waitForXxx() * methods. - * + * * @param timeout The maximum amount of time to wait, in milliseconds. Use a value of 0 to wait * indefinitely. * @return false in the case of wait timeout or error; call getReturnCode() and/or @@ -446,18 +446,18 @@ public boolean waitForIncomingCall(long timeout) { * from the network. Prior to calling this method, any of the listenForXyz() methods must have * already been called to turn on request listening. You can call this method to wait for any kind * of ACK (invite, re-invite...). - * + * *
* This method blocks until one of the following occurs: 1) An ACK request message has been * received, addressed to this user agent. In this case, a value of true is returned. The * getLastReceivedRequest() method can be called to get information about the received ACK * request. 2) The wait timeout period specified by the parameter to this method expires. false is * returned in this case. 3) An error occurs. false is returned in this case. - * + * *
* Any non-ACK requests received for this user agent are collected while waiting for an ACK * message and can be seen by calling getAllReceivedRequests() once this method returns. - * + * *
* Regardless of the outcome, incoming requests associated with this User Agent will continue to * be queued up until the stopListeningForRequests() method is called. IT IS RECOMMENDED THAT THE @@ -466,7 +466,7 @@ public boolean waitForIncomingCall(long timeout) { * this or other 'wait' methods) and until the stopListeningForRequests() method is called, the * calling program can continue to retrieve specific subsequently received requests by calling one * of the waitForXxx() methods. - * + * * @param timeout The maximum amount of time to wait, in milliseconds. Use a value of 0 to wait * indefinitely. * @return false in the case of wait timeout or error; call getReturnCode() and/or @@ -527,18 +527,18 @@ public boolean waitForAck(long timeout) { * The waitForMessage() method waits for a MESSAGE request addressed to this user agent to be * received from the network. Prior to calling this method, any of the listenForXyz() methods must * have already been called to turn on request listening. - * + * *
* This method blocks until one of the following occurs: 1) A MESSAGE request message has been * received, addressed to this user agent. In this case, a value of true is returned. The * getLastReceivedRequest() method can be called to get information about the received MESSAGE * request. 2) The wait timeout period specified by the parameter to this method expires. false is * returned in this case. 3) An error occurs. false is returned in this case. - * + * *
* Any non-MESSAGE requests received for this user agent are collected while waiting for an * MESSAGE message and can be seen by calling getAllReceivedRequests() once this method returns. - * + * *
* Regardless of the outcome, incoming requests associated with this User Agent will continue to * be queued up until the stopListeningForRequests() method is called. IT IS RECOMMENDED THAT THE @@ -547,7 +547,7 @@ public boolean waitForAck(long timeout) { * this or other 'wait' methods) and until the stopListeningForRequests() method is called, the * calling program can continue to retrieve specific subsequently received requests by calling one * of the waitForXxx() methods. - * + * * @param timeout The maximum amount of time to wait, in milliseconds. Use a value of 0 to wait * indefinitely. * @return false in the case of wait timeout or error; call getReturnCode() and/or @@ -631,7 +631,7 @@ public boolean waitForMessage(long timeout) { * constructed based on the parameters passed in. Call this method after waitForMessage() returns * true. Call this method multiple times to send multiple responses to the received MESSAGE. The * MESSAGE being responded to must be the last received request on this SipCall. - * + * * @param statusCode The status code of the response to send (may use SipResponse constants). * @param reasonPhrase If not null, the reason phrase to send. * @param expires If not -1, an expiration time is added to the response. This parameter indicates @@ -646,10 +646,10 @@ public boolean sendMessageResponse(int statusCode, String reasonPhrase, int expi * This method is the same as the basic sendMessageResponse() method except that it allows the * caller to specify a message body and/or additional JAIN-SIP API message headers to add to or * replace in the outbound message. Use of this method requires knowledge of the JAIN-SIP API. - * + * *
* The extra parameters supported by this method are: - * + * * @param body A String to be used as the body of the message. The additionalHeaders parameter * must contain a ContentTypeHeader for this body to be included in the message. Use null * for no body bytes. @@ -664,10 +664,10 @@ public boolean sendMessageResponse(int statusCode, String reasonPhrase, int expi * This method is the same as the basic sendMessageResponse() method except that it allows the * caller to specify a message body and/or additional JAIN-SIP API message headers to add to or * replace in the outbound message. Use of this method requires knowledge of the JAIN-SIP API. - * + * *
* The extra parameters supported by this method are: - * + * * @param additionalHeaders ArrayList of javax.sip.header.Header, each element a SIP header to add * to the outbound message. These headers are added to the message after a correct message * has been constructed. Note that if you try to add a header that there is only supposed @@ -727,15 +727,15 @@ public boolean sendMessageResponse(int statusCode, String reasonPhrase, int expi /** * This basic method is used to initiate an outgoing MESSAGE. - * + * *
* This method returns when the request message has been sent out. Your calling program must * subsequently call the waitOutgoingMessageResponse() method (one or more times) to get the * result(s). - * + * *
* If a DIALOG exists the method will use it to send the MESSAGE - * + * * @param toUri The URI (sip:bob@nist.gov) to which the message should be directed * @param viaNonProxyRoute Indicates whether to route the MESSAGE via Proxy or some other route. * If null, route the call to the Proxy that was specified when the SipPhone object was @@ -750,13 +750,13 @@ public boolean initiateOutgoingMessage(String toUri, String viaNonProxyRoute) { /** * This method is the same as the basic initiateOutgoingMessage() method except that it allows the * caller to specify a message body. - * + * *
* If a DIALOG exists the method will use it to send the MESSAGE - * + * *
* The extra parameters supported by this method are: - * + * * @param body A String to be used as the body of the message. The additionalHeaders parameter * must contain a ContentTypeHeader for this body to be included in the message. Use null * for no body bytes. @@ -770,11 +770,11 @@ public boolean initiateOutgoingMessage(String toUri, String viaNonProxyRoute, St * This method is the same as the basic initiateOutgoingMessage() method except that it allows the * caller to specify a from URI and/or additional JAIN-SIP API message headers to add to or * replace in the outbound message. Use of this method requires knowledge of the JAIN-SIP API. - * + * * If a DIALOG exists the method will use it to send the MESSAGE - * + * * The extra parameters supported by this method are: - * + * * @param fromUri An URI string (ex: sip:bob@192.0.2.4), or null to use the default 'from' address * (me) specified when the SipPhone object was created (SipStack.createSipPhone()). * @param additionalHeaders ArrayList of javax.sip.header.Header, each element a SIP header to add @@ -899,22 +899,22 @@ public boolean initiateOutgoingMessage(String fromUri, String toUri, String viaN /** * The waitOutgoingMessageResponse() method waits for a response to be received from the network * for a sent MESSAGE. Call this method after calling initiateOutgoingMessage(). - * + * *
* This method blocks until one of the following occurs: 1) A response message has been received. * In this case, a value of true is returned. Call the getLastReceivedResponse() method to get the * response details. - * + * *
* Regardless of the outcome, getReturnCode() can be called after this method returns to get the * status code: IE, the SIP response code received from the network (defined in SipResponse, along * with the corresponding textual equivalent) or a SipUnit internal status/return code (defined in * SipSession, along with the corresponding textual equivalent). SipUnit internal codes are in a * specially designated range (SipSession.SIPUNIT_INTERNAL_RETURNCODE_MIN and upward). - * + * *
* This method can be called repeatedly to get each subsequently received response. - * + * * @param timeout The maximum amount of time to wait, in milliseconds. Use a value of 0 to wait * indefinitely. * @return true if a response was received - in that case, call getReturnCode() to get the status @@ -975,7 +975,7 @@ public boolean waitOutgoingMessageResponse(long timeout) { * constructed based on the parameters passed in. Call this method after waitForIncomingCall() * returns true. Call this method multiple times to send multiple responses to the received * INVITE. The INVITE being responded to must be the last received request on this SipCall. - * + * * @param statusCode The status code of the response to send (may use SipResponse constants). * @param reasonPhrase If not null, the reason phrase to send. * @param expires If not -1, an expiration time is added to the response. This parameter indicates @@ -990,10 +990,10 @@ public boolean sendIncomingCallResponse(int statusCode, String reasonPhrase, int * This method is the same as the basic sendIncomingCallResponse() method except that it allows * the caller to specify a message body and/or additional JAIN-SIP API message headers to add to * or replace in the outbound message. Use of this method requires knowledge of the JAIN-SIP API. - * + * *
* The extra parameters supported by this method are: - * + * * @param additionalHeaders ArrayList of javax.sip.header.Header, each element a SIP header to add * to the outbound message. These headers are added to the message after a correct message * has been constructed. Note that if you try to add a header that there is only supposed @@ -1038,10 +1038,10 @@ public boolean sendIncomingCallResponse(int statusCode, String reasonPhrase, int * This method is the same as the basic sendIncomingCallResponse() method except that it allows * the caller to specify a message body and/or additional message headers to add to or replace in * the outbound message without requiring knowledge of the JAIN-SIP API. - * + * *
* The extra parameters supported by this method are:
- *
+ *
* @param body A String to be used as the body of the message. Parameters contentType,
* contentSubType must both be non-null to get the body included in the message. Use null
* for no body bytes.
@@ -1067,7 +1067,7 @@ public boolean sendIncomingCallResponse(int statusCode, String reasonPhrase, int
* occur if your headers are not syntactically correct or contain nonsensical values (the
* message may not pass through the local SIP stack). Use null for no replacement of
* message headers.
- *
+ *
*/
public boolean sendIncomingCallResponse(int statusCode, String reasonPhrase, int expires,
String body, String contentType, String contentSubType, ArrayList
* This method blocks until one of the following occurs: 1) An INVITE message has been received on
* the current dialog. In this case, a non-null SipTransaction object is returned. The
@@ -1096,11 +1096,11 @@ public boolean sendIncomingCallResponse(int statusCode, String reasonPhrase, int
* the method respondToReinvite() for sending a response to the received RE-INVITE. 2) The wait
* timeout period specified by the parameter to this method expires. Null is returned in this
* case. 3) An error occurs. Null is returned in this case.
- *
+ *
*
* Any non-INVITE requests received for this user agent are collected while waiting for the
* RE-INVITE message and can be seen by calling getAllReceivedRequests() once this method returns.
- *
+ *
* @param timeout The maximum amount of time to wait, in milliseconds. Use a value of 0 to wait
* indefinitely.
* @return null in the case of wait timeout or error; call getReturnCode() and/or
@@ -1174,7 +1174,7 @@ public SipTransaction waitForReinvite(long timeout) {
* This method sends a basic response to a previously received RE-INVITE request. The response is
* constructed based on the parameters passed in. Call this method after waitForReinvite() returns
* non-null. Call this method multiple times to send multiple responses to the received RE-INVITE.
- *
+ *
* @param siptrans This is the object that was returned by method waitForReinvite(). It identifies
* a specific RE-INVITE transaction.
* @param statusCode The status code of the response to send (may use SipResponse constants).
@@ -1206,10 +1206,10 @@ public boolean respondToReinvite(SipTransaction siptrans, int statusCode, String
* This method is the same as the basic respondToReinvite() plus it additionally allows the caller
* to specify additional message headers to add to or replace in the response message without
* requiring knowledge of the JAIN-SIP API.
- *
+ *
*
* Additional parameters handled by this method include:
- *
+ *
* @param additionalHeaders ArrayList of String, each element representing a SIP message header to
* add to the outbound message. Examples: "Priority: Urgent", "Max-Forwards: 10". These
* headers are added to the message after a correct message has been constructed. Note that
@@ -1219,7 +1219,7 @@ public boolean respondToReinvite(SipTransaction siptrans, int statusCode, String
* you want to replace the existing header with your own. Unpredictable results may occur
* if your headers are not syntactically correct or contain nonsensical values (the message
* may not pass through the local SIP stack). Use null for no additional message headers.
- *
+ *
* @param replaceHeaders ArrayList of String, each element representing a SIP message header to
* add to the outbound message, replacing existing header(s) of that type if present in the
* message. Examples: "Priority: Urgent", "Max-Forwards: 10". These headers are applied to
@@ -1227,7 +1227,7 @@ public boolean respondToReinvite(SipTransaction siptrans, int statusCode, String
* occur if your headers are not syntactically correct or contain nonsensical values (the
* message may not pass through the local SIP stack). Use null for no replacement of
* message headers.
- *
+ *
* @return true if the response was successfully sent, false otherwise.
*/
public boolean respondToReinvite(SipTransaction siptrans, int statusCode, String reasonPhrase,
@@ -1251,14 +1251,14 @@ public boolean respondToReinvite(SipTransaction siptrans, int statusCode, String
* This method is equivalent to the basic respondToReinvite() method except that it allows the
* caller to specify additional JAIN-SIP API message headers to add to or replace in the outbound
* message. Use of this method requires knowledge of the JAIN-SIP API.
- *
+ *
*
* NOTE: The additionalHeaders parameter passed to this method must contain a ContentTypeHeader in
* order for a body to be included in the message.
- *
+ *
*
* The extra parameters supported by this method are:
- *
+ *
* @param additionalHeaders ArrayList of javax.sip.header.Header, each element a SIP header to add
* to the outbound message. These headers are added to the message after a correct message
* has been constructed. Note that if you try to add a header that there is only supposed
@@ -1266,12 +1266,12 @@ public boolean respondToReinvite(SipTransaction siptrans, int statusCode, String
* for that header, then this header addition attempt will be ignored. Use the
* 'replaceHeaders' parameter instead if you want to replace the existing header with your
* own. Use null for no additional message headers.
- *
+ *
* @param replaceHeaders ArrayList of javax.sip.header.Header, each element a SIP header to add to
* the outbound message, replacing existing header(s) of that type if present in the
* message. These headers are applied to the message after a correct message has been
* constructed. Use null for no replacement of message headers.
- *
+ *
* @return true if the response was successfully sent, false otherwise.
*/
public boolean respondToReinvite(SipTransaction siptrans, int statusCode, String reasonPhrase,
@@ -1316,7 +1316,7 @@ public boolean respondToReinvite(SipTransaction siptrans, int statusCode, String
* constructed using a status code of OK. Call this method after waitForDisconnect() returns true.
* Call this method multiple times to send multiple OK responses to the received BYE. The BYE
* being responded to must be the last received request on this SipCall.
- *
+ *
* @return true if the response was successfully sent, false otherwise.
*/
public boolean respondToDisconnect() {
@@ -1326,7 +1326,7 @@ public boolean respondToDisconnect() {
/**
* This method is the same as the basic respondToDisconnect() method except that it uses the given
* parameters for the status code and reason in the response message sent out.
- *
+ *
* @param statusCode The integer status code to use (ie, SipResponse.OK).
* @param reasonPhrase The String reason phrase to use.
* @return true if the response was successfully sent, false otherwise.
@@ -1349,10 +1349,10 @@ public boolean respondToDisconnect(int statusCode, String reasonPhrase) {
* parameters for the status code and reason in the response message sent out and allows the
* caller to specify a message body and/or additional JAIN-SIP API message headers to add to or
* replace in the outbound message. Use of this method requires knowledge of the JAIN-SIP API.
- *
+ *
*
* The extra parameters supported by this method are:
- *
+ *
* @param statusCode The integer status code to use (ie, SipResponse.OK).
* @param reasonPhrase The String reason phrase to use.
* @param additionalHeaders ArrayList of javax.sip.header.Header, each element a SIP header to add
@@ -1390,10 +1390,10 @@ public boolean respondToDisconnect(int statusCode, String reasonPhrase,
* parameters for the status code and reason in the response message sent out and allows the
* caller to specify a message body and/or additional message headers to add to or replace in the
* outbound message without requiring knowledge of the JAIN-SIP API.
- *
+ *
*
* The extra parameters supported by this method are:
- *
+ *
* @param statusCode The integer status code to use (ie, SipResponse.OK).
* @param reasonPhrase The String reason phrase to use.
* @param body A String to be used as the body of the message. Parameters contentType,
@@ -1421,7 +1421,7 @@ public boolean respondToDisconnect(int statusCode, String reasonPhrase,
* occur if your headers are not syntactically correct or contain nonsensical values (the
* message may not pass through the local SIP stack). Use null for no replacement of
* message headers.
- *
+ *
*/
public boolean respondToDisconnect(int statusCode, String reasonPhrase, String body,
String contentType, String contentSubType, ArrayList
* This method returns when the request message has been sent out. Your calling program must
* subsequently call the waitOutgoingCallResponse() method (one or more times) to get the
* result(s), and optionally at some point, waitForAnswer() if you're no longer interested in
* processing intermediate responses.
- *
+ *
* @param fromUri An URI string (ex: sip:bob@192.0.2.4), or null to use the default 'from' address
* (me) specified when the SipPhone object was created (SipStack.createSipPhone()).
* @param toUri The URI (sip:bob@nist.gov) to which the call should be directed
@@ -1472,10 +1472,10 @@ public boolean initiateOutgoingCall(String fromUri, String toUri, String viaNonP
* This method is the same as the basic initiateOutgoingCall() method except that it allows the
* caller to specify a message body and/or additional JAIN-SIP API message headers to add to or
* replace in the outbound message. Use of this method requires knowledge of the JAIN-SIP API.
- *
+ *
*
* The extra parameters supported by this method are:
- *
+ *
* @param additionalHeaders ArrayList of javax.sip.header.Header, each element a SIP header to add
* to the outbound message. These headers are added to the message after a correct message
* has been constructed. Note that if you try to add a header that there is only supposed
@@ -1501,10 +1501,10 @@ public boolean initiateOutgoingCall(String fromUri, String toUri, String viaNonP
* This method is the same as the basic initiateOugoingCall() method except that it allows the
* caller to specify a message body and/or additional message headers to add to or replace in the
* outbound message without requiring knowledge of the JAIN-SIP API.
- *
+ *
*
* The extra parameters supported by this method are:
- *
+ *
* @param body A String to be used as the body of the message. Parameters contentType,
* contentSubType must both be non-null to get the body included in the message. Use null
* for no body bytes.
@@ -1530,7 +1530,7 @@ public boolean initiateOutgoingCall(String fromUri, String toUri, String viaNonP
* occur if your headers are not syntactically correct or contain nonsensical values (the
* message may not pass through the local SIP stack). Use null for no replacement of
* message headers.
- *
+ *
*/
public boolean initiateOutgoingCall(String fromUri, String toUri, String viaNonProxyRoute,
String body, String contentType, String contentSubType, ArrayList
* Knowledge of the JAIN-SIP API is required to use this method.
- *
+ *
*
* This method returns when the request message has been sent out. The calling program must
* subsequently call the waitOutgoingCallResponse() method (one or more times) to get the
* result(s), and optionally at some point, waitForAnswer() if you're no longer interested in
* processing intermediate responses.
- *
+ *
* @param msg The Request message to resend. The CSEQ number will be incremented by this method,
* otherwise the request is sent as is.
- *
+ *
* @return true if the message was successfully sent, false otherwise.
*/
protected boolean reInitiateOutgoingCall(Request msg) {
@@ -1741,7 +1755,7 @@ protected boolean reInitiateOutgoingCall(Request msg, MessageListener respListen
* subsequently call the waitReinviteResponse() method (one or more times) to get the response(s)
* and perhaps the sendReinviteOkAck() method to send an ACK. On the receive side, pertinent
* methods include waitForReinvite(), respondToReinvite(), and waitForAck().
- *
+ *
* @param newContact An URI string (ex: sip:bob@192.0.2.4:5093) for updating the remote target URI
* kept by the far end (target refresh), or null to not change that information.
* @param displayName Display name to set in the contact header sent to the far end if newContact
@@ -1768,12 +1782,12 @@ public SipTransaction sendReinvite(String newContact, String displayName, String
* This method is equivalent to the basic sendReinvite() method except that it allows the caller
* to specify additional JAIN-SIP API message headers to add to or replace in the outbound
* message. Use of this method requires knowledge of the JAIN-SIP API.
- *
+ *
* NOTE: The additionalHeaders parameter passed to this method must contain a ContentTypeHeader in
* order for a body to be included in the message.
- *
+ *
* The extra parameters supported by this method are:
- *
+ *
* @param additionalHeaders ArrayList of javax.sip.header.Header, each element a SIP header to add
* to the outbound message. These headers are added to the message after a correct message
* has been constructed. Note that if you try to add a header that there is only supposed
@@ -1781,12 +1795,12 @@ public SipTransaction sendReinvite(String newContact, String displayName, String
* for that header, then this header addition attempt will be ignored. Use the
* 'replaceHeaders' parameter instead if you want to replace the existing header with your
* own. Use null for no additional message headers.
- *
+ *
* @param replaceHeaders ArrayList of javax.sip.header.Header, each element a SIP header to add to
* the outbound message, replacing existing header(s) of that type if present in the
* message. These headers are applied to the message after a correct message has been
* constructed. Use null for no replacement of message headers.
- *
+ *
* @return A SipTransaction object if the message was successfully sent, null otherwise. You don't
* need to anything with this returned object other than to pass it to methods that you
* call subsequently for this operation, namely waitReinviteResponse() and
@@ -1851,10 +1865,10 @@ public SipTransaction sendReinvite(String newContact, String displayName,
* This method is the same as the basic sendReinvite() method except that it allows the caller to
* specify additional message headers to add to or replace in the outbound message without
* requiring knowledge of the JAIN-SIP API.
- *
+ *
*
* The extra parameters supported by this method are:
- *
+ *
* @param additionalHeaders ArrayList of String, each element representing a SIP message header to
* add to the outbound message. Examples: "Priority: Urgent", "Max-Forwards: 10". These
* headers are added to the message after a correct message has been constructed. Note that
@@ -1871,7 +1885,7 @@ public SipTransaction sendReinvite(String newContact, String displayName,
* occur if your headers are not syntactically correct or contain nonsensical values (the
* message may not pass through the local SIP stack). Use null for no replacement of
* message headers.
- *
+ *
* @return A SipTransaction object if the message was successfully sent, null otherwise. You don't
* need to anything with this returned object other than to pass it to methods that you
* call subsequently for this operation, namely waitReinviteResponse() and
@@ -1895,7 +1909,7 @@ public SipTransaction sendReinvite(String newContact, String displayName, String
/**
* This method sends a basic ACK in response to an OK received in response to a sent INVITE.
- *
+ *
* @return true if the message was successfully sent, false otherwise.
*/
public boolean sendInviteOkAck() {
@@ -1906,10 +1920,10 @@ public boolean sendInviteOkAck() {
* This method is the same as the basic sendInviteOkAck() method except that it allows the caller
* to specify a message body and/or additional JAIN-SIP API message headers to add to or replace
* in the outbound message. Use of this method requires knowledge of the JAIN-SIP API.
- *
+ *
*
* The extra parameters supported by this method are:
- *
+ *
* @param additionalHeaders ArrayList of javax.sip.header.Header, each element a SIP header to add
* to the outbound message. These headers are added to the message after a correct message
* has been constructed. Note that if you try to add a header that there is only supposed
@@ -1976,10 +1990,10 @@ public boolean sendInviteOkAck(ArrayList
* The extra parameters supported by this method are:
- *
+ *
* @param body A String to be used as the body of the message. Parameters contentType,
* contentSubType must both be non-null to get the body included in the message. Use null
* for no body bytes.
@@ -2005,7 +2019,7 @@ public boolean sendInviteOkAck(ArrayList
* The extra parameters supported by this method are:
- *
+ *
* @param additionalHeaders ArrayList of javax.sip.header.Header, each element a SIP header to add
* to the outbound message. These headers are added to the message after a correct message
* has been constructed. Note that if you try to add a header that there is only supposed
@@ -2091,10 +2105,10 @@ public boolean sendReinviteOkAck(SipTransaction siptrans, ArrayList
* The extra parameters supported by this method are:
- *
+ *
* @param body A String to be used as the body of the message. Parameters contentType,
* contentSubType must both be non-null to get the body included in the message. Use null
* for no body bytes.
@@ -2120,7 +2134,7 @@ public boolean sendReinviteOkAck(SipTransaction siptrans, ArrayList
* This method blocks until one of the following occurs: 1) A response message has been received.
* In this case, a value of true is returned. Call the getLastReceivedResponse() method to get the
* response details. Use the method sendInviteOkAck() for responding to an OK. 2) A timeout
* occurs. A false value is returned in this case. 3) An error occurs. False is returned in this
* case.
- *
+ *
*
* Regardless of the outcome, getReturnCode() can be called after this method returns to get the
* status code: IE, the SIP response code received from the network (defined in SipResponse, along
* with the corresponding textual equivalent) or a SipUnit internal status/return code (defined in
* SipSession, along with the corresponding textual equivalent). SipUnit internal codes are in a
* specially designated range (SipSession.SIPUNIT_INTERNAL_RETURNCODE_MIN and upward).
- *
+ *
*
* This method can be called repeatedly to get each subsequently received response.
- *
+ *
* @param timeout The maximum amount of time to wait, in milliseconds. Use a value of 0 to wait
* indefinitely.
* @return true if a response was received - in that case, call getReturnCode() to get the status
@@ -2229,25 +2243,25 @@ public boolean waitOutgoingCallResponse(long timeout) {
/**
* The waitReinviteResponse() method waits for a response to be received from the network for a
* sent RE-INVITE. Call this method after calling sendReinvite().
- *
+ *
*
* This method blocks until one of the following occurs: 1) A response message has been received.
* In this case, a value of true is returned. Call the getLastReceivedResponse() method to get the
* response details. Use the method sendReinviteOkAck() for responding to an OK. 2) A timeout
* occurs. A false value is returned in this case. 3) An error occurs. False is returned in this
* case.
- *
+ *
*
* Regardless of the outcome, getReturnCode() can be called after this method returns to get the
* status code: IE, the SIP response code received from the network (defined in SipResponse, along
* with the corresponding textual equivalent) or a SipUnit internal status/error code (defined in
* SipSession, along with the corresponding textual equivalent). SipUnit internal codes are in a
* specially designated range (SipSession.SIPUNIT_INTERNAL_RETURNCODE_MIN and upward).
- *
+ *
*
* This method can be called repeatedly to get each subsequently received response for this
* particular RE-INVITE transaction.
- *
+ *
* @param siptrans This is the object that was returned by method sendReinvite(). It identifies a
* specific RE-INVITE transaction.
* @param timeout The maximum amount of time to wait, in milliseconds. Use a value of 0 to wait
@@ -2294,7 +2308,7 @@ public boolean waitReinviteResponse(SipTransaction siptrans, long timeout) {
* This method sends a basic BYE message. It incorporates required authorization headers that have
* previously been accumulated during the call. This SipCall object will handle an authentication
* request received in response to the BYE.
- *
+ *
* @return true if the message was successfully sent, false otherwise.
*/
public boolean disconnect() {
@@ -2305,10 +2319,10 @@ public boolean disconnect() {
* This method is the same as the basic disconnect() method except that it allows the caller to
* specify a message body and/or additional JAIN-SIP API message headers to add to or replace in
* the outbound message. Use of this method requires knowledge of the JAIN-SIP API.
- *
+ *
*
* The extra parameters supported by this method are:
- *
+ *
* @param additionalHeaders ArrayList of javax.sip.header.Header, each element a SIP header to add
* to the outbound message. These headers are added to the message after a correct message
* has been constructed. Note that if you try to add a header that there is only supposed
@@ -2370,10 +2384,10 @@ public boolean disconnect(ArrayList
* The extra parameters supported by this method are:
- *
+ *
* @param body A String to be used as the body of the message. Parameters contentType,
* contentSubType must both be non-null to get the body included in the message. Use null
* for no body bytes.
@@ -2399,7 +2413,7 @@ public boolean disconnect(ArrayList
* See also SipCall methods getAllReceivedResponses(), findMostRecentResponse(statuscode).
- *
+ *
* @return A SipResponse object representing the last response message received on this call, or
* null if none has been received.
- *
+ *
*/
public SipResponse getLastReceivedResponse() {
synchronized (receivedResponses) {
@@ -2555,13 +2569,13 @@ public SipResponse getLastReceivedResponse() {
/**
* Gets the last request received on this call.
- *
+ *
*
* See also SipCall method getAllReceivedRequests().
- *
+ *
* @return A SipRequest object representing the last request message received on this call, or
* null if none has been received.
- *
+ *
*/
public SipRequest getLastReceivedRequest() {
synchronized (receivedRequests) {
@@ -2576,10 +2590,10 @@ public SipRequest getLastReceivedRequest() {
/**
* Gets all the responses received on this call, including any that required re-initiation of the
* call (ie, authentication challenge).
- *
+ *
*
* See also SipCall methods getLastReceivedResponse(), findMostRecentResponse(statuscode).
- *
+ *
* @return ArrayList of zero or more SipResponse objects.
*/
public ArrayList
* See also SipCall method getLastReceivedRequest().
- *
+ *
* @return ArrayList of zero or more SipRequest objects.
*/
public ArrayList
* Call this method after calling SipPhone.makeCall() or SipCall.initiateOutgoingCall().
- *
+ *
*
* If OK has already been received for this call, this method returns immediately. Otherwise, this
* method blocks until one of the following occurs: 1) An OK response message is received. In this
@@ -2848,14 +2862,14 @@ public boolean callTimeoutOrError() {
* occurs. A false value is returned in this case. 3) An error occurs. False is returned in this
* case. 4) A final response other than OK is received. False is returned in this case. See
* details below for what to do when false is returned.
- *
+ *
*
* Regardless of the outcome, getReturnCode() can be called after this method returns to get the
* status code: IE, the SIP response code received from the network (defined in SipResponse, along
* with the corresponding textual equivalent) or a SipUnit internal status/return code (defined in
* SipSession, along with the corresponding textual equivalent). SipUnit internal codes are in a
* specially designated range (SipSession.SIPUNIT_INTERNAL_RETURNCODE_MIN and upward).
- *
+ *
* @param timeout The maximum amount of time to wait, in milliseconds. Use a value of 0 to wait
* indefinitely.
* @return true if an OK response was received - call getLastReceivedResponse() to see the OK
@@ -2918,12 +2932,12 @@ public boolean waitForAnswer(long timeout) {
* The waitForAuthorisation() method waits for answer(401/407) to be received from the network. It
* ignores provisional responses, but will stop and return false on any progress/ringing response.
* If an authorisation request is received, a response will be sent and a success returned.
- *
+ *
*
* This method will block until any non-provisional message is received.
- *
+ *
*
- *
+ *
* @param timeout The maximum amount of time to wait for each message, in milliseconds. Use a
* value of 0 to wait indefinitely.
* @return true if an authorisation challenge was received and was handled successfully. false, if
@@ -2966,7 +2980,7 @@ public boolean waitForAuthorisation(long timeout) {
/**
* Finds the last received response with status code matching the given parameter.
- *
+ *
* @param statusCode Indicates the type of response to return.
* @return SipResponse object or null, if not found.
*/
@@ -2986,13 +3000,13 @@ public SipResponse findMostRecentResponse(int statusCode) {
/**
* Sends a basic CANCEL in a new transaction on the current dialog.
- *
+ *
*
* This method returns when the request message has been sent out. The calling program must
* subsequently call the waitForCancelResponse() method (one or more times) to get the
* response(s). On the receive side, pertinent methods include listenForCancel, waitForCancel()
* and respondToCancel().
- *
+ *
* @return A SipTransaction object if the message was successfully sent, null otherwise. You don't
* need to do anything with this returned object other than to pass it to methods that you
* call subsequently for this operation, namely waitForCancelResponse().
@@ -3005,10 +3019,10 @@ public SipTransaction sendCancel() {
* This method is equivalent to the basic sendCancel() method except that it allows the caller to
* specify a message body and/or additional JAIN-SIP API message headers to add to or replace in
* the outbound message. Use of this method requires knowledge of the JAIN-SIP API.
- *
+ *
*
* The extra parameters supported by this method are:
- *
+ *
* @param additionalHeaders ArrayList of javax.sip.header.Header, each element a SIP header to add
* to the outbound message. These headers are added to the message after a correct message
* has been constructed. Note that if you try to add a header that there is only supposed
@@ -3081,9 +3095,9 @@ public SipTransaction sendCancel(ArrayList
* Any non-CANCEL requests or unmatched CANCEL requests received for this user agent are collected
* while waiting for the CANCEL message and can be seen by calling getAllReceivedRequests().
- *
+ *
* @param timeout The maximum amount of time to wait, in milliseconds. Use a value of 0 to wait
* indefinitely.
* @return null in the case of wait timeout or error; call getReturnCode() and/or
@@ -3243,7 +3257,7 @@ public SipTransaction waitForCancel(long timeout) {
* This method sends a basic response to a previously received CANCEL request. The response is
* constructed based on the parameters passed in. Call this method after waitForCancel() returns
* non-null. Call this method multiple times to send multiple responses to the received CANCEL.
- *
+ *
* @param siptrans This is the object that was returned by method waitForCancel(). It identifies a
* specific CANCEL transaction.
* @param statusCode The status code of the response to send (may use SipResponse constants).
@@ -3261,14 +3275,14 @@ public boolean respondToCancel(SipTransaction siptrans, int statusCode, String r
* This method is equivalent to the basic respondToCancel() method except that it allows the
* caller to specify a message body and/or additional JAIN-SIP API message headers to add to or
* replace in the outbound message. Use of this method requires knowledge of the JAIN-SIP API.
- *
+ *
*
* NOTE: The additionalHeaders parameter passed to this method must contain a ContentTypeHeader in
* order for a body to be included in the message.
- *
+ *
*
* The extra parameters supported by this method are:
- *
+ *
* @param additionalHeaders ArrayList of javax.sip.header.Header, each element a SIP header to add
* to the outbound message. These headers are added to the message after a correct message
* has been constructed. Note that if you try to add a header that there is only supposed
@@ -3283,7 +3297,7 @@ public boolean respondToCancel(SipTransaction siptrans, int statusCode, String r
* @param body A String to be used as the body of the message. The additionalHeaders parameter
* must contain a ContentTypeHeader for this body to be included in the message. Use null
* for no body bytes.
- *
+ *
* @return true if the response was successfully sent, false otherwise.
*/
public boolean respondToCancel(SipTransaction siptrans, int statusCode, String reasonPhrase,
@@ -3315,9 +3329,9 @@ public boolean respondToCancel(SipTransaction siptrans, int statusCode, String r
* This method is equivalent to the basic respondToCancel() method except that it allows the
* caller to specify a message body and/or additional JAIN-SIP API message headers to add to or
* replace in the outbound message without requiring knowledge of the JAIN-SIP API.
- *
+ *
* The extra parameters supported by this method are:
- *
+ *
* @param body A String to be used as the body of the message. Parameters contentType,
* contentSubType must both be non-null to get the body included in the message. Use null
* for no body bytes.
@@ -3343,7 +3357,7 @@ public boolean respondToCancel(SipTransaction siptrans, int statusCode, String r
* occur if your headers are not syntactically correct or contain nonsensical values (the
* message may not pass through the local SIP stack). Use null for no replacement of
* message headers.
- *
+ *
* @return true if the response was successfully sent, false otherwise.
*/
public boolean respondToCancel(SipTransaction siptrans, int statusCode, String reasonPhrase,
@@ -3376,7 +3390,7 @@ public boolean respondToCancel(SipTransaction siptrans, int statusCode, String r
* SipSession, along with the corresponding textual equivalent). SipUnit internal codes are in a
* specially designated range (SipSession.SIPUNIT_INTERNAL_RETURNCODE_MIN and upward).
*
- *
+ *
* @param siptrans This is the object that was returned by method sendCancel(). It identifies a
* specific Cancel transaction.
* @param timeout The maximum amount of time to wait, in milliseconds. Use a value of 0 to wait
@@ -3421,7 +3435,7 @@ public boolean waitForCancelResponse(SipTransaction siptrans, long timeout) {
/**
* Gets the SIP Call ID for this incoming or outgoing call.
- *
+ *
* @return Returns the callId.
*/
public String getCallId() {