Q850.c

Go to the documentation of this file.
00001 /*****************************************************************************
00002 
00003   FileName:             Q850.c
00004 
00005   Contents:             ITU-T Q.850 cause codes
00006 
00007   License/Copyright:
00008 
00009   Copyright (c) 2008, Stefan Knoblich, axsentis GmbH. All rights reserved.
00010   email: s.knoblich@axsentis.de
00011 
00012   Redistribution and use in source and binary forms, with or without 
00013   modification, are permitted provided that the following conditions are 
00014   met:
00015 
00016     * Redistributions of source code must retain the above copyright notice, 
00017       this list of conditions and the following disclaimer.
00018     * Redistributions in binary form must reproduce the above copyright notice, 
00019       this list of conditions and the following disclaimer in the documentation 
00020       and/or other materials provided with the distribution.
00021     * Neither the name of the axsentis GmbH nor the names of its contributors 
00022       may be used to endorse or promote products derived from this software 
00023       without specific prior written permission.
00024 
00025   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
00026   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
00027   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
00028   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
00029   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
00030   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
00031   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
00032   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
00033   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
00034   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
00035   POSSIBILITY OF SUCH DAMAGE.
00036 *****************************************************************************/
00037 
00038 #define Q931PRIVATE
00039 
00040 #include "Q931.h"
00041 
00042 struct Q850CauseName
00043 {
00044         const int id;
00045         const char *name;
00046 
00047 } Q850CauseNames[] = {
00048         { Q850_CAUSE_NONE, "None" },
00049         { Q850_CAUSE_UNALLOCATED, "Unallocated" },
00050         { Q850_CAUSE_NO_ROUTE_TRANSIT_NET, "No route transit net" },
00051         { Q850_CAUSE_NO_ROUTE_DESTINATION, "No route destination" },
00052         { Q850_CAUSE_CHANNEL_UNACCEPTABLE, "Channel unacceptable" },
00053         { Q850_CAUSE_CALL_AWARDED_DELIVERED, "" },
00054         { Q850_CAUSE_NORMAL_CLEARING, "Normal clearing" },
00055         { Q850_CAUSE_USER_BUSY, "User busy" },
00056         { Q850_CAUSE_NO_USER_RESPONSE, "No user response" },
00057         { Q850_CAUSE_NO_ANSWER, "No answer" },
00058         { Q850_CAUSE_SUBSCRIBER_ABSENT, "Subscriber absent" },
00059         { Q850_CAUSE_CALL_REJECTED, "Call rejected" },
00060         { Q850_CAUSE_NUMBER_CHANGED, "Number changed" },
00061         { Q850_CAUSE_REDIRECTION_TO_NEW_DESTINATION, "Redirection to new destination" },
00062         { Q850_CAUSE_EXCHANGE_ROUTING_ERROR, "Exchange routing error" },
00063         { Q850_CAUSE_DESTINATION_OUT_OF_ORDER, "Destination out of order" },
00064         { Q850_CAUSE_INVALID_NUMBER_FORMAT, "Invalid number format" },
00065         { Q850_CAUSE_FACILITY_REJECTED, "Facility rejected" },
00066         { Q850_CAUSE_RESPONSE_TO_STATUS_ENQUIRY, "Response to STATUS ENQUIRY" },
00067         { Q850_CAUSE_NORMAL_UNSPECIFIED, "Unspecified" },
00068         { Q850_CAUSE_NORMAL_CIRCUIT_CONGESTION, "Circuit congestion" },
00069         { Q850_CAUSE_NETWORK_OUT_OF_ORDER, "Network out of order" },
00070         { Q850_CAUSE_NORMAL_TEMPORARY_FAILURE, "Temporary failure" },
00071         { Q850_CAUSE_SWITCH_CONGESTION, "Switch congestion" },
00072         { Q850_CAUSE_ACCESS_INFO_DISCARDED, "Access info discarded" },
00073         { Q850_CAUSE_REQUESTED_CHAN_UNAVAIL, "Requested channel unavailable" },
00074         { Q850_CAUSE_PRE_EMPTED, "Pre-empted" },
00075         { Q850_CAUSE_FACILITY_NOT_SUBSCRIBED, "Facility not subscribed" },
00076         { Q850_CAUSE_OUTGOING_CALL_BARRED, "Outgoing call barred" },
00077         { Q850_CAUSE_INCOMING_CALL_BARRED, "Incoming call barred" },
00078         { Q850_CAUSE_BEARERCAPABILITY_NOTAUTH, "" },
00079         { Q850_CAUSE_BEARERCAPABILITY_NOTAVAIL, "Bearer capability not available" },
00080         { Q850_CAUSE_SERVICE_UNAVAILABLE, "Service unavailable" },
00081         { Q850_CAUSE_BEARERCAPABILITY_NOTIMPL, "Bearer capability not implemented" },
00082         { Q850_CAUSE_CHAN_NOT_IMPLEMENTED, "Channel not implemented" },
00083         { Q850_CAUSE_FACILITY_NOT_IMPLEMENTED, "Facility not implemented" },
00084         { Q850_CAUSE_SERVICE_NOT_IMPLEMENTED, "Service not implemented" },
00085         { Q850_CAUSE_INVALID_CALL_REFERENCE, "Invalid call reference" },
00086         { Q850_CAUSE_INCOMPATIBLE_DESTINATION, "Incompatible destination" },
00087         { Q850_CAUSE_INVALID_MSG_UNSPECIFIED, "Message, unspecified" },
00088         { Q850_CAUSE_MANDATORY_IE_MISSING, "Mandatory IE missing" },
00089         { Q850_CAUSE_MESSAGE_TYPE_NONEXIST, "Message type nonexistant" },
00090         { Q850_CAUSE_WRONG_MESSAGE, "Wrong message" },
00091         { Q850_CAUSE_IE_NONEXIST, "IE nonexistant" },
00092         { Q850_CAUSE_INVALID_IE_CONTENTS, "Invalid IE content" },
00093         { Q850_CAUSE_WRONG_CALL_STATE, "Wrong call state" },
00094         { Q850_CAUSE_RECOVERY_ON_TIMER_EXPIRE, "Recovery on timer expire" },
00095         { Q850_CAUSE_MANDATORY_IE_LENGTH_ERROR, "Mandatory IE length error" },
00096         { Q850_CAUSE_PROTOCOL_ERROR, "Protocol error" },
00097         { Q850_CAUSE_INTERWORKING, "Interworking, unspecified" },
00098 
00099         { 0, NULL }
00100 };
00101 
00102 
00103 const char *Q850CauseGetName(const int cause)
00104 {
00105         struct Q850CauseName *ptr = Q850CauseNames;
00106 
00107         while (ptr->name) {
00108                 if (ptr->id == cause) {
00109                         return ptr->name;
00110                 }
00111                 ptr++;
00112         }
00113         return "Unknown";
00114 }

Generated on Tue Apr 7 17:38:18 2009 for mod_ssh by  doxygen 1.5.4