Create a list of MTP Service Indicator macros and use them.
[obnox/wireshark/wip.git] / epan / dissectors / packet-isup.c
1 /* packet-isup.c
2  * Routines for ISUP dissection
3  * Copyright 2001, Martina Obermeier <martina.obermeier@icn.siemens.de>
4  *
5  * Copyright 2004-2005, Anders Broman <anders.broman@ericsson.com>
6  * Modified 2003-09-10 by Anders Broman
7  *          <anders.broman@ericsson.com>
8  * Inserted routines for BICC dissection according to Q.765.5 Q.1902 Q.1970 Q.1990,
9  * calling SDP dissector for RFC2327 decoding.
10  * Modified 2004-01-10 by Anders Broman to add abillity to dissect
11  * Content type application/ISUP RFC 3204 used in SIP-T
12  *
13  * $Id$
14  *
15  * Wireshark - Network traffic analyzer
16  * By Gerald Combs <gerald@wireshark.org>
17  * Copyright 1998 Gerald Combs
18  *
19  * Copied from README.developer
20  *
21  * This program is free software; you can redistribute it and/or
22  * modify it under the terms of the GNU General Public License
23  * as published by the Free Software Foundation; either version 2
24  * of the License, or (at your option) any later version.
25  *
26  * This program is distributed in the hope that it will be useful,
27  * but WITHOUT ANY WARRANTY; without even the implied warranty of
28  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
29  * GNU General Public License for more details.
30  *
31  * You should have received a copy of the GNU General Public License
32  * along with this program; if not, write to the Free Software
33  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34  * References:
35  * ISUP:
36  * http://www.itu.int/rec/recommendation.asp?type=products&lang=e&parent=T-REC-Q
37  * Q.763-199912, Q.763-200212Amd2
38  * ITU-T Q.763/Amd.1 (03/2001)
39  */
40
41 #ifdef HAVE_CONFIG_H
42 # include "config.h"
43 #endif
44
45 #include <epan/packet.h>
46 #include <epan/stats_tree.h>
47 #include <epan/asn1.h>
48 #include <prefs.h>
49 #include "packet-q931.h"
50 #include "packet-isup.h"
51 #include "packet-e164.h"
52 #include "packet-charging_ase.h"
53 #include <epan/sctpppids.h>
54 #include <epan/emem.h>
55 #include <epan/circuit.h>
56 #include <epan/reassemble.h>
57 #include <packet-mtp3.h>
58
59 static gint isup_standard = ITU_STANDARD;
60
61 #define ASCII_NUMBER_DELTA              0x30
62 #define ASCII_LETTER_DELTA              0x37
63
64 /* Definition of protocol field values und lengths */
65
66 /* Definition of Message Types */
67 #define MESSAGE_TYPE_INITIAL_ADDR        1
68 #define MESSAGE_TYPE_SUBSEQ_ADDR         2
69 #define MESSAGE_TYPE_INFO_REQ            3
70 #define MESSAGE_TYPE_INFO                4
71 #define MESSAGE_TYPE_CONTINUITY          5
72 #define MESSAGE_TYPE_ADDR_CMPL           6
73 #define MESSAGE_TYPE_CONNECT             7
74 #define MESSAGE_TYPE_FORW_TRANS          8
75 #define MESSAGE_TYPE_ANSWER              9
76 #define MESSAGE_TYPE_RELEASE            12
77 #define MESSAGE_TYPE_SUSPEND            13
78 #define MESSAGE_TYPE_RESUME             14
79 #define MESSAGE_TYPE_REL_CMPL           16
80 #define MESSAGE_TYPE_CONT_CHECK_REQ     17
81 #define MESSAGE_TYPE_RESET_CIRCUIT      18
82 #define MESSAGE_TYPE_BLOCKING           19
83 #define MESSAGE_TYPE_UNBLOCKING         20
84 #define MESSAGE_TYPE_BLOCK_ACK          21
85 #define MESSAGE_TYPE_UNBLOCK_ACK        22
86 #define MESSAGE_TYPE_CIRC_GRP_RST       23
87 #define MESSAGE_TYPE_CIRC_GRP_BLCK      24
88 #define MESSAGE_TYPE_CIRC_GRP_UNBL      25
89 #define MESSAGE_TYPE_CIRC_GRP_BL_ACK    26
90 #define MESSAGE_TYPE_CIRC_GRP_UNBL_ACK  27
91 #define MESSAGE_TYPE_FACILITY_REQ       31
92 #define MESSAGE_TYPE_FACILITY_ACC       32
93 #define MESSAGE_TYPE_FACILITY_REJ       33
94 #define MESSAGE_TYPE_LOOP_BACK_ACK      36
95 #define MESSAGE_TYPE_PASS_ALONG         40
96 #define MESSAGE_TYPE_CIRC_GRP_RST_ACK   41
97 #define MESSAGE_TYPE_CIRC_GRP_QRY       42
98 #define MESSAGE_TYPE_CIRC_GRP_QRY_RSP   43
99 #define MESSAGE_TYPE_CALL_PROGRSS       44
100 #define MESSAGE_TYPE_USER2USER_INFO     45
101 #define MESSAGE_TYPE_UNEQUIPPED_CIC     46
102 #define MESSAGE_TYPE_CONFUSION          47
103 #define MESSAGE_TYPE_OVERLOAD           48
104 #define MESSAGE_TYPE_CHARGE_INFO        49
105 #define MESSAGE_TYPE_NETW_RESRC_MGMT    50
106 #define MESSAGE_TYPE_FACILITY           51
107 #define MESSAGE_TYPE_USER_PART_TEST     52
108 #define MESSAGE_TYPE_USER_PART_AVAIL    53
109 #define MESSAGE_TYPE_IDENT_REQ          54
110 #define MESSAGE_TYPE_IDENT_RSP          55
111 #define MESSAGE_TYPE_SEGMENTATION       56
112 #define MESSAGE_TYPE_LOOP_PREVENTION    64
113 #define MESSAGE_TYPE_APPLICATION_TRANS  65
114 #define MESSAGE_TYPE_PRE_RELEASE_INFO   66
115 #define MESSAGE_TYPE_SUBSEQUENT_DIR_NUM 67
116
117 #define ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES_ACK  0xE9
118 #define ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES      0xEA
119 #define ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST_RSP 0xEB
120 #define ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST     0xEC
121 #define ANSI_ISUP_MESSAGE_TYPE_EXIT             0xED
122
123 static const value_string isup_message_type_value[] = {
124   { MESSAGE_TYPE_INITIAL_ADDR,                "Initial address"},
125   { MESSAGE_TYPE_SUBSEQ_ADDR,                 "Subsequent address"},
126   { MESSAGE_TYPE_INFO_REQ,                    "Information request (national use)"},
127   { MESSAGE_TYPE_INFO,                        "Information (national use)"},
128   { MESSAGE_TYPE_CONTINUITY,                  "Continuity"},
129   { MESSAGE_TYPE_ADDR_CMPL,                   "Address complete"},
130   { MESSAGE_TYPE_CONNECT,                     "Connect"},
131   { MESSAGE_TYPE_FORW_TRANS,                  "Forward transfer"},
132   { MESSAGE_TYPE_ANSWER,                      "Answer"},
133
134   { 0x0a,                                     "Reserved (used in 1984 version)"},
135   { 0x0b,                                     "Reserved (used in 1984 version)"},
136
137   { MESSAGE_TYPE_RELEASE,                     "Release"},
138   { MESSAGE_TYPE_SUSPEND,                     "Suspend"},
139   { MESSAGE_TYPE_RESUME,                      "Resume"},
140   { MESSAGE_TYPE_REL_CMPL,                    "Release complete"},
141   { MESSAGE_TYPE_CONT_CHECK_REQ,              "Continuity check request"},
142   { MESSAGE_TYPE_RESET_CIRCUIT,               "Reset Circuit"},
143   { MESSAGE_TYPE_BLOCKING,                    "Blocking"},
144   { MESSAGE_TYPE_UNBLOCKING,                  "Unblocking"},
145   { MESSAGE_TYPE_BLOCK_ACK,                   "Blocking acknowledgement"},
146   { MESSAGE_TYPE_UNBLOCK_ACK,                 "Unblocking acknowledgment"},
147   { MESSAGE_TYPE_CIRC_GRP_RST,                "Circuit group reset"},
148   { MESSAGE_TYPE_CIRC_GRP_BLCK,               "Circuit group blocking"},
149   { MESSAGE_TYPE_CIRC_GRP_UNBL,               "Circuit group unblocking"},
150   { MESSAGE_TYPE_CIRC_GRP_BL_ACK,             "Circuit group blocking acknowledgement"},
151   { MESSAGE_TYPE_CIRC_GRP_UNBL_ACK,           "Circuit group unblocking acknowledgement"},
152
153   { 28,                                      "Reserved (used in 1988 version)"},
154   { 29,                                      "Reserved (used in 1988 version)"},
155   { 30,                                      "Reserved (used in 1988 version)"},
156
157   { MESSAGE_TYPE_FACILITY_REQ,                "Facility request"},
158   { MESSAGE_TYPE_FACILITY_ACC,                "Facility accepted"},
159   { MESSAGE_TYPE_FACILITY_REJ,                "Facility reject"},
160
161   { 34,                                      "Reserved (used in 1984 version)"},
162   { 35,                                      "Reserved (used in 1984 version)"},
163
164   { MESSAGE_TYPE_LOOP_BACK_ACK,               "Loop back acknowledgement (national use)"},
165
166   { 37,                                      "Reserved (used in 1984 version)"},
167   { 38,                                      "Reserved (used in 1984 version)"},
168   { 39,                                      "Reserved (used in 1984 version)"},
169
170   { MESSAGE_TYPE_PASS_ALONG,                  "Pass-along (national use)"},
171   { MESSAGE_TYPE_CIRC_GRP_RST_ACK,            "Circuit group reset acknowledgement"},
172   { MESSAGE_TYPE_CIRC_GRP_QRY,                "Circuit group query (national use)"},
173   { MESSAGE_TYPE_CIRC_GRP_QRY_RSP,            "Circuit group query response (national use)"},
174   { MESSAGE_TYPE_CALL_PROGRSS,                "Call progress"},
175   { MESSAGE_TYPE_USER2USER_INFO,              "User-to-user information"},
176   { MESSAGE_TYPE_UNEQUIPPED_CIC,              "Unequipped CIC (national use)"},
177   { MESSAGE_TYPE_CONFUSION,                   "Confusion"},
178   { MESSAGE_TYPE_OVERLOAD,                    "Overload (national use)"},
179   { MESSAGE_TYPE_CHARGE_INFO,                 "Charge information (national use)"},
180   { MESSAGE_TYPE_NETW_RESRC_MGMT,             "Network resource management"},
181   { MESSAGE_TYPE_FACILITY,                    "Facility"},
182   { MESSAGE_TYPE_USER_PART_TEST,              "User part test"},
183   { MESSAGE_TYPE_USER_PART_AVAIL,             "User part available"},
184   { MESSAGE_TYPE_IDENT_REQ,                   "Identification request"},
185   { MESSAGE_TYPE_IDENT_RSP,                   "Identification response"},
186   { MESSAGE_TYPE_SEGMENTATION,                "Segmentation"},
187
188   { 57,                                       "Reserved (used in B-ISUP)"},
189   { 58,                                       "Reserved (used in B-ISUP)"},
190   { 59,                                       "Reserved (used in B-ISUP)"},
191   { 60,                                       "Reserved (used in B-ISUP)"},
192   { 61,                                       "Reserved (used in B-ISUP)"},
193
194   { 63,                                       "Unknown"},
195   { 63,                                       "Unknown"},
196
197   { MESSAGE_TYPE_LOOP_PREVENTION,             "Loop prevention"},
198   { MESSAGE_TYPE_APPLICATION_TRANS,           "Application transport"},
199   { MESSAGE_TYPE_PRE_RELEASE_INFO,            "Pre-release information"},
200   { MESSAGE_TYPE_SUBSEQUENT_DIR_NUM,          "Subsequent Directory Number (national use)"},
201   { 0,                                  NULL}};
202 static value_string_ext isup_message_type_value_ext = VALUE_STRING_EXT_INIT(isup_message_type_value);
203
204 static const value_string ansi_isup_message_type_value[] = {
205   { MESSAGE_TYPE_INITIAL_ADDR,                "Initial address"},
206   { MESSAGE_TYPE_SUBSEQ_ADDR,                 "Subsequent address"},
207   { MESSAGE_TYPE_INFO_REQ,                    "Information request (national use)"},
208   { MESSAGE_TYPE_INFO,                        "Information (national use)"},
209   { MESSAGE_TYPE_CONTINUITY,                  "Continuity"},
210   { MESSAGE_TYPE_ADDR_CMPL,                   "Address complete"},
211   { MESSAGE_TYPE_CONNECT,                     "Connect"},
212   { MESSAGE_TYPE_FORW_TRANS,                  "Forward transfer"},
213   { MESSAGE_TYPE_ANSWER,                      "Answer"},
214   { MESSAGE_TYPE_RELEASE,                     "Release"},
215   { MESSAGE_TYPE_SUSPEND,                     "Suspend"},
216   { MESSAGE_TYPE_RESUME,                      "Resume"},
217   { MESSAGE_TYPE_REL_CMPL,                    "Release complete"},
218   { MESSAGE_TYPE_CONT_CHECK_REQ,              "Continuity check request"},
219   { MESSAGE_TYPE_RESET_CIRCUIT,               "Reset Circuit"},
220   { MESSAGE_TYPE_BLOCKING,                    "Blocking"},
221   { MESSAGE_TYPE_UNBLOCKING,                  "Unblocking"},
222   { MESSAGE_TYPE_BLOCK_ACK,                   "Blocking acknowledgement"},
223   { MESSAGE_TYPE_UNBLOCK_ACK,                 "Unblocking acknowledgment"},
224   { MESSAGE_TYPE_CIRC_GRP_RST,                "Circuit group reset"},
225   { MESSAGE_TYPE_CIRC_GRP_BLCK,               "Circuit group blocking"},
226   { MESSAGE_TYPE_CIRC_GRP_UNBL,               "Circuit group unblocking"},
227   { MESSAGE_TYPE_CIRC_GRP_BL_ACK,             "Circuit group blocking acknowledgement"},
228   { MESSAGE_TYPE_CIRC_GRP_UNBL_ACK,           "Circuit group unblocking acknowledgement"},
229   { MESSAGE_TYPE_FACILITY_REQ,                "Facility request"},
230   { MESSAGE_TYPE_FACILITY_ACC,                "Facility accepted"},
231   { MESSAGE_TYPE_FACILITY_REJ,                "Facility reject"},
232   { MESSAGE_TYPE_LOOP_BACK_ACK,               "Loop back acknowledgement (national use)"},
233   { MESSAGE_TYPE_PASS_ALONG,                  "Pass-along (national use)"},
234   { MESSAGE_TYPE_CIRC_GRP_RST_ACK,            "Circuit group reset acknowledgement"},
235   { MESSAGE_TYPE_CIRC_GRP_QRY,                "Circuit group query (national use)"},
236   { MESSAGE_TYPE_CIRC_GRP_QRY_RSP,            "Circuit group query response (national use)"},
237   { MESSAGE_TYPE_CALL_PROGRSS,                "Call progress"},
238   { MESSAGE_TYPE_USER2USER_INFO,              "User-to-user information"},
239   { MESSAGE_TYPE_UNEQUIPPED_CIC,              "Unequipped CIC (national use)"},
240   { MESSAGE_TYPE_CONFUSION,                   "Confusion"},
241   { MESSAGE_TYPE_OVERLOAD,                    "Overload (national use)"},
242   { MESSAGE_TYPE_CHARGE_INFO,                 "Charge information (national use)"},
243   { MESSAGE_TYPE_NETW_RESRC_MGMT,             "Network resource management"},
244   { MESSAGE_TYPE_FACILITY,                    "Facility"},
245   { MESSAGE_TYPE_USER_PART_TEST,              "User part test"},
246   { MESSAGE_TYPE_USER_PART_AVAIL,             "User part available"},
247   { MESSAGE_TYPE_IDENT_REQ,                   "Identification request"},
248   { MESSAGE_TYPE_IDENT_RSP,                   "Identification response"},
249   { MESSAGE_TYPE_SEGMENTATION,                "Segmentation"},
250   { MESSAGE_TYPE_LOOP_PREVENTION,             "Loop prevention"},
251   { MESSAGE_TYPE_APPLICATION_TRANS,           "Application transport"},
252   { MESSAGE_TYPE_PRE_RELEASE_INFO,            "Pre-release information"},
253   { MESSAGE_TYPE_SUBSEQUENT_DIR_NUM,          "Subsequent Directory Number (national use)"},
254   { ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES_ACK,   "Circuit Reservation Acknowledge"},
255   { ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES,       "Circuit Reservation"},
256   { ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST_RSP,  "Circuit Validation Test Response"},
257   { ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST,      "Circuit Validation Test"},
258   { ANSI_ISUP_MESSAGE_TYPE_EXIT,              "Exit"},
259   { 0,                                  NULL}};
260 static value_string_ext ansi_isup_message_type_value_ext = VALUE_STRING_EXT_INIT(ansi_isup_message_type_value);
261
262 /* Same as above but in acronym form (for the Info column) */
263 static const value_string isup_message_type_value_acro[] = {
264   { MESSAGE_TYPE_INITIAL_ADDR,                "IAM"},
265   { MESSAGE_TYPE_SUBSEQ_ADDR,                 "SAM"},
266   { MESSAGE_TYPE_INFO_REQ,                    "INR"},
267   { MESSAGE_TYPE_INFO,                        "INF"},
268   { MESSAGE_TYPE_CONTINUITY,                  "COT"},
269   { MESSAGE_TYPE_ADDR_CMPL,                   "ACM"},
270   { MESSAGE_TYPE_CONNECT,                     "CON"},
271   { MESSAGE_TYPE_FORW_TRANS,                  "FOT"},
272   { MESSAGE_TYPE_ANSWER,                      "ANM"},
273
274   { 0x0a,                                     "Reserved"},
275   { 0x0b,                                     "Reserved"},
276
277   { MESSAGE_TYPE_RELEASE,                     "REL"},
278   { MESSAGE_TYPE_SUSPEND,                     "SUS"},
279   { MESSAGE_TYPE_RESUME,                      "RES"},
280   { MESSAGE_TYPE_REL_CMPL,                    "RLC"},
281   { MESSAGE_TYPE_CONT_CHECK_REQ,              "CCR"},
282   { MESSAGE_TYPE_RESET_CIRCUIT,               "RSC"},
283   { MESSAGE_TYPE_BLOCKING,                    "BLO"},
284   { MESSAGE_TYPE_UNBLOCKING,                  "UBL"},
285   { MESSAGE_TYPE_BLOCK_ACK,                   "BLA"},
286   { MESSAGE_TYPE_UNBLOCK_ACK,                 "UBLA"},
287   { MESSAGE_TYPE_CIRC_GRP_RST,                "GRS"},
288   { MESSAGE_TYPE_CIRC_GRP_BLCK,               "CGB"},
289   { MESSAGE_TYPE_CIRC_GRP_UNBL,               "CGU"},
290   { MESSAGE_TYPE_CIRC_GRP_BL_ACK,             "CGBA"},
291   { MESSAGE_TYPE_CIRC_GRP_UNBL_ACK,           "CGUA"},
292
293   { 28,                                      "Reserved"},
294   { 29,                                      "Reserved"},
295   { 30,                                      "Reserved"},
296
297   { MESSAGE_TYPE_FACILITY_REQ,                "FAR"},
298   { MESSAGE_TYPE_FACILITY_ACC,                "FAA"},
299   { MESSAGE_TYPE_FACILITY_REJ,                "FRJ"},
300
301   { 34,                                      "Reserved"},
302   { 35,                                      "Reserved"},
303
304   { MESSAGE_TYPE_LOOP_BACK_ACK,               "LPA"},
305
306   { 37,                                      "Reserved"},
307   { 38,                                      "Reserved"},
308   { 39,                                      "Reserved"},
309
310   { MESSAGE_TYPE_PASS_ALONG,                  "PAM"},
311   { MESSAGE_TYPE_CIRC_GRP_RST_ACK,            "GRA"},
312   { MESSAGE_TYPE_CIRC_GRP_QRY,                "CQM"},
313   { MESSAGE_TYPE_CIRC_GRP_QRY_RSP,            "CQR"},
314   { MESSAGE_TYPE_CALL_PROGRSS,                "CPG"},
315   { MESSAGE_TYPE_USER2USER_INFO,              "UUI"},
316   { MESSAGE_TYPE_UNEQUIPPED_CIC,              "UCIC"},
317   { MESSAGE_TYPE_CONFUSION,                   "CFN"},
318   { MESSAGE_TYPE_OVERLOAD,                    "OLM"},
319   { MESSAGE_TYPE_CHARGE_INFO,                 "CRG"},
320   { MESSAGE_TYPE_NETW_RESRC_MGMT,             "NRM"},
321   { MESSAGE_TYPE_FACILITY,                    "FAC"},
322   { MESSAGE_TYPE_USER_PART_TEST,              "UPT"},
323   { MESSAGE_TYPE_USER_PART_AVAIL,             "UPA"},
324   { MESSAGE_TYPE_IDENT_REQ,                   "IDR"},
325   { MESSAGE_TYPE_IDENT_RSP,                   "IDS"},
326   { MESSAGE_TYPE_SEGMENTATION,                "SGM"},
327
328   { 57,                                       "Reserved"},
329   { 58,                                       "Reserved"},
330   { 59,                                       "Reserved"},
331   { 60,                                       "Reserved"},
332   { 61,                                       "Reserved"},
333
334   { 63,                                       "Unknown"},
335   { 63,                                       "Unknown"},
336
337   { MESSAGE_TYPE_LOOP_PREVENTION,             "LOP"},
338   { MESSAGE_TYPE_APPLICATION_TRANS,           "APM"},
339   { MESSAGE_TYPE_PRE_RELEASE_INFO,            "PRI"},
340   { MESSAGE_TYPE_SUBSEQUENT_DIR_NUM,          "SDN"},
341   { 0,                                  NULL}};
342 value_string_ext isup_message_type_value_acro_ext = VALUE_STRING_EXT_INIT(isup_message_type_value_acro);
343
344   /* Same as above but in acronym form (for the Info column) */
345 static const value_string ansi_isup_message_type_value_acro[] = {
346   { MESSAGE_TYPE_INITIAL_ADDR,                "IAM"},
347   { MESSAGE_TYPE_SUBSEQ_ADDR,                 "SAM"},
348   { MESSAGE_TYPE_INFO_REQ,                    "INR"},
349   { MESSAGE_TYPE_INFO,                        "INF"},
350   { MESSAGE_TYPE_CONTINUITY,                  "COT"},
351   { MESSAGE_TYPE_ADDR_CMPL,                   "ACM"},
352   { MESSAGE_TYPE_CONNECT,                     "CON"},
353   { MESSAGE_TYPE_FORW_TRANS,                  "FOT"},
354   { MESSAGE_TYPE_ANSWER,                      "ANM"},
355   { MESSAGE_TYPE_RELEASE,                     "REL"},
356   { MESSAGE_TYPE_SUSPEND,                     "SUS"},
357   { MESSAGE_TYPE_RESUME,                      "RES"},
358   { MESSAGE_TYPE_REL_CMPL,                    "RLC"},
359   { MESSAGE_TYPE_CONT_CHECK_REQ,              "CCR"},
360   { MESSAGE_TYPE_RESET_CIRCUIT,               "RSC"},
361   { MESSAGE_TYPE_BLOCKING,                    "BLO"},
362   { MESSAGE_TYPE_UNBLOCKING,                  "UBL"},
363   { MESSAGE_TYPE_BLOCK_ACK,                   "BLA"},
364   { MESSAGE_TYPE_UNBLOCK_ACK,                 "UBLA"},
365   { MESSAGE_TYPE_CIRC_GRP_RST,                "GRS"},
366   { MESSAGE_TYPE_CIRC_GRP_BLCK,               "CGB"},
367   { MESSAGE_TYPE_CIRC_GRP_UNBL,               "CGU"},
368   { MESSAGE_TYPE_CIRC_GRP_BL_ACK,             "CGBA"},
369   { MESSAGE_TYPE_CIRC_GRP_UNBL_ACK,           "CGUA"},
370   { MESSAGE_TYPE_FACILITY_REQ,                "FAR"},
371   { MESSAGE_TYPE_FACILITY_ACC,                "FAA"},
372   { MESSAGE_TYPE_FACILITY_REJ,                "FRJ"},
373   { MESSAGE_TYPE_LOOP_BACK_ACK,               "LPA"},
374   { MESSAGE_TYPE_PASS_ALONG,                  "PAM"},
375   { MESSAGE_TYPE_CIRC_GRP_RST_ACK,            "GRA"},
376   { MESSAGE_TYPE_CIRC_GRP_QRY,                "CQM"},
377   { MESSAGE_TYPE_CIRC_GRP_QRY_RSP,            "CQR"},
378   { MESSAGE_TYPE_CALL_PROGRSS,                "CPG"},
379   { MESSAGE_TYPE_USER2USER_INFO,              "UUI"},
380   { MESSAGE_TYPE_UNEQUIPPED_CIC,              "UCIC"},
381   { MESSAGE_TYPE_CONFUSION,                   "CFN"},
382   { MESSAGE_TYPE_OVERLOAD,                    "OLM"},
383   { MESSAGE_TYPE_CHARGE_INFO,                 "CRG"},
384   { MESSAGE_TYPE_NETW_RESRC_MGMT,             "NRM"},
385   { MESSAGE_TYPE_FACILITY,                    "FAC"},
386   { MESSAGE_TYPE_USER_PART_TEST,              "UPT"},
387   { MESSAGE_TYPE_USER_PART_AVAIL,             "UPA"},
388   { MESSAGE_TYPE_IDENT_REQ,                   "IDR"},
389   { MESSAGE_TYPE_IDENT_RSP,                   "IDS"},
390   { MESSAGE_TYPE_SEGMENTATION,                "SGM"},
391   { MESSAGE_TYPE_LOOP_PREVENTION,             "LOP"},
392   { MESSAGE_TYPE_APPLICATION_TRANS,           "APM"},
393   { MESSAGE_TYPE_PRE_RELEASE_INFO,            "PRI"},
394   { MESSAGE_TYPE_SUBSEQUENT_DIR_NUM,          "SDN"},
395   { ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES_ACK,   "CRA"},
396   { ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES,       "CRM"},
397   { ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST_RSP,  "CVR"},
398   { ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST,      "CVT"},
399   { ANSI_ISUP_MESSAGE_TYPE_EXIT,              "EXIT"},
400   { 0,                                  NULL}};
401 static value_string_ext ansi_isup_message_type_value_acro_ext = VALUE_STRING_EXT_INIT(ansi_isup_message_type_value_acro);
402
403 const value_string isup_parameter_type_value[] = {
404   { PARAM_TYPE_END_OF_OPT_PARAMS,         "End of optional parameters"},
405   { PARAM_TYPE_CALL_REF,                  "Call Reference (national use)"},
406   { PARAM_TYPE_TRANSM_MEDIUM_REQU,        "Transmission medium requirement"},
407   { PARAM_TYPE_ACC_TRANSP,                "Access transport"},
408   { PARAM_TYPE_CALLED_PARTY_NR,           "Called party number"},
409   { PARAM_TYPE_SUBSQT_NR,                 "Subsequent number"},
410   { PARAM_TYPE_NATURE_OF_CONN_IND,        "Nature of connection indicators"},
411   { PARAM_TYPE_FORW_CALL_IND,             "Forward call indicators"},
412   { PARAM_TYPE_OPT_FORW_CALL_IND,         "Optional forward call indicators"},
413   { PARAM_TYPE_CALLING_PRTY_CATEG,        "Calling party's category"},
414   { PARAM_TYPE_CALLING_PARTY_NR,          "Calling party number"},
415   { PARAM_TYPE_REDIRECTING_NR,            "Redirecting number"},
416   { PARAM_TYPE_REDIRECTION_NR,            "Redirection number"},
417   { PARAM_TYPE_CONNECTION_REQ,            "Connection request"},
418   { PARAM_TYPE_INFO_REQ_IND,              "Information request indicators (national use)"},
419   { PARAM_TYPE_INFO_IND,                  "Information indicators (national use)"},
420   { PARAM_TYPE_CONTINUITY_IND,            "Continuity request"},
421   { PARAM_TYPE_BACKW_CALL_IND,            "Backward call indicators"},
422   { PARAM_TYPE_CAUSE_INDICATORS,          "Cause indicators"},
423   { PARAM_TYPE_REDIRECTION_INFO,          "Redirection information"},
424   { PARAM_TYPE_CIRC_GRP_SV_MSG_TYPE,      "Circuit group supervision message type"},
425   { PARAM_TYPE_RANGE_AND_STATUS,          "Range and Status"},
426   { PARAM_TYPE_FACILITY_IND,              "Facility indicator"},
427   { PARAM_TYPE_CLSD_USR_GRP_ILOCK_CD,     "Closed user group interlock code"},
428   { PARAM_TYPE_USER_SERVICE_INFO,         "User service information"},
429   { PARAM_TYPE_SIGNALLING_POINT_CODE,     "Signalling point code (national use)"},
430   { PARAM_TYPE_USER_TO_USER_INFO,         "User-to-user information"},
431   { PARAM_TYPE_CONNECTED_NR,              "Connected number"},
432   { PARAM_TYPE_SUSP_RESUME_IND,           "Suspend/Resume indicators"},
433   { PARAM_TYPE_TRANSIT_NETW_SELECT,       "Transit network selection (national use)"},
434   { PARAM_TYPE_EVENT_INFO,                "Event information"},
435   { PARAM_TYPE_CIRC_ASSIGN_MAP,           "Circuit assignment map"},
436   { PARAM_TYPE_CIRC_STATE_IND,            "Circuit state indicator (national use)"},
437   { PARAM_TYPE_AUTO_CONG_LEVEL,           "Automatic congestion level"},
438   { PARAM_TYPE_ORIG_CALLED_NR,            "Original called number"},
439   { PARAM_TYPE_OPT_BACKW_CALL_IND,        "Backward call indicators"},
440   { PARAM_TYPE_USER_TO_USER_IND,          "User-to-user indicators"},
441   { PARAM_TYPE_ORIG_ISC_POINT_CODE,       "Origination ISC point code"},
442   { PARAM_TYPE_GENERIC_NOTIF_IND,         "Generic notification indicator"},
443   { PARAM_TYPE_CALL_HIST_INFO,            "Call history information"},
444   { PARAM_TYPE_ACC_DELIV_INFO,            "Access delivery information"},
445   { PARAM_TYPE_NETW_SPECIFIC_FACLTY,      "Network specific facility (national use)"},
446   { PARAM_TYPE_USER_SERVICE_INFO_PR,      "User service information prime"},
447   { PARAM_TYPE_PROPAG_DELAY_COUNTER,      "Propagation delay counter"},
448   { PARAM_TYPE_REMOTE_OPERATIONS,         "Remote operations (national use)"},
449   { PARAM_TYPE_SERVICE_ACTIVATION,        "Service activation"},
450   { PARAM_TYPE_USER_TELESERV_INFO,        "User teleservice information"},
451   { PARAM_TYPE_TRANSM_MEDIUM_USED,        "Transmission medium used"},
452   { PARAM_TYPE_CALL_DIV_INFO,             "Call diversion information"},
453   { PARAM_TYPE_ECHO_CTRL_INFO,            "Echo control information"},
454   { PARAM_TYPE_MSG_COMPAT_INFO,           "Message compatibility information"},
455   { PARAM_TYPE_PARAM_COMPAT_INFO,         "Parameter compatibility information"},
456   { PARAM_TYPE_MLPP_PRECEDENCE,           "MLPP precedence"},
457   { PARAM_TYPE_MCID_REQ_IND,              "MCID request indicators"},
458   { PARAM_TYPE_MCID_RSP_IND,              "MCID response indicators"},
459   { PARAM_TYPE_HOP_COUNTER,               "Hop counter"},
460   { PARAM_TYPE_TRANSM_MEDIUM_RQUR_PR,     "Transmission medium requirement prime"},
461   { PARAM_TYPE_LOCATION_NR,               "Location number"},
462   { PARAM_TYPE_REDIR_NR_RSTRCT,           "Redirection number restriction"},
463   { PARAM_TYPE_CALL_TRANS_REF,            "Call transfer reference"},
464   { PARAM_TYPE_LOOP_PREV_IND,             "Loop prevention indicators"},
465   { PARAM_TYPE_CALL_TRANS_NR,             "Call transfer number"},
466   { PARAM_TYPE_CCSS,                      "CCSS"},
467   { PARAM_TYPE_FORW_GVNS,                 "Forward GVNS"},
468   { PARAM_TYPE_BACKW_GVNS,                "Backward GVNS"},
469   { PARAM_TYPE_REDIRECT_CAPAB,            "Redirect capability (reserved for national use)"},
470   { PARAM_TYPE_NETW_MGMT_CTRL,            "Network management controls"},
471   { PARAM_TYPE_CORRELATION_ID,            "Correlation id"},
472   { PARAM_TYPE_SCF_ID,                    "SCF id"},
473   { PARAM_TYPE_CALL_DIV_TREAT_IND,        "Call diversion treatment indicators"},
474   { PARAM_TYPE_CALLED_IN_NR,              "Called IN number"},
475   { PARAM_TYPE_CALL_OFF_TREAT_IND,        "Call offering treatment indicators"},
476   { PARAM_TYPE_CHARGED_PARTY_IDENT,       "Charged party identification (national use)"},
477   { PARAM_TYPE_CONF_TREAT_IND,            "Conference treatment indicators"},
478   { PARAM_TYPE_DISPLAY_INFO,              "Display information"},
479   { PARAM_TYPE_UID_ACTION_IND,            "UID action indicators"},
480   { PARAM_TYPE_UID_CAPAB_IND,             "UID capability indicators"},
481   { PARAM_TYPE_REDIRECT_COUNTER,          "Redirect counter (reserved for national use)"},
482   { PARAM_TYPE_APPLICATON_TRANS,          "Application transport"},
483   { PARAM_TYPE_COLLECT_CALL_REQ,          "Collect call request"},
484   { PARAM_TYPE_GENERIC_NR,                "Generic number"},
485   { PARAM_TYPE_GENERIC_DIGITS,            "Generic digits (national use)"},
486   { 0,                                 NULL}};
487 static value_string_ext isup_parameter_type_value_ext = VALUE_STRING_EXT_INIT(isup_parameter_type_value);
488
489 static const value_string ansi_isup_parameter_type_value[] = {
490   { PARAM_TYPE_END_OF_OPT_PARAMS,         "End of optional parameters"},
491   { PARAM_TYPE_CALL_REF,                  "Call Reference (national use)"},
492   { PARAM_TYPE_TRANSM_MEDIUM_REQU,        "Transmission medium requirement"},
493   { PARAM_TYPE_ACC_TRANSP,                "Access transport"},
494   { PARAM_TYPE_CALLED_PARTY_NR,           "Called party number"},
495   { PARAM_TYPE_SUBSQT_NR,                 "Subsequent number"},
496   { PARAM_TYPE_NATURE_OF_CONN_IND,        "Nature of connection indicators"},
497   { PARAM_TYPE_FORW_CALL_IND,             "Forward call indicators"},
498   { PARAM_TYPE_OPT_FORW_CALL_IND,         "Optional forward call indicators"},
499   { PARAM_TYPE_CALLING_PRTY_CATEG,        "Calling party's category"},
500   { PARAM_TYPE_CALLING_PARTY_NR,          "Calling party number"},
501   { PARAM_TYPE_REDIRECTING_NR,            "Redirecting number"},
502   { PARAM_TYPE_REDIRECTION_NR,            "Redirection number"},
503   { PARAM_TYPE_CONNECTION_REQ,            "Connection request"},
504   { PARAM_TYPE_INFO_REQ_IND,              "Information request indicators (national use)"},
505   { PARAM_TYPE_INFO_IND,                  "Information indicators (national use)"},
506   { PARAM_TYPE_CONTINUITY_IND,            "Continuity request"},
507   { PARAM_TYPE_BACKW_CALL_IND,            "Backward call indicators"},
508   { PARAM_TYPE_CAUSE_INDICATORS,          "Cause indicators"},
509   { PARAM_TYPE_REDIRECTION_INFO,          "Redirection information"},
510   { PARAM_TYPE_CIRC_GRP_SV_MSG_TYPE,      "Circuit group supervision message type"},
511   { PARAM_TYPE_RANGE_AND_STATUS,          "Range and Status"},
512   { PARAM_TYPE_FACILITY_IND,              "Facility indicator"},
513   { PARAM_TYPE_CLSD_USR_GRP_ILOCK_CD,     "Closed user group interlock code"},
514   { PARAM_TYPE_USER_SERVICE_INFO,         "User service information"},
515   { PARAM_TYPE_SIGNALLING_POINT_CODE,     "Signalling point code (national use)"},
516   { PARAM_TYPE_USER_TO_USER_INFO,         "User-to-user information"},
517   { PARAM_TYPE_CONNECTED_NR,              "Connected number"},
518   { PARAM_TYPE_SUSP_RESUME_IND,           "Suspend/Resume indicators"},
519   { PARAM_TYPE_TRANSIT_NETW_SELECT,       "Transit network selection (national use)"},
520   { PARAM_TYPE_EVENT_INFO,                "Event information"},
521   { PARAM_TYPE_CIRC_ASSIGN_MAP,           "Circuit assignment map"},
522   { PARAM_TYPE_CIRC_STATE_IND,            "Circuit state indicator (national use)"},
523   { PARAM_TYPE_AUTO_CONG_LEVEL,           "Automatic congestion level"},
524   { PARAM_TYPE_ORIG_CALLED_NR,            "Original called number"},
525   { PARAM_TYPE_OPT_BACKW_CALL_IND,        "Backward call indicators"},
526   { PARAM_TYPE_USER_TO_USER_IND,          "User-to-user indicators"},
527   { PARAM_TYPE_ORIG_ISC_POINT_CODE,       "Origination ISC point code"},
528   { PARAM_TYPE_GENERIC_NOTIF_IND,         "Generic notification indicator"},
529   { PARAM_TYPE_CALL_HIST_INFO,            "Call history information"},
530   { PARAM_TYPE_ACC_DELIV_INFO,            "Access delivery information"},
531   { PARAM_TYPE_NETW_SPECIFIC_FACLTY,      "Network specific facility (national use)"},
532   { PARAM_TYPE_USER_SERVICE_INFO_PR,      "User service information prime"},
533   { PARAM_TYPE_PROPAG_DELAY_COUNTER,      "Propagation delay counter"},
534   { PARAM_TYPE_REMOTE_OPERATIONS,         "Remote operations (national use)"},
535   { PARAM_TYPE_SERVICE_ACTIVATION,        "Service activation"},
536   { PARAM_TYPE_USER_TELESERV_INFO,        "User teleservice information"},
537   { PARAM_TYPE_TRANSM_MEDIUM_USED,        "Transmission medium used"},
538   { PARAM_TYPE_CALL_DIV_INFO,             "Call diversion information"},
539   { PARAM_TYPE_ECHO_CTRL_INFO,            "Echo control information"},
540   { PARAM_TYPE_MSG_COMPAT_INFO,           "Message compatibility information"},
541   { PARAM_TYPE_PARAM_COMPAT_INFO,         "Parameter compatibility information"},
542   { PARAM_TYPE_MLPP_PRECEDENCE,           "MLPP precedence"},
543   { PARAM_TYPE_MCID_REQ_IND,              "MCID request indicators"},
544   { PARAM_TYPE_MCID_RSP_IND,              "MCID response indicators"},
545   { PARAM_TYPE_HOP_COUNTER,               "Hop counter"},
546   { PARAM_TYPE_TRANSM_MEDIUM_RQUR_PR,     "Transmission medium requirement prime"},
547   { PARAM_TYPE_LOCATION_NR,               "Location number"},
548   { PARAM_TYPE_REDIR_NR_RSTRCT,           "Redirection number restriction"},
549   { PARAM_TYPE_CALL_TRANS_REF,            "Call transfer reference"},
550   { PARAM_TYPE_LOOP_PREV_IND,             "Loop prevention indicators"},
551   { PARAM_TYPE_CALL_TRANS_NR,             "Call transfer number"},
552   { PARAM_TYPE_CCSS,                      "CCSS"},
553   { PARAM_TYPE_FORW_GVNS,                 "Forward GVNS"},
554   { PARAM_TYPE_BACKW_GVNS,                "Backward GVNS"},
555   { PARAM_TYPE_REDIRECT_CAPAB,            "Redirect capability (reserved for national use)"},
556   { PARAM_TYPE_NETW_MGMT_CTRL,            "Network management controls"},
557   { PARAM_TYPE_CORRELATION_ID,            "Correlation id"},
558   { PARAM_TYPE_SCF_ID,                    "SCF id"},
559   { PARAM_TYPE_CALL_DIV_TREAT_IND,        "Call diversion treatment indicators"},
560   { PARAM_TYPE_CALLED_IN_NR,              "Called IN number"},
561   { PARAM_TYPE_CALL_OFF_TREAT_IND,        "Call offering treatment indicators"},
562   { PARAM_TYPE_CHARGED_PARTY_IDENT,       "Charged party identification (national use)"},
563   { PARAM_TYPE_CONF_TREAT_IND,            "Conference treatment indicators"},
564   { PARAM_TYPE_DISPLAY_INFO,              "Display information"},
565   { PARAM_TYPE_UID_ACTION_IND,            "UID action indicators"},
566   { PARAM_TYPE_UID_CAPAB_IND,             "UID capability indicators"},
567   { PARAM_TYPE_REDIRECT_COUNTER,          "Redirect counter (reserved for national use)"},
568   { PARAM_TYPE_APPLICATON_TRANS,          "Application transport"},
569   { PARAM_TYPE_COLLECT_CALL_REQ,          "Collect call request"},
570   { PARAM_TYPE_CALLING_GEODETIC_LOCATION, "Calling geodetic location"},
571   { PARAM_TYPE_GENERIC_NR,                "Generic number"},
572   { PARAM_TYPE_GENERIC_DIGITS,            "Generic digits (national use)"},
573 #if 0 /* XXX: Dups of below */
574   { PARAM_TYPE_JURISDICTION,              "Jurisdiction"},
575   { PARAM_TYPE_GENERIC_NAME,              "Generic name"},
576   { PARAM_TYPE_ORIG_LINE_INFO,            "Originating line info"},
577 #endif
578   { ANSI_ISUP_PARAM_TYPE_OPER_SERV_INF,   "Operator Services information"},
579   { ANSI_ISUP_PARAM_TYPE_EGRESS,          "Egress"},
580   { ANSI_ISUP_PARAM_TYPE_JURISDICTION,    "Jurisdiction"},
581   { ANSI_ISUP_PARAM_TYPE_CARRIER_ID,      "Carrier identification"},
582   { ANSI_ISUP_PARAM_TYPE_BUSINESS_GRP,    "Business group"},
583   { ANSI_ISUP_PARAM_TYPE_GENERIC_NAME,    "Generic name"},
584   { ANSI_ISUP_PARAM_TYPE_NOTIF_IND,       "Notification indicator"},
585   { ANSI_ISUP_PARAM_TYPE_CG_CHAR_IND,     "Circuit group characteristic indicator"},
586   { ANSI_ISUP_PARAM_TYPE_CVR_RESP_IND,    "Circuit validation response indicator"},
587   { ANSI_ISUP_PARAM_TYPE_OUT_TRK_GRP_NM,  "Outgoing trunk group number"},
588   { ANSI_ISUP_PARAM_TYPE_CI_NAME_IND,     "Circuit identification name"},
589   { ANSI_ISUP_PARAM_CLLI_CODE,            "COMMON LANGUAGE location identification (CLLI) code"},
590   { ANSI_ISUP_PARAM_ORIG_LINE_INF,        "Originating line information"},
591   { ANSI_ISUP_PARAM_CHRG_NO,              "Charge number"},
592   { ANSI_ISUP_PARAM_SERV_CODE_IND,        "Service code indicator"},
593   { ANSI_ISUP_PARAM_SPEC_PROC_REQ,        "Special processing request"},
594   { ANSI_ISUP_PARAM_CARRIER_SEL_INF,      "Carrier selection information"},
595   { ANSI_ISUP_PARAM_NET_TRANS,            "Network transport"},
596   { 0,                                 NULL}};
597 static value_string_ext ansi_isup_parameter_type_value_ext = VALUE_STRING_EXT_INIT(ansi_isup_parameter_type_value);
598
599 #define CIC_LENGTH                             2
600 #define BICC_CIC_LENGTH                        4
601 #define MESSAGE_TYPE_LENGTH                    1
602 #define COMMON_HEADER_LENGTH                   (CIC_LENGTH + MESSAGE_TYPE_LENGTH)
603 #define BICC_COMMON_HEADER_LENGTH              (BICC_CIC_LENGTH + MESSAGE_TYPE_LENGTH)
604
605 #define MAXDIGITS                              32 /* Max number of address digits */
606 #define MAXGNAME                               15 /* Max number of characters in generic name */
607
608 #define PARAMETER_TYPE_LENGTH                  1
609 #define PARAMETER_POINTER_LENGTH               1
610 #define PARAMETER_LENGTH_IND_LENGTH            1
611
612 /* All following parameter length definitions are WITHOUT the parameter type byte and length indicator for optional parameters*/
613 #define PARAMETER_NAME_LENGTH                  1
614 #define PARAMETER_LENGTH_IND_LENGTH            1
615 #define ACCESS_DELIVERY_INFO_LENGTH            1
616 #define AUTO_CONGEST_LEVEL_LENGTH              1
617 #define BACKWARD_CALL_IND_LENGTH               2
618 #define BACKWARD_GVNS_LENGTH                   1
619 #define CALL_DIV_INFO_LENGTH                   1
620 #define CALL_DIV_TREATMENT_IND_LENGTH          1
621 #define CALL_HISTORY_INFO_LENGTH               2
622 #define CALL_OFFERING_TREATMENT_IND_LENGTH     1
623 #define CALL_REFERENCE_LENGTH                  5
624 #define CALL_TRANSFER_REF_LENGTH               1
625 #define CALLING_PRTYS_CATEGORY_LENGTH          1
626 #define CCSS_LENGTH                            1
627 #define CIRCUIT_ASSIGNMENT_MAP_LENGTH          5
628 #define CIRC_GRP_SV_MSG_TYPE_LENGTH            1
629 #define CLOSED_USR_GRP_INTERLOCK_CODE_LENGTH   4
630 #define COLLECT_CALL_REQUEST_LENGTH            1
631 #define CONFERENCE_TREATMENT_IND_LENGTH        1
632 #define CONNECTION_REQUEST_LENGTH              7
633 #define CONTINUITY_IND_LENGTH                  1
634 #define ECHO_CONTROL_INFO_LENGTH               1
635 #define END_OF_OPT_PART_LENGTH                 1
636 #define EVENT_INFO_LENGTH                      1
637 #define FACILITY_IND_LENGTH                    1
638 #define FORWARD_CALL_IND_LENGTH                2
639 #define GENERIC_NOTIFICATION_IND_LENGTH        1
640 #define HOP_COUNTER_LENGTH                     1
641 #define ORIG_LINE_INFO_LENGTH                  1
642 #define INFO_IND_LENGTH                        2
643 #define INFO_REQUEST_IND_LENGTH                2
644 #define LOOP_PREVENTION_IND_LENGTH             1
645 #define MCID_REQUEST_IND_LENGTH                1
646 #define MCID_RESPONSE_IND_LENGTH               1
647 #define MLPP_PRECEDENCE_LENGTH                 1
648 #define NATURE_OF_CONNECTION_IND_LENGTH        1
649 #define NETWORK_MANAGEMENT_CONTROLS_LENGTH     1
650 #define OPTIONAL_BACKWARD_CALL_IND_LENGTH      1
651 #define OPTIONAL_FORWARD_CALL_IND_LENGTH       1
652 #define ORIGINAL_ISC_POINT_CODE_LENGTH         2
653 #define PROPAGATION_DELAY_COUNT_LENGTH         2
654 #define REDIRECTION_NUMBER_LENGTH              2
655 #define REDIRECTION_INFO_LENGTH                2
656 #define REDIRECTION_NUMBER_RESTRICTION_LENGTH  1
657 #define SIGNALLING_POINT_CODE_LENGTH           2
658 #define SUSPEND_RESUME_IND_LENGTH              1
659 #define TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH 1
660 #define TRANSMISSION_MEDIUM_RQMT_PRIME_LENGTH  1
661 #define TRANSMISSION_MEDIUM_USED_LENGTH        1
662 #define UID_ACTION_IND_LENGTH                  1
663 #define UID_CAPABILITY_IND_LENGTH              1
664 #define USER_TELESERVICE_INFO_LENGTH           2
665 #define USER_TO_USER_IND_LENGTH                1
666 #define RANGE_LENGTH                           1
667
668 #define CVR_RESP_IND_LENGTH                    1
669 #define CG_CHAR_IND_LENGTH                     1
670 #define CI_NAME_IND                           28
671 #define CLLI_CODE_LENGTH                      13
672
673 #define CALL_ID_LENGTH        3 /* for parameter Call Reference */
674 #define SPC_LENGTH            2 /* for parameter Call Reference, Connection request */
675 #define LOCAL_REF_LENGTH      3 /* for parameter Connection request */
676 #define PROTOCOL_CLASS_LENGTH 1 /* for parameter Connection request */
677 #define CREDIT_LENGTH         1 /* for parameter Connection request */
678
679 #define CIC_OFFSET            0
680 #define BICC_CIC_OFFSET       0
681
682 #define NO_SATELLITE_CIRCUIT_IN_CONNECTION   0
683 #define ONE_SATELLITE_CIRCUIT_IN_CONNECTION  1
684 #define TWO_SATELLITE_CIRCUIT_IN_CONNECTION  2
685 static const value_string isup_satellite_ind_value[] = {
686   { NO_SATELLITE_CIRCUIT_IN_CONNECTION,          "No Satellite circuit in connection"},
687   { ONE_SATELLITE_CIRCUIT_IN_CONNECTION,         "One Satellite circuit in connection"},
688   { TWO_SATELLITE_CIRCUIT_IN_CONNECTION,         "Two Satellite circuits in connection"},
689   { 0,                                 NULL}};
690
691 #define CONTINUITY_CHECK_NOT_REQUIRED           0
692 #define CONTINUITY_CHECK_REQUIRED               1
693 #define CONTINUITY_CHECK_ON_A_PREVIOUS_CIRCUIT  2
694 static const value_string isup_continuity_check_ind_value[] = {
695   { CONTINUITY_CHECK_NOT_REQUIRED,               "Continuity check not required"},
696   { CONTINUITY_CHECK_REQUIRED,                   "Continuity check required on this circuit"},
697   { CONTINUITY_CHECK_ON_A_PREVIOUS_CIRCUIT ,     "Continuity check performed on a previous circuit"},
698   { 0,                                 NULL}};
699
700 static const true_false_string isup_echo_control_device_ind_value = {
701   "Echo control device included",
702   "Echo control device not included"
703 };
704
705 static const true_false_string isup_natnl_inatnl_call_ind_value = {
706   "Call to be treated as international call",
707   "Call to be treated as national call"
708 };
709
710 #define NO_END_TO_END_METHOD_AVAILABLE       0
711 #define PASS_ALONG_METHOD_AVAILABLE          1
712 #define SCCP_METHOD_AVAILABLE                2
713 #define PASS_ALONG_AND_SCCP_METHOD_AVAILABLE 3
714 static const value_string isup_end_to_end_method_ind_value[] = {
715   { NO_END_TO_END_METHOD_AVAILABLE,          "No End-to-end method available (only link-by-link method available)"},
716   { PASS_ALONG_METHOD_AVAILABLE,             "Pass-along method available (national use)"},
717   { SCCP_METHOD_AVAILABLE,                   "SCCP method available"},
718   { PASS_ALONG_AND_SCCP_METHOD_AVAILABLE,    "pass-along and SCCP method available (national use)"},
719   { 0,                                 NULL}};
720
721 static const true_false_string isup_interworking_ind_value = {
722   "interworking encountered",
723   "no interworking encountered (No.7 signalling all the way)"
724 };
725
726 static const true_false_string isup_end_to_end_info_ind_value = {
727   "end-to-end information available",
728   "no end-to-end information available"
729 };
730
731 static const true_false_string isup_ISDN_user_part_ind_value = {
732   "ISDN user part used all the way",
733   "ISDN user part not used all the way"
734 };
735
736 #define ISUP_PREFERRED_ALL_THE_WAY              0
737 #define ISUP_NOT_REQUIRED_ALL_THE_WAY           1
738 #define ISUP_REQUIRED_ALL_WAY                   2
739 #define ISUP_ISDN_USER_PART_IND_SPARE           3
740 static const value_string isup_preferences_ind_value[] = {
741   { ISUP_PREFERRED_ALL_THE_WAY,                  "ISDN user part preferred all the way"},
742   { ISUP_NOT_REQUIRED_ALL_THE_WAY,               "ISDN user part not required all the way"},
743   { ISUP_REQUIRED_ALL_WAY,                       "ISDN user part required all the way"},
744   { ISUP_ISDN_USER_PART_IND_SPARE,               "spare"},
745   { 0,                                 NULL}};
746
747 static const true_false_string isup_ISDN_originating_access_ind_value = {
748   "originating access ISDN",
749   "originating access non-ISDN"
750 };
751
752 static const true_false_string isup_ISDN_ported_num_trans_ind_value = {
753   "number translated",
754   "number not translated"
755 };
756
757 static const true_false_string isup_ISDN_qor_attempt_ind_value = {
758   "QoR routing attempt in progress",
759   "no QoR routing attempt in progress"
760 };
761
762 #define NO_INDICATION                                0
763 #define CONNECTIONLESS_METHOD_AVAILABLE              1
764 #define CONNECITON_ORIENTED_METHOD_AVAILABLE         2
765 #define CONNECTIONLESS_AND_ORIENTED_METHOD_AVAILABLE 3
766 static const value_string isup_SCCP_method_ind_value[] = {
767   { NO_INDICATION,                                  "No indication"},
768   { CONNECTIONLESS_METHOD_AVAILABLE,                "Connectionless method available (national use)"},
769   { CONNECITON_ORIENTED_METHOD_AVAILABLE,           "Connection oriented method available"},
770   { CONNECTIONLESS_AND_ORIENTED_METHOD_AVAILABLE,   "Connectionless and -oriented method available (national use)"},
771   { 0,                                 NULL}};
772
773 #define UNKNOWN_AT_THIS_TIME                 0
774 #define OPERATOR_FRENCH                      1
775 #define OPERATOR_ENGLISH                     2
776 #define OPERATOR_GERMAN                      3
777 #define OPERATOR_RUSSIAN                     4
778 #define OPERATOR_SPANISH                     5
779 #define ORDINARY_CALLING_SUBSCRIBER         10
780 #define CALLING_SUBSCRIBER_WITH_PRIORITY    11
781 #define DATA_CALL                           12
782 #define TEST_CALL                           13
783 #define PAYPHONE                            15
784 static const value_string isup_calling_partys_category_value[] = {
785   { UNKNOWN_AT_THIS_TIME,               "Category unknown at this time (national use)"},
786   { OPERATOR_FRENCH,                    "operator, language French"},
787   { OPERATOR_ENGLISH,                   "operator, language English"},
788   { OPERATOR_GERMAN,                    "operator, language German"},
789   { OPERATOR_RUSSIAN,                   "operator, language Russian"},
790   { OPERATOR_SPANISH,                   "operator, language Spanish"},
791
792   { 6,                                  "available to Administrations"},
793   { 7,                                  "available to Administrations"},
794   { 8,                                  "available to Administrations"},
795   { 9,                                  "reserved (national use)"},
796
797   { ORDINARY_CALLING_SUBSCRIBER,        "ordinary calling subscriber"},
798   { CALLING_SUBSCRIBER_WITH_PRIORITY,   "calling subscriber with priority"},
799   { DATA_CALL,                          "data call (voice band data)"},
800   { TEST_CALL,                          "test call"},
801   /* q.763-200212Amd2 */
802   { 14,                                 "IEPS call marking for preferential call set up"},
803   { PAYPHONE,                           "payphone"},
804   { 0,                                 NULL}};
805 value_string_ext isup_calling_partys_category_value_ext = VALUE_STRING_EXT_INIT(isup_calling_partys_category_value);
806
807 #define CVR_RSP_IND_FAILURE     0
808 #define CVR_RSP_IND_SUCCESS     1
809
810 static const value_string isup_cvr_rsp_ind_value[ ] = {
811   { CVR_RSP_IND_FAILURE, "CVR Response Fail" },
812   { CVR_RSP_IND_SUCCESS, "CVR Response Success" },
813   { 0,                  NULL }
814 };
815
816 #define CVR_CG_IND_DOUBLE_SEIZE_NONE 0
817 #define CVR_CG_IND_DOUBLE_SEIZE_ODD  1
818 #define CVR_CG_IND_DOUBLE_SEIZE_EVEN 2
819 #define CVR_CG_IND_DOUBLE_SEIZE_ALL  3
820
821 static const value_string isup_cvr_cg_double_seize_value[ ] = {
822   { CVR_CG_IND_DOUBLE_SEIZE_NONE, "Double Seize control NONE" },
823   { CVR_CG_IND_DOUBLE_SEIZE_ODD,  "Double Seize control odd circuits"},
824   { CVR_CG_IND_DOUBLE_SEIZE_EVEN, "Double Seize control even circuits"},
825   { CVR_CG_IND_DOUBLE_SEIZE_ALL,  "Double Seize control all circuits"},
826   {0, NULL }
827 };
828
829 #define CVR_CG_IND_CAR_IND_UNKNOWN      0
830 #define CVR_CG_IND_CAR_IND_ANALOG       1
831 #define CVR_CG_IND_CAR_IND_DIGITAL      2
832 #define CVR_CG_IND_CAR_IND_ANALOG_DIG   3
833
834 static const value_string isup_cvr_cg_car_ind_value[ ] = {
835 { CVR_CG_IND_CAR_IND_UNKNOWN   , "Carrier Type Unknown" },
836 { CVR_CG_IND_CAR_IND_ANALOG    , "Carrier Type Analog" },
837 { CVR_CG_IND_CAR_IND_DIGITAL   , "Carrier Type Digital"},
838 { CVR_CG_IND_CAR_IND_ANALOG_DIG, "Carrier Type Digital And Analog"},
839 { 0, NULL }
840 };
841
842 #define CVR_CG_IND_ALARM_CAR_IND_UNKNOWN  0
843 #define CVR_CG_IND_ALARM_CAR_IND_SOFTWARE 1
844 #define CVR_CG_IND_ALARM_CAR_IND_HARDWARE 2
845 #define CVR_CG_IND_ALARM_CAR_IND_SPARE    3
846
847 static const value_string isup_cvr_alarm_car_ind_value[ ] = {
848   { CVR_CG_IND_ALARM_CAR_IND_UNKNOWN    , "Alarm Carrier Ind Default"},
849   { CVR_CG_IND_ALARM_CAR_IND_SOFTWARE   , "Alarm Carrier Ind Software"},
850   { CVR_CG_IND_ALARM_CAR_IND_HARDWARE   , "Alarm Carrier Ind Hardware"},
851   { CVR_CG_IND_ALARM_CAR_IND_SPARE      , "Alarm Carrier Ind Spare"},
852   { 0, NULL }
853 };
854
855 #define CVR_CG_IND_CONT_CHK_UNKNOWN  0
856 #define CVR_CG_IND_CONT_CHK_NONE     1
857 #define CVR_CG_IND_CONT_CHK_STAT     2
858 #define CVR_CG_IND_CONT_CHK_PER_CALL 3
859
860 static const value_string isup_cvr_cont_chk_ind_value[ ] = {
861
862   { CVR_CG_IND_CONT_CHK_UNKNOWN  , "Continuity Check Unknown"},
863   { CVR_CG_IND_CONT_CHK_NONE     , "Continuity Check NONE"},
864   { CVR_CG_IND_CONT_CHK_STAT     , "Continuity Check Statistical"},
865   { CVR_CG_IND_CONT_CHK_PER_CALL , "Continuity Check Per Call"},
866   { 0, NULL }
867 };
868
869 #define MEDIUM_SPEECH                        0
870 #define MEDIUM_64KBS                         2
871 #define MEDIUM_3_1_KHZ_AUDIO                 3
872 #define MEDIUM_RESERVED_SERVICE2_1           4
873 #define MEDIUM_RESERVED_SERVICE1_2           5
874 #define MEDIUM_64KBS_PREFERRED               6
875 #define MEDIUM_2_64KBS                       7
876 #define MEDIUM_384KBS                        8
877 #define MEDIUM_1536KBS                       9
878 #define MEDIUM_1920KBS                      10
879
880 #define MEDIUM_3_64KBS                      16
881 #define MEDIUM_4_64KBS                      17
882 #define MEDIUM_5_64KBS                      18
883
884 #define MEDIUM_7_64KBS                      20
885 #define MEDIUM_8_64KBS                      21
886 #define MEDIUM_9_64KBS                      22
887 #define MEDIUM_10_64KBS                     23
888 #define MEDIUM_11_64KBS                     24
889 #define MEDIUM_12_64KBS                     25
890 #define MEDIUM_13_64KBS                     26
891 #define MEDIUM_14_64KBS                     27
892 #define MEDIUM_15_64KBS                     28
893 #define MEDIUM_16_64KBS                     29
894 #define MEDIUM_17_64KBS                     30
895 #define MEDIUM_18_64KBS                     31
896 #define MEDIUM_19_64KBS                     32
897 #define MEDIUM_20_64KBS                     33
898 #define MEDIUM_21_64KBS                     34
899 #define MEDIUM_22_64KBS                     35
900 #define MEDIUM_23_64KBS                     36
901
902 #define MEDIUM_25_64KBS                     38
903 #define MEDIUM_26_64KBS                     39
904 #define MEDIUM_27_64KBS                     40
905 #define MEDIUM_28_64KBS                     41
906 #define MEDIUM_29_64KBS                     42
907
908 static const value_string isup_transmission_medium_requirement_value[] = {
909   { MEDIUM_SPEECH,                       "speech"},
910   { 1,                                   "spare"},
911   { MEDIUM_64KBS,                        "64 kbit/s unrestricted"},
912   { MEDIUM_3_1_KHZ_AUDIO,                "3.1 kHz audio"},
913   { MEDIUM_RESERVED_SERVICE2_1,          "reserved for alternate speech (service 2)/64 kbit/s unrestricted (service 1)"},
914   { MEDIUM_RESERVED_SERVICE1_2,          "reserved for alternate 64 kbit/s unrestricted (service 1)/speech (service 2)"},
915   { MEDIUM_64KBS_PREFERRED,              "64 kbit/s preferred"},
916   { MEDIUM_2_64KBS,                      "2x64 kbit/s unrestricted"},
917   { MEDIUM_384KBS,                       "384 kbit/s unrestricted"},
918   { MEDIUM_1536KBS,                      "1536 kbit/s unrestricted"},
919   { MEDIUM_1920KBS,                      "1920 kbit/s unrestricted"},
920
921   { 11,                                  "spare"},
922   { 12,                                  "spare"},
923   { 13,                                  "spare"},
924   { 14,                                  "spare"},
925   { 15,                                  "spare"},
926
927   { MEDIUM_3_64KBS,                      "3x64 kbit/s unrestricted"},
928   { MEDIUM_4_64KBS,                      "4x64 kbit/s unrestricted"},
929   { MEDIUM_5_64KBS,                      "5x64 kbit/s unrestricted"},
930
931   { 19,                                  "spare"},
932
933   { MEDIUM_7_64KBS,                      "7x64 kbit/s unrestricted"},
934   { MEDIUM_8_64KBS,                      "8x64 kbit/s unrestricted"},
935   { MEDIUM_9_64KBS,                      "9x64 kbit/s unrestricted"},
936   { MEDIUM_10_64KBS,                     "10x64 kbit/s unrestricted"},
937   { MEDIUM_11_64KBS,                     "11x64 kbit/s unrestricted"},
938   { MEDIUM_12_64KBS,                     "12x64 kbit/s unrestricted"},
939   { MEDIUM_13_64KBS,                     "13x64 kbit/s unrestricted"},
940   { MEDIUM_14_64KBS,                     "14x64 kbit/s unrestricted"},
941   { MEDIUM_15_64KBS,                     "15x64 kbit/s unrestricted"},
942   { MEDIUM_16_64KBS,                     "16x64 kbit/s unrestricted"},
943   { MEDIUM_17_64KBS,                     "17x64 kbit/s unrestricted"},
944   { MEDIUM_18_64KBS,                     "18x64 kbit/s unrestricted"},
945   { MEDIUM_19_64KBS,                     "19x64 kbit/s unrestricted"},
946   { MEDIUM_20_64KBS,                     "20x64 kbit/s unrestricted"},
947   { MEDIUM_21_64KBS,                     "21x64 kbit/s unrestricted"},
948   { MEDIUM_22_64KBS,                     "22x64 kbit/s unrestricted"},
949   { MEDIUM_23_64KBS,                     "23x64 kbit/s unrestricted"},
950
951   { 37,                                  "spare"},
952
953   { MEDIUM_25_64KBS,                     "25x64 kbit/s unrestricted"},
954   { MEDIUM_26_64KBS,                     "26x64 kbit/s unrestricted"},
955   { MEDIUM_27_64KBS,                     "27x64 kbit/s unrestricted"},
956   { MEDIUM_28_64KBS,                     "28x64 kbit/s unrestricted"},
957   { MEDIUM_29_64KBS,                     "29x64 kbit/s unrestricted"},
958   { 0,                                 NULL}};
959 value_string_ext isup_transmission_medium_requirement_value_ext = VALUE_STRING_EXT_INIT(isup_transmission_medium_requirement_value);
960
961 static const value_string isup_transmission_medium_requirement_prime_value[] = {
962   { MEDIUM_SPEECH,                       "speech"},
963   { 1,                                   "spare"},
964   { MEDIUM_64KBS,                        "reserved for 64 kbit/s unrestricted"},
965   { MEDIUM_3_1_KHZ_AUDIO,                "3.1 kHz audio"},
966   { MEDIUM_RESERVED_SERVICE2_1,          "reserved for alternate speech (service 2)/64 kbit/s unrestricted (service 1)"},
967   { MEDIUM_RESERVED_SERVICE1_2,          "reserved for alternate 64 kbit/s unrestricted (service 1)/speech (service 2)"},
968   { MEDIUM_64KBS_PREFERRED,              "reserved for 64 kbit/s preferred"},
969   { MEDIUM_2_64KBS,                      "reserved for 2x64 kbit/s unrestricted"},
970   { MEDIUM_384KBS,                       "reserved for 384 kbit/s unrestricted"},
971   { MEDIUM_1536KBS,                      "reserved for 1536 kbit/s unrestricted"},
972   { MEDIUM_1920KBS,                      "reserved for 1920 kbit/s unrestricted"},
973   { 0,                                 NULL}};
974 static value_string_ext isup_transmission_medium_requirement_prime_value_ext = VALUE_STRING_EXT_INIT(isup_transmission_medium_requirement_prime_value);
975
976
977 /* Definitions for Called and Calling Party number */
978 #define ISUP_ODD_EVEN_MASK                       0x80
979 #define ISUP_NATURE_OF_ADDRESS_IND_MASK          0x7F
980 #define ISUP_INN_MASK                            0x80
981 #define ISUP_NI_MASK                             0x80
982 #define ISUP_NUMBERING_PLAN_IND_MASK             0x70
983 #define ISUP_ADDRESS_PRESENTATION_RESTR_IND_MASK 0x0C
984 #define ISUP_SCREENING_IND_MASK                  0x03
985 #define ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK       0x0F
986 #define ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK      0xF0
987
988 static const true_false_string isup_odd_even_ind_value = {
989   "odd number of address signals",
990   "even number of address signals"
991 };
992
993 #define ISUP_CALLED_PARTY_NATURE_SUBSCRIBER_NR  1
994 #define ISUP_CALLED_PARTY_NATURE_UNKNOWN        2
995 #define ISUP_CALLED_PARTY_NATURE_NATIONAL_NR    3
996 #define ISUP_CALLED_PARTY_NATURE_INTERNATNL_NR  4
997 #define ISUP_CALLED_PARTY_NATURE_NETW_SPEC_NR   5
998
999 #define ISUP_CHARGE_NATURE_ANI_CGPA_SUB_NR      1
1000 #define ISUP_CHARGE_NATURE_ANI_NA               2
1001 #define ISUP_CHARGE_NATURE_ANI_CGPA_NAT_NR      3
1002 #define ISUP_CHARGE_NATURE_ANI_CDPA_SUB_NR      5
1003 #define ISUP_CHARGE_NATURE_ANI_CDPA_NO_NR       6
1004 #define ISUP_CHARGE_NATURE_ANI_CDPA_NAT_NR      7
1005
1006 static const value_string isup_called_party_nature_of_address_ind_value[] = {
1007   { ISUP_CALLED_PARTY_NATURE_SUBSCRIBER_NR,     "subscriber number (national use)"},
1008   { ISUP_CALLED_PARTY_NATURE_UNKNOWN,           "unknown (national use)"},
1009   { ISUP_CALLED_PARTY_NATURE_NATIONAL_NR,       "national (significant) number"},
1010   { ISUP_CALLED_PARTY_NATURE_INTERNATNL_NR,     "international number"},
1011   { ISUP_CALLED_PARTY_NATURE_NETW_SPEC_NR,      "network-specific number (national use)"},
1012   { 0,                                 NULL}};
1013
1014 static const value_string isup_calling_party_nature_of_address_ind_value[] = {
1015   { ISUP_CALLED_PARTY_NATURE_SUBSCRIBER_NR,     "subscriber number (national use)"},
1016   { ISUP_CALLED_PARTY_NATURE_UNKNOWN,           "unknown (national use)"},
1017   { ISUP_CALLED_PARTY_NATURE_NATIONAL_NR,       "national (significant) number"},
1018   { ISUP_CALLED_PARTY_NATURE_INTERNATNL_NR,     "international number"},
1019   { 0,                                 NULL}};
1020
1021 static const value_string isup_charge_number_nature_of_address_ind_value[] = {
1022   { ISUP_CHARGE_NATURE_ANI_CGPA_SUB_NR,  "ANI of the calling party; subscriber number"},
1023   { ISUP_CHARGE_NATURE_ANI_NA,           "ANI not available or not provided"},
1024   { ISUP_CHARGE_NATURE_ANI_CGPA_NAT_NR,  "ANI of the calling party; national number"},
1025   { ISUP_CHARGE_NATURE_ANI_CDPA_SUB_NR,  "ANI of the called party; subscriber number"},
1026   { ISUP_CHARGE_NATURE_ANI_CDPA_NO_NR,   "ANI of the called party; no number present"},
1027   { ISUP_CHARGE_NATURE_ANI_CDPA_NAT_NR,  "ANI of the called party; national number"},
1028   { 0,                                 NULL}};
1029
1030 #define ISUP_GENERIC_NAME_PRESENTATION_ALLOWED          0
1031 #define ISUP_GENERIC_NAME_PRESENTATION_RESTRICT         1
1032 #define ISUP_GENERIC_NAME_PRESENTATION_BLOCK_TOGGLE     2
1033 #define ISUP_GENERIC_NAME_PRESENTATION_NO_INDIC         3
1034 #define ISUP_GENERIC_NAME_TYPE_SPARE                    0
1035 #define ISUP_GENERIC_NAME_TYPE_CALLING                  1
1036 #define ISUP_GENERIC_NAME_TYPE_ORIG_CALLED              2
1037 #define ISUP_GENERIC_NAME_TYPE_REDIRECTING              3
1038 #define ISUP_GENERIC_NAME_TYPE_CONNECTED                4
1039
1040 static const value_string isup_generic_name_presentation_value[] = {
1041   { ISUP_GENERIC_NAME_PRESENTATION_ALLOWED,             "presentation allowed"},
1042   { ISUP_GENERIC_NAME_PRESENTATION_RESTRICT,            "presentation restricted"},
1043   { ISUP_GENERIC_NAME_PRESENTATION_BLOCK_TOGGLE,        "blocking toggle"},
1044   { ISUP_GENERIC_NAME_PRESENTATION_NO_INDIC,            "no indication"},
1045   { 0,                                 NULL}};
1046
1047 static const true_false_string isup_generic_name_availability_value = {
1048   "name not available",
1049   "name available/unknown"
1050 };
1051
1052 static const value_string isup_generic_name_type_value[] = {
1053   { ISUP_GENERIC_NAME_TYPE_SPARE,               "spare"},
1054   { ISUP_GENERIC_NAME_TYPE_CALLING,             "calling name"},
1055   { ISUP_GENERIC_NAME_TYPE_ORIG_CALLED,         "original called name"},
1056   { ISUP_GENERIC_NAME_TYPE_REDIRECTING,         "redirecting name"},
1057   { ISUP_GENERIC_NAME_TYPE_CONNECTED,           "connected name"},
1058   { 5,                                          "spare"},
1059   { 6,                                          "spare"},
1060   { 7,                                          "spare"},
1061   { 0,                                 NULL}};
1062
1063 static const true_false_string isup_INN_ind_value = {
1064   "routing to internal network number not allowed",
1065   "routing to internal network number allowed "
1066 };
1067 static const true_false_string isup_NI_ind_value = {
1068   "incomplete",
1069   "complete"
1070 };
1071
1072 static const value_string isup_location_presentation_restricted_ind_value[] = {
1073   { 0,                                 "presentation allowed"},
1074   { 1,                                 "presentation restricted"},
1075   { 2,                                 "location not available"},
1076   { 3,                                 "spare"},
1077   { 0,                                 NULL}};
1078
1079 static const value_string isup_location_type_of_shape_value[] = {
1080   { 0,          "ellipsoid point"},
1081   { 1,          "ellipsoid point with uncertainty"},
1082   { 2,          "point with altitude and uncertainty"},
1083   { 3,          "ellipse on the ellipsoid"},
1084   { 4,          "ellipsoid circle sector"},
1085   { 5,          "polygon"},
1086   { 0,          NULL}};
1087
1088 #define ISDN_NUMBERING_PLAN                     1
1089 #define DATA_NUMBERING_PLAN                     3
1090 #define TELEX_NUMBERING_PLAN                    4
1091 static const value_string isup_numbering_plan_ind_value[] = {
1092   { ISDN_NUMBERING_PLAN,     "ISDN (Telephony) numbering plan"},
1093   { DATA_NUMBERING_PLAN,     "Data numbering plan (national use)"},
1094   { TELEX_NUMBERING_PLAN,    "Telex numbering plan (national use)"},
1095   { 5,                       "Reserved for national use"},
1096   { 6,                       "Reserved for national use"},
1097   { 0,                                 NULL}};
1098
1099 #define ADDRESS_PRESETATION_ALLOWED      0
1100 #define ADDRESS_PRESETATION_RESTRICTED   1
1101 #define ADDRESS_NOT_AVAILABLE            2
1102 static const value_string isup_address_presentation_restricted_ind_value[] = {
1103   { ADDRESS_PRESETATION_ALLOWED,     "presentation allowed"},
1104   { ADDRESS_PRESETATION_RESTRICTED,  "presentation restricted"},
1105   { ADDRESS_NOT_AVAILABLE,           "address not available (national use)"},
1106   { 3,                                 "spare"},
1107   { 0,                                 NULL}};
1108
1109 static const value_string isup_screening_ind_value[] = {
1110   { 0,     "reserved"},
1111   { 1,     "user provided, verified and passed"},
1112   { 2,     "reserved"},
1113   { 3,     "network provided"},
1114   { 0,     NULL}};
1115
1116 static const value_string isup_screening_ind_enhanced_value[] = {
1117   { 0,     "user provided, not verified"},
1118   { 1,     "user provided, verified and passed"},
1119   { 2,     "user provided, verified and failed"},
1120   { 3,     "network provided"},
1121   { 0,     NULL}};
1122
1123 static const value_string isup_called_party_address_digit_value[] = {
1124   { 0,  "0"},
1125   { 1,  "1"},
1126   { 2,  "2"},
1127   { 3,  "3"},
1128   { 4,  "4"},
1129   { 5,  "5"},
1130   { 6,  "6"},
1131   { 7,  "7"},
1132   { 8,  "8"},
1133   { 9,  "9"},
1134   { 10, "spare"},
1135   { 11, "code 11 "},
1136   { 12, "code 12"},
1137   { 15, "Stop sending"},
1138   { 0,  NULL}};
1139
1140 static const value_string isup_calling_party_address_digit_value[] = {
1141   { 0,  "0"},
1142   { 1,  "1"},
1143   { 2,  "2"},
1144   { 3,  "3"},
1145   { 4,  "4"},
1146   { 5,  "5"},
1147   { 6,  "6"},
1148   { 7,  "7"},
1149   { 8,  "8"},
1150   { 9,  "9"},
1151   { 10, "spare"},
1152   { 11, "code 11 "},
1153   { 12, "code 12"},
1154   { 15, "spare"},
1155   { 0,  NULL}};
1156
1157 /*End of Called/Calling party address definitions */
1158
1159
1160 static const true_false_string isup_calling_party_address_request_ind_value = {
1161   "calling party address requested",
1162   "calling party address not requested"
1163 };
1164 static const true_false_string isup_holding_ind_value = {
1165   "holding requested",
1166   "holding not requested"
1167 };
1168 static const true_false_string isup_calling_partys_category_request_ind_value = {
1169   "Calling Party's category requested",
1170   "Calling Party's category not requested",
1171 };
1172 static const true_false_string isup_charge_information_request_ind_value = {
1173   "Charge Information requested",
1174   "Charge Information not requested"
1175 };
1176 static const true_false_string isup_malicious_call_identification_request_ind_value = {
1177   "Malicious call identification requested",
1178   "Malicious call identification not requested"
1179 };
1180
1181 #define CALLING_PARTY_ADDRESS_NOT_INCLUDED             0
1182 #define CALLING_PARTY_ADDRESS_NOT_AVAILABLE            1
1183 #define CALLING_PARTY_ADDRESS_INCLUDED                 3
1184 static const value_string isup_calling_party_address_response_ind_value[] = {
1185   { CALLING_PARTY_ADDRESS_NOT_INCLUDED, "Calling party address not included"},
1186   { CALLING_PARTY_ADDRESS_NOT_AVAILABLE,"Calling party address not available"},
1187   { 4,                                  "spare"},
1188   { CALLING_PARTY_ADDRESS_INCLUDED,     "Calling party address included"},
1189   { 0,                                 NULL}};
1190
1191 static const true_false_string isup_hold_provided_ind_value = {
1192   "hold provided",
1193   "hold not provided"
1194 };
1195 static const true_false_string isup_calling_partys_category_response_ind_value = {
1196   "Calling Party's category included",
1197   "Calling Party's category not included",
1198 };
1199 static const true_false_string isup_charge_information_response_ind_value = {
1200   "Charge Information included",
1201   "Charge Information not included"
1202 };
1203 static const true_false_string isup_solicited_information_ind_value = {
1204   "unsolicited",
1205   "solicited"
1206 };
1207
1208 static const true_false_string isup_continuity_ind_value = {
1209   "Continuity check successful",
1210   "Continuity ckec failed"
1211 };
1212
1213 #define CHARGE_NO_IND       0
1214 #define CHARGE_NO_CHARGE    1
1215 #define CHARGE_CHARGE       2
1216 static const value_string isup_charge_ind_value[] = {
1217   { CHARGE_NO_IND,    "No indication"},
1218   { CHARGE_NO_CHARGE, "No charge"},
1219   { CHARGE_CHARGE,    "Charge"},
1220   { 3,                "spare"},
1221   { 0,                NULL}};
1222
1223 #define CALLED_PARTYS_STATUS_NO_IND            0
1224 #define CALLED_PARTYS_STATUS_SUBSCR_FREE       1
1225 #define CALLED_PARTYS_STATUS_CONNECT_WHEN_FREE 2
1226 static const value_string isup_called_partys_status_ind_value[] = {
1227   { CALLED_PARTYS_STATUS_NO_IND,            "No indication"},
1228   { CALLED_PARTYS_STATUS_SUBSCR_FREE,       "Subscriber free"},
1229   { CALLED_PARTYS_STATUS_CONNECT_WHEN_FREE, "Connect when free (national use)"},
1230   { 3,                                      "spare"},
1231   { 0,                NULL}};
1232
1233 #define CALLED_PARTYS_CATEGORY_NO_IND            0
1234 #define CALLED_PARTYS_CATEGORY_ORDINARY_SUBSCR   1
1235 #define CALLED_PARTYS_CATEGORY_PAYPHONE          2
1236 static const value_string isup_called_partys_category_ind_value[] = {
1237   { CALLED_PARTYS_CATEGORY_NO_IND,             "No indication"},
1238   { CALLED_PARTYS_CATEGORY_ORDINARY_SUBSCR,    "Ordinary subscriber"},
1239   { CALLED_PARTYS_CATEGORY_PAYPHONE,           "Payphone"},
1240   { 3,                                         "spare"},
1241   { 0,                NULL}};
1242
1243 static const true_false_string isup_ISDN_terminating_access_ind_value = {
1244   "terminating access ISDN",
1245   "terminating access non-ISDN"
1246 };
1247
1248 static const true_false_string isup_suspend_resume_ind_value = {
1249   "network initiated",
1250   "ISDN subscriber initiated"
1251 };
1252 #define MAINTENANCE            0
1253 #define HARDWARE_FAILURE       1
1254 #define RES_FOR_NATNL_USE      2
1255 static const value_string isup_cgs_message_type_value[] = {
1256   { MAINTENANCE,            "maintenance oriented"},
1257   { HARDWARE_FAILURE,       "hardware failure oriented"},
1258   { RES_FOR_NATNL_USE,      "reserved for national use (ISUP'84)"},
1259   { 3,                      "spare"},
1260   { 0,                NULL}};
1261
1262 #define USER_TO_USER_SERVICE      2
1263 static const value_string isup_facility_ind_value[] = {
1264   { USER_TO_USER_SERVICE,     "user-to-user service"},
1265   { 0,                NULL}};
1266
1267 #define MTC_BLCK_STATE_TRANSIENT  0
1268 #define MTC_BLCK_STATE_UNEQUIPPED 3
1269 static const value_string isup_mtc_blocking_state_DC00_value[] = {
1270   {  MTC_BLCK_STATE_TRANSIENT,  "transient"},
1271   { 1,                          "spare"},
1272   { 2,                          "spare"},
1273   {  MTC_BLCK_STATE_UNEQUIPPED, "unequipped"},
1274   { 0,                NULL}};
1275
1276 #define MTC_BLCK_NO_BLOCKING      0
1277 #define MTC_LOCALLY_BLOCKED       1
1278 #define MTC_REMOTELY_BLOCKED      2
1279 #define MTC_LOCAL_REMOTE_BLOCKED  3
1280 static const value_string isup_mtc_blocking_state_DCnot00_value[] = {
1281   {  MTC_BLCK_NO_BLOCKING,     "no blocking (active)"},
1282   {  MTC_LOCALLY_BLOCKED,      "locally blocked"},
1283   {  MTC_REMOTELY_BLOCKED,     "remotely blocked"},
1284   {  MTC_LOCAL_REMOTE_BLOCKED, "locally and remotely blocked"},
1285   {  0,                NULL}};
1286
1287 #define CALL_PROC_INCOMING_BUSY 1
1288 #define CALL_PROC_OUTGOING_BUSY 2
1289 #define CALL_PROC_IDLE          3
1290 static const value_string isup_call_processing_state_value[] = {
1291   {  CALL_PROC_INCOMING_BUSY,     "circuit incoming busy"},
1292   {  CALL_PROC_OUTGOING_BUSY,     "circuit outgoing busy"},
1293   {  CALL_PROC_IDLE,              "idle"},
1294   {  0,                NULL}};
1295
1296 #define HW_BLCK_NO_BLOCKING          0
1297 #define HW_LOCALLY_BLOCKED           1
1298 #define HW_REMOTELY_BLOCKED          2
1299 #define HW_LOCAL_REMOTE_BLOCKED      3
1300 static const value_string isup_HW_blocking_state_value[] = {
1301   {  HW_BLCK_NO_BLOCKING,     "no blocking (active)"},
1302   {  HW_LOCALLY_BLOCKED,      "locally blocked"},
1303   {  HW_REMOTELY_BLOCKED,     "remotely blocked"},
1304   {  HW_LOCAL_REMOTE_BLOCKED, "locally and remotely blocked"},
1305   {  0,                NULL}};
1306
1307 #define EVENT_ALERTING      1
1308 #define EVENT_PROGRESS      2
1309 #define EVENT_INBAND_INFO   3
1310 #define EVENT_ON_BUSY       4
1311 #define EVENT_ON_NO_REPLY   5
1312 #define EVENT_UNCONDITIONAL 6
1313 static const value_string isup_event_ind_value[] = {
1314   /* according 3.21/Q.763 */
1315   {  EVENT_ALERTING,     "ALERTING"},
1316   {  EVENT_PROGRESS,     "PROGRESS"},
1317   {  EVENT_INBAND_INFO,  "in-band information or an appropriate pattern is now available"},
1318   {  EVENT_ON_BUSY,      "call forwarded on busy (national use)"},
1319   {  EVENT_ON_NO_REPLY,  "call forwarded on no reply (national use)"},
1320   {  EVENT_UNCONDITIONAL,"call forwarded unconditional (national use)"},
1321   {  0,                NULL}};
1322
1323 static const true_false_string isup_event_presentation_restricted_ind_value = {
1324   /* according 3.21/Q.763 */
1325   "presentation restricted",
1326   "no indication"
1327 };
1328 #define CUG_NON_CUG_CALL                      0
1329 #define CUG_CALL_OUTGOING_ACCESS_ALLOWED      2
1330 #define CUG_CALL_OUTGOING_ACCESS_NOT_ALLOWED  3
1331 static const value_string isup_CUG_call_ind_value[] = {
1332   /* according 3.38/Q.763 */
1333   {  CUG_NON_CUG_CALL,                     "non-CUG call"},
1334   {  1,                                    "spare"},
1335   {  CUG_CALL_OUTGOING_ACCESS_ALLOWED,     "closed user group call, outgoing access allowed"},
1336   {  CUG_CALL_OUTGOING_ACCESS_NOT_ALLOWED, "closed user group call, outgoing access not allowed"},
1337   {  0,                NULL}};
1338
1339
1340 static const true_false_string isup_simple_segmentation_ind_value = {
1341   /* according 3.38/Q.763 */
1342   "additional information will be sent in a segmentation message",
1343   "no additional information will be sent"
1344 };
1345
1346 static const true_false_string isup_connected_line_identity_request_ind_value = {
1347   /* according 3.38/Q.763 */
1348   "requested",
1349   "not requested"
1350 };
1351
1352 static const value_string isup_redirecting_ind_value[] = {
1353   /* according 3.45/Q.763 */
1354   {  0,  "no redirection (national use)"},
1355   {  1,  "call rerouted (national use)"},
1356   {  2,  "call rerouted, all redirection information presentation restricted (national use)"},
1357   {  3,  "call diverted"},
1358   {  4,  "call diverted, all redirection information presentation restricted"},
1359   {  5,  "call rerouted, redirection number presentation restricted (national use)"},
1360   {  6,  "call diversion, redirection number presentation restricted (national use)"},
1361   {  7,  "spare"},
1362   {  0,  NULL}};
1363
1364 static const value_string isup_original_redirection_reason_value[] = {
1365   /* according 3.45/Q.763 */
1366   {  0,  "unknown/not available"},
1367   {  1,  "user busy (national use)"},
1368   {  2,  "no reply (national use)"},
1369   {  3,  "unconditional (national use)"},
1370   {  0,  NULL}};
1371
1372 static const value_string isup_redirection_reason_value[] = {
1373   /* according 3.45/Q.763 */
1374   {  0,  "unknown/not available"},
1375   {  1,  "user busy (national use)"},
1376   {  2,  "no reply (national use)"},
1377   {  3,  "unconditional (national use)"},
1378   {  4,  "deflection during alerting"},
1379   {  5,  "deflection immediate response"},
1380   {  6,  "mobile subscriber not reachable"},
1381   {  0,  NULL}};
1382
1383 static const value_string isup_type_of_network_identification_value[] = {
1384   /* according 3.53/Q.763 */
1385   {  0,  "CCITT/ITU-T-standardized identification"},
1386   {  2,  "national network identification"},
1387   {  0,  NULL}};
1388
1389 static const value_string isup_network_identification_plan_value[] = {
1390   /* according 3.53/Q.763 */
1391   {  0,  "if CCITT/ITU-T id - unknown"},
1392   {  3,  "if CCITT/ITU-T id - public data network id code (X.121)"},
1393   {  6,  "if CCITT/ITU-T id - public land Mobile Network id code (E.211)"},
1394   {  0,  NULL}};
1395
1396 static const value_string isup_map_type_value[] = {
1397   /* according 3.69/Q.763 */
1398   {  1,  "1544 kbit/s digital path map format (64 kbit/s base rate"},
1399   {  2,  "2048 kbit/s digital path map format (64 kbit/s base rate"},
1400   {  0,  NULL}};
1401
1402 static const value_string isup_auto_congestion_level_value[] = {
1403   /* according 3.4/Q.763 */
1404   {  1,  "Congestion level 1 exceeded"},
1405   {  2,  "Congestion level 2 exceeded"},
1406   {  0,  NULL}};
1407
1408 static const true_false_string isup_inband_information_ind_value = {
1409   /* according 3.37/Q.763 */
1410   "in-band information or an appropriate pattern is now available",
1411   "no indication"
1412 };
1413 static const true_false_string isup_call_diversion_may_occur_ind_value = {
1414   /* according 3.37/Q.763 */
1415   "call diversion may occur",
1416   "no indication"
1417 };
1418 static const true_false_string isup_MLPP_user_ind_value = {
1419   /* according 3.37/Q.763 */
1420   "MLPP user",
1421   "no indication"
1422 };
1423
1424 static const true_false_string isup_access_delivery_ind_value = {
1425   /* according 3.2/Q.763 */
1426   "No set-up message generated",
1427   "Set-up message generated"
1428 };
1429
1430 static const value_string isup_loop_prevention_response_ind_value[] = {
1431   /* according 3.67/Q.763 */
1432   {  0,  "insufficient information"},
1433   {  1,  "no loop exists"},
1434   {  2,  "simultaneous transfer"},
1435   {  0,  NULL}};
1436
1437 static const true_false_string isup_temporary_alternative_routing_ind_value = {
1438   /* according 3.68/Q.763 */
1439   "TAR controlled call",
1440   "no indication"
1441 };
1442 static const true_false_string isup_extension_ind_value = {
1443   /* according 3.68/Q.763 */
1444   "last octet",
1445   "information continues through the next octet"
1446 };
1447
1448
1449
1450 static const value_string isup_call_to_be_diverted_ind_value[] = {
1451   /* according 3.72/Q.763 */
1452   {  0,  "no indication"},
1453   {  1,  "call diversion allowed"},
1454   {  2,  "call diversion not allowed"},
1455   {  3,  "spare"},
1456   {  0,  NULL}};
1457
1458 static const value_string isup_call_to_be_offered_ind_value[] = {
1459   /* according 3.72/Q.763 */
1460   {  0,  "no indication"},
1461   {  1,  "call offering not allowed"},
1462   {  2,  "call offering allowed"},
1463   {  3,  "spare"},
1464   {  0,  NULL}};
1465
1466 static const value_string isup_conference_acceptance_ind_value[] = {
1467   /* according 3.76/Q.763 */
1468   {  0,  "no indication"},
1469   {  1,  "accept conference request"},
1470   {  2,  "reject conference request"},
1471   {  3,  "spare"},
1472   {  0,  NULL}};
1473
1474 static const value_string isup_application_transport_parameter_value[] = {
1475   /* according 3.82/Q.763 */
1476   {  0,  "Unidentified Context and Error Handling (UCEH) ASE"},
1477   {  1,  "PSS1 ASE (VPN)"},
1478   {  2,  "spare"},
1479   {  3,  "Charging ASE"},
1480   {  4,  "GAT"},
1481   {  5,  "BAT ASE"},
1482   {  6,  "Enhanced Unidentified Context and Error Handling ASE (EUCEH ASE)"},
1483   {  0,  NULL}};
1484
1485 static const true_false_string isup_Release_call_indicator_value = {
1486   "release call",
1487   "do not release call"
1488 };
1489
1490 static const true_false_string isup_Send_notification_ind_value = {
1491   "send notification",
1492   "do not send notification"
1493 };
1494 static const value_string isup_APM_segmentation_ind_value[] = {
1495
1496   {  0x00,  "final segment"},
1497   {  0x01,  "number of following segments"},
1498   {  0x02,  "number of following segments"},
1499   {  0x03,  "number of following segments"},
1500   {  0x04,  "number of following segments"},
1501   {  0x05,  "number of following segments"},
1502   {  0x06,  "number of following segments"},
1503   {  0x07,  "number of following segments"},
1504   {  0x08,  "number of following segments"},
1505   {  0x09,  "number of following segments"},
1506   {  0,     NULL}};
1507
1508 static const true_false_string isup_Sequence_ind_value = {
1509   "new sequence",
1510   "subsequent segment to first segment"
1511 };
1512
1513
1514 /* Generalized bit masks for 8 and 16 bits fields */
1515 #define A_8BIT_MASK  0x01
1516 #define B_8BIT_MASK  0x02
1517 #define C_8BIT_MASK  0x04
1518 #define D_8BIT_MASK  0x08
1519 #define E_8BIT_MASK  0x10
1520 #define F_8BIT_MASK  0x20
1521 #define G_8BIT_MASK  0x40
1522 #define H_8BIT_MASK  0x80
1523
1524 #define BA_8BIT_MASK 0x03
1525 #define CB_8BIT_MASK 0x06
1526 #define DC_8BIT_MASK 0x0C
1527 #define ED_8BIT_MASK 0x18
1528 #define FE_8BIT_MASK 0x30
1529 #define GF_8BIT_MASK 0x60
1530 #define HG_8BIT_MASK 0xC0
1531 #define GFE_8BIT_MASK 0x70
1532 #define HGF_8BIT_MASK 0xE0
1533 #define DCBA_8BIT_MASK 0x0F
1534 #define EDCBA_8BIT_MASK 0x1F
1535 #define HGFE_8BIT_MASK 0xF0
1536 #define GFEDCBA_8BIT_MASK 0x7F
1537 #define FEDCBA_8BIT_MASK 0x3F
1538
1539 #define A_16BIT_MASK  0x0100
1540 #define B_16BIT_MASK  0x0200
1541 #define C_16BIT_MASK  0x0400
1542 #define D_16BIT_MASK  0x0800
1543 #define E_16BIT_MASK  0x1000
1544 #define F_16BIT_MASK  0x2000
1545 #define G_16BIT_MASK  0x4000
1546 #define H_16BIT_MASK  0x8000
1547 #define I_16BIT_MASK  0x0001
1548 #define J_16BIT_MASK  0x0002
1549 #define K_16BIT_MASK  0x0004
1550 #define L_16BIT_MASK  0x0008
1551 #define M_16BIT_MASK  0x0010
1552 #define N_16BIT_MASK  0x0020
1553 #define O_16BIT_MASK  0x0040
1554 #define P_16BIT_MASK  0x0080
1555
1556 #define BA_16BIT_MASK 0x0300
1557 #define CB_16BIT_MASK 0x0600
1558 #define DC_16BIT_MASK 0x0C00
1559 #define FE_16BIT_MASK 0x3000
1560 #define HG_16BIT_MASK 0xC000
1561 #define KJ_16BIT_MASK 0x0006
1562 #define PO_16BIT_MASK 0x00C0
1563
1564 #define CBA_16BIT_MASK 0x0700
1565 #define KJI_16BIT_MASK 0x0007
1566 #define HGFE_16BIT_MASK 0xF000
1567 #define PONM_16BIT_MASK 0x00F0
1568
1569 /* Initialize the protocol and registered fields */
1570 static int proto_isup = -1;
1571 static int proto_bicc = -1;
1572 static module_t *isup_module;
1573
1574 static gboolean isup_show_cic_in_info = TRUE;
1575
1576 static int hf_isup_called = -1;
1577 static int hf_isup_calling = -1;
1578 static int hf_isup_redirecting = -1;
1579
1580 static int hf_isup_cic = -1;
1581 static int hf_bicc_cic = -1;
1582
1583 static int isup_tap = -1;
1584
1585 static int hf_isup_message_type = -1;
1586 static int hf_isup_parameter_type = -1;
1587 static int hf_isup_parameter_length = -1;
1588 static int hf_isup_mandatory_variable_parameter_pointer = -1;
1589 static int hf_isup_pointer_to_start_of_optional_part = -1;
1590
1591 static int hf_isup_cvr_rsp_ind = -1;
1592 static int hf_isup_cvr_cg_car_ind = -1;
1593 static int hf_isup_cvr_cg_double_seize = -1;
1594 static int hf_isup_cvr_cg_alarm_car_ind = -1;
1595 static int hf_isup_cvr_cont_chk_ind = -1;
1596
1597 static int hf_isup_satellite_indicator = -1;
1598 static int hf_isup_continuity_check_indicator = -1;
1599 static int hf_isup_echo_control_device_indicator = -1;
1600
1601 static int hf_isup_forw_call_natnl_inatnl_call_indicator = -1;
1602 static int hf_isup_forw_call_end_to_end_method_indicator = -1;
1603 static int hf_isup_forw_call_interworking_indicator = -1;
1604 static int hf_isup_forw_call_end_to_end_info_indicator = -1;
1605 static int hf_isup_forw_call_isdn_user_part_indicator = -1;
1606 static int hf_isup_forw_call_preferences_indicator = -1;
1607 static int hf_isup_forw_call_isdn_access_indicator = -1;
1608 static int hf_isup_forw_call_ported_num_trans_indicator = -1;
1609 static int hf_isup_forw_call_qor_attempt_indicator = -1;
1610 static int hf_isup_forw_call_sccp_method_indicator = -1;
1611
1612 static int hf_isup_calling_partys_category = -1;
1613
1614 static int hf_isup_transmission_medium_requirement = -1;
1615
1616 static int hf_isup_odd_even_indicator = -1;
1617 static int hf_isup_called_party_nature_of_address_indicator = -1;
1618 static int hf_isup_calling_party_nature_of_address_indicator = -1;
1619 static int hf_isup_inn_indicator = -1;
1620 static int hf_isup_ni_indicator = -1;
1621 static int hf_isup_numbering_plan_indicator = -1;
1622 static int hf_isup_address_presentation_restricted_indicator = -1;
1623 static int hf_isup_screening_indicator = -1;
1624 static int hf_isup_screening_indicator_enhanced = -1;
1625 static int hf_isup_called_party_odd_address_signal_digit = -1;
1626 static int hf_isup_calling_party_odd_address_signal_digit = -1;
1627 static int hf_isup_called_party_even_address_signal_digit = -1;
1628 static int hf_isup_calling_party_even_address_signal_digit = -1;
1629
1630 static int hf_isup_generic_name_presentation  = -1;
1631 static int hf_isup_generic_name_availability  = -1;
1632 static int hf_isup_generic_name_type          = -1;
1633 static int hf_isup_generic_name_ia5           = -1;
1634
1635 static int hf_isup_OECD_inf_ind = -1;
1636 static int hf_isup_IECD_inf_ind = -1;
1637 static int hf_isup_OECD_req_ind = -1;
1638 static int hf_isup_IECD_req_ind = -1;
1639
1640 static int hf_isup_calling_party_address_request_indicator = -1;
1641 static int hf_isup_info_req_holding_indicator = -1;
1642 static int hf_isup_calling_partys_category_request_indicator = -1;
1643 static int hf_isup_charge_information_request_indicator = -1;
1644 static int hf_isup_charge_number_nature_of_address_indicator = -1;
1645 static int hf_isup_malicious_call_identification_request_indicator = -1;
1646
1647 static int hf_isup_calling_party_address_response_indicator = -1;
1648 static int hf_isup_hold_provided_indicator = -1;
1649 static int hf_isup_calling_partys_category_response_indicator = -1;
1650 static int hf_isup_charge_information_response_indicator = -1;
1651 static int hf_isup_solicited_indicator = -1;
1652
1653 static int hf_isup_continuity_indicator = -1;
1654
1655 static int hf_isup_backw_call_charge_ind = -1 ;
1656 static int hf_isup_backw_call_called_partys_status_ind = -1;
1657 static int hf_isup_backw_call_called_partys_category_ind = -1;
1658 static int hf_isup_backw_call_end_to_end_method_ind = -1;
1659 static int hf_isup_backw_call_interworking_ind = -1;
1660 static int hf_isup_backw_call_end_to_end_info_ind = -1;
1661 static int hf_isup_backw_call_isdn_user_part_ind = -1;
1662 static int hf_isup_backw_call_holding_ind = -1;
1663 static int hf_isup_backw_call_isdn_access_ind = -1;
1664 static int hf_isup_backw_call_echo_control_device_ind = -1;
1665 static int hf_isup_backw_call_sccp_method_ind = -1;
1666
1667 static int hf_isup_cause_indicator = -1;
1668 static int hf_ansi_isup_cause_indicator = -1;
1669
1670 static int hf_isup_suspend_resume_indicator = -1;
1671
1672 static int hf_isup_range_indicator = -1;
1673 static int hf_isup_cgs_message_type = -1;
1674
1675 static int hf_isup_mtc_blocking_state1 = -1;
1676 static int hf_isup_mtc_blocking_state2 = -1;
1677 static int hf_isup_call_proc_state = -1;
1678 static int hf_isup_hw_blocking_state = -1;
1679
1680 static int hf_isup_event_ind = -1;
1681 static int hf_isup_event_presentation_restricted_ind = -1;
1682
1683 static int hf_isup_cug_call_ind = -1;
1684 static int hf_isup_simple_segmentation_ind = -1;
1685 static int hf_isup_connected_line_identity_request_ind = -1;
1686
1687 static int hf_isup_redirecting_ind = -1;
1688 static int hf_isup_original_redirection_reason = -1;
1689 static int hf_isup_redirection_counter = -1;
1690 static int hf_isup_redirection_reason = -1;
1691
1692 static int hf_isup_type_of_network_identification = -1;
1693 static int hf_isup_network_identification_plan = -1;
1694
1695 static int hf_isup_map_type = -1;
1696
1697 static int hf_isup_automatic_congestion_level               = -1;
1698
1699 static int hf_isup_inband_information_ind                   = -1;
1700 static int hf_isup_call_diversion_may_occur_ind             = -1;
1701 static int hf_isup_mlpp_user_ind                            = -1;
1702
1703 static int hf_isup_UUI_type                                 = -1;
1704 static int hf_isup_UUI_req_service1                         = -1;
1705 static int hf_isup_UUI_req_service2                         = -1;
1706 static int hf_isup_UUI_req_service3                         = -1;
1707 static int hf_isup_UUI_res_service1                         = -1;
1708 static int hf_isup_UUI_res_service2                         = -1;
1709 static int hf_isup_UUI_res_service3                         = -1;
1710 static int hf_isup_UUI_network_discard_ind                  = -1;
1711 static int hf_isup_access_delivery_ind                      = -1;
1712
1713 static int hf_isup_transmission_medium_requirement_prime    = -1;
1714
1715 static int hf_isup_loop_prevention_response_ind             = -1;
1716
1717 static int hf_isup_temporary_alternative_routing_ind        = -1;
1718 static int hf_isup_extension_ind                            = -1;
1719
1720 static int hf_isup_call_to_be_diverted_ind                  = -1;
1721
1722 static int hf_isup_call_to_be_offered_ind                   = -1;
1723
1724 static int hf_isup_conference_acceptance_ind                = -1;
1725
1726 static int hf_isup_transit_at_intermediate_exchange_ind     = -1;
1727 static int hf_isup_Release_call_ind                         = -1;
1728 static int hf_isup_Send_notification_ind                    = -1;
1729 static int hf_isup_Discard_message_ind_value                = -1;
1730 static int hf_isup_Discard_parameter_ind                    = -1;
1731 static int hf_isup_Pass_on_not_possible_indicator           = -1;
1732 static int hf_isup_pass_on_not_possible_indicator2          = -1;
1733 static int hf_isup_Broadband_narrowband_interworking_ind    = -1;
1734 static int hf_isup_Broadband_narrowband_interworking_ind2   = -1;
1735
1736 static int hf_isup_app_cont_ident                   = -1;
1737 static int hf_isup_app_Send_notification_ind        = -1;
1738 static int hf_isup_apm_segmentation_ind             = -1;
1739 static int hf_isup_apm_si_ind                       = -1;
1740 static int hf_isup_apm_slr                          = -1;
1741 static int hf_isup_orig_addr_len                    = -1;
1742 static int hf_isup_dest_addr_len                    = -1;
1743 static int hf_isup_app_Release_call_ind             = -1;
1744 static int hf_isup_cause_location                   = -1;
1745
1746 static int hf_ansi_isup_coding_standard             = -1;
1747
1748 static int hf_length_indicator                      = -1;
1749 static int hf_afi                                   = -1;
1750 static int hf_bicc_nsap_dsp                         = -1;
1751 static int hf_bat_ase_identifier                    = -1;
1752
1753 static int hf_Action_Indicator                      = -1;
1754
1755 static int hf_Instruction_ind_for_general_action       = -1;
1756
1757 static int hf_Send_notification_ind_for_general_action = -1;
1758
1759 static int hf_Instruction_ind_for_pass_on_not_possible = -1;
1760
1761 static int hf_Send_notification_ind_for_pass_on_not_possible = -1;
1762 static int hf_BCTP_Version_Indicator        = -1;
1763 static int hf_Tunnelled_Protocol_Indicator  = -1;
1764 static int hf_TPEI                          = -1;
1765 static int hf_BVEI                          = -1;
1766 static int hf_bncid                         = -1;
1767 static int hf_bat_ase_biwfa                 = -1;
1768 static int hf_characteristics               = -1;
1769
1770 static int hf_Organization_Identifier       = -1;
1771 static int hf_codec_type                    = -1;
1772 static int hf_etsi_codec_type               = -1;
1773 static int hf_active_code_set  = -1;
1774 static int hf_active_code_set_12_2  = -1;
1775 static int hf_active_code_set_10_2  = -1;
1776 static int hf_active_code_set_7_95  = -1;
1777 static int hf_active_code_set_7_40  = -1;
1778 static int hf_active_code_set_6_70  = -1;
1779 static int hf_active_code_set_5_90  = -1;
1780 static int hf_active_code_set_5_15  = -1;
1781 static int hf_active_code_set_4_75  = -1;
1782 static int hf_supported_code_set  = -1;
1783 static int hf_supported_code_set_12_2  = -1;
1784 static int hf_supported_code_set_10_2  = -1;
1785 static int hf_supported_code_set_7_95  = -1;
1786 static int hf_supported_code_set_7_40  = -1;
1787 static int hf_supported_code_set_6_70  = -1;
1788 static int hf_supported_code_set_5_90  = -1;
1789 static int hf_supported_code_set_5_15  = -1;
1790 static int hf_supported_code_set_4_75  = -1;
1791 static int hf_optimisation_mode  = -1;
1792 static int hf_max_codec_modes  = -1;
1793 static int hf_bearer_control_tunneling          = -1;
1794 static int hf_Local_BCU_ID                      = -1;
1795 static int hf_late_cut_trough_cap_ind           = -1;
1796 static int hf_bat_ase_signal                    = -1;
1797 static int hf_bat_ase_duration                  = -1;
1798 static int hf_bat_ase_bearer_redir_ind          = -1;
1799 static int hf_BAT_ASE_Comp_Report_Reason        = -1;
1800 static int hf_BAT_ASE_Comp_Report_ident         = -1;
1801 static int hf_BAT_ASE_Comp_Report_diagnostic    = -1;
1802 static int hf_nsap_ipv4_addr                    = -1;
1803 static int hf_nsap_ipv6_addr                    = -1;
1804 static int hf_iana_icp                          = -1;
1805
1806 static int hf_isup_geo_loc_presentation_restricted_ind  = -1;
1807 static int hf_isup_geo_loc_screening_ind        = -1;
1808
1809 static int hf_isup_apm_msg_fragments = -1;
1810 static int hf_isup_apm_msg_fragment = -1;
1811 static int hf_isup_apm_msg_fragment_overlap = -1;
1812 static int hf_isup_apm_msg_fragment_overlap_conflicts = -1;
1813 static int hf_isup_apm_msg_fragment_multiple_tails = -1;
1814 static int hf_isup_apm_msg_fragment_too_long_fragment = -1;
1815 static int hf_isup_apm_msg_fragment_error = -1;
1816 static int hf_isup_apm_msg_fragment_count = -1;
1817 static int hf_isup_apm_msg_reassembled_in = -1;
1818 static int hf_isup_apm_msg_reassembled_length = -1;
1819
1820 /* Initialize the subtree pointers */
1821 static gint ett_isup                            = -1;
1822 static gint ett_isup_parameter                  = -1;
1823 static gint ett_isup_address_digits             = -1;
1824 static gint ett_isup_pass_along_message         = -1;
1825 static gint ett_isup_circuit_state_ind          = -1;
1826 static gint ett_bat_ase                         = -1;
1827 static gint ett_bicc                            = -1;
1828 static gint ett_bat_ase_element                 = -1;
1829 static gint ett_bat_ase_iwfa                    = -1;
1830 static gint ett_acs                             = -1;
1831 static gint ett_scs                             = -1;
1832
1833 static gint ett_isup_apm_msg_fragment = -1;
1834 static gint ett_isup_apm_msg_fragments = -1;
1835
1836
1837 static dissector_handle_t sdp_handle = NULL;
1838 static dissector_handle_t q931_ie_handle = NULL;
1839
1840 /* Declarations to desegment APM Messages */
1841 static gboolean isup_apm_desegment = TRUE;
1842
1843 static const fragment_items isup_apm_msg_frag_items = {
1844   /* Fragment subtrees */
1845   &ett_isup_apm_msg_fragment,
1846   &ett_isup_apm_msg_fragments,
1847   /* Fragment fields */
1848   &hf_isup_apm_msg_fragments,
1849   &hf_isup_apm_msg_fragment,
1850   &hf_isup_apm_msg_fragment_overlap,
1851   &hf_isup_apm_msg_fragment_overlap_conflicts,
1852   &hf_isup_apm_msg_fragment_multiple_tails,
1853   &hf_isup_apm_msg_fragment_too_long_fragment,
1854   &hf_isup_apm_msg_fragment_error,
1855   &hf_isup_apm_msg_fragment_count,
1856   /* Reassembled in field */
1857   &hf_isup_apm_msg_reassembled_in,
1858   /* Reassembled length field */
1859   &hf_isup_apm_msg_reassembled_length,
1860   /* Tag */
1861   "ISUP APM Message fragments"
1862 };
1863
1864 static GHashTable *isup_apm_msg_fragment_table = NULL;
1865 static GHashTable *isup_apm_msg_reassembled_table = NULL;
1866
1867
1868 static void
1869 isup_apm_defragment_init(void)
1870 {
1871   fragment_table_init (&isup_apm_msg_fragment_table);
1872   reassembled_table_init(&isup_apm_msg_reassembled_table);
1873 }
1874
1875 /* Info for the tap that must be passed between procedures */
1876 static gchar *tap_called_number = NULL;
1877 static gchar *tap_calling_number = NULL;
1878 static guint8 tap_cause_value = 0;
1879
1880 /* ------------------------------------------------------------------
1881   Mapping number to ASCII-character
1882  ------------------------------------------------------------------ */
1883 static char number_to_char(int number)
1884 {
1885   if (number < 10)
1886     return ((char) number + ASCII_NUMBER_DELTA);
1887   else
1888     return ((char) number + ASCII_LETTER_DELTA);
1889 }
1890
1891 /* ------------------------------------------------------------------ */
1892 /* Dissectors for all used parameter types                            */
1893 /* ------------------------------------------------------------------ */
1894 /* argument tvbuff_t contains only parameter-specific length          */
1895 /* length indicator is already dissected in dissect_isup_message() or */
1896 /* dissect_isup_optional_parameter()                                  */
1897 /* ------------------------------------------------------------------ */
1898 /* ------------------------------------------------------------------
1899  Dissector Parameter circuit validation response indicator
1900  */
1901
1902 static void
1903 dissect_isup_cvr_response_ind_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1904 {
1905   guint8 cvr_response_ind;
1906
1907   cvr_response_ind = tvb_get_guint8(parameter_tvb, 0);
1908   proto_tree_add_uint(parameter_tree, hf_isup_cvr_rsp_ind, parameter_tvb, 0, CVR_RESP_IND_LENGTH, cvr_response_ind );
1909   proto_item_set_text(parameter_item, "Circuit Validation Test Response Indicator: 0x%x", cvr_response_ind );
1910
1911 }
1912
1913 /* ------------------------------------------------------------------
1914    Dissector Parameter circuit validation response - circuit group
1915    characters
1916 */
1917 static void
1918 dissect_isup_circuit_group_char_ind_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1919 {
1920   guint8 cvr_cg_char_ind;
1921
1922   cvr_cg_char_ind = tvb_get_guint8(parameter_tvb, 0);
1923   proto_tree_add_uint(parameter_tree, hf_isup_cvr_cg_car_ind, parameter_tvb, 0, CG_CHAR_IND_LENGTH, cvr_cg_char_ind );
1924   proto_tree_add_uint(parameter_tree, hf_isup_cvr_cg_double_seize, parameter_tvb, 0, CG_CHAR_IND_LENGTH, cvr_cg_char_ind );
1925   proto_tree_add_uint(parameter_tree, hf_isup_cvr_cg_alarm_car_ind, parameter_tvb, 0, CG_CHAR_IND_LENGTH, cvr_cg_char_ind );
1926   proto_tree_add_uint(parameter_tree, hf_isup_cvr_cont_chk_ind, parameter_tvb, 0, CG_CHAR_IND_LENGTH, cvr_cg_char_ind );
1927
1928   proto_item_set_text(parameter_item, "Circuit Validation Test Response Circuit Group Characteristics: 0x%x", cvr_cg_char_ind );
1929 }
1930
1931 /* ------------------------------------------------------------------
1932  Dissector Parameter nature of connection flags
1933  */
1934 static void
1935 dissect_isup_nature_of_connection_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1936 {
1937   guint8 nature_of_connection_ind;
1938
1939   nature_of_connection_ind = tvb_get_guint8(parameter_tvb, 0);
1940   proto_tree_add_uint(parameter_tree, hf_isup_satellite_indicator, parameter_tvb, 0,NATURE_OF_CONNECTION_IND_LENGTH, nature_of_connection_ind);
1941   proto_tree_add_uint(parameter_tree, hf_isup_continuity_check_indicator, parameter_tvb, 0,NATURE_OF_CONNECTION_IND_LENGTH, nature_of_connection_ind);
1942   proto_tree_add_boolean(parameter_tree, hf_isup_echo_control_device_indicator, parameter_tvb, 0,  NATURE_OF_CONNECTION_IND_LENGTH, nature_of_connection_ind);
1943
1944   proto_item_set_text(parameter_item, "Nature of Connection Indicators: 0x%x", nature_of_connection_ind);
1945 }
1946
1947 /* ------------------------------------------------------------------
1948  Dissector Parameter Forward Call Indicators
1949  */
1950 static void
1951 dissect_isup_forward_call_indicators_parameter(tvbuff_t *parameter_tvb,proto_tree *parameter_tree, proto_item *parameter_item)
1952 {
1953   guint16 forward_call_ind;
1954
1955   forward_call_ind = tvb_get_ntohs(parameter_tvb, 0);
1956   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_natnl_inatnl_call_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1957   proto_tree_add_uint(parameter_tree, hf_isup_forw_call_end_to_end_method_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1958   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_interworking_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1959   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_end_to_end_info_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1960   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_isdn_user_part_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1961   proto_tree_add_uint(parameter_tree, hf_isup_forw_call_preferences_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1962   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_isdn_access_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1963   proto_tree_add_uint(parameter_tree, hf_isup_forw_call_sccp_method_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1964   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_ported_num_trans_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1965   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_qor_attempt_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1966
1967   proto_item_set_text(parameter_item, "Forward Call Indicators: 0x%x", forward_call_ind );
1968 }
1969
1970 /* ------------------------------------------------------------------
1971  Dissector Parameter Calling Party's Category
1972  */
1973 static void
1974 dissect_isup_calling_partys_category_parameter(tvbuff_t *parameter_tvb,proto_tree *parameter_tree, proto_item *parameter_item)
1975 {
1976   guint8 calling_partys_category;
1977
1978   calling_partys_category = tvb_get_guint8(parameter_tvb, 0);
1979   proto_tree_add_uint(parameter_tree, hf_isup_calling_partys_category, parameter_tvb, 0, CALLING_PRTYS_CATEGORY_LENGTH, calling_partys_category);
1980
1981   proto_item_set_text(parameter_item, "Calling Party's category: 0x%x (%s)", calling_partys_category, val_to_str_ext_const(calling_partys_category, &isup_calling_partys_category_value_ext, "reserved/spare"));
1982 }
1983
1984
1985 /* ------------------------------------------------------------------
1986   Dissector Parameter Transmission medium requirement
1987  */
1988 static void
1989 dissect_isup_transmission_medium_requirement_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1990 {
1991   guint8 transmission_medium_requirement;
1992
1993   transmission_medium_requirement = tvb_get_guint8(parameter_tvb, 0);
1994   proto_tree_add_uint(parameter_tree, hf_isup_transmission_medium_requirement, parameter_tvb, 0, TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH,transmission_medium_requirement);
1995
1996   proto_item_set_text(parameter_item, "Transmission medium requirement: %u (%s)",  transmission_medium_requirement, val_to_str_ext_const(transmission_medium_requirement, &isup_transmission_medium_requirement_value_ext, "spare"));
1997 }
1998 /* ------------------------------------------------------------------
1999   Dissector Parameter Called party number
2000  */
2001 void
2002 dissect_isup_called_party_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2003 {
2004   proto_item *address_digits_item;
2005   proto_tree *address_digits_tree;
2006   proto_item *hidden_item;
2007   guint8 indicators1, indicators2;
2008   guint8 address_digit_pair=0;
2009   gint offset=0;
2010   gint i=0;
2011   gint length;
2012   char called_number[MAXDIGITS + 1]="";
2013   e164_info_t e164_info;
2014   gint number_plan;
2015
2016   indicators1 = tvb_get_guint8(parameter_tvb, 0);
2017   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
2018   proto_tree_add_uint(parameter_tree, hf_isup_called_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
2019   indicators2 = tvb_get_guint8(parameter_tvb, 1);
2020   number_plan = (indicators2 & 0x70)>> 4;
2021   proto_tree_add_boolean(parameter_tree, hf_isup_inn_indicator, parameter_tvb, 1, 1, indicators2);
2022   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
2023   offset = 2;
2024
2025   if (tvb_reported_length_remaining(parameter_tvb, offset) == 0) {
2026     proto_tree_add_text(parameter_tree, parameter_tvb, offset, 0, "Called Number (empty)");
2027     proto_item_set_text(parameter_item, "Called Number: (empty)");
2028     return;
2029   }
2030
2031   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
2032                                             offset, -1, "Called Party Number");
2033   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
2034
2035   while((length = tvb_reported_length_remaining(parameter_tvb, offset)) > 0) {
2036     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
2037     proto_tree_add_uint(address_digits_tree, hf_isup_called_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2038     called_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
2039     if (i > MAXDIGITS)
2040       THROW(ReportedBoundsError);
2041     if ((length - 1) > 0 ){
2042       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2043       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2044       if (i > MAXDIGITS)
2045         THROW(ReportedBoundsError);
2046     }
2047     offset++;
2048   }
2049   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)) { /* Even Indicator set -> last even digit is valid */
2050     proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
2051     called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2052     if (i > MAXDIGITS)
2053       THROW(ReportedBoundsError);
2054   }
2055
2056   called_number[i++] = '\0';
2057   proto_item_set_text(address_digits_item, "Called Party Number: %s", called_number);
2058   proto_item_set_text(parameter_item, "Called Party Number: %s", called_number);
2059   if ( number_plan == 1 ) {
2060     e164_info.e164_number_type = CALLED_PARTY_NUMBER;
2061     e164_info.nature_of_address = indicators1 & 0x7f;
2062     e164_info.E164_number_str = called_number;
2063     e164_info.E164_number_length = i - 1;
2064     dissect_e164_number(parameter_tvb, address_digits_tree, 2, (offset - 2), e164_info);
2065     hidden_item = proto_tree_add_string(address_digits_tree, hf_isup_called, parameter_tvb,
2066                                         offset - length, length, called_number);
2067     PROTO_ITEM_SET_HIDDEN(hidden_item);
2068   } else {
2069     proto_tree_add_string(address_digits_tree, hf_isup_called, parameter_tvb,
2070                           offset - length, length, called_number);
2071   }
2072   tap_called_number = ep_strdup(called_number);
2073 }
2074 /* ------------------------------------------------------------------
2075   Dissector Parameter  Subsequent number
2076  */
2077 static void
2078 dissect_isup_subsequent_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2079 {
2080   proto_item *address_digits_item;
2081   proto_tree *address_digits_tree;
2082   guint8 indicators1;
2083   guint8 address_digit_pair=0;
2084   gint offset=0;
2085   gint i=0;
2086   gint length;
2087   char called_number[MAXDIGITS + 1]="";
2088
2089   indicators1 = tvb_get_guint8(parameter_tvb, 0);
2090   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
2091   offset = 1;
2092
2093   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
2094                                             offset, -1,
2095                                             "Subsequent Number");
2096   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
2097
2098   while((length = tvb_reported_length_remaining(parameter_tvb, offset)) > 0){
2099     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
2100     proto_tree_add_uint(address_digits_tree, hf_isup_called_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2101     called_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
2102     if (i > MAXDIGITS)
2103       THROW(ReportedBoundsError);
2104     if ((length - 1) > 0 ){
2105       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2106       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2107       if (i > MAXDIGITS)
2108         THROW(ReportedBoundsError);
2109     }
2110     offset++;
2111   }
2112
2113   if (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
2114       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
2115       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2116       if (i > MAXDIGITS)
2117         THROW(ReportedBoundsError);
2118   }
2119   called_number[i++] = '\0';
2120
2121   proto_item_set_text(address_digits_item, "Subsequent Number: %s", called_number);
2122   proto_item_set_text(parameter_item, "Subsequent Number: %s", called_number);
2123
2124 }
2125 /* ------------------------------------------------------------------
2126   Dissector Parameter Information Request Indicators
2127  */
2128 static void
2129 dissect_isup_information_request_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2130 {
2131   guint16 information_request_indicators;
2132
2133   information_request_indicators = tvb_get_ntohs(parameter_tvb, 0);
2134   proto_tree_add_boolean(parameter_tree, hf_isup_calling_party_address_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
2135   proto_tree_add_boolean(parameter_tree, hf_isup_info_req_holding_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
2136   proto_tree_add_boolean(parameter_tree, hf_isup_calling_partys_category_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
2137   proto_tree_add_boolean(parameter_tree, hf_isup_charge_information_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
2138   proto_tree_add_boolean(parameter_tree, hf_isup_malicious_call_identification_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
2139
2140
2141   proto_item_set_text(parameter_item, "Information request indicators: 0x%x", information_request_indicators);
2142 }
2143 /* ------------------------------------------------------------------
2144   Dissector Parameter Information Indicators
2145  */
2146 static void
2147 dissect_isup_information_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2148 {
2149   guint16 information_indicators;
2150
2151   information_indicators = tvb_get_ntohs(parameter_tvb, 0);
2152   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_address_response_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
2153   proto_tree_add_boolean(parameter_tree, hf_isup_hold_provided_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
2154   proto_tree_add_boolean(parameter_tree, hf_isup_calling_partys_category_response_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
2155   proto_tree_add_boolean(parameter_tree, hf_isup_charge_information_response_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
2156   proto_tree_add_boolean(parameter_tree, hf_isup_solicited_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
2157
2158
2159   proto_item_set_text(parameter_item, "Information indicators: 0x%x", information_indicators);
2160 }
2161 /* ------------------------------------------------------------------
2162   Dissector Parameter Continuity Indicators
2163  */
2164 static void
2165 dissect_isup_continuity_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2166 {
2167   guint8 continuity_indicators;
2168
2169   continuity_indicators = tvb_get_guint8(parameter_tvb, 0);
2170   proto_tree_add_boolean(parameter_tree, hf_isup_continuity_indicator, parameter_tvb, 0, CONTINUITY_IND_LENGTH,  continuity_indicators);
2171
2172   proto_item_set_text(parameter_item, "Continuity indicators: 0x%x", continuity_indicators);
2173 }
2174 /* ------------------------------------------------------------------
2175  Dissector Parameter Backward Call Indicators
2176  */
2177 static void
2178 dissect_isup_backward_call_indicators_parameter(tvbuff_t *parameter_tvb,proto_tree *parameter_tree, proto_item *parameter_item)
2179 {
2180   guint16 backward_call_ind;
2181
2182   backward_call_ind = tvb_get_ntohs(parameter_tvb, 0);
2183
2184
2185   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_charge_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2186   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_called_partys_status_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2187   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_called_partys_category_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2188   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_end_to_end_method_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2189   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_interworking_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2190   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_end_to_end_info_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2191   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_isdn_user_part_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2192   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_holding_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH,  backward_call_ind);
2193   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_isdn_access_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2194   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_echo_control_device_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2195   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_sccp_method_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2196
2197   proto_item_set_text(parameter_item, "Backward Call Indicators: 0x%x", backward_call_ind);
2198 }
2199 /* ------------------------------------------------------------------
2200   Dissector Parameter Cause Indicators - no detailed dissection since defined in Rec. Q.850
2201  */
2202
2203 /*
2204  * Cause codes for Cause.
2205  * The decoding of cause indicators parameter field are defined in ITU-T
2206  * Recommendation Q.850; those are different from the ones in the Q.931
2207  * dissector, as that has some values not specified by the standard but
2208  * that appear to be used for purposes other than the ones in Q.850.
2209  */
2210   /* The table is "filled" with "unassigned" to make full use of value_string_ext */
2211 static const value_string q850_cause_code_vals[] = {
2212   { 0x00,  "Valid cause code not yet received" },
2213   { 0x01,  "Unallocated (unassigned) number" },
2214   { 0x02,  "No route to specified transit network" },
2215   { 0x03,  "No route to destination" },
2216   { 0x04,  "Send special information tone" },
2217   { 0x05,  "Misdialled trunk prefix" },
2218   { 0x06,  "Channel unacceptable" },
2219   { 0x07,  "Call awarded and being delivered in an established channel" },
2220   { 0x08,  "Preemption" },
2221   { 0x09,  "Preemption - circuit reserved for reuse" },
2222   { 0x0A,  "Unassigned" },
2223   { 0x0B,  "Unassigned" },
2224   { 0x0C,  "Unassigned" },
2225   { 0x0D,  "Unassigned" },
2226   { 0x0E,  "QoR: ported number" },
2227   { 0x0F,  "Unassigned" },
2228   { 0x10,  "Normal call clearing" },
2229   { 0x11,  "User busy" },
2230   { 0x12,  "No user responding" },
2231   { 0x13,  "No answer from user (user alerted)" },
2232   { 0x14,  "Subscriber absent" },
2233   { 0x15,  "Call rejected" },
2234   { 0x16,  "Number changed" },
2235   { 0x17,  "Redirection to new destination" },
2236   { 0x18,  "Call rejected due to feature at the destination" },
2237   { 0x19,  "Exchange routing error" },
2238   { 0x1A,  "Non-selected user clearing" },
2239   { 0x1B,  "Destination out of order" },
2240   { 0x1C,  "Invalid number format (address incomplete)" },
2241   { 0x1D,  "Facility rejected" },
2242   { 0x1E,  "Response to STATUS ENQUIRY" },
2243   { 0x1F,  "Normal unspecified" },
2244   { 0x20,  "Unassigned" },
2245   { 0x21,  "Circuit out of order" },
2246   { 0x22,  "No circuit/channel available" },
2247   { 0x23,  "Unassigned" },
2248   { 0x24,  "Unassigned" },
2249   { 0x25,  "Unassigned" },
2250   { 0x26,  "Network out of order" },
2251   { 0x27,  "Permanent frame mode connection out of service" },
2252   { 0x28,  "Permanent frame mode connection operational" },
2253   { 0x29,  "Temporary failure" },
2254   { 0x2A,  "Switching equipment congestion" },
2255   { 0x2B,  "Access information discarded" },
2256   { 0x2C,  "Requested circuit/channel not available" },
2257   { 0x2D,  "Unassigned" },
2258   { 0x2E,  "Precedence call blocked" },
2259   { 0x2F,  "Resources unavailable, unspecified" },
2260   { 0x30,  "Unassigned" },
2261   { 0x31,  "Quality of service unavailable" },
2262   { 0x32,  "Requested facility not subscribed" },
2263   { 0x33,  "Unassigned" },
2264   { 0x34,  "Unassigned" },
2265   { 0x35,  "Outgoing calls barred within CUG" },
2266   { 0x36,  "Unassigned" },
2267   { 0x37,  "Incoming calls barred within CUG" },
2268   { 0x38,  "Call waiting not subscribed" },
2269   { 0x39,  "Bearer capability not authorized" },
2270   { 0x3A,  "Bearer capability not presently available" },
2271   { 0x3B,  "Unassigned" },
2272   { 0x3C,  "Unassigned" },
2273   { 0x3D,  "Unassigned" },
2274   { 0x3E,  "Inconsistency in designated outgoing access information and subscriber class" },
2275   { 0x3F,  "Service or option not available, unspecified" },
2276   { 0x40,  "Unassigned" },
2277   { 0x41,  "Bearer capability not implemented" },
2278   { 0x42,  "Channel type not implemented" },
2279   { 0x43,  "Unassigned" },
2280   { 0x44,  "Unassigned" },
2281   { 0x45,  "Requested facility not implemented" },
2282   { 0x46,  "Only restricted digital information bearer capability is available" },
2283   { 0x47,  "Unassigned" },
2284   { 0x48,  "Unassigned" },
2285   { 0x49,  "Unassigned" },
2286   { 0x4A,  "Unassigned" },
2287   { 0x4B,  "Unassigned" },
2288   { 0x4C,  "Unassigned" },
2289   { 0x4D,  "Unassigned" },
2290   { 0x4E,  "Unassigned" },
2291   { 0x4F,  "Service or option not implemented, unspecified" },
2292   { 0x50,  "Unassigned" },
2293   { 0x51,  "Invalid call reference value" },
2294   { 0x52,  "Identified channel does not exist" },
2295   { 0x53,  "Call identity does not exist for suspended call" },
2296   { 0x54,  "Call identity in use" },
2297   { 0x55,  "No call suspended" },
2298   { 0x56,  "Call having the requested call identity has been cleared" },
2299   { 0x57,  "Called user not member of CUG" },
2300   { 0x58,  "Incompatible destination" },
2301   { 0x59,  "Unassigned" },
2302   { 0x5A,  "Non-existing CUG" },
2303   { 0x5B,  "Invalid transit network selection (national use)" },
2304   { 0x5C,  "Unassigned" },
2305   { 0x5D,  "Unassigned" },
2306   { 0x5E,  "Unassigned" },
2307   { 0x5F,  "Invalid message, unspecified" },
2308   { 0x60,  "Mandatory information element is missing" },
2309   { 0x61,  "Message type non-existent or not implemented" },
2310   { 0x62,  "Message not compatible with call state or message type non-existent or not implemented" },
2311   { 0x63,  "Information element nonexistent or not implemented" },
2312   { 0x64,  "Invalid information element contents" },
2313   { 0x65,  "Message not compatible with call state" },
2314   { 0x66,  "Recovery on timer expiry" },
2315   { 0x67,  "Parameter non-existent or not implemented - passed on" },
2316   { 0x68,  "Unassigned" },
2317   { 0x69,  "Unassigned" },
2318   { 0x6A,  "Unassigned" },
2319   { 0x6B,  "Unassigned" },
2320   { 0x6C,  "Unassigned" },
2321   { 0x6D,  "Unassigned" },
2322   { 0x6E,  "Message with unrecognized parameter discarded" },
2323   { 0x6F,  "Protocol error, unspecified" },
2324   { 0x70,  "Unassigned" },
2325   { 0x71,  "Unassigned" },
2326   { 0x72,  "Unassigned" },
2327   { 0x73,  "Unassigned" },
2328   { 0x74,  "Unassigned" },
2329   { 0x75,  "Unassigned" },
2330   { 0x76,  "Unassigned" },
2331   { 0x77,  "Unassigned" },
2332   { 0x78,  "Unassigned" },
2333   { 0x79,  "Unassigned" },
2334   { 0x7A,  "Unassigned" },
2335   { 0x7B,  "Unassigned" },
2336   { 0x7C,  "Unassigned" },
2337   { 0x7D,  "Unassigned" },
2338   { 0x7E,  "Unassigned" },
2339   { 0x7F,  "Internetworking, unspecified" },
2340   { 0,  NULL }
2341 };
2342 value_string_ext q850_cause_code_vals_ext = VALUE_STRING_EXT_INIT(q850_cause_code_vals);
2343
2344 static const value_string ansi_isup_cause_code_vals[] = {
2345   { 0x00,  "Valid cause code not yet received" },
2346   { 0x01,  "Unallocated (unassigned) number" },
2347   { 0x02,  "No route to specified transit network" },
2348   { 0x03,  "No route to destination" },
2349   { 0x04,  "Send special information tone" },
2350   { 0x05,  "Misdialled trunk prefix" },
2351   { 0x06,  "Channel unacceptable" },
2352   { 0x07,  "Call awarded and being delivered in an established channel" },
2353   { 0x08,  "Preemption" },
2354   { 0x09,  "Preemption - circuit reserved for reuse" },
2355   { 0x0A,  "Unassigned" },
2356   { 0x0B,  "Unassigned" },
2357   { 0x0C,  "Unassigned" },
2358   { 0x0D,  "Unassigned" },
2359   { 0x0E,  "QoR: ported number" },
2360   { 0x0F,  "Unassigned" },
2361   { 0x10,  "Normal call clearing" },
2362   { 0x11,  "User busy" },
2363   { 0x12,  "No user responding" },
2364   { 0x13,  "No answer from user (user alerted)" },
2365   { 0x14,  "Subscriber absent" },
2366   { 0x15,  "Call rejected" },
2367   { 0x16,  "Number changed" },
2368   { 0x17,  "Unallocated destination number" },
2369   { 0X18,  "Undefined business group" },
2370   { 0x19,  "Exchange routing error" },
2371   { 0x1A,  "Non-selected user clearing" },
2372   { 0x1B,  "Destination out of order" },
2373   { 0x1C,  "Invalid number format (address incomplete)" },
2374   { 0x1D,  "Facility rejected" },
2375   { 0x1E,  "Response to STATUS ENQUIRY" },
2376   { 0x1F,  "Normal unspecified" },
2377   { 0x20,  "Unassigned" },
2378   { 0x21,  "Circuit out of order" },
2379   { 0x22,  "No circuit/channel available" },
2380   { 0x23,  "Unassigned" },
2381   { 0x24,  "Unassigned" },
2382   { 0x25,  "Unassigned" },
2383   { 0x26,  "Network out of order" },
2384   { 0x27,  "Permanent frame mode connection out of service" },
2385   { 0x28,  "Permanent frame mode connection operational" },
2386   { 0x29,  "Temporary failure" },
2387   { 0x2A,  "Switching equipment congestion" },
2388   { 0x2B,  "Access information discarded" },
2389   { 0x2C,  "Requested circuit/channel not available" },
2390   { 0x2D,  "Preemption" },
2391   { 0x2E,  "Precedence call blocked" },
2392   { 0x2F,  "Resources unavailable, unspecified" },
2393   { 0x30,  "Unassigned" },
2394   { 0x31,  "Quality of service unavailable" },
2395   { 0x32,  "Requested facility not subscribed" },
2396   { 0x33,  "Call type incompatible with service request" },
2397   { 0x34,  "Unassigned" },
2398   { 0x35,  "Outgoing calls barred within CUG" },
2399   { 0x36,  "Call blocked due to group restriction" },
2400   { 0x37,  "Incoming calls barred within CUG" },
2401   { 0x38,  "Call waiting not subscribed" },
2402   { 0x39,  "Bearer capability not authorized" },
2403   { 0x3A,  "Bearer capability not presently available" },
2404   { 0x3B,  "Unassigned" },
2405   { 0x3C,  "Unassigned" },
2406   { 0x3D,  "Unassigned" },
2407   { 0x3E,  "Inconsistency in designated outgoing access information and subscriber class" },
2408   { 0x3F,  "Service or option not available, unspecified" },
2409   { 0x40,  "Unassigned" },
2410   { 0x41,  "Bearer capability not implemented" },
2411   { 0x42,  "Channel type not implemented" },
2412   { 0x43,  "Unassigned" },
2413   { 0x44,  "Unassigned" },
2414   { 0x45,  "Requested facility not implemented" },
2415   { 0x46,  "Only restricted digital information bearer capability is available" },
2416   { 0x47,  "Unassigned" },
2417   { 0x48,  "Unassigned" },
2418   { 0x49,  "Unassigned" },
2419   { 0x4A,  "Unassigned" },
2420   { 0x4B,  "Unassigned" },
2421   { 0x4C,  "Unassigned" },
2422   { 0x4D,  "Unassigned" },
2423   { 0x4E,  "Unassigned" },
2424   { 0x4F,  "Service or option not implemented, unspecified" },
2425   { 0x50,  "Unassigned" },
2426   { 0x51,  "Invalid call reference value" },
2427   { 0x52,  "Identified channel does not exist" },
2428   { 0x53,  "Call identity does not exist for suspended call" },
2429   { 0x54,  "Call identity in use" },
2430   { 0x55,  "No call suspended" },
2431   { 0x56,  "Call having the requested call identity has been cleared" },
2432   { 0x57,  "Called user not member of CUG" },
2433   { 0x58,  "Incompatible destination" },
2434   { 0x59,  "Unassigned" },
2435   { 0x5A,  "Non-existing CUG" },
2436   { 0x5B,  "Invalid transit network selection (national use)" },
2437   { 0x5C,  "Unassigned" },
2438   { 0x5D,  "Unassigned" },
2439   { 0x5E,  "Unassigned" },
2440   { 0x5F,  "Invalid message, unspecified" },
2441   { 0x60,  "Mandatory information element is missing" },
2442   { 0x61,  "Message type non-existent or not implemented" },
2443   { 0x62,  "Message not compatible with call state or message type non-existent or not implemented" },
2444   { 0x63,  "Information element nonexistent or not implemented" },
2445   { 0x64,  "Invalid information element contents" },
2446   { 0x65,  "Message not compatible with call state" },
2447   { 0x66,  "Recovery on timer expiry" },
2448   { 0x67,  "Parameter non-existent or not implemented - passed on" },
2449   { 0x68,  "Unassigned" },
2450   { 0x69,  "Unassigned" },
2451   { 0x6A,  "Unassigned" },
2452   { 0x6B,  "Unassigned" },
2453   { 0x6C,  "Unassigned" },
2454   { 0x6D,  "Unassigned" },
2455   { 0x6E,  "Message with unrecognized parameter discarded" },
2456   { 0x6F,  "Protocol error, unspecified" },
2457   { 0x70,  "Unassigned" },
2458   { 0x71,  "Unassigned" },
2459   { 0x72,  "Unassigned" },
2460   { 0x73,  "Unassigned" },
2461   { 0x74,  "Unassigned" },
2462   { 0x75,  "Unassigned" },
2463   { 0x76,  "Unassigned" },
2464   { 0x77,  "Unassigned" },
2465   { 0x78,  "Unassigned" },
2466   { 0x79,  "Unassigned" },
2467   { 0x7A,  "Unassigned" },
2468   { 0x7B,  "Unassigned" },
2469   { 0x7C,  "Unassigned" },
2470   { 0x7D,  "Unassigned" },
2471   { 0x7E,  "Unassigned" },
2472   { 0x7F,  "Internetworking, unspecified" },
2473   { 0,  NULL }
2474 };
2475 static value_string_ext ansi_isup_cause_code_vals_ext = VALUE_STRING_EXT_INIT(ansi_isup_cause_code_vals);
2476
2477 static const value_string ansi_isup_coding_standard_vals[] = {
2478   { 0, "CCITT Standard" },
2479   { 1, "Reserved for other international standards" },
2480   { 2, "ANSI Standard" },
2481   { 3, "Reserved" },
2482   { 0,  NULL }
2483 };
2484 void
2485 dissect_isup_cause_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2486 { guint length = tvb_reported_length(parameter_tvb);
2487   proto_tree_add_text(parameter_tree, parameter_tvb,0, -1, "Cause indicators (-> Q.850)");
2488   dissect_q931_cause_ie(parameter_tvb,0,length,
2489                         parameter_tree,
2490                         hf_isup_cause_indicator, &tap_cause_value, isup_parameter_type_value);
2491   proto_item_set_text(parameter_item, "Cause indicators, see Q.850 (%u byte%s length)", length , plurality(length, "", "s"));
2492 }
2493
2494 static void
2495 dissect_ansi_isup_cause_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2496 {
2497   guint8 coding_standard;
2498   guint8 cause_value;
2499   int offset = 0;
2500   guint length = tvb_reported_length(parameter_tvb);
2501
2502   coding_standard = (tvb_get_guint8(parameter_tvb, offset)&0x60)>>5;
2503
2504   switch (coding_standard) {
2505     case 0:
2506       /*CCITT*/
2507       proto_tree_add_item(parameter_tree, hf_isup_cause_location, parameter_tvb, offset, 1, ENC_BIG_ENDIAN);
2508       proto_tree_add_item(parameter_tree, hf_ansi_isup_coding_standard, parameter_tvb, offset, 1, ENC_BIG_ENDIAN);
2509       proto_tree_add_item(parameter_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, ENC_BIG_ENDIAN);
2510       offset ++;
2511       length--;
2512       if (length == 0)
2513         return;
2514       proto_tree_add_item(parameter_tree, hf_isup_cause_indicator, parameter_tvb, offset, 1, ENC_BIG_ENDIAN);
2515       cause_value=tvb_get_guint8(parameter_tvb, offset)&0x7f;
2516       offset ++;
2517       length--;
2518       proto_item_set_text(parameter_item, "Cause indicators: %s (%u)", val_to_str_ext_const(cause_value, &q850_cause_code_vals_ext, "spare"),cause_value );
2519       if (length == 0) {
2520         return;
2521       }
2522       proto_tree_add_text(parameter_tree, parameter_tvb, offset,
2523                           length, "Diagnostic: %s",
2524                           tvb_bytes_to_str(parameter_tvb, offset, length));
2525       return;
2526     case 2:
2527       /*ANSI*/
2528       proto_tree_add_item(parameter_tree, hf_isup_cause_location, parameter_tvb, offset, 1, ENC_BIG_ENDIAN);
2529       proto_tree_add_item(parameter_tree, hf_ansi_isup_coding_standard, parameter_tvb, offset, 1, ENC_BIG_ENDIAN);
2530       proto_tree_add_item(parameter_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, ENC_BIG_ENDIAN);
2531       offset ++;
2532       length--;
2533       if (length == 0)
2534         return;
2535       proto_tree_add_item(parameter_tree, hf_ansi_isup_cause_indicator, parameter_tvb, offset, 1, ENC_BIG_ENDIAN);
2536       cause_value=tvb_get_guint8(parameter_tvb, offset)&0x7f;
2537       proto_item_set_text(parameter_item, "Cause indicators: %s (%u)",
2538                           val_to_str_ext_const(cause_value, &ansi_isup_cause_code_vals_ext, "spare"),
2539                           cause_value );
2540       offset ++;
2541       length--;
2542       if (length == 0) {
2543         return;
2544       }
2545       proto_tree_add_text(parameter_tree, parameter_tvb, offset,
2546                           length, "Diagnostic: %s",
2547                           tvb_bytes_to_str(parameter_tvb, offset, length));
2548       return;
2549     default:
2550       proto_tree_add_item(parameter_tree, hf_ansi_isup_coding_standard, parameter_tvb, offset, 1, ENC_BIG_ENDIAN);
2551       proto_tree_add_item(parameter_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, ENC_BIG_ENDIAN);
2552       break;
2553   }
2554   proto_item_set_text(parameter_item, "Cause indicators(%u byte%s length)", length , plurality(length, "", "s"));
2555 }
2556
2557 /* ------------------------------------------------------------------
2558   Dissector Parameter Suspend/Resume Indicators
2559  */
2560 static void
2561 dissect_isup_suspend_resume_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2562 {
2563   guint8 indicators;
2564
2565   indicators = tvb_get_guint8(parameter_tvb, 0);
2566   proto_tree_add_boolean(parameter_tree, hf_isup_suspend_resume_indicator, parameter_tvb, 0, SUSPEND_RESUME_IND_LENGTH,  indicators);
2567
2568   proto_item_set_text(parameter_item, "Suspend/Resume indicator: 0x%x", indicators);
2569 }
2570 /* ------------------------------------------------------------------
2571   Dissector Parameter Range and Status Indicators
2572  */
2573 static void
2574 dissect_isup_range_and_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2575 {
2576   guint8 range, actual_status_length;
2577
2578   range = tvb_get_guint8(parameter_tvb, 0);
2579   proto_tree_add_uint_format(parameter_tree, hf_isup_range_indicator, parameter_tvb, 0, RANGE_LENGTH, range, "Range: %u", range);
2580   actual_status_length = tvb_reported_length_remaining(parameter_tvb, RANGE_LENGTH);
2581   if (actual_status_length > 0)
2582     proto_tree_add_text(parameter_tree, parameter_tvb , RANGE_LENGTH, -1, "Status subfield");
2583   else
2584     proto_tree_add_text(parameter_tree, parameter_tvb , 0, 0, "Status subfield is not present with this message type");
2585
2586
2587   proto_item_set_text(parameter_item, "Range (%u) and status", range);
2588 }
2589 /* ------------------------------------------------------------------
2590   Dissector Parameter Circuit group supervision message type
2591  */
2592 static void
2593 dissect_isup_circuit_group_supervision_message_type_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2594 {
2595   guint8 cgs_message_type;
2596
2597   cgs_message_type = tvb_get_guint8(parameter_tvb, 0);
2598   proto_tree_add_uint(parameter_tree, hf_isup_cgs_message_type, parameter_tvb, 0, CIRC_GRP_SV_MSG_TYPE_LENGTH, cgs_message_type);
2599
2600   proto_item_set_text(parameter_item, "Circuit group supervision message type: %s (%u)"  ,val_to_str(cgs_message_type, isup_cgs_message_type_value,"unknown"), cgs_message_type);
2601 }
2602 /* ------------------------------------------------------------------
2603   Dissector Parameter Facility indicator parameter
2604  */
2605 static void
2606 dissect_isup_facility_ind_parameter(tvbuff_t *parameter_tvb, proto_item *parameter_item)
2607 {
2608   guint8 indicator;
2609
2610   indicator = tvb_get_guint8(parameter_tvb, 0);
2611
2612   proto_item_set_text(parameter_item, "Facility indicator: %s (%u)"  ,val_to_str(indicator, isup_facility_ind_value,"spare"), indicator);
2613 }
2614 /* ------------------------------------------------------------------
2615   Dissector Parameter Circuit state indicator
2616  */
2617 static void
2618 dissect_isup_circuit_state_ind_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2619 {
2620   proto_item *circuit_state_item;
2621   proto_tree *circuit_state_tree;
2622   guint8 circuit_state;
2623   gint offset=0;
2624   gint i=0;
2625
2626   while(tvb_reported_length_remaining(parameter_tvb, offset) > 0){
2627     circuit_state_item = proto_tree_add_text(parameter_tree, parameter_tvb,
2628                                              offset, -1,
2629                                              "Circuit# CIC+%u state", i);
2630     circuit_state_tree = proto_item_add_subtree(circuit_state_item, ett_isup_circuit_state_ind);
2631     circuit_state = tvb_get_guint8(parameter_tvb, offset);
2632     if ((circuit_state & DC_8BIT_MASK) == 0){
2633       proto_tree_add_uint(circuit_state_tree, hf_isup_mtc_blocking_state1, parameter_tvb, offset, 1, circuit_state);
2634       proto_item_set_text(circuit_state_item, "Circuit# CIC+%u state: %s", i++, val_to_str(circuit_state&BA_8BIT_MASK, isup_mtc_blocking_state_DC00_value, "unknown"));
2635     }
2636     else {
2637       proto_tree_add_uint(circuit_state_tree, hf_isup_mtc_blocking_state2, parameter_tvb, offset, 1, circuit_state);
2638       proto_tree_add_uint(circuit_state_tree, hf_isup_call_proc_state, parameter_tvb, offset, 1, circuit_state);
2639       proto_tree_add_uint(circuit_state_tree, hf_isup_hw_blocking_state, parameter_tvb, offset, 1, circuit_state);
2640       proto_item_set_text(circuit_state_item, "Circuit# CIC+%u state: %s", i++, val_to_str(circuit_state&BA_8BIT_MASK, isup_mtc_blocking_state_DCnot00_value, "unknown"));
2641     }
2642     offset++;
2643   }
2644   proto_item_set_text(parameter_item, "Circuit state indicator (national use)");
2645 }
2646 /* ------------------------------------------------------------------
2647   Dissector Parameter Event information
2648  */
2649 static void
2650 dissect_isup_event_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2651 {
2652   guint8 indicators;
2653
2654   indicators = tvb_get_guint8(parameter_tvb, 0);
2655   proto_tree_add_uint_format(parameter_tree, hf_isup_event_ind, parameter_tvb, 0, EVENT_INFO_LENGTH, indicators, "Event indicator: %s (%u)", val_to_str(indicators & GFEDCBA_8BIT_MASK, isup_event_ind_value, "spare"), indicators & GFEDCBA_8BIT_MASK);
2656   proto_tree_add_boolean(parameter_tree, hf_isup_event_presentation_restricted_ind, parameter_tvb, 0, EVENT_INFO_LENGTH, indicators);
2657
2658   proto_item_set_text(parameter_item,"Event information: %s (%u)", val_to_str(indicators & GFEDCBA_8BIT_MASK, isup_event_ind_value, "spare"),indicators );
2659 }
2660 /* ------------------------------------------------------------------
2661   Dissector Parameter User-to-user information- no detailed dissection since defined in Rec. Q.931
2662  */
2663 static void
2664 dissect_isup_user_to_user_information_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *parameter_tree, proto_item *parameter_item)
2665 { guint length = tvb_reported_length(parameter_tvb);
2666   proto_tree_add_text(parameter_tree, parameter_tvb, 0, -1,
2667                       "User-to-user info (-> Q.931)");
2668   dissect_q931_user_user_ie(parameter_tvb, pinfo, 0, length,
2669     parameter_tree );
2670   proto_item_set_text(parameter_item, "User-to-user information,(%u byte%s length)",
2671                       length , plurality(length, "", "s"));
2672 }
2673 /* ------------------------------------------------------------------
2674   Dissector Parameter Call Reference
2675  */
2676 static void
2677 dissect_isup_call_reference_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2678 {
2679   guint32 call_id;
2680   guint16 spc;
2681
2682   call_id = tvb_get_ntoh24(parameter_tvb, 0);
2683   spc = tvb_get_letohs(parameter_tvb, CALL_ID_LENGTH) & 0x3FFF; /*since 1st 2 bits spare */
2684   proto_tree_add_text(parameter_tree, parameter_tvb, 0, CALL_ID_LENGTH, "Call identity: %u", call_id);
2685   proto_tree_add_text(parameter_tree, parameter_tvb, CALL_ID_LENGTH, SPC_LENGTH, "Signalling Point Code: %u", spc);
2686
2687   proto_item_set_text(parameter_item, "Call Reference: Call ID = %u, SPC = %u", call_id, spc);
2688 }
2689 /* ------------------------------------------------------------------
2690   Dissector Parameter Access Transport - no detailed dissection since defined in Rec. Q.931
2691  */
2692 static void
2693 dissect_isup_access_transport_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree,
2694                                         proto_item *parameter_item, packet_info *pinfo)
2695 { guint length = tvb_reported_length(parameter_tvb);
2696
2697   proto_tree_add_text(parameter_tree, parameter_tvb, 0, -1,
2698                       "Access transport parameter field (-> Q.931)");
2699
2700   if (q931_ie_handle)
2701     call_dissector(q931_ie_handle, parameter_tvb, pinfo, parameter_tree);
2702
2703   proto_item_set_text(parameter_item, "Access transport (%u byte%s length)",
2704                       length , plurality(length, "", "s"));
2705 }
2706
2707 /* dissect x.213 NSAP coded Address */
2708
2709 static const value_string x213_afi_value[] = {
2710   { 0x34, "IANA ICP"},
2711   { 0x35, "IANA ICP"},
2712   { 0x36, "X.121"},
2713   { 0x37, "X.121"},
2714   { 0x38, "ISO DCC"},
2715   { 0x39, "ISO DCC"},
2716   { 0x40, "F.69"},
2717   { 0x41, "F.69"},
2718   { 0x42, "E.163"},
2719   { 0x43, "E.163"},
2720   { 0x44, "E.164"},
2721   { 0x45, "E.164"},
2722   { 0x46, "ISO 6523-ICD"},
2723   { 0x47, "ISO 6523-ICD"},
2724   { 0x48, "Local"},
2725   { 0x49, "Local"},
2726   { 0x50, "Local ISO/IEC 646 character "},
2727   { 0x51, "Local ( National character )"},
2728   { 0x52, "X.121"},
2729   { 0x53, "X.121"},
2730   { 0x54, "F.69"},
2731   { 0x55, "F.69"},
2732   { 0x56, "E.163"},
2733   { 0x57, "E.163"},
2734   { 0x58, "E.164"},
2735   { 0x59, "E.164"},
2736
2737   { 0x76, "ITU-T IND"},
2738   { 0x77, "ITU-T IND"},
2739
2740   { 0xb8, "IANA ICP Group no"},
2741   { 0xb9, "IANA ICP Group no"},
2742   { 0xba, "X.121 Group no"},
2743   { 0xbb, "X.121 Group no"},
2744   { 0xbc, "ISO DCC Group no"},
2745   { 0xbd, "ISO DCC Group no"},
2746   { 0xbe, "F.69 Group no"},
2747   { 0xbf, "F.69 Group no"},
2748   { 0xc0, "E.163 Group no"},
2749   { 0xc1, "E.163 Group no"},
2750   { 0xc2, "E.164 Group no"},
2751   { 0xc3, "E.164 Group no"},
2752   { 0xc4, "ISO 6523-ICD Group no"},
2753   { 0xc5, "ISO 6523-ICD Group no"},
2754   { 0xc6, "Local Group no"},
2755   { 0xc7, "Local Group no"},
2756   { 0xc8, "Local ISO/IEC 646 character Group no"},
2757   { 0xc9, "Local ( National character ) Group no"},
2758   { 0xca, "X.121 Group no"},
2759   { 0xcb, "X.121 Group no"},
2760   { 0xcd, "F.69 Group no"},
2761   { 0xce, "F.69 Group no"},
2762   { 0xcf, "E.163 Group no"},
2763   { 0xd0, "E.164 Group no"},
2764   { 0xd1, "E.164 Group no"},
2765   { 0xde, "E.163 Group no"},
2766
2767   { 0xe2, "ITU-T IND Group no"},
2768   { 0xe3, "ITU-T IND Group no"},
2769   { 0,  NULL }
2770 };
2771 value_string_ext x213_afi_value_ext = VALUE_STRING_EXT_INIT(x213_afi_value);
2772
2773
2774 /* Up-to-date information on the allocated ICP values can be found in   */
2775 /*draft-gray-rfc1888bis-01 at                                           */
2776 /*http://www.ietf.org/internet-drafts/draft-gray-rfc1888bis-01.txt      */
2777 static const value_string iana_icp_values[] = {
2778   {   0x0, "IP Version 6 Address"},
2779   {   0x1, "IP Version 4 Address"},
2780   { 0,  NULL }
2781 };
2782
2783 /*
2784  * XXX - shouldn't there be a centralized routine for dissecting NSAPs?
2785  * See also "dissect_atm_nsap()" in epan/dissectors/packet-arp.c and
2786  * "print_nsap_net_buf()" and "print_nsap_net()" in epan/osi_utils.c.
2787  */
2788 void
2789 dissect_nsap(tvbuff_t *parameter_tvb,gint offset,gint len, proto_tree *parameter_tree)
2790 {
2791   guint8 afi;
2792   guint8 length = 0;
2793   guint icp, cc_offset;
2794
2795   afi = tvb_get_guint8(parameter_tvb, offset);
2796
2797   switch ( afi ) {
2798     case 0x35:  /* IANA ICP Binary fortmat*/
2799       proto_tree_add_text(parameter_tree, parameter_tvb, offset, 3,
2800                           "IDP = %s", tvb_bytes_to_str(parameter_tvb, offset, 3));
2801
2802       proto_tree_add_uint(parameter_tree, hf_afi, parameter_tvb, offset, 1, afi );
2803       offset = offset + 1;
2804       icp = tvb_get_ntohs(parameter_tvb, offset);
2805       proto_tree_add_uint(parameter_tree, hf_iana_icp, parameter_tvb, offset, 1, icp );
2806       if ( icp == 0 ){ /* IPv6 addr */
2807         proto_tree_add_text(parameter_tree, parameter_tvb, offset + 2 , 17,
2808                             "DSP = %s", tvb_bytes_to_str(parameter_tvb, offset + 2, 17));
2809         proto_tree_add_item(parameter_tree, hf_nsap_ipv6_addr, parameter_tvb, offset + 2,
2810                             16, ENC_NA);
2811
2812       }
2813       else { /* IPv4 addr */
2814         /* XXX - this is really only for ICP 1 */
2815         proto_tree_add_text(parameter_tree, parameter_tvb, offset + 2, 17,
2816                             "DSP = %s", tvb_bytes_to_str(parameter_tvb, offset + 2, 17));
2817         proto_tree_add_item(parameter_tree, hf_nsap_ipv4_addr, parameter_tvb, offset + 2, 4, ENC_BIG_ENDIAN);
2818       }
2819
2820       break;
2821     case 0x45:  /* E.164 ATM format */
2822     case 0xC3:  /* E.164 ATM group format */
2823       proto_tree_add_text(parameter_tree, parameter_tvb, offset, 9,
2824                           "IDP = %s", tvb_bytes_to_str(parameter_tvb, offset, 9));
2825
2826       proto_tree_add_uint(parameter_tree, hf_afi, parameter_tvb, offset, 1, afi );
2827
2828       proto_tree_add_text(parameter_tree, parameter_tvb, offset + 1, 8,
2829                           "IDI = %s", tvb_bytes_to_str(parameter_tvb, offset + 1, 8));
2830       offset = offset +1;
2831       /* Dissect country code */
2832       cc_offset = offset;
2833       dissect_e164_cc(parameter_tvb, parameter_tree, 3, TRUE);
2834
2835       proto_tree_add_text(parameter_tree,parameter_tvb, cc_offset, length,"DSP length %u(len %u -9 )",(len-9),len );
2836
2837       proto_tree_add_item(parameter_tree, hf_bicc_nsap_dsp, parameter_tvb, offset + 8, (len - 9),ENC_NA);
2838
2839       break;
2840     default:
2841       proto_tree_add_uint(parameter_tree, hf_afi, parameter_tvb, offset, len, afi );
2842   }/* end switch afi */
2843
2844 }
2845
2846
2847 #define  ACTION_INDICATOR                               0x01
2848 #define  BACKBONE_NETWORK_CONNECTION_IDENTIFIER         0x02
2849 #define  INTERWORKING_FUNCTION_ADDRESS                  0x03
2850 #define  CODEC_LIST                                     0x04
2851 #define  CODEC                                          0x05
2852 #define  BAT_COMPATIBILITY_REPORT                       0x06
2853 #define  BEARER_NETWORK_CONNECTION_CHARACTERISTICS      0x07
2854 #define  BEARER_CONTROL_INFORMATION                     0x08
2855 #define  BEARER_CONTROL_TUNNELLING                      0x09
2856 #define  BEARER_CONTROL_UNIT_IDENTIFIER                 0x0A
2857 #define  SIGNAL                                         0x0B
2858 #define  BEARER_REDIRECTION_CAPABILITY                  0x0C
2859 #define  BEARER_REDIRECTION_INDICATORS                  0x0D
2860 #define  SIGNAL_TYPE                                    0x0E
2861 #define  DURATION                                       0x0F
2862
2863
2864 static const value_string bat_ase_list_of_Identifiers_vals[] = {
2865
2866   { 0x00                                        ,   "spare" },
2867   { ACTION_INDICATOR                            ,   "Action Indicator" },
2868   { BACKBONE_NETWORK_CONNECTION_IDENTIFIER      ,   "Backbone Network Connection Identifier" },
2869   { INTERWORKING_FUNCTION_ADDRESS               ,   "Interworking Function Address" },
2870   { CODEC_LIST                                  ,   "Codec List" },
2871   { CODEC                                       ,   "Codec" },
2872   { BAT_COMPATIBILITY_REPORT                    ,   "BAT Compatibility Report" },
2873   { BEARER_NETWORK_CONNECTION_CHARACTERISTICS   ,   "Bearer Network Connection Characteristics" },
2874   { BEARER_CONTROL_INFORMATION                  ,   "Bearer Control Information"},
2875   { BEARER_CONTROL_TUNNELLING                   ,   "Bearer Control Tunnelling"},
2876   { BEARER_CONTROL_UNIT_IDENTIFIER              ,   "Bearer Control Unit Identifier" },
2877   { SIGNAL                                      ,   "Signal"},
2878   { BEARER_REDIRECTION_CAPABILITY               ,   "Bearer Redirection Capability"},
2879   { BEARER_REDIRECTION_INDICATORS               ,   "Bearer Redirection Indicators"},
2880   { SIGNAL_TYPE                                 ,   "Signal Type"},
2881   { DURATION                                    ,   "Duration" },
2882   { 0,  NULL }
2883 };
2884 static value_string_ext bat_ase_list_of_Identifiers_vals_ext = VALUE_STRING_EXT_INIT(bat_ase_list_of_Identifiers_vals);
2885
2886 /*ITU-T Q.765.5 (06/2000) 13*/
2887 static const value_string Instruction_indicator_for_general_action_vals[] =
2888 {
2889   { 0,  "Pass on information element"},
2890   { 1,  "Discard information element"},
2891   { 2,  "Discard BICC data"},
2892   { 3,  "Release call"},
2893   { 0,  NULL}};
2894
2895 static const value_string Instruction_indicator_for_pass_on_not_possible_vals[] = {
2896   { 0,  "Release call"},
2897   { 1,  "Discard information element"},
2898   { 2,  "Discard BICC data"},
2899   { 3,  "reserved (interpreted as 00)"},
2900   { 0,  NULL}};
2901
2902 static const value_string bat_ase_action_indicator_field_vals[] = {
2903
2904   { 0x00,  "no indication"},
2905   { 0x01,  "connect backward"},
2906   { 0x02,  "connect forward"},
2907   { 0x03,  "connect forward, no notification"},
2908   { 0x04,  "connect forward, plus notification"},
2909   { 0x05,  "connect forward, no notification + selected codec"},
2910   { 0x06,  "connect forward, plus notification + selected codec"},
2911   { 0x07,  "use idle"},
2912   { 0x08,  "connected"},
2913   { 0x09,  "switched"},
2914   { 0x0a,  "selected codec"},
2915   { 0x0b,  "modify codec"},
2916   { 0x0c,  "successful codec modification"},
2917   { 0x0d,  "codec modification failure"},
2918   { 0x0e,  "mid-call codec negotiation"},
2919   { 0x0f,  "modify to selected codec information"},
2920   { 0x10,  "mid-call codec negotiation failure"},
2921   { 0x11,  "start signal, notify"},
2922   { 0x12,  "start signal, no notify"},
2923   { 0x13,  "stop signal, notify"},
2924   { 0x14,  "stop signal, no notify"},
2925   { 0x15,  "start signal acknowledge"},
2926   { 0x16,  "start signal reject"},
2927   { 0x17,  "stop signal acknowledge"},
2928   { 0x18,  "bearer redirect"},
2929   { 0,     NULL }
2930 };
2931 static value_string_ext bat_ase_action_indicator_field_vals_ext = VALUE_STRING_EXT_INIT(bat_ase_action_indicator_field_vals);
2932
2933 static const true_false_string BCTP_BVEI_value  = {
2934   "Version Error Indication, BCTP version not supported",
2935   "No indication"
2936 };
2937
2938 static const value_string BCTP_Tunnelled_Protocol_Indicator_vals[] = {
2939
2940   { 0x20,  "IPBCP (text encoded)"},
2941   { 0x21,  "spare (text encoded protocol)"},
2942   { 0x22,  "not used"},
2943   { 0,  NULL }
2944 };
2945
2946 static const true_false_string BCTP_TPEI_value  = {
2947   "Protocol Error Indication, Bearer Control Protocol not supported",
2948   "No indication"
2949 };
2950
2951
2952 #define  ITU_T  0x01
2953 #define  ETSI   0x02
2954
2955 static const value_string bat_ase_organization_identifier_subfield_vals[] = {
2956
2957   { 0x00,   "no indication"},
2958   { 0x01,   "ITU-T"},
2959   { 0x02,   "ETSI (refer to TS 26.103)"},
2960   { 0,  NULL }
2961 };
2962
2963 #define G_711_64_A            0x01
2964 #define G_711_64_U            0x02
2965 #define G_711_56_A            0x03
2966 #define G_711_56_U            0x04
2967 #define G_722_SB_ADPCM        0x05
2968 #define G_723_1               0x06
2969 #define G_723_1_Annex_A       0x07
2970 #define G_726_ADPCM           0x08
2971 #define G_727_Embedded_ADPCM  0x09
2972 #define G_728                 0x0a
2973 #define G_729_CS_ACELP        0x0b
2974 #define G_729_Annex_B         0x0c
2975
2976 static const value_string ITU_T_codec_type_subfield_vals[] = {
2977
2978   { 0x00,                  "no indication"},
2979   { G_711_64_A,            "G.711 64 kbit/s A-law"},
2980   { G_711_64_U,            "G.711 64 kbit/s -law"},
2981   { G_711_56_A,            "G.711 56 kbit/s A-law"},
2982   { G_711_56_U,            "G.711 56 kbit/s -law"},
2983   { G_722_SB_ADPCM,        "G.722 (SB-ADPCM)"},
2984   { G_723_1,               "G.723.1"},
2985   { G_723_1_Annex_A,       "G.723.1 Annex A (silence suppression)"},
2986   { G_726_ADPCM,           "G.726 (ADPCM)"},
2987   { G_727_Embedded_ADPCM,  "G.727 (Embedded ADPCM)"},
2988   { G_728,                 "G.728"},
2989   { G_729_CS_ACELP,        "G.729 (CS-ACELP)"},
2990   { G_729_Annex_B,         "G.729 Annex B (silence suppression)"},
2991   { 0,  NULL }
2992 };
2993 static value_string_ext ITU_T_codec_type_subfield_vals_ext = VALUE_STRING_EXT_INIT(ITU_T_codec_type_subfield_vals);
2994
2995 static const value_string ETSI_codec_type_subfield_vals[] = {
2996
2997   { 0x00, "GSM Full Rate (13.0 kBit/s)( GSM FR )"},
2998   { 0x01, "GSM Half Rate (5.6 kBit/s) ( GSM HR )"},
2999   { 0x02, "GSM Enhanced Full Rate (12.2 kBit/s)( GSM EFR )"},
3000   { 0x03, "Full Rate Adaptive Multi-Rate ( FR AMR )"},
3001   { 0x04, "Half Rate Adaptive Multi-Rate ( HR AMR )"},
3002   { 0x05, "UMTS Adaptive Multi-Rate ( UMTS AMR )"},
3003   { 0x06, "UMTS Adaptive Multi-Rate 2 ( UMTS AMR 2 )"},
3004   { 0x07, "TDMA Enhanced Full Rate (7.4 kBit/s) ( TDMA EFR )"},
3005   { 0x08, "PDC Enhanced Full Rate (6.7 kBit/s) ( PDC EFR )"},
3006   { 0x09, "Full Rate Adaptive Multi-Rate WideBand ( FR AMR-WB )"},
3007   { 0x0a, "UMTS Adaptive Multi-Rate WideBand ( UMTS AMR-WB )"},
3008   { 0x0b, "8PSK Half Rate Adaptive Multi-Rate ( OHR AMR )"},
3009   { 0x0c, "8PSK Full Rate Adaptive Multi-Rate WideBand  ( OFR AMR-WB )"},
3010   { 0x0d, "8PSK Half Rate Adaptive Multi-Rate WideBand ( OHR AMR-WB )"},
3011   { 0xfe, "Reserved for future use."},
3012   { 0xff, "Reserved for MuMe dummy Codec Type ( MuMe )"},
3013   { 0,  NULL }
3014 };
3015 static value_string_ext ETSI_codec_type_subfield_vals_ext = VALUE_STRING_EXT_INIT(ETSI_codec_type_subfield_vals);
3016
3017 static const value_string bat_initial_codec_mode_vals[] = {
3018   {0x7, "12.2 kbps"},
3019   {0x6, "10.2 kbps"},
3020   {0x5, "7.95 kbps"},
3021   {0x4, "7.40 kbps"},
3022   {0x3, "6.70 kbps"},
3023   {0x2, "5.90 kbps"},
3024   {0x1, "5.15 kbps"},
3025   {0x0, "4.75 kbps"},
3026   {0, NULL}
3027 };
3028
3029 static const value_string optimisation_mode_vals[] = {
3030   { 0,  "Optimisation of the ACS not supported,"},
3031   { 1,  "Optimisation of the ACS supported,"},
3032   { 0,  NULL }
3033 };
3034
3035 static const value_string bearer_network_connection_characteristics_vals[] = {
3036
3037   { 0x00,   "no indication"},
3038   { 0x01,   "AAL type 1"},
3039   { 0x02,   "AAL type 2"},
3040   { 0x03,   "Structured AAL type 1"},
3041   { 0x04,   "IP/RTP"},
3042   { 0x05,   "TDM (reserved for use by ITU-T Rec. Q.1950)"},
3043   { 0,  NULL }
3044 };
3045 value_string_ext bearer_network_connection_characteristics_vals_ext = VALUE_STRING_EXT_INIT(bearer_network_connection_characteristics_vals);
3046
3047 static const true_false_string Bearer_Control_Tunnelling_ind_value  = {
3048   "Tunnelling to be used",
3049   "No indication"
3050 };
3051
3052 static const true_false_string late_cut_trough_cap_ind_value  = {
3053   "Late Cut-through supported",
3054   "Late Cut-through not supported"
3055 };
3056 /*  ITU-T Rec. Q.765.5/Amd.1 (07/2001) */
3057 static const value_string Bearer_Redirection_Indicator_vals[] = {
3058   { 0x00,  " no indication"},
3059   { 0x01,  "late cut-through request"},
3060   { 0x02,  "redirect temporary reject"},
3061   { 0x03,  "redirect backwards request"},
3062   { 0x04,  "redirect forwards request"},
3063   { 0x05,  "redirect bearer release request"},
3064   { 0x06,  "redirect bearer release proceed"},
3065   { 0x07,  "redirect bearer release complete"},
3066   { 0x08,  "redirect cut-through request"},
3067   { 0x09,  "redirect bearer connected indication"},
3068   { 0x0a,  "redirect failure"},
3069   { 0x0b,  "new connection identifier"},
3070   { 0,  NULL }
3071 };
3072 static value_string_ext Bearer_Redirection_Indicator_vals_ext = VALUE_STRING_EXT_INIT(Bearer_Redirection_Indicator_vals);
3073
3074 /*26/Q.765.5 - Signal Type */
3075 static const value_string BAT_ASE_Signal_Type_vals[] = {
3076   { 0x00,  "DTMF 0"},
3077   { 0x01,  "DTMF 1"},
3078   { 0x02,  "DTMF 2"},
3079   { 0x03,  "DTMF 3"},
3080   { 0x04,  "DTMF 4"},
3081   { 0x05,  "DTMF 5"},
3082   { 0x06,  "DTMF 6"},
3083   { 0x07,  "DTMF 7"},
3084   { 0x08,  "DTMF 8"},
3085   { 0x09,  "DTMF 9"},
3086   { 0x0a,  "DTMF *"},
3087   { 0x0b,  "DTMF #"},
3088   { 0x0c,  "DTMF A"},
3089   { 0x0d,  "DTMF B"},
3090   { 0x0e,  "DTMF C"},
3091   { 0x0f,  "DTMF D"},
3092   /* 0001 0000
3093    * to
3094    * 0011 1111
3095    * Spare