001/*
002 *   Copyright 2024 Vonage
003 *
004 *   Licensed under the Apache License, Version 2.0 (the "License");
005 *   you may not use this file except in compliance with the License.
006 *   You may obtain a copy of the License at
007 *
008 *        http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *   Unless required by applicable law or agreed to in writing, software
011 *   distributed under the License is distributed on an "AS IS" BASIS,
012 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *   See the License for the specific language governing permissions and
014 *   limitations under the License.
015 */
016package com.vonage.client.incoming;
017
018import com.fasterxml.jackson.annotation.JsonCreator;
019
020/**
021 * @deprecated Use {@link com.vonage.client.voice.CallStatusDetail}.
022 */
023@Deprecated
024public enum CallStatusDetail {
025
026    /**
027     * No detail field present.
028     */
029    NO_DETAIL,
030
031    /**
032     * Detail present, but has not been mapped to an enum yet.
033     */
034    UNMAPPED_DETAIL,
035
036    /**
037     * Number invalid.
038     */
039    INVALID_NUMBER,
040
041    /**
042     * Rejected by carrier.
043     */
044    RESTRICTED,
045
046    /**
047     * Call rejected by callee.
048     */
049    DECLINED,
050
051    /**
052     * Cannot route to the number.
053     */
054    CANNOT_ROUTE,
055
056    /**
057     * Number is no longer available.
058     */
059    NUMBER_OUT_OF_SERVICE,
060
061    /**
062     * Server error or failure.
063     */
064    INTERNAL_ERROR,
065
066    /**
067     * Carrier timed out.
068     */
069    CARRIER_TIMEOUT,
070
071    /**
072     * Callee is temporarily unavailable.
073     */
074    UNAVAILABLE;
075
076
077    @JsonCreator
078    public static CallStatusDetail fromString(String detail) {
079        if (detail == null) {
080            return NO_DETAIL;
081        }
082        try {
083            return CallStatusDetail.valueOf(detail.toUpperCase());
084        }
085        catch (IllegalArgumentException ex) {
086            return UNMAPPED_DETAIL;
087        }
088    }
089}