1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 #ifndef __FTMOD_SANGOMA_ISDN_TRACE_H__
35 #define __FTMOD_SANGOMA_ISDN_TRACE_H__
36
37 #define MX_CODE_TXT_LEN 70
38 #define Q931_LOCKING_SHIFT 0x90
39 #define Q931_NON_LOCKING_SHIFT 0x98
40
41 #define PROT_Q931_RELEASE_CAUSE_MISDIALED_TRUNK_PREFIX 5
42 #define PROT_Q931_RELEASE_CAUSE_INVALID_NUMBER_FORMAT 28
43 #define PROT_Q931_RELEASE_CAUSE_NO_CHAN_AVAIL 34
44 #define PROT_Q931_RELEASE_CAUSE_DEST_OUT_OF_ORDER 27
45 #define PROT_Q931_RELEASE_CAUSE_IE_NOT_EXIST 99
46 #define PROT_Q931_RECOVERY_ON_TIMER_EXPIRE 102
47 #define PROT_Q931_RELEASE_CAUSE_WRONG_CALL_STATE 101
48
49
50 #define PROT_Q931_IE_SEGMENTED_MESSAGE 0x00
51 #define PROT_Q931_IE_BEARER_CAP 0x04
52 #define PROT_Q931_IE_CAUSE 0x08
53 #define PROT_Q931_IE_CALL_IDENTITY 0x10
54 #define PROT_Q931_IE_CALL_STATE 0x14
55 #define PROT_Q931_IE_CHANNEL_ID 0x18
56 #define PROT_Q931_IE_FACILITY 0x1c
57 #define PROT_Q931_IE_PROGRESS_IND 0x1e
58 #define PROT_Q931_IE_NETWORK_SPF_FACILITY 0x20
59 #define PROT_Q931_IE_NOTIFICATION_IND 0x27
60 #define PROT_Q931_IE_DISPLAY 0x28
61 #define PROT_Q931_IE_DATE_TIME 0x29
62 #define PROT_Q931_IE_KEYPAD_FACILITY 0x2c
63 #define PROT_Q931_IE_INFORMATION_REQUEST 0x32
64 #define PROT_Q931_IE_SIGNAL 0x34
65 #define PROT_Q931_IE_SWITCHOOK 0x36
66 #define PROT_Q931_IE_GENERIC_DIGITS 0x37
67 #define PROT_Q931_IE_FEATURE_ACT 0x38
68 #define PROT_Q931_IE_FEATURE_IND 0x39
69 #define PROT_Q931_IE_INFORMATION_RATE 0x40
70 #define PROT_Q931_IE_END_TO_END_TRANSIT_DELAY 0x42
71 #define PROT_Q931_IE_TRANSIT_DELAY_SELECT_IND 0x43
72 #define PROT_Q931_IE_PACKET_LAYER_BINARY_PARAMS 0x44
73 #define PROT_Q931_IE_PACKET_LAYER_WINDOW_SIZE 0x45
74 #define PROT_Q931_IE_PACKET_LAYER_SIZE 0x46
75 #define PROT_Q931_IE_CALLING_PARTY_NUMBER 0x6c
76 #define PROT_Q931_IE_CALLING_PARTY_SUBADDRESS 0x6d
77 #define PROT_Q931_IE_CALLED_PARTY_NUMBER 0x70
78 #define PROT_Q931_IE_CALLED_PARTY_SUBADDRESS 0x71
79 #define PROT_Q931_IE_REDIRECTING_NUMBER 0x74
80 #define PROT_Q931_IE_REDIRECTION_NUMBER 0x76
81 #define PROT_Q931_IE_TRANSIT_NETWORK_SELECTION 0x78
82 #define PROT_Q931_IE_RESTART_IND 0x79
83 #define PROT_Q931_IE_LOW_LAYER_COMPAT 0x7c
84 #define PROT_Q931_IE_HIGH_LAYER_COMPAT 0x7d
85 #define PROT_Q931_IE_USER_USER 0x7e
86 #define PROT_Q931_IE_SENDING_COMPLETE 0xa1
87 #define PROT_Q931_IE_ESCAPE_FOR_EXTENSION 0x7f
88 #define PROT_Q931_IE_SENDING_COMPLETE 0xa1
89
90 #define NULL_CHAR 0
91
92
93 struct code2str
94 {
95 int code;
96 char text[MX_CODE_TXT_LEN];
97 };
98
99 enum {
100 I_FRAME = 1,
101 S_FRAME,
102 U_FRAME,
103 };
104
105 char ia5[16][8]={{NULL_CHAR,NULL_CHAR,' ','0','@','P','`','p'},
106 {NULL_CHAR,NULL_CHAR,'!','1','A','Q','a','q'},
107 {NULL_CHAR,NULL_CHAR,'"','2','B','R','b','r'},
108 {NULL_CHAR,NULL_CHAR,'#','3','C','S','c','s'},
109 {NULL_CHAR,NULL_CHAR,'$','4','D','T','d','t'},
110 {NULL_CHAR,NULL_CHAR,'%','5','E','U','e','u'},
111 {NULL_CHAR,NULL_CHAR,'&','6','F','V','f','v'},
112 {NULL_CHAR,NULL_CHAR,'\'','7','G','W','g','w'},
113 {NULL_CHAR,NULL_CHAR,'(','8','H','X','h','x'},
114 {NULL_CHAR,NULL_CHAR,')','9','I','Y','i','y'},
115 {NULL_CHAR,NULL_CHAR,'*',':','J','Z','j','z'},
116 {NULL_CHAR,NULL_CHAR,'+',';','K','[','k','{'},
117 {NULL_CHAR,NULL_CHAR,',','<','L','\\','l','|'},
118 {NULL_CHAR,NULL_CHAR,'-','=','M',']','m','}'},
119 {NULL_CHAR,NULL_CHAR,'.','>','N','^','n','~'},
120 {NULL_CHAR,NULL_CHAR,'/','?','O','_','o',NULL_CHAR}};
121
122
123 struct code2str dcodQ921FrameFormatTable[] = {
124 {I_FRAME, "Information"},
125 {S_FRAME, "Supervisory"},
126 {U_FRAME, "Unnumbered"},
127 {-1, "?"},
128 };
129
130
131
132 struct code2str dcodQ921SupervisoryCmdTable[] = {
133 {0, "RR - receive ready"},
134 {1, "RNR - receive not ready"},
135 {2, "REJ - reject"},
136 {-1, "Unknown"},
137 };
138
139
140 struct code2str dcodQ921UnnumberedCmdTable[] = {
141 {0x0F, "SABME - set async balanced mode extended"},
142 {0x03, "DM - disconnected mode"},
143 {0x00, "UI - unnumbered information"},
144 {0x08, "DISC - disconnect"},
145 {0x0C, "UA - unnumbered acknowledgement"},
146 {0x11, "FRMR - frame reject"},
147 {0x17, "XID - Exchange Identification)"},
148 {-1, "Unknown"},
149 };
150
151 struct code2str dcodQ931ProtDiscTable[] = {
152 {0x08, "Q.931/I.451"},
153 {0x09, "Q.2931"},
154 {-1, "Unknown"},
155 };
156
157 struct code2str dcodQ931CallRefHiTable[] = {
158 {0, "0"},
159 {16, "1"},
160 {32, "2"},
161 {48, "3"},
162 {64, "4"},
163 {80, "5"},
164 {96, "6"},
165 {112, "7"},
166 {128, "8"},
167 {144, "9"},
168 {160, "A"},
169 {176, "B"},
170 {192, "C"},
171 {208, "D"},
172 {224, "E"},
173 {240, "F"},
174 {-1,"?"},
175 };
176
177 struct code2str dcodQ931CallRefLoTable[] = {
178 {0, "0"},
179 {1, "1"},
180 {2, "2"},
181 {3, "3"},
182 {4, "4"},
183 {5, "5"},
184 {6, "6"},
185 {7, "7"},
186 {8, "8"},
187 {9, "9"},
188 {10, "A"},
189 {11, "B"},
190 {12, "C"},
191 {13, "D"},
192 {14, "E"},
193 {15, "F"},
194 {-1,"?"},
195 };
196
197 struct code2str dcodQ931MsgTypeTable[] = {
198 {1, "Alerting"},
199 {2, "Call Proceeding"},
200 {3, "Progress"},
201 {5, "Setup"},
202 {7, "Connect"},
203 {13, "Setup Ack"},
204 {15, "Connect Ack"},
205 {32, "User Info"},
206 {33, "Suspend Rej"},
207 {34, "Resume Rej"},
208 {37, "Suspend"},
209 {38, "Resume"},
210 {45, "Suspend Ack"},
211 {46, "Resume Ack"},
212 {69, "Disconnect"},
213 {70, "Restart"},
214 {77, "Release"},
215 {78, "Release Ack"},
216 {90, "Release Compl"},
217 {96, "Segment"},
218 {98, "Facility"},
219 {110, "Notify"},
220 {117, "Status Enquiry"},
221 {121, "Congest Cntrl"},
222 {123, "Information"},
223 {125, "Status"},
224 {-1, "Unknown"},
225 };
226
227 struct code2str dcodQ931CauseCodeTable[] = {
228 {1, "Unallocated (unassigned) number"},
229 {2, "No route to specified network"},
230 {3, "No route to destination"},
231 {4, "Send special information tone"},
232 {5, "Misdialed trunk prefix"},
233 {6, "Channel Unacceptable"},
234 {7, "Call awarded and channel established"},
235 {8, "Pre-emption"},
236 {9, "Pre-emption-circuit reserved"},
237 {16, "Normal call clearing"},
238 {17, "User Busy"},
239 {18, "No User Responding"},
240 {19, "No Answer from User"},
241 {20, "Subscriber Absent"},
242 {21, "Call Rejected"},
243 {22, "Number Changed"},
244 {26, "Non-Selected User Clearing"},
245 {27, "Destination Out-of-Order"},
246 {28, "Invalid Number Format"},
247 {29, "Facility Rejected"},
248 {30, "Response to Status Enquiry"},
249 {31, "Normal, Unspecified"},
250 {34, "No Circuit/Channel Available"},
251 {38, "Network Out-of-Order"},
252 {39, "Permanent Frame Mode OOS"},
253 {40, "Permanent Frame Mode Operational"},
254 {41, "Temporary Failure"},
255 {42, "Switching Equipment Congestion"},
256 {43, "Access Information Discarded"},
257 {44, "Requested Circuit/Channel not available"},
258 {47, "Resource Unavailable, Unspecified"},
259 {49, "Quality of Service not available"},
260 {50, "Requested facility not subscribed"},
261 {53, "Outgoing calls barred within CUG"},
262 {55, "Incoming calls barred within CUG"},
263 {57, "Bearer capability not authorized"},
264 {58, "Bearer capability not presently available"},
265 {62, "Inconsistency in access inf and subscriber"},
266 {63, "Service or Option not available"},
267 {65, "Bearer capability not implemented"},
268 {66, "Channel type not implemented"},
269 {69, "Requested facility not implemented"},
270 {70, "Only restricted digital BC available"},
271 {79, "Service or option not implemented"},
272 {81, "Invalid call reference value"},
273 {82, "Identified channel does not exist"},
274 {83, "Suspended call exists"},
275 {84, "Call identity in use"},
276 {85, "No call suspended"},
277 {86, "Call already cleared"},
278 {87, "User not member of CUG"},
279 {88, "Incompatible destination"},
280 {90, "Non existent CUG"},
281 {91, "Invalid transit network selection"},
282 {95, "Invalid message, unspecified"},
283 {96, "Mandatory IE missing"},
284 {97, "Message type non-existent, not implemented"},
285 {98, "Message not compatible with call state"},
286 {99, "An IE or parameter does not exist"},
287 {100, "Invalid IE contents"},
288 {101, "Message not compatible with call state"},
289 {102, "Recovery on timer expired"},
290 {103, "Parameter non-existent, not impl"},
291 {110, "Message with unrecognized parameter"},
292 {111, "Protocol error, unspecified"},
293 {127, "Interworking, unspecified"},
294 {-1, "Unknown"},
295 };
296
297 struct code2str dcodQ931IEIDTable[] = {
298 {PROT_Q931_IE_SEGMENTED_MESSAGE, "Segmented Message"},
299 {PROT_Q931_IE_BEARER_CAP, "Bearer Capability"},
300 {PROT_Q931_IE_CAUSE, "Cause"},
301 {PROT_Q931_IE_CALL_IDENTITY, "Call Identity"},
302 {PROT_Q931_IE_CALL_STATE, "Call State"},
303 {PROT_Q931_IE_CHANNEL_ID, "Channel Id"},
304 {PROT_Q931_IE_FACILITY, "Facility"},
305 {PROT_Q931_IE_PROGRESS_IND, "Progress Indicator"},
306 {PROT_Q931_IE_NETWORK_SPF_FACILITY, "Network Specific Facilities"},
307 {PROT_Q931_IE_NOTIFICATION_IND, "Notification Indicator"},
308 {PROT_Q931_IE_DISPLAY, "Display"},
309 {PROT_Q931_IE_DATE_TIME, "Date/Time"},
310 {PROT_Q931_IE_KEYPAD_FACILITY, "Keypad Facility"},
311 {PROT_Q931_IE_INFORMATION_REQUEST, "Information Request"},
312 {PROT_Q931_IE_SIGNAL, "Signal"},
313 {PROT_Q931_IE_SWITCHOOK, "Switchhook"},
314 {PROT_Q931_IE_GENERIC_DIGITS, "Generic Digits"},
315 {PROT_Q931_IE_FEATURE_ACT, "Feature Activation"},
316 {PROT_Q931_IE_FEATURE_IND, "Feature Indication"},
317 {PROT_Q931_IE_INFORMATION_RATE, "Information Rate"},
318 {PROT_Q931_IE_END_TO_END_TRANSIT_DELAY, "End-to-end Transit Delay"},
319 {PROT_Q931_IE_TRANSIT_DELAY_SELECT_IND, "Transit Delay Selection and Indication"},
320 {PROT_Q931_IE_PACKET_LAYER_BINARY_PARAMS, "Packet layer binary parameters"},
321 {PROT_Q931_IE_PACKET_LAYER_WINDOW_SIZE, "Packet layer Window Size"},
322 {PROT_Q931_IE_PACKET_LAYER_SIZE, "Packet layer Size"},
323 {PROT_Q931_IE_CALLING_PARTY_NUMBER, "Calling Party Number"},
324 {PROT_Q931_IE_CALLING_PARTY_SUBADDRESS, "Calling Party Subaddress"},
325 {PROT_Q931_IE_CALLED_PARTY_NUMBER, "Called Party Number"},
326 {PROT_Q931_IE_CALLED_PARTY_SUBADDRESS, "Called Party Subaddress"},
327 {PROT_Q931_IE_REDIRECTING_NUMBER, "Redirecting Number"},
328 {PROT_Q931_IE_REDIRECTION_NUMBER, "Redirection Number"},
329 {PROT_Q931_IE_TRANSIT_NETWORK_SELECTION, "Transit Network Selection"},
330 {PROT_Q931_IE_RESTART_IND, "Restart Indicator"},
331 {PROT_Q931_IE_LOW_LAYER_COMPAT, "Low-Layer Compatibility"},
332 {PROT_Q931_IE_HIGH_LAYER_COMPAT, "High-Layer Compatibility"},
333 {PROT_Q931_IE_USER_USER, "User-User"},
334 {PROT_Q931_IE_SENDING_COMPLETE, "Sending complete"},
335 {PROT_Q931_IE_ESCAPE_FOR_EXTENSION, "Escape for extension"},
336 {-1,"Unknown"},
337 };
338
339 struct code2str dcodQ931NumberingPlanTable[] = {
340 {0, "unknown"},
341 {1, "isdn"},
342 {3, "data"},
343 {4, "telex"},
344 {8, "national"},
345 {9, "private"},
346 {15, "reserved"},
347 {-1, "invalid"},
348 };
349
350 struct code2str dcodQ931TypeofNumberTable[] = {
351 {0, "unknown"},
352 {1, "international"},
353 {2, "national"},
354 {3, "network spf"},
355 {4, "subscriber"},
356 {6, "abbreviated"},
357 {7, "reserved"},
358 {-1, "invalid" },
359 };
360
361 struct code2str dcodQ931PresentationTable[] = {
362 {0, "allowed"},
363 {1, "restricted"},
364 {2, "not available"},
365 {-1, "invalid" },
366 };
367
368 struct code2str dcodQ931ScreeningTable[] = {
369 {0, "user, not screened"},
370 {1, "user, passed"},
371 {2, "user, failed"},
372 {3, "network, provided"},
373 {-1, "invalid" },
374 };
375
376 struct code2str dcodQ931InfoChannelSelTable[] = {
377 {0, "No Chan"},
378 {1, "B1"},
379 {2, "B2"},
380 {3, "Any Chan"},
381 {-1, "invalid" },
382 };
383
384 struct code2str dcodQ931ReasonTable[] = {
385 {0x0, "Unknown"},
386 {0x1, "Call forwarding busy"},
387 {0x2, "Call forwarding no reply"},
388 {0x4, "Call deflection"},
389 {0x9, "Called DTE out of order"},
390 {0xA, "Call forwarding by the called DTE"},
391 {0xF, "Call forwarding unconditional"},
392 {-1, "reserved" },
393 };
394
395 struct code2str dcodQ931BcCodingStandardTable[] = {
396 {0x0, "ITU-T"},
397 {0x1, "ISO/IEC"},
398 {0x2, "National"},
399 {0x3, "Defined standard"},
400 {-1, "unknown"},
401 };
402
403 struct code2str dcodQ931BcInfTransferCapTable[] = {
404 {0x00, "Speech"},
405 {0x08, "Unrestricted digital"},
406 {0x09, "Restricted digital"},
407 {0x10, "3.1Khz audio"},
408 {0x11, "Unrestricted digital w/ tones"},
409 {0x18, "Video"},
410 {-1, "reserved"},
411 };
412
413 struct code2str dcodQ931BcInfTransferRateTable[] = {
414 {0x00, "n/a"},
415 {0x10, "64 Kbit/s"},
416 {0x11, "2x64 Kbit/s"},
417 {0x13, "384 Kbit/s"},
418 {0x15, "1536 Kbit/s"},
419 {0x17, "1920 Kbit/s"},
420 {0x18, "Multirate"},
421 {-1, "reserved"},
422 };
423
424
425 struct code2str dcodQ931BcusrL1ProtTable[] = {
426 {0x01, "ITU-T rate/V.110/I.460/X.30"},
427 {0x02, "G.711 u-Law"},
428 {0x03, "G.711 A-Law"},
429 {0x04, "G.721/I.460"},
430 {0x05, "H.221/H.242"},
431 {0x06, "H.223/H.245"},
432 {0x07, "Non-ITU-T rate"},
433 {0x08, "V.120"},
434 {0x09, "X.31 HDLC"},
435 {-1, "reserved"},
436 };
437
438 struct code2str dcodQ931UuiProtDiscrTable[] = {
439 {0x00, "User-specific"},
440 {0x01, "OSI high layer prot"},
441 {0x02, "Recommendation X.244"},
442 {0x03, "System management"},
443 {0x04, "IA5 Chars"},
444 {0x05, "X.208/X.209"},
445 {0x07, "V.120"},
446 {0x08, "Q.931/I.451"},
447 {0x10, "X.25"},
448 {-1,"reserved"},
449 };
450
451 struct code2str dcodQ931ChanTypeTable[] = {
452 {0x3,"B-chans"},
453 {0x6,"H0-chans"},
454 {0x8,"H11-chans"},
455 {0x9,"H12-chans"},
456 {-1,"reserved"},
457 };
458
459 struct code2str dcodQ931RestartIndClassTable[] = {
460 {0x0 ,"Indicated in channel IE"},
461 {0x6 ,"Single interface"},
462 {0x7 ,"All interfaces"},
463 {-1, "reserved"},
464 };
465
466 struct code2str dcodQ931IelocationTable[] = {
467 {0x0, "User"},
468 {0x1, "Private network, local user"},
469 {0x2, "Public network, local user"},
470 {0x3, "Transit network"},
471 {0x4, "Public network, remote user"},
472 {0x5, "Private network, remote user"},
473 {0xA, "Beyond interworking point"},
474 {-1, "reserved"},
475 };
476
477 struct code2str dcodQ931IeprogressDescrTable[] = {
478 {0x01, "Further info maybe available"},
479 {0x02, "Destination is non-ISDN"},
480 {0x03, "Origination address is non-ISDN"},
481 {0x04, "Call returned to ISDN"},
482 {0x08, "In-band data ready"},
483 {-1, "reserved"},
484 };
485
486 struct code2str dcodQ931IeFacilityProtProfileTable[] = {
487 {0x11, "Remote Operations Protocol"},
488 {0x12, "CMIP Protocol"},
489 {0x13, "ACSE Protocol"},
490 {0x16, "GAT Protocol"},
491 {0x1F, "Networking Extensions"},
492 {-1, "reserved"},
493 };
494
495
496 struct code2str dcodQ931LineInfoTable[] = {
497 {0, "Plain Old Telephone Service(POTS)" },
498 {1, "Multiparty line"},
499 {2, "ANI Failure"},
500 {6, "Station Level Rating"},
501 {7, "Special Operator Handling Required"},
502 {20, "Automatic Identified Outward Dialing (AIOD)"},
503 {23, "Coin or Non-coin"},
504 {24, "Toll free service, POTS originated for non-pay station"},
505 {25, "Toll free service, POTS originated for pay station"},
506 {27, "Pay station with coin control"},
507 {29, "Prison-Inmate service"},
508 {30, "Intercept - blank"},
509 {31, "Intercept - trouble"},
510 {32, "Intercept - regular"},
511 {34, "Telco operator handled call"},
512 {52, "Outward Wide Area Telecommunications Service(OUTWATS)"},
513 {60, "TRS call - from unrestricted line"},
514 {61, "Cellular-Wireless PCS Type 1"},
515 {62, "Cellular-Wireless PCS Type 2"},
516 {63, "Cellular-Wireless PCS Type Roaming"},
517 {66, "TRS call - from hotel/motel"},
518 {67, "TRS call - from restricted line"},
519 {70, "Line connected to pay station"},
520 {93, "Private virtual network call"},
521 {-1, "Unassigned"},
522 };
523
524
525 struct code2str dcodQ931GenDigitsEncodingTable[] = {
526 {0, "BCD even"},
527 {1, "BCD odd"},
528 {2, "IA5"},
529 {3, "Binary"},
530 {-1, "Invalid"},
531 };
532
533
534 struct code2str dcodQ931GenDigitsTypeTable[] = {
535 { 0, "Account Code"},
536 { 1, "Auth Code"},
537 { 2, "Customer ID" },
538 { 3, "Universal Access"},
539 { 4, "Info Digits"},
540 { 5, "Callid"},
541 { 6, "Opart"},
542 { 7, "TCN"},
543 { 9, "Adin"},
544 {-1, "Invalid"},
545 };
546
547 #endif
548