No empty .Rs/.Re
[netbsd-mini2440.git] / usr.sbin / isdn / isdntrace / pcause_q850.c
blob106ea06fce7a8d9412f54d43ec9279db93407892
1 /*
2 * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
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.
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.
25 *---------------------------------------------------------------------------
27 * printing cause values
28 * ---------------------
30 * $Id: pcause_q850.c,v 1.3 2009/04/16 05:56:33 lukem Exp $
32 * $FreeBSD$
34 * last edit-date: [Mon Dec 13 21:56:18 1999]
36 *---------------------------------------------------------------------------*/
38 #include "trace.h"
39 #include "pcause_q850.h"
41 const char *
42 print_cause_q850(unsigned char code)
44 static char error_message[120];
45 const char *e;
47 switch (code)
49 case CAUSE_Q850_SHUTDN:
50 e = "normal D-channel shutdown";
51 break;
53 case CAUSE_Q850_NUNALLC:
54 e = "Unallocated (unassigned) number";
55 break;
57 case CAUSE_Q850_NRTTN:
58 e = "No route to specified transit network";
59 break;
61 case CAUSE_Q850_NRTDST:
62 e = "No route to destination";
63 break;
65 case CAUSE_Q850_SSINFTN:
66 e = "Send special information tone";
67 break;
69 case CAUSE_Q850_MDIALTP:
70 e = "Misdialled trunk prefix";
71 break;
73 case CAUSE_Q850_CHUNACC:
74 e = "Channel unacceptable";
75 break;
77 case CAUSE_Q850_CALLAWD:
78 e = "Call awarded and being delivered in an established channel";
79 break;
81 case CAUSE_Q850_PREEMPT:
82 e = "Preemption";
83 break;
85 case CAUSE_Q850_PREECRR:
86 e = "Preemption - circuit reserved for reuse";
87 break;
89 case CAUSE_Q850_NCCLR:
90 e = "Normal call clearing";
91 break;
93 case CAUSE_Q850_USRBSY:
94 e = "User busy";
95 break;
97 case CAUSE_Q850_NOUSRRSP:
98 e = "No user responding";
99 break;
101 case CAUSE_Q850_NOANSWR:
102 e = "No answer from user (user alerted)";
103 break;
105 case CAUSE_Q850_SUBSABS:
106 e = "Subscriber absent";
107 break;
109 case CAUSE_Q850_CALLREJ:
110 e = "Call rejected";
111 break;
113 case CAUSE_Q850_NUCHNG:
114 e = "Number changed";
115 break;
117 case CAUSE_Q850_NONSELUC:
118 e = "Non-selected user clearing";
119 break;
121 case CAUSE_Q850_DSTOOORDR:
122 e = "Destination out of order";
123 break;
125 case CAUSE_Q850_INVNUFMT:
126 e = "Invalid number format";
127 break;
129 case CAUSE_Q850_FACREJ:
130 e = "Facility rejected";
131 break;
133 case CAUSE_Q850_STENQRSP:
134 e = "Response to STATUS ENQUIRY";
135 break;
137 case CAUSE_Q850_NORMUNSP:
138 e = "Normal, unspecified";
139 break;
141 case CAUSE_Q850_NOCAVAIL:
142 e = "No circuit / channel available";
143 break;
145 case CAUSE_Q850_NETOOORDR:
146 e = "Network out of order";
147 break;
149 case CAUSE_Q850_PFMCDOOSERV:
150 e = "Permanent frame mode connection out of service";
151 break;
153 case CAUSE_Q850_PFMCOPER:
154 e = "Permanent frame mode connection operational";
155 break;
157 case CAUSE_Q850_TMPFAIL:
158 e = "Temporary failure";
159 break;
161 case CAUSE_Q850_SWEQCONG:
162 e = "Switching equipment congestion";
163 break;
165 case CAUSE_Q850_ACCINFDIS:
166 e = "Access information discarded";
167 break;
169 case CAUSE_Q850_REQCNOTAV:
170 e = "Requested circuit/channel not available";
171 break;
173 case CAUSE_Q850_PRECALBLK:
174 e = "Precedence call blocked";
175 break;
177 case CAUSE_Q850_RESUNAVAIL:
178 e = "Resources unavailable, unspecified";
179 break;
181 case CAUSE_Q850_QOSUNAVAIL:
182 e = "Quality of service unavailable";
183 break;
185 case CAUSE_Q850_REQSERVNS:
186 e = "Requested facility not subscribed";
187 break;
189 case CAUSE_Q850_OCBARRCUG:
190 e = "Outgoing calls barred within CUG";
191 break;
193 case CAUSE_Q850_ICBARRCUG:
194 e = "Incoming calls barred within CUG";
195 break;
197 case CAUSE_Q850_BCAPNAUTH:
198 e = "Bearer capability not authorized";
199 break;
201 case CAUSE_Q850_BCAPNAVAIL:
202 e = "Bearer capability not presently available";
203 break;
205 case CAUSE_Q850_INCSTOACISC:
206 e = "Inconsistenciy in designated outg. access info and subscriber class";
207 break;
209 case CAUSE_Q850_SOONOTAVAIL:
210 e = "Service or option not available, unspecified";
211 break;
213 case CAUSE_Q850_BCAPNOTIMPL:
214 e = "Bearer capability not implemented";
215 break;
217 case CAUSE_Q850_CHTYPNIMPL:
218 e = "Channel type not implemented";
219 break;
221 case CAUSE_Q850_REQFACNIMPL:
222 e = "Requested facility not implemented";
223 break;
225 case CAUSE_Q850_ORDINBCAVL:
226 e = "Only restricted digital information bearer capability is available";
227 break;
229 case CAUSE_Q850_SOONOTIMPL:
230 e = "Service or option not implemented, unspecified";
231 break;
233 case CAUSE_Q850_INVCLRFVAL:
234 e = "Invalid call reference value";
235 break;
237 case CAUSE_Q850_IDCHDNOEX:
238 e = "Identified channel does not exist";
239 break;
241 case CAUSE_Q850_SUSCAEXIN:
242 e = "A suspended call exists, but this call identity does not";
243 break;
245 case CAUSE_Q850_CLIDINUSE:
246 e = "Call identity in use";
247 break;
249 case CAUSE_Q850_NOCLSUSP:
250 e = "No call suspended";
251 break;
253 case CAUSE_Q850_CLIDCLRD:
254 e = "Call having the requested call identity has been cleared";
255 break;
257 case CAUSE_Q850_UNOTMEMCUG:
258 e = "User not member of CUG";
259 break;
261 case CAUSE_Q850_INCDEST:
262 e = "Incompatible destination";
263 break;
265 case CAUSE_Q850_NONEXCUG:
266 e = "Non-existent CUG";
267 break;
269 case CAUSE_Q850_INVNTWSEL:
270 e = "Invalid transit network selection";
271 break;
273 case CAUSE_Q850_INVMSG:
274 e = "Invalid message, unspecified";
275 break;
277 case CAUSE_Q850_MIEMISS:
278 e = "Mandatory information element is missing";
279 break;
281 case CAUSE_Q850_MSGTNI:
282 e = "Message type non-existent or not implemented";
283 break;
285 case CAUSE_Q850_MSGNCMPT:
286 e = "Msg incompatible with call state/message type non-existent/not implemented";
287 break;
289 case CAUSE_Q850_IENENI:
290 e = "Information element/parameter non-existent or not implemented";
291 break;
293 case CAUSE_Q850_INVIEC:
294 e = "Invalid information element contents";
295 break;
297 case CAUSE_Q850_MSGNCWCS:
298 e = "Message not compatible with call state";
299 break;
301 case CAUSE_Q850_RECOTIMEXP:
302 e = "Recovery on timer expiry";
303 break;
305 case CAUSE_Q850_PARMNENIPO:
306 e = "Parameter non-existent or not implemented, passed on";
307 break;
309 case CAUSE_Q850_MSGUNRDPRM:
310 e = "Message with unrecognized parameter, discarded";
311 break;
313 case CAUSE_Q850_PROTERR:
314 e = "Protocol error, unspecified";
315 break;
317 case CAUSE_Q850_INTWRKU:
318 e = "Interworking, unspecified";
319 break;
321 default:
322 e = "ERROR, unknown cause value!";
323 break;
326 sprintf(error_message, "%d: %s (Q.850)", code, e);
327 return(error_message);
330 /* EOF */