00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
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 }