Rel100Exception – Protocol-Specific Exception
The Rel100Exception class represents an exception that is thrown when an application attempts to send a provisional response reliably or create a PRACK request on a non-reliable provisional response, and the operation fails due to conditions outlined in RFC 3262. This class extends ServletException and serves as a specific indicator for issues related to the reliable provisional response mechanism (100rel extension).
- The exception is triggered under the following scenarios:
- The status code of the provisional response is not in the range of 101-199.
- The original request was not an INVITE.
- The User Agent Client (UAC) did not indicate support for the 100rel extension in the request.
- The container does not support the 100rel extension.
Additionally, this exception is raised when the SipServletResponse.createPrack() method is called on a non-reliable provisional response, a final response, or when the original request was not an INVITE.
The reason for the failure can be obtained using the getReason() method, providing you with details to understand and address the issue. This class plays a critical role in ensuring that applications comply with SIP reliability rules when using the 100rel extension.
Fields:
NOT_1XX
public static final int NOT_1XX
This constant represents a reason code indicating that the SipServletResponse.sendReliably() or SipServletResponse.createPrack() method was invoked on a final response or a 100 Trying response. These operations are invalid because reliable provisional responses are only applicable for status codes in the range of 101-199.
By providing this specific code, the container can indicate that the issue lies in attempting to use reliability mechanisms on an unsupported response type.
NOT_INVITE
public static final int NOT_INVITE
This constant represents a reason code indicating that SipServletResponse.sendReliably() or SipServletResponse.createPrack() was called for a response associated with a non-INVITE request. Reliable provisional responses are only applicable to requests of the INVITE method, as per RFC 3262.
By using this reason code, the container clarifies that the operation failed due to an invalid request type for reliable response handling.
NO_REQ_SUPPORT
public static final int NO_REQ_SUPPORT
This constant represents a reason code indicating that the User Agent Client (UAC) did not declare support for the reliable responses extension (100rel) in its request. Reliable provisional responses, as defined in RFC 3262, require the UAC to explicitly indicate support for this extension, typically through the Supported or Require headers.
This code is used to explain the failure of methods like SipServletResponse.sendReliably() or SipServletResponse.createPrack() when the UAC does not meet this condition.
NOT_SUPPORTED
public static final int NOT_SUPPORTED
This constant represents a reason code indicating that the SIP container does not support the reliable provisional response mechanism (100rel). Reliable provisional responses, as specified in RFC 3262, require support from both the UAC and the container. If the container lacks this capability, attempts to use methods like SipServletResponse.sendReliably() or SipServletResponse.createPrack() will fail, and this code will be provided as the reason.
NOT_100rel
public static final int NOT_100rel
This constant represents a reason code indicating that SipServletResponse.createPrack() was called on a provisional response that is not marked as reliable. Reliable provisional responses are a specific feature of SIP (as defined by the 100rel extension in RFC 3262), and this reason code signifies that the response in question does not meet the requirements to support PRACK.
Constructor:
Rel100Exception Constructor
public Rel100Exception(int reason)
This constructor creates a new instance of the Rel100Exception class with a specified error reason. The reason parameter identifies the specific cause of the exception, such as invoking sendReliably() or createPrack() under conditions that do not meet the requirements for reliable provisional responses. Valid values for the reason parameter include the predefined constants NOT_1XX, NOT_INVITE, NO_REQ_SUPPORT, NOT_SUPPORTED, and NOT_100rel. These constants represent various conditions that trigger this exception.
Parameters:
reason – An integer constant indicating the specific error cause. Must be one of:
- NOT_1XX: Response is not provisional (1xx) or is a final/100 response.
- NOT_INVITE: Response pertains to a non-INVITE request.
- NO_REQ_SUPPORT: The UAC does not support the reliable responses extension.
- NOT_SUPPORTED: The container does not support reliable provisional responses.
- NOT_100rel: Response is not marked as reliable for PRACK creation.
Methods:
getReason
public int getReason()
Returns an integer code indicating the specific reason why this exception was thrown.
Returns:
One of NOT_1XX, NOT_INVITE, NO_REQ_SUPPORT, NOT_SUPPORTED, NOT_100rel.
getMessage
public java.lang.String getMessage()
Returns message phrase suitable for the reason integer code.
Overrides: getMessage in class java.lang.Throwable
Returns: descriptive message phrase.
Methods inherited from class javax.servlet.ServletException:
getRootCause.
Methods inherited from class java.lang.Throwable:
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString.
Methods inherited from class java.lang.Object:
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait.
Start innovating with Mobius
What's next? Let's talk!