Package com.opencloud.sentinel.util
Class SipStatusUtil
- java.lang.Object
-
- com.opencloud.sentinel.util.SipStatusUtil
-
public final class SipStatusUtil extends java.lang.Object
Utility class for SIP response status codes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SipStatusUtil.SipStatusType
Represents the Response SipStatusType.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SipStatusUtil.SipStatusType
classifyStatusCode(int statusCode)
Classifies SIP response status codes into one of the following categories: Provisional, Success, Failure, Invalid.static java.lang.String
getReasonPhrase(int statusCode)
Get the standard reason phrase for a SIP status code, or "Unknown" if the status code is not recognised.static boolean
isFailureStatusCode(int statusCode)
Convenience method for returning if status code falls between allowable values forSipStatusType.Failure
.static boolean
isProvisionalStatusCode(int statusCode)
Convenience method for returning if status code falls between allowable values forSipStatusType.Provisional
.static boolean
isSubscriptionTerminatingCode(int statusCode)
Convenience method for returning if status code should terminate the subscriptionstatic boolean
isSuccessfulStatusCode(int statusCode)
Convenience method for returning if status code falls between allowable values forSipStatusType.Success
.
-
-
-
Method Detail
-
classifyStatusCode
public static SipStatusUtil.SipStatusType classifyStatusCode(int statusCode)
Classifies SIP response status codes into one of the following categories: Provisional, Success, Failure, Invalid.
-
isSuccessfulStatusCode
public static boolean isSuccessfulStatusCode(int statusCode)
Convenience method for returning if status code falls between allowable values forSipStatusType.Success
.- Returns:
- true if status code falls between allowable
values for
SipStatusType.Success
.
-
isProvisionalStatusCode
public static boolean isProvisionalStatusCode(int statusCode)
Convenience method for returning if status code falls between allowable values forSipStatusType.Provisional
.- Returns:
- true if status code falls between allowable
values for
SipStatusType.Provisional
.
-
isFailureStatusCode
public static boolean isFailureStatusCode(int statusCode)
Convenience method for returning if status code falls between allowable values forSipStatusType.Failure
.- Returns:
- true if status code falls between allowable
values for
SipStatusType.Failure
.
-
isSubscriptionTerminatingCode
public static boolean isSubscriptionTerminatingCode(int statusCode)
Convenience method for returning if status code should terminate the subscription- Returns:
- true if status code should terminate the subscription outlined in RFC 6665.
-
getReasonPhrase
public static java.lang.String getReasonPhrase(int statusCode)
Get the standard reason phrase for a SIP status code, or "Unknown" if the status code is not recognised.
-
-