Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / usr.sbin / i4b / isdndecode / pcause.c
1 /*
2  * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23  * SUCH DAMAGE.
24  *
25  *---------------------------------------------------------------------------
26  *
27  *      pcause.c - printing cause values
28  *      --------------------------------
29  *
30  *      $Id: pcause.c,v 1.5 1999/12/13 21:25:25 hm Exp $
31  *
32  * $FreeBSD: src/usr.sbin/i4b/isdndecode/pcause.c,v 1.6.2.1 2001/08/01 17:45:05 obrien Exp $
33  * $DragonFly: src/usr.sbin/i4b/isdndecode/pcause.c,v 1.2 2003/06/17 04:29:55 dillon Exp $
34  *
35  *      last edit-date: [Mon Dec 13 21:51:20 1999]
36  *
37  *---------------------------------------------------------------------------*/
38
39 #include "decode.h"
40 #include "pcause.h"
41
42 char *
43 print_cause_q850(unsigned char code)
44 {
45         static char error_message[120];
46         char *e;
47
48         switch(code)
49         {
50                 case CAUSE_Q850_SHUTDN:
51                         e = "normal D-channel shutdown";
52                         break;
53
54                 case CAUSE_Q850_NUNALLC:
55                         e = "Unallocated (unassigned) number";
56                         break;
57
58                 case CAUSE_Q850_NRTTN:
59                         e = "No route to specified transit network";
60                         break;
61
62                 case CAUSE_Q850_NRTDST:
63                         e = "No route to destination";
64                         break;
65
66                 case CAUSE_Q850_SSINFTN:
67                         e = "Send special information tone";
68                         break;
69
70                 case CAUSE_Q850_MDIALTP:
71                         e = "Misdialled trunk prefix";
72                         break;
73
74                 case CAUSE_Q850_CHUNACC:
75                         e = "Channel unacceptable";
76                         break;
77
78                 case CAUSE_Q850_CALLAWD:
79                         e = "Call awarded and being delivered in an established channel";
80                         break;
81
82                 case CAUSE_Q850_PREEMPT:
83                         e = "Preemption";
84                         break;
85
86                 case CAUSE_Q850_PREECRR:
87                         e = "Preemption - circuit reserved for reuse";
88                         break;
89
90                 case CAUSE_Q850_NCCLR:
91                         e = "Normal call clearing";
92                         break;
93
94                 case CAUSE_Q850_USRBSY:
95                         e = "User busy";
96                         break;
97
98                 case CAUSE_Q850_NOUSRRSP:
99                         e = "No user responding";
100                         break;
101
102                 case CAUSE_Q850_NOANSWR:
103                         e = "No answer from user (user alerted)";
104                         break;
105
106                 case CAUSE_Q850_SUBSABS:
107                         e = "Subscriber absent";
108                         break;
109
110                 case CAUSE_Q850_CALLREJ:
111                         e = "Call rejected";
112                         break;
113
114                 case CAUSE_Q850_NUCHNG:
115                         e = "Number changed";
116                         break;
117
118                 case CAUSE_Q850_NONSELUC:
119                         e = "Non-selected user clearing";
120                         break;
121
122                 case CAUSE_Q850_DSTOOORDR:
123                         e = "Destination out of order";
124                         break;
125
126                 case CAUSE_Q850_INVNUFMT:
127                         e = "Invalid number format";
128                         break;
129
130                 case CAUSE_Q850_FACREJ:
131                         e = "Facility rejected";
132                         break;
133
134                 case CAUSE_Q850_STENQRSP:
135                         e = "Response to STATUS ENQUIRY";
136                         break;
137
138                 case CAUSE_Q850_NORMUNSP:
139                         e = "Normal, unspecified";
140                         break;
141
142                 case CAUSE_Q850_NOCAVAIL:
143                         e = "No circuit / channel available";
144                         break;
145
146                 case CAUSE_Q850_NETOOORDR:
147                         e = "Network out of order";
148                         break;
149
150                 case CAUSE_Q850_PFMCDOOSERV:
151                         e = "Permanent frame mode connection out of service";
152                         break;
153
154                 case CAUSE_Q850_PFMCOPER:
155                         e = "Permanent frame mode connection operational";
156                         break;
157
158                 case CAUSE_Q850_TMPFAIL:
159                         e = "Temporary failure";
160                         break;
161
162                 case CAUSE_Q850_SWEQCONG:
163                         e = "Switching equipment congestion";
164                         break;
165
166                 case CAUSE_Q850_ACCINFDIS:
167                         e = "Access information discarded";
168                         break;
169
170                 case CAUSE_Q850_REQCNOTAV:
171                         e = "Requested circuit/channel not available";
172                         break;
173
174                 case CAUSE_Q850_PRECALBLK:
175                         e = "Precedence call blocked";
176                         break;
177
178                 case CAUSE_Q850_RESUNAVAIL:
179                         e = "Resources unavailable, unspecified";
180                         break;
181
182                 case CAUSE_Q850_QOSUNAVAIL:
183                         e = "Quality of service unavailable";
184                         break;
185
186                 case CAUSE_Q850_REQSERVNS:
187                         e = "Requested facility not subscribed";
188                         break;
189
190                 case CAUSE_Q850_OCBARRCUG:
191                         e = "Outgoing calls barred within CUG";
192                         break;
193
194                 case CAUSE_Q850_ICBARRCUG:
195                         e = "Incoming calls barred within CUG";
196                         break;
197
198                 case CAUSE_Q850_BCAPNAUTH:
199                         e = "Bearer capability not authorized";
200                         break;
201
202                 case CAUSE_Q850_BCAPNAVAIL:
203                         e = "Bearer capability not presently available";
204                         break;
205
206                 case CAUSE_Q850_INCSTOACISC:
207                         e = "Inconsistenciy in designated outg. access info and subscriber class";
208                         break;
209
210                 case CAUSE_Q850_SOONOTAVAIL:
211                         e = "Service or option not available, unspecified";
212                         break;
213
214                 case CAUSE_Q850_BCAPNOTIMPL:
215                         e = "Bearer capability not implemented";
216                         break;
217
218                 case CAUSE_Q850_CHTYPNIMPL:
219                         e = "Channel type not implemented";
220                         break;
221
222                 case CAUSE_Q850_REQFACNIMPL:
223                         e = "Requested facility not implemented";
224                         break;
225
226                 case CAUSE_Q850_ORDINBCAVL:
227                         e = "Only restricted digital information bearer capability is available";
228                         break;
229
230                 case CAUSE_Q850_SOONOTIMPL:
231                         e = "Service or option not implemented, unspecified";
232                         break;
233
234                 case CAUSE_Q850_INVCLRFVAL:
235                         e = "Invalid call reference value";
236                         break;
237
238                 case CAUSE_Q850_IDCHDNOEX:
239                         e = "Identified channel does not exist";
240                         break;
241
242                 case CAUSE_Q850_SUSCAEXIN:
243                         e = "A suspended call exists, but this call identity does not";
244                         break;
245
246                 case CAUSE_Q850_CLIDINUSE:
247                         e = "Call identity in use";
248                         break;
249
250                 case CAUSE_Q850_NOCLSUSP:
251                         e = "No call suspended";
252                         break;
253
254                 case CAUSE_Q850_CLIDCLRD:
255                         e = "Call having the requested call identity has been cleared";
256                         break;
257
258                 case CAUSE_Q850_UNOTMEMCUG:
259                         e = "User not member of CUG";
260                         break;
261
262                 case CAUSE_Q850_INCDEST:
263                         e = "Incompatible destination";
264                         break;
265
266                 case CAUSE_Q850_NONEXCUG:
267                         e = "Non-existent CUG";
268                         break;
269
270                 case CAUSE_Q850_INVNTWSEL:
271                         e = "Invalid transit network selection";
272                         break;
273
274                 case CAUSE_Q850_INVMSG:
275                         e = "Invalid message, unspecified";
276                         break;
277
278                 case CAUSE_Q850_MIEMISS:
279                         e = "Mandatory information element is missing";
280                         break;
281
282                 case CAUSE_Q850_MSGTNI:
283                         e = "Message type non-existent or not implemented";
284                         break;
285
286                 case CAUSE_Q850_MSGNCMPT:
287                         e = "Msg incompatible with call state/message type non-existent/not implemented";
288                         break;
289
290                 case CAUSE_Q850_IENENI:
291                         e = "Information element/parameter non-existent or not implemented";
292                         break;
293
294                 case CAUSE_Q850_INVIEC:
295                         e = "Invalid information element contents";
296                         break;
297
298                 case CAUSE_Q850_MSGNCWCS:
299                         e = "Message not compatible with call state";
300                         break;
301
302                 case CAUSE_Q850_RECOTIMEXP:
303                         e = "Recovery on timer expiry";
304                         break;
305
306                 case CAUSE_Q850_PARMNENIPO:
307                         e = "Parameter non-existent or not implemented, passed on";
308                         break;
309
310                 case CAUSE_Q850_MSGUNRDPRM:
311                         e = "Message with unrecognized parameter, discarded";
312                         break;
313
314                 case CAUSE_Q850_PROTERR:
315                         e = "Protocol error, unspecified";
316                         break;
317
318                 case CAUSE_Q850_INTWRKU:
319                         e = "Interworking, unspecified";
320                         break;
321
322                 default:
323                         e = "ERROR, unknown cause value!";
324                         break;
325         }
326
327         sprintf(error_message, "%d: %s (Q.850)", code, e);
328         return(error_message);
329 }
330
331 /* EOF */