Add some GCC warnings to the standard set, and add some others to the
[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 <stdio.h>
46 #include <stdlib.h>
47 #include <string.h>
48
49 #include <glib.h>
50
51 #include <epan/packet.h>
52 #include <epan/stats_tree.h>
53 #include <prefs.h>
54 #include "packet-q931.h"
55 #include "packet-isup.h"
56 #include "packet-e164.h"
57 #include <epan/sctpppids.h>
58 #include <epan/emem.h>
59 #include <epan/circuit.h>
60 #include <epan/reassemble.h>
61 #include <packet-mtp3.h>
62
63 static gint isup_standard = ITU_STANDARD;
64
65 #define MTP3_ISUP_SERVICE_INDICATOR     5
66 #define MTP3_BICC_SERVICE_INDICATOR     13
67 #define ASCII_NUMBER_DELTA              0x30
68 #define ASCII_LETTER_DELTA              0x37
69
70 /* Definition of protocol field values und lengths */
71
72 /* Definition of Message Types */
73 #define MESSAGE_TYPE_INITIAL_ADDR       1
74 #define MESSAGE_TYPE_SUBSEQ_ADDR        2
75 #define MESSAGE_TYPE_INFO_REQ           3
76 #define MESSAGE_TYPE_INFO               4
77 #define MESSAGE_TYPE_CONTINUITY         5
78 #define MESSAGE_TYPE_ADDR_CMPL          6
79 #define MESSAGE_TYPE_CONNECT            7
80 #define MESSAGE_TYPE_FORW_TRANS         8
81 #define MESSAGE_TYPE_ANSWER             9
82 #define MESSAGE_TYPE_RELEASE           12
83 #define MESSAGE_TYPE_SUSPEND           13
84 #define MESSAGE_TYPE_RESUME            14
85 #define MESSAGE_TYPE_REL_CMPL          16
86 #define MESSAGE_TYPE_CONT_CHECK_REQ    17
87 #define MESSAGE_TYPE_RESET_CIRCUIT     18
88 #define MESSAGE_TYPE_BLOCKING          19
89 #define MESSAGE_TYPE_UNBLOCKING        20
90 #define MESSAGE_TYPE_BLOCK_ACK         21
91 #define MESSAGE_TYPE_UNBLOCK_ACK       22
92 #define MESSAGE_TYPE_CIRC_GRP_RST      23
93 #define MESSAGE_TYPE_CIRC_GRP_BLCK     24
94 #define MESSAGE_TYPE_CIRC_GRP_UNBL     25
95 #define MESSAGE_TYPE_CIRC_GRP_BL_ACK   26
96 #define MESSAGE_TYPE_CIRC_GRP_UNBL_ACK 27
97 #define MESSAGE_TYPE_FACILITY_REQ      31
98 #define MESSAGE_TYPE_FACILITY_ACC      32
99 #define MESSAGE_TYPE_FACILITY_REJ      33
100 #define MESSAGE_TYPE_LOOP_BACK_ACK     36
101 #define MESSAGE_TYPE_PASS_ALONG        40
102 #define MESSAGE_TYPE_CIRC_GRP_RST_ACK  41
103 #define MESSAGE_TYPE_CIRC_GRP_QRY      42
104 #define MESSAGE_TYPE_CIRC_GRP_QRY_RSP  43
105 #define MESSAGE_TYPE_CALL_PROGRSS      44
106 #define MESSAGE_TYPE_USER2USER_INFO    45
107 #define MESSAGE_TYPE_UNEQUIPPED_CIC    46
108 #define MESSAGE_TYPE_CONFUSION         47
109 #define MESSAGE_TYPE_OVERLOAD          48
110 #define MESSAGE_TYPE_CHARGE_INFO       49
111 #define MESSAGE_TYPE_NETW_RESRC_MGMT   50
112 #define MESSAGE_TYPE_FACILITY          51
113 #define MESSAGE_TYPE_USER_PART_TEST    52
114 #define MESSAGE_TYPE_USER_PART_AVAIL   53
115 #define MESSAGE_TYPE_IDENT_REQ         54
116 #define MESSAGE_TYPE_IDENT_RSP         55
117 #define MESSAGE_TYPE_SEGMENTATION      56
118 #define MESSAGE_TYPE_LOOP_PREVENTION   64
119 #define MESSAGE_TYPE_APPLICATION_TRANS 65
120 #define MESSAGE_TYPE_PRE_RELEASE_INFO  66
121 #define MESSAGE_TYPE_SUBSEQUENT_DIR_NUM 67
122
123 #define ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES_ACK                          0xE9
124 #define ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES                                      0xEA
125 #define ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST_RSP                         0xEB
126 #define ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST                                     0xEC
127 #define ANSI_ISUP_MESSAGE_TYPE_EXIT                                                     0xED
128
129 const value_string isup_message_type_value[] = {
130   { MESSAGE_TYPE_INITIAL_ADDR,          "Initial address"},
131   { MESSAGE_TYPE_SUBSEQ_ADDR,           "Subsequent address"},
132   { MESSAGE_TYPE_INFO_REQ,              "Information request (national use)"},
133   { MESSAGE_TYPE_INFO,                  "Information (national use)"},
134   { MESSAGE_TYPE_CONTINUITY,            "Continuity"},
135   { MESSAGE_TYPE_ADDR_CMPL,             "Address complete"},
136   { MESSAGE_TYPE_CONNECT,               "Connect"},
137   { MESSAGE_TYPE_FORW_TRANS,            "Forward transfer"},
138   { MESSAGE_TYPE_ANSWER,                "Answer"},
139   { MESSAGE_TYPE_RELEASE,               "Release"},
140   { MESSAGE_TYPE_SUSPEND,               "Suspend"},
141   { MESSAGE_TYPE_RESUME,                "Resume"},
142   { MESSAGE_TYPE_REL_CMPL,              "Release complete"},
143   { MESSAGE_TYPE_CONT_CHECK_REQ,        "Continuity check request"},
144   { MESSAGE_TYPE_RESET_CIRCUIT,         "Reset Circuit"},
145   { MESSAGE_TYPE_BLOCKING,              "Blocking"},
146   { MESSAGE_TYPE_UNBLOCKING,            "Unblocking"},
147   { MESSAGE_TYPE_BLOCK_ACK,             "Blocking acknowledgement"},
148   { MESSAGE_TYPE_UNBLOCK_ACK,           "Unblocking acknowledgment"},
149   { MESSAGE_TYPE_CIRC_GRP_RST,          "Circuit group reset"},
150   { MESSAGE_TYPE_CIRC_GRP_BLCK,         "Circuit group blocking"},
151   { MESSAGE_TYPE_CIRC_GRP_UNBL,         "Circuit group unblocking"},
152   { MESSAGE_TYPE_CIRC_GRP_BL_ACK,       "Circuit group blocking acknowledgement"},
153   { MESSAGE_TYPE_CIRC_GRP_UNBL_ACK,     "Circuit group unblocking acknowledgement"},
154   { MESSAGE_TYPE_FACILITY_REQ,          "Facility request"},
155   { MESSAGE_TYPE_FACILITY_ACC,          "Facility accepted"},
156   { MESSAGE_TYPE_FACILITY_REJ,          "Facility reject"},
157   { MESSAGE_TYPE_LOOP_BACK_ACK,         "Loop back acknowledgement (national use)"},
158   { MESSAGE_TYPE_PASS_ALONG,            "Pass-along (national use)"},
159   { MESSAGE_TYPE_CIRC_GRP_RST_ACK,      "Circuit group reset acknowledgement"},
160   { MESSAGE_TYPE_CIRC_GRP_QRY,          "Circuit group query (national use)"},
161   { MESSAGE_TYPE_CIRC_GRP_QRY_RSP,      "Circuit group query response (national use)"},
162   { MESSAGE_TYPE_CALL_PROGRSS,          "Call progress"},
163   { MESSAGE_TYPE_USER2USER_INFO,        "User-to-user information"},
164   { MESSAGE_TYPE_UNEQUIPPED_CIC,        "Unequipped CIC (national use)"},
165   { MESSAGE_TYPE_CONFUSION,             "Confusion"},
166   { MESSAGE_TYPE_OVERLOAD,              "Overload (national use)"},
167   { MESSAGE_TYPE_CHARGE_INFO,           "Charge information (national use)"},
168   { MESSAGE_TYPE_NETW_RESRC_MGMT,       "Network resource management"},
169   { MESSAGE_TYPE_FACILITY,              "Facility"},
170   { MESSAGE_TYPE_USER_PART_TEST,        "User part test"},
171   { MESSAGE_TYPE_USER_PART_AVAIL,       "User part available"},
172   { MESSAGE_TYPE_IDENT_REQ,             "Identification request"},
173   { MESSAGE_TYPE_IDENT_RSP,             "Identification response"},
174   { MESSAGE_TYPE_SEGMENTATION,          "Segmentation"},
175   { MESSAGE_TYPE_LOOP_PREVENTION,       "Loop prevention"},
176   { MESSAGE_TYPE_APPLICATION_TRANS,             "Application transport"},
177   { MESSAGE_TYPE_PRE_RELEASE_INFO,              "Pre-release information"},
178   { MESSAGE_TYPE_SUBSEQUENT_DIR_NUM,    "Subsequent Directory Number (national use)"},
179   { 0,                                  NULL}};
180
181  static const value_string ansi_isup_message_type_value[] = {
182   { MESSAGE_TYPE_INITIAL_ADDR,          "Initial address"},
183   { MESSAGE_TYPE_SUBSEQ_ADDR,           "Subsequent address"},
184   { MESSAGE_TYPE_INFO_REQ,              "Information request (national use)"},
185   { MESSAGE_TYPE_INFO,                  "Information (national use)"},
186   { MESSAGE_TYPE_CONTINUITY,            "Continuity"},
187   { MESSAGE_TYPE_ADDR_CMPL,             "Address complete"},
188   { MESSAGE_TYPE_CONNECT,               "Connect"},
189   { MESSAGE_TYPE_FORW_TRANS,            "Forward transfer"},
190   { MESSAGE_TYPE_ANSWER,                "Answer"},
191   { MESSAGE_TYPE_RELEASE,               "Release"},
192   { MESSAGE_TYPE_SUSPEND,               "Suspend"},
193   { MESSAGE_TYPE_RESUME,                "Resume"},
194   { MESSAGE_TYPE_REL_CMPL,              "Release complete"},
195   { MESSAGE_TYPE_CONT_CHECK_REQ,        "Continuity check request"},
196   { MESSAGE_TYPE_RESET_CIRCUIT,         "Reset Circuit"},
197   { MESSAGE_TYPE_BLOCKING,              "Blocking"},
198   { MESSAGE_TYPE_UNBLOCKING,            "Unblocking"},
199   { MESSAGE_TYPE_BLOCK_ACK,             "Blocking acknowledgement"},
200   { MESSAGE_TYPE_UNBLOCK_ACK,           "Unblocking acknowledgment"},
201   { MESSAGE_TYPE_CIRC_GRP_RST,          "Circuit group reset"},
202   { MESSAGE_TYPE_CIRC_GRP_BLCK,         "Circuit group blocking"},
203   { MESSAGE_TYPE_CIRC_GRP_UNBL,         "Circuit group unblocking"},
204   { MESSAGE_TYPE_CIRC_GRP_BL_ACK,       "Circuit group blocking acknowledgement"},
205   { MESSAGE_TYPE_CIRC_GRP_UNBL_ACK,     "Circuit group unblocking acknowledgement"},
206   { MESSAGE_TYPE_FACILITY_REQ,          "Facility request"},
207   { MESSAGE_TYPE_FACILITY_ACC,          "Facility accepted"},
208   { MESSAGE_TYPE_FACILITY_REJ,          "Facility reject"},
209   { MESSAGE_TYPE_LOOP_BACK_ACK,         "Loop back acknowledgement (national use)"},
210   { MESSAGE_TYPE_PASS_ALONG,            "Pass-along (national use)"},
211   { MESSAGE_TYPE_CIRC_GRP_RST_ACK,      "Circuit group reset acknowledgement"},
212   { MESSAGE_TYPE_CIRC_GRP_QRY,          "Circuit group query (national use)"},
213   { MESSAGE_TYPE_CIRC_GRP_QRY_RSP,      "Circuit group query response (national use)"},
214   { MESSAGE_TYPE_CALL_PROGRSS,          "Call progress"},
215   { MESSAGE_TYPE_USER2USER_INFO,        "User-to-user information"},
216   { MESSAGE_TYPE_UNEQUIPPED_CIC,        "Unequipped CIC (national use)"},
217   { MESSAGE_TYPE_CONFUSION,             "Confusion"},
218   { MESSAGE_TYPE_OVERLOAD,              "Overload (national use)"},
219   { MESSAGE_TYPE_CHARGE_INFO,           "Charge information (national use)"},
220   { MESSAGE_TYPE_NETW_RESRC_MGMT,       "Network resource management"},
221   { MESSAGE_TYPE_FACILITY,              "Facility"},
222   { MESSAGE_TYPE_USER_PART_TEST,        "User part test"},
223   { MESSAGE_TYPE_USER_PART_AVAIL,       "User part available"},
224   { MESSAGE_TYPE_IDENT_REQ,             "Identification request"},
225   { MESSAGE_TYPE_IDENT_RSP,             "Identification response"},
226   { MESSAGE_TYPE_SEGMENTATION,          "Segmentation"},
227   { MESSAGE_TYPE_LOOP_PREVENTION,       "Loop prevention"},
228   { MESSAGE_TYPE_APPLICATION_TRANS,             "Application transport"},
229   { MESSAGE_TYPE_PRE_RELEASE_INFO,              "Pre-release information"},
230   { MESSAGE_TYPE_SUBSEQUENT_DIR_NUM,    "Subsequent Directory Number (national use)"},
231   { ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES_ACK,             "Circuit Reservation Acknowledge"},
232   { ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES,                 "Circuit Reservation"},
233   { ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST_RSP,    "Circuit Validation Test Response"},
234   { ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST,                "Circuit Validation Test"},
235   { ANSI_ISUP_MESSAGE_TYPE_EXIT,                                "Exit"},
236   { 0,                                  NULL}};
237 /* Same as above but in acronym form (for the Info column) */
238 const value_string isup_message_type_value_acro[] = {
239   { MESSAGE_TYPE_INITIAL_ADDR,          "IAM"},
240   { MESSAGE_TYPE_SUBSEQ_ADDR,           "SAM"},
241   { MESSAGE_TYPE_INFO_REQ,              "INR"},
242   { MESSAGE_TYPE_INFO,                  "INF"},
243   { MESSAGE_TYPE_CONTINUITY,            "COT"},
244   { MESSAGE_TYPE_ADDR_CMPL,             "ACM"},
245   { MESSAGE_TYPE_CONNECT,               "CON"},
246   { MESSAGE_TYPE_FORW_TRANS,            "FOT"},
247   { MESSAGE_TYPE_ANSWER,                "ANM"},
248   { MESSAGE_TYPE_RELEASE,               "REL"},
249   { MESSAGE_TYPE_SUSPEND,               "SUS"},
250   { MESSAGE_TYPE_RESUME,                "RES"},
251   { MESSAGE_TYPE_REL_CMPL,              "RLC"},
252   { MESSAGE_TYPE_CONT_CHECK_REQ,        "CCR"},
253   { MESSAGE_TYPE_RESET_CIRCUIT,         "RSC"},
254   { MESSAGE_TYPE_BLOCKING,              "BLO"},
255   { MESSAGE_TYPE_UNBLOCKING,            "UBL"},
256   { MESSAGE_TYPE_BLOCK_ACK,             "BLA"},
257   { MESSAGE_TYPE_UNBLOCK_ACK,           "UBLA"},
258   { MESSAGE_TYPE_CIRC_GRP_RST,          "GRS"},
259   { MESSAGE_TYPE_CIRC_GRP_BLCK,         "CGB"},
260   { MESSAGE_TYPE_CIRC_GRP_UNBL,         "CGU"},
261   { MESSAGE_TYPE_CIRC_GRP_BL_ACK,       "CGBA"},
262   { MESSAGE_TYPE_CIRC_GRP_UNBL_ACK,     "CGUA"},
263   { MESSAGE_TYPE_FACILITY_REQ,          "FAR"},
264   { MESSAGE_TYPE_FACILITY_ACC,          "FAA"},
265   { MESSAGE_TYPE_FACILITY_REJ,          "FRJ"},
266   { MESSAGE_TYPE_LOOP_BACK_ACK,         "LPA"},
267   { MESSAGE_TYPE_PASS_ALONG,            "PAM"},
268   { MESSAGE_TYPE_CIRC_GRP_RST_ACK,      "GRA"},
269   { MESSAGE_TYPE_CIRC_GRP_QRY,          "CQM"},
270   { MESSAGE_TYPE_CIRC_GRP_QRY_RSP,      "CQR"},
271   { MESSAGE_TYPE_CALL_PROGRSS,          "CPG"},
272   { MESSAGE_TYPE_USER2USER_INFO,        "UUI"},
273   { MESSAGE_TYPE_UNEQUIPPED_CIC,        "UCIC"},
274   { MESSAGE_TYPE_CONFUSION,             "CFN"},
275   { MESSAGE_TYPE_OVERLOAD,              "OLM"},
276   { MESSAGE_TYPE_CHARGE_INFO,           "CRG"},
277   { MESSAGE_TYPE_NETW_RESRC_MGMT,       "NRM"},
278   { MESSAGE_TYPE_FACILITY,              "FAC"},
279   { MESSAGE_TYPE_USER_PART_TEST,        "UPT"},
280   { MESSAGE_TYPE_USER_PART_AVAIL,       "UPA"},
281   { MESSAGE_TYPE_IDENT_REQ,             "IDR"},
282   { MESSAGE_TYPE_IDENT_RSP,             "IDS"},
283   { MESSAGE_TYPE_SEGMENTATION,          "SGM"},
284   { MESSAGE_TYPE_LOOP_PREVENTION,       "LOP"},
285   { MESSAGE_TYPE_APPLICATION_TRANS,             "APM"},
286   { MESSAGE_TYPE_PRE_RELEASE_INFO,              "PRI"},
287   { MESSAGE_TYPE_SUBSEQUENT_DIR_NUM,    "SDN"},
288   { 0,                                  NULL}};
289
290   /* Same as above but in acronym form (for the Info column) */
291 static const value_string ansi_isup_message_type_value_acro[] = {
292   { MESSAGE_TYPE_INITIAL_ADDR,          "IAM"},
293   { MESSAGE_TYPE_SUBSEQ_ADDR,           "SAM"},
294   { MESSAGE_TYPE_INFO_REQ,              "INR"},
295   { MESSAGE_TYPE_INFO,                  "INF"},
296   { MESSAGE_TYPE_CONTINUITY,            "COT"},
297   { MESSAGE_TYPE_ADDR_CMPL,             "ACM"},
298   { MESSAGE_TYPE_CONNECT,               "CON"},
299   { MESSAGE_TYPE_FORW_TRANS,            "FOT"},
300   { MESSAGE_TYPE_ANSWER,                "ANM"},
301   { MESSAGE_TYPE_RELEASE,               "REL"},
302   { MESSAGE_TYPE_SUSPEND,               "SUS"},
303   { MESSAGE_TYPE_RESUME,                "RES"},
304   { MESSAGE_TYPE_REL_CMPL,              "RLC"},
305   { MESSAGE_TYPE_CONT_CHECK_REQ,        "CCR"},
306   { MESSAGE_TYPE_RESET_CIRCUIT,         "RSC"},
307   { MESSAGE_TYPE_BLOCKING,              "BLO"},
308   { MESSAGE_TYPE_UNBLOCKING,            "UBL"},
309   { MESSAGE_TYPE_BLOCK_ACK,             "BLA"},
310   { MESSAGE_TYPE_UNBLOCK_ACK,           "UBLA"},
311   { MESSAGE_TYPE_CIRC_GRP_RST,          "GRS"},
312   { MESSAGE_TYPE_CIRC_GRP_BLCK,         "CGB"},
313   { MESSAGE_TYPE_CIRC_GRP_UNBL,         "CGU"},
314   { MESSAGE_TYPE_CIRC_GRP_BL_ACK,       "CGBA"},
315   { MESSAGE_TYPE_CIRC_GRP_UNBL_ACK,     "CGUA"},
316   { MESSAGE_TYPE_FACILITY_REQ,          "FAR"},
317   { MESSAGE_TYPE_FACILITY_ACC,          "FAA"},
318   { MESSAGE_TYPE_FACILITY_REJ,          "FRJ"},
319   { MESSAGE_TYPE_LOOP_BACK_ACK,         "LPA"},
320   { MESSAGE_TYPE_PASS_ALONG,            "PAM"},
321   { MESSAGE_TYPE_CIRC_GRP_RST_ACK,      "GRA"},
322   { MESSAGE_TYPE_CIRC_GRP_QRY,          "CQM"},
323   { MESSAGE_TYPE_CIRC_GRP_QRY_RSP,      "CQR"},
324   { MESSAGE_TYPE_CALL_PROGRSS,          "CPG"},
325   { MESSAGE_TYPE_USER2USER_INFO,        "UUI"},
326   { MESSAGE_TYPE_UNEQUIPPED_CIC,        "UCIC"},
327   { MESSAGE_TYPE_CONFUSION,             "CFN"},
328   { MESSAGE_TYPE_OVERLOAD,              "OLM"},
329   { MESSAGE_TYPE_CHARGE_INFO,           "CRG"},
330   { MESSAGE_TYPE_NETW_RESRC_MGMT,       "NRM"},
331   { MESSAGE_TYPE_FACILITY,              "FAC"},
332   { MESSAGE_TYPE_USER_PART_TEST,        "UPT"},
333   { MESSAGE_TYPE_USER_PART_AVAIL,       "UPA"},
334   { MESSAGE_TYPE_IDENT_REQ,             "IDR"},
335   { MESSAGE_TYPE_IDENT_RSP,             "IDS"},
336   { MESSAGE_TYPE_SEGMENTATION,          "SGM"},
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   { ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES_ACK,             "CRA"},
342   { ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES,                 "CRM"},
343   { ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST_RSP,    "CVR"},
344   { ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST,                "CVT"},
345   { ANSI_ISUP_MESSAGE_TYPE_EXIT,                                "EXIT"},
346   { 0,                                  NULL}};
347
348 const value_string isup_parameter_type_value[] = {
349 { PARAM_TYPE_END_OF_OPT_PARAMS,        "End of optional parameters"},
350   { PARAM_TYPE_CALL_REF,               "Call Reference (national use)"},
351   { PARAM_TYPE_TRANSM_MEDIUM_REQU,     "Transmission medium requirement"},
352   { PARAM_TYPE_ACC_TRANSP,             "Access transport"},
353   { PARAM_TYPE_CALLED_PARTY_NR,        "Called party number"},
354   { PARAM_TYPE_SUBSQT_NR,              "Subsequent number"},
355   { PARAM_TYPE_NATURE_OF_CONN_IND,     "Nature of connection indicators"},
356   { PARAM_TYPE_FORW_CALL_IND,          "Forward call indicators"},
357   { PARAM_TYPE_OPT_FORW_CALL_IND,      "Optional forward call indicators"},
358   { PARAM_TYPE_CALLING_PRTY_CATEG,     "Calling party's category"},
359   { PARAM_TYPE_CALLING_PARTY_NR,       "Calling party number"},
360   { PARAM_TYPE_REDIRECTING_NR,         "Redirecting number"},
361   { PARAM_TYPE_REDIRECTION_NR,         "Redirection number"},
362   { PARAM_TYPE_CONNECTION_REQ,         "Connection request"},
363   { PARAM_TYPE_INFO_REQ_IND,           "Information request indicators (national use)"},
364   { PARAM_TYPE_INFO_IND,               "Information indicators (national use)"},
365   { PARAM_TYPE_CONTINUITY_IND,         "Continuity request"},
366   { PARAM_TYPE_BACKW_CALL_IND,         "Backward call indicators"},
367   { PARAM_TYPE_CAUSE_INDICATORS,       "Cause indicators"},
368   { PARAM_TYPE_REDIRECTION_INFO,       "Redirection information"},
369   { PARAM_TYPE_CIRC_GRP_SV_MSG_TYPE,   "Circuit group supervision message type"},
370   { PARAM_TYPE_RANGE_AND_STATUS,       "Range and Status"},
371   { PARAM_TYPE_FACILITY_IND,           "Facility indicator"},
372   { PARAM_TYPE_CLSD_USR_GRP_ILOCK_CD,  "Closed user group interlock code"},
373   { PARAM_TYPE_USER_SERVICE_INFO,      "User service information"},
374   { PARAM_TYPE_SIGNALLING_POINT_CODE,  "Signalling point code (national use)"},
375   { PARAM_TYPE_USER_TO_USER_INFO,      "User-to-user information"},
376   { PARAM_TYPE_CONNECTED_NR,           "Connected number"},
377   { PARAM_TYPE_SUSP_RESUME_IND,        "Suspend/Resume indicators"},
378   { PARAM_TYPE_TRANSIT_NETW_SELECT,    "Transit network selection (national use)"},
379   { PARAM_TYPE_EVENT_INFO,             "Event information"},
380   { PARAM_TYPE_CIRC_ASSIGN_MAP,        "Circuit assignment map"},
381   { PARAM_TYPE_CIRC_STATE_IND,         "Circuit state indicator (national use)"},
382   { PARAM_TYPE_AUTO_CONG_LEVEL,        "Automatic congestion level"},
383   { PARAM_TYPE_ORIG_CALLED_NR,         "Original called number"},
384   { PARAM_TYPE_OPT_BACKW_CALL_IND,     "Backward call indicators"},
385   { PARAM_TYPE_USER_TO_USER_IND,       "User-to-user indicators"},
386   { PARAM_TYPE_ORIG_ISC_POINT_CODE,    "Origination ISC point code"},
387   { PARAM_TYPE_GENERIC_NOTIF_IND,      "Generic notification indicator"},
388   { PARAM_TYPE_CALL_HIST_INFO,         "Call history information"},
389   { PARAM_TYPE_ACC_DELIV_INFO,         "Access delivery information"},
390   { PARAM_TYPE_NETW_SPECIFIC_FACLTY,   "Network specific facility (national use)"},
391   { PARAM_TYPE_USER_SERVICE_INFO_PR,   "User service information prime"},
392   { PARAM_TYPE_PROPAG_DELAY_COUNTER,   "Propagation delay counter"},
393   { PARAM_TYPE_REMOTE_OPERATIONS,      "Remote operations (national use)"},
394   { PARAM_TYPE_SERVICE_ACTIVATION,     "Service activation"},
395   { PARAM_TYPE_USER_TELESERV_INFO,     "User teleservice information"},
396   { PARAM_TYPE_TRANSM_MEDIUM_USED,     "Transmission medium used"},
397   { PARAM_TYPE_CALL_DIV_INFO,          "Call diversion information"},
398   { PARAM_TYPE_ECHO_CTRL_INFO,         "Echo control information"},
399   { PARAM_TYPE_MSG_COMPAT_INFO,        "Message compatibility information"},
400   { PARAM_TYPE_PARAM_COMPAT_INFO,      "Parameter compatibility information"},
401   { PARAM_TYPE_MLPP_PRECEDENCE,        "MLPP precedence"},
402   { PARAM_TYPE_MCID_REQ_IND,           "MCID request indicators"},
403   { PARAM_TYPE_MCID_RSP_IND,           "MCID response indicators"},
404   { PARAM_TYPE_HOP_COUNTER,            "Hop counter"},
405   { PARAM_TYPE_TRANSM_MEDIUM_RQUR_PR,  "Transmission medium requirement prime"},
406   { PARAM_TYPE_LOCATION_NR,            "Location number"},
407   { PARAM_TYPE_REDIR_NR_RSTRCT,        "Redirection number restriction"},
408   { PARAM_TYPE_CALL_TRANS_REF,         "Call transfer reference"},
409   { PARAM_TYPE_LOOP_PREV_IND,          "Loop prevention indicators"},
410   { PARAM_TYPE_CALL_TRANS_NR,          "Call transfer number"},
411   { PARAM_TYPE_CCSS,                   "CCSS"},
412   { PARAM_TYPE_FORW_GVNS,              "Forward GVNS"},
413   { PARAM_TYPE_BACKW_GVNS,             "Backward GVNS"},
414   { PARAM_TYPE_REDIRECT_CAPAB,         "Redirect capability (reserved for national use)"},
415   { PARAM_TYPE_NETW_MGMT_CTRL,         "Network management controls"},
416   { PARAM_TYPE_CORRELATION_ID,         "Correlation id"},
417   { PARAM_TYPE_SCF_ID,                 "SCF id"},
418   { PARAM_TYPE_CALL_DIV_TREAT_IND,     "Call diversion treatment indicators"},
419   { PARAM_TYPE_CALLED_IN_NR,           "Called IN number"},
420   { PARAM_TYPE_CALL_OFF_TREAT_IND,     "Call offering treatment indicators"},
421   { PARAM_TYPE_CHARGED_PARTY_IDENT,    "Charged party identification (national use)"},
422   { PARAM_TYPE_CONF_TREAT_IND,         "Conference treatment indicators"},
423   { PARAM_TYPE_DISPLAY_INFO,           "Display information"},
424   { PARAM_TYPE_UID_ACTION_IND,         "UID action indicators"},
425   { PARAM_TYPE_UID_CAPAB_IND,          "UID capability indicators"},
426   { PARAM_TYPE_REDIRECT_COUNTER,       "Redirect counter (reserved for national use)"},
427   { PARAM_TYPE_COLLECT_CALL_REQ,       "Collect call request"},
428   { PARAM_TYPE_GENERIC_NR,             "Generic number"},
429   { PARAM_TYPE_GENERIC_DIGITS,         "Generic digits (national use)"},
430   { PARAM_TYPE_APPLICATON_TRANS,       "Application transport"},
431   { 0,                                 NULL}};
432
433 static const value_string ansi_isup_parameter_type_value[] = {
434 { PARAM_TYPE_END_OF_OPT_PARAMS,        "End of optional parameters"},
435   { PARAM_TYPE_CALL_REF,               "Call Reference (national use)"},
436   { PARAM_TYPE_TRANSM_MEDIUM_REQU,     "Transmission medium requirement"},
437   { PARAM_TYPE_ACC_TRANSP,             "Access transport"},
438   { PARAM_TYPE_CALLED_PARTY_NR,        "Called party number"},
439   { PARAM_TYPE_SUBSQT_NR,              "Subsequent number"},
440   { PARAM_TYPE_NATURE_OF_CONN_IND,     "Nature of connection indicators"},
441   { PARAM_TYPE_FORW_CALL_IND,          "Forward call indicators"},
442   { PARAM_TYPE_OPT_FORW_CALL_IND,      "Optional forward call indicators"},
443   { PARAM_TYPE_CALLING_PRTY_CATEG,     "Calling party's category"},
444   { PARAM_TYPE_CALLING_PARTY_NR,       "Calling party number"},
445   { PARAM_TYPE_REDIRECTING_NR,         "Redirecting number"},
446   { PARAM_TYPE_REDIRECTION_NR,         "Redirection number"},
447   { PARAM_TYPE_CONNECTION_REQ,         "Connection request"},
448   { PARAM_TYPE_INFO_REQ_IND,           "Information request indicators (national use)"},
449   { PARAM_TYPE_INFO_IND,               "Information indicators (national use)"},
450   { PARAM_TYPE_CONTINUITY_IND,         "Continuity request"},
451   { PARAM_TYPE_BACKW_CALL_IND,         "Backward call indicators"},
452   { PARAM_TYPE_CAUSE_INDICATORS,       "Cause indicators"},
453   { PARAM_TYPE_REDIRECTION_INFO,       "Redirection information"},
454   { PARAM_TYPE_CIRC_GRP_SV_MSG_TYPE,   "Circuit group supervision message type"},
455   { PARAM_TYPE_RANGE_AND_STATUS,       "Range and Status"},
456   { PARAM_TYPE_FACILITY_IND,           "Facility indicator"},
457   { PARAM_TYPE_CLSD_USR_GRP_ILOCK_CD,  "Closed user group interlock code"},
458   { PARAM_TYPE_USER_SERVICE_INFO,      "User service information"},
459   { PARAM_TYPE_SIGNALLING_POINT_CODE,  "Signalling point code (national use)"},
460   { PARAM_TYPE_USER_TO_USER_INFO,      "User-to-user information"},
461   { PARAM_TYPE_CONNECTED_NR,           "Connected number"},
462   { PARAM_TYPE_SUSP_RESUME_IND,        "Suspend/Resume indicators"},
463   { PARAM_TYPE_TRANSIT_NETW_SELECT,    "Transit network selection (national use)"},
464   { PARAM_TYPE_EVENT_INFO,             "Event information"},
465   { PARAM_TYPE_CIRC_ASSIGN_MAP,        "Circuit assignment map"},
466   { PARAM_TYPE_CIRC_STATE_IND,         "Circuit state indicator (national use)"},
467   { PARAM_TYPE_AUTO_CONG_LEVEL,        "Automatic congestion level"},
468   { PARAM_TYPE_ORIG_CALLED_NR,         "Original called number"},
469   { PARAM_TYPE_OPT_BACKW_CALL_IND,     "Backward call indicators"},
470   { PARAM_TYPE_USER_TO_USER_IND,       "User-to-user indicators"},
471   { PARAM_TYPE_ORIG_ISC_POINT_CODE,    "Origination ISC point code"},
472   { PARAM_TYPE_GENERIC_NOTIF_IND,      "Generic notification indicator"},
473   { PARAM_TYPE_CALL_HIST_INFO,         "Call history information"},
474   { PARAM_TYPE_ACC_DELIV_INFO,         "Access delivery information"},
475   { PARAM_TYPE_NETW_SPECIFIC_FACLTY,   "Network specific facility (national use)"},
476   { PARAM_TYPE_USER_SERVICE_INFO_PR,   "User service information prime"},
477   { PARAM_TYPE_PROPAG_DELAY_COUNTER,   "Propagation delay counter"},
478   { PARAM_TYPE_REMOTE_OPERATIONS,      "Remote operations (national use)"},
479   { PARAM_TYPE_SERVICE_ACTIVATION,     "Service activation"},
480   { PARAM_TYPE_USER_TELESERV_INFO,     "User teleservice information"},
481   { PARAM_TYPE_TRANSM_MEDIUM_USED,     "Transmission medium used"},
482   { PARAM_TYPE_CALL_DIV_INFO,          "Call diversion information"},
483   { PARAM_TYPE_ECHO_CTRL_INFO,         "Echo control information"},
484   { PARAM_TYPE_MSG_COMPAT_INFO,        "Message compatibility information"},
485   { PARAM_TYPE_PARAM_COMPAT_INFO,      "Parameter compatibility information"},
486   { PARAM_TYPE_MLPP_PRECEDENCE,        "MLPP precedence"},
487   { PARAM_TYPE_MCID_REQ_IND,           "MCID request indicators"},
488   { PARAM_TYPE_MCID_RSP_IND,           "MCID response indicators"},
489   { PARAM_TYPE_HOP_COUNTER,            "Hop counter"},
490   { PARAM_TYPE_TRANSM_MEDIUM_RQUR_PR,  "Transmission medium requirement prime"},
491   { PARAM_TYPE_LOCATION_NR,            "Location number"},
492   { PARAM_TYPE_REDIR_NR_RSTRCT,        "Redirection number restriction"},
493   { PARAM_TYPE_CALL_TRANS_REF,         "Call transfer reference"},
494   { PARAM_TYPE_LOOP_PREV_IND,          "Loop prevention indicators"},
495   { PARAM_TYPE_CALL_TRANS_NR,          "Call transfer number"},
496   { PARAM_TYPE_CCSS,                   "CCSS"},
497   { PARAM_TYPE_FORW_GVNS,              "Forward GVNS"},
498   { PARAM_TYPE_BACKW_GVNS,             "Backward GVNS"},
499   { PARAM_TYPE_REDIRECT_CAPAB,         "Redirect capability (reserved for national use)"},
500   { PARAM_TYPE_NETW_MGMT_CTRL,         "Network management controls"},
501   { PARAM_TYPE_CORRELATION_ID,         "Correlation id"},
502   { PARAM_TYPE_SCF_ID,                 "SCF id"},
503   { PARAM_TYPE_CALL_DIV_TREAT_IND,     "Call diversion treatment indicators"},
504   { PARAM_TYPE_CALLED_IN_NR,           "Called IN number"},
505   { PARAM_TYPE_CALL_OFF_TREAT_IND,     "Call offering treatment indicators"},
506   { PARAM_TYPE_CHARGED_PARTY_IDENT,    "Charged party identification (national use)"},
507   { PARAM_TYPE_CONF_TREAT_IND,         "Conference treatment indicators"},
508   { PARAM_TYPE_DISPLAY_INFO,           "Display information"},
509   { PARAM_TYPE_UID_ACTION_IND,         "UID action indicators"},
510   { PARAM_TYPE_UID_CAPAB_IND,          "UID capability indicators"},
511   { PARAM_TYPE_REDIRECT_COUNTER,       "Redirect counter (reserved for national use)"},
512   { PARAM_TYPE_COLLECT_CALL_REQ,       "Collect call request"},
513   { PARAM_TYPE_GENERIC_NR,             "Generic number"},
514   { PARAM_TYPE_GENERIC_DIGITS,         "Generic digits (national use)"},
515   { PARAM_TYPE_APPLICATON_TRANS,       "Application transport"},
516   { ANSI_ISUP_PARAM_TYPE_OPER_SERV_INF, "Operator Services information"},
517   { ANSI_ISUP_PARAM_TYPE_EGRESS,                "Egress"},
518   { ANSI_ISUP_PARAM_TYPE_JURISDICTION,  "Jurisdiction"},
519   { ANSI_ISUP_PARAM_TYPE_CARRIER_ID,    "Carrier identification"},
520   { ANSI_ISUP_PARAM_TYPE_BUSINESS_GRP,  "Buisiness group"},
521   { ANSI_ISUP_PARAM_TYPE_GENERIC_NAME,  "Generic name"},
522   { ANSI_ISUP_PARAM_TYPE_NOTIF_IND,             "Notification indicator"},
523   { ANSI_ISUP_PARAM_TYPE_CG_CHAR_IND,   "Circuit group characteristic indicator"},
524   { ANSI_ISUP_PARAM_TYPE_CVR_RESP_IND,  "Circuit validation response indicator"},
525   { ANSI_ISUP_PARAM_TYPE_OUT_TRK_GRP_NM,"Outgoing trunk group number"},
526   { ANSI_ISUP_PARAM_TYPE_CI_NAME_IND,   "Circuit identification name"},
527   { ANSI_ISUP_PARAM_CLLI_CODE,                  "COMMON LANGUAGE location identificatio (CLLI) code"},
528   { ANSI_ISUP_PARAM_ORIG_LINE_INF,              "Originating line information"},
529   { ANSI_ISUP_PARAM_CHRG_NO,                    "Charge number"},
530   { ANSI_ISUP_PARAM_SERV_CODE_IND,              "Service code indicator"},
531   { ANSI_ISUP_PARAM_SPEC_PROC_REQ,              "Special processing request"},
532   { ANSI_ISUP_PARAM_CARRIER_SEL_INF,    "Carrier selection information"},
533   { ANSI_ISUP_PARAM_NET_TRANS,                  "Network transport"},
534   { 0,                                 NULL}};
535
536 #define CIC_LENGTH                             2
537 #define BICC_CIC_LENGTH                        4
538 #define MESSAGE_TYPE_LENGTH                    1
539 #define COMMON_HEADER_LENGTH                   (CIC_LENGTH + MESSAGE_TYPE_LENGTH)
540 #define BICC_COMMON_HEADER_LENGTH              (BICC_CIC_LENGTH + MESSAGE_TYPE_LENGTH)
541
542 #define MAXDIGITS                              32 /* Max number of address digits */
543
544 #define PARAMETER_TYPE_LENGTH                  1
545 #define PARAMETER_POINTER_LENGTH               1
546 #define PARAMETER_LENGTH_IND_LENGTH            1
547
548 /* All following parameter length definitions are WITHOUT the parameter type byte and length indicator for optional parameters*/
549 #define PARAMETER_NAME_LENGTH                  1
550 #define PARAMETER_LENGTH_IND_LENGTH            1
551 #define ACCESS_DELIVERY_INFO_LENGTH            1
552 #define AUTO_CONGEST_LEVEL_LENGTH              1
553 #define BACKWARD_CALL_IND_LENGTH               2
554 #define BACKWARD_GVNS_LENGTH                   1
555 #define CALL_DIV_INFO_LENGTH                   1
556 #define CALL_DIV_TREATMENT_IND_LENGTH          1
557 #define CALL_HISTORY_INFO_LENGTH               2
558 #define CALL_OFFERING_TREATMENT_IND_LENGTH     1
559 #define CALL_REFERENCE_LENGTH                  5
560 #define CALL_TRANSFER_REF_LENGTH               1
561 #define CALLING_PRTYS_CATEGORY_LENGTH          1
562 #define CCSS_LENGTH                            1
563 #define CIRCUIT_ASSIGNMENT_MAP_LENGTH          5
564 #define CIRC_GRP_SV_MSG_TYPE_LENGTH            1
565 #define CLOSED_USR_GRP_INTERLOCK_CODE_LENGTH   4
566 #define COLLECT_CALL_REQUEST_LENGTH            1
567 #define CONFERENCE_TREATMENT_IND_LENGTH        1
568 #define CONNECTION_REQUEST_LENGTH              7
569 #define CONTINUITY_IND_LENGTH                  1
570 #define ECHO_CONTROL_INFO_LENGTH               1
571 #define END_OF_OPT_PART_LENGTH                 1
572 #define EVENT_INFO_LENGTH                      1
573 #define FACILITY_IND_LENGTH                    1
574 #define FORWARD_CALL_IND_LENGTH                2
575 #define GENERIC_NOTIFICATION_IND_LENGTH        1
576 #define HOP_COUNTER_LENGTH                     1
577 #define INFO_IND_LENGTH                        2
578 #define INFO_REQUEST_IND_LENGTH                2
579 #define LOOP_PREVENTION_IND_LENGTH             1
580 #define MCID_REQUEST_IND_LENGTH                1
581 #define MCID_RESPONSE_IND_LENGTH               1
582 #define MLPP_PRECEDENCE_LENGTH                 1
583 #define NATURE_OF_CONNECTION_IND_LENGTH        1
584 #define NETWORK_MANAGEMENT_CONTROLS_LENGTH     1
585 #define OPTIONAL_BACKWARD_CALL_IND_LENGTH      1
586 #define OPTIONAL_FORWARD_CALL_IND_LENGTH       1
587 #define ORIGINAL_ISC_POINT_CODE_LENGTH         2
588 #define PROPAGATION_DELAY_COUNT_LENGTH         2
589 #define REDIRECTION_NUMBER_LENGTH              2
590 #define REDIRECTION_INFO_LENGTH                2
591 #define REDIRECTION_NUMBER_RESTRICTION_LENGTH  1
592 #define SIGNALLING_POINT_CODE_LENGTH           2
593 #define SUSPEND_RESUME_IND_LENGTH              1
594 #define TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH 1
595 #define TRANSMISSION_MEDIUM_RQMT_PRIME_LENGTH  1
596 #define TRANSMISSION_MEDIUM_USED_LENGTH        1
597 #define UID_ACTION_IND_LENGTH                  1
598 #define UID_CAPABILITY_IND_LENGTH              1
599 #define USER_TELESERVICE_INFO_LENGTH           2
600 #define USER_TO_USER_IND_LENGTH                1
601 #define RANGE_LENGTH                           1
602
603 #define CVR_RESP_IND_LENGTH                                             1
604 #define CG_CHAR_IND_LENGTH                                              1
605 #define CI_NAME_IND                                                             28
606 #define CLLI_CODE_LENGTH                                                13
607
608 #define CALL_ID_LENGTH        3 /* for parameter Call Reference */
609 #define SPC_LENGTH            2 /* for parameter Call Reference, Connection request */
610 #define LOCAL_REF_LENGTH      3 /* for parameter Connection request */
611 #define PROTOCOL_CLASS_LENGTH 1 /* for parameter Connection request */
612 #define CREDIT_LENGTH         1 /* for parameter Connection request */
613
614 #define CIC_OFFSET            0
615 #define BICC_CIC_OFFSET       0
616
617 #define NO_SATELLITE_CIRCUIT_IN_CONNECTION   0
618 #define ONE_SATELLITE_CIRCUIT_IN_CONNECTION  1
619 #define TWO_SATELLITE_CIRCUIT_IN_CONNECTION  2
620 static const value_string isup_satellite_ind_value[] = {
621   { NO_SATELLITE_CIRCUIT_IN_CONNECTION,          "No Satellite circuit in connection"},
622   { ONE_SATELLITE_CIRCUIT_IN_CONNECTION,         "One Satellite circuit in connection"},
623   { TWO_SATELLITE_CIRCUIT_IN_CONNECTION,         "Two Satellite circuits in connection"},
624   { 0,                                 NULL}};
625
626 #define CONTINUITY_CHECK_NOT_REQUIRED           0
627 #define CONTINUITY_CHECK_REQUIRED               1
628 #define CONTINUITY_CHECK_ON_A_PREVIOUS_CIRCUIT  2
629 static const value_string isup_continuity_check_ind_value[] = {
630   { CONTINUITY_CHECK_NOT_REQUIRED,               "Continuity check not required"},
631   { CONTINUITY_CHECK_REQUIRED,                   "Continuity check required on this circuit"},
632   { CONTINUITY_CHECK_ON_A_PREVIOUS_CIRCUIT ,     "Continuity check performed on a previous circuit"},
633   { 0,                                 NULL}};
634
635 static const true_false_string isup_echo_control_device_ind_value = {
636   "Echo control device included",
637   "Echo control device not included"
638 };
639
640 static const true_false_string isup_natnl_inatnl_call_ind_value = {
641   "Call to be treated as international call",
642   "Call to be treated as national call"
643 };
644
645 #define NO_END_TO_END_METHOD_AVAILABLE       0
646 #define PASS_ALONG_METHOD_AVAILABLE          1
647 #define SCCP_METHOD_AVAILABLE                2
648 #define PASS_ALONG_AND_SCCP_METHOD_AVAILABLE 3
649 static const value_string isup_end_to_end_method_ind_value[] = {
650   { NO_END_TO_END_METHOD_AVAILABLE,          "No End-to-end method available (only link-by-link method available)"},
651   { PASS_ALONG_METHOD_AVAILABLE,             "Pass-along method available (national use)"},
652   { SCCP_METHOD_AVAILABLE,                   "SCCP method available"},
653   { PASS_ALONG_AND_SCCP_METHOD_AVAILABLE,    "pass-along and SCCP method available (national use)"},
654   { 0,                                 NULL}};
655
656 static const true_false_string isup_interworking_ind_value = {
657   "interworking encountered",
658   "no interworking encountered (No.7 signalling all the way)"
659 };
660
661 static const true_false_string isup_end_to_end_info_ind_value = {
662   "end-to-end information available",
663   "no end-to-end information available"
664 };
665
666 static const true_false_string isup_ISDN_user_part_ind_value = {
667   "ISDN user part used all the way",
668   "ISDN user part not used all the way"
669 };
670
671 #define ISUP_PREFERED_ALL_THE_WAY               0
672 #define ISUP_NOT_REQUIRED_ALL_THE_WAY           1
673 #define ISUP_REQUIRED_ALL_WAY                   2
674 #define ISUP_ISDN_USER_PART_IND_SPARE           3
675 static const value_string isup_preferences_ind_value[] = {
676   { ISUP_PREFERED_ALL_THE_WAY,                   "ISDN user part prefered all the way"},
677   { ISUP_NOT_REQUIRED_ALL_THE_WAY,               "ISDN user part not required all the way"},
678   { ISUP_REQUIRED_ALL_WAY,                       "ISDN user part required all the way"},
679   { ISUP_ISDN_USER_PART_IND_SPARE,               "spare"},
680   { 0,                                 NULL}};
681
682 static const true_false_string isup_ISDN_originating_access_ind_value = {
683   "originating access ISDN",
684   "originating access non-ISDN"
685 };
686
687 #define NO_INDICATION                                0
688 #define CONNECTIONLESS_METHOD_AVAILABLE              1
689 #define CONNECITON_ORIENTED_METHOD_AVAILABLE         2
690 #define CONNECTIONLESS_AND_ORIENTED_METHOD_AVAILABLE 3
691 static const value_string isup_SCCP_method_ind_value[] = {
692   { NO_INDICATION,                                  "No indication"},
693   { CONNECTIONLESS_METHOD_AVAILABLE,                "Connectionless method available (national use)"},
694   { CONNECITON_ORIENTED_METHOD_AVAILABLE,           "Connection oriented method available"},
695   { CONNECTIONLESS_AND_ORIENTED_METHOD_AVAILABLE,   "Connectionless and -oriented method available (national use)"},
696   { 0,                                 NULL}};
697
698 #define UNKNOWN_AT_THIS_TIME                 0
699 #define OPERATOR_FRENCH                      1
700 #define OPERATOR_ENGLISH                     2
701 #define OPERATOR_GERMAN                      3
702 #define OPERATOR_RUSSIAN                     4
703 #define OPERATOR_SPANISH                     5
704 #define ORDINARY_CALLING_SUBSCRIBER         10
705 #define CALLING_SUBSCRIBER_WITH_PRIORITY    11
706 #define DATA_CALL                           12
707 #define TEST_CALL                           13
708 #define PAYPHONE                            15
709 const value_string isup_calling_partys_category_value[] = {
710   { UNKNOWN_AT_THIS_TIME,               "Category unknown at this time (national use)"},
711   { OPERATOR_FRENCH,                    "operator, language French"},
712   { OPERATOR_ENGLISH,                   "operator, language English"},
713   { OPERATOR_GERMAN,                    "operator, language German"},
714   { OPERATOR_RUSSIAN,                   "operator, language Russian"},
715   { OPERATOR_SPANISH,                   "operator, language Spanish"},
716   { ORDINARY_CALLING_SUBSCRIBER,        "ordinary calling subscriber"},
717   { CALLING_SUBSCRIBER_WITH_PRIORITY,   "calling subscriber with priority"},
718   { DATA_CALL,                          "data call (voice band data)"},
719   { TEST_CALL,                          "test call"},
720   /* q.763-200212Amd2 */
721   { 14,                                                                 "IEPS call marking for preferential call set up"},
722   { PAYPHONE,                           "payphone"},
723   { 0,                                 NULL}};
724
725 #define CVR_RSP_IND_FAILURE             0
726 #define CVR_RSP_IND_SUCCESS             1
727
728 const value_string isup_cvr_rsp_ind_value[ ] = {
729         { CVR_RSP_IND_FAILURE, "CVR Response Fail" },
730         { CVR_RSP_IND_SUCCESS, "CVR Response Success" },
731         { 0,                                    NULL }
732 };
733
734 #define CVR_CG_IND_DOUBLE_SEIZE_NONE 0
735 #define CVR_CG_IND_DOUBLE_SEIZE_ODD  1
736 #define CVR_CG_IND_DOUBLE_SEIZE_EVEN 2
737 #define CVR_CG_IND_DOUBLE_SEIZE_ALL  3
738
739 const value_string isup_cvr_cg_double_seize_value[ ] = {
740         { CVR_CG_IND_DOUBLE_SEIZE_NONE, "Double Seize control NONE" },
741         { CVR_CG_IND_DOUBLE_SEIZE_ODD, "Double Seize control odd circuits"},
742         { CVR_CG_IND_DOUBLE_SEIZE_EVEN, "Double Seize control even circuits"},
743         { CVR_CG_IND_DOUBLE_SEIZE_ALL, "Double Seize control all circuits"},
744         {0, NULL }
745 };
746
747 #define CVR_CG_IND_CAR_IND_UNKNOWN              0
748 #define CVR_CG_IND_CAR_IND_ANALOG               1
749 #define CVR_CG_IND_CAR_IND_DIGITAL              2
750 #define CVR_CG_IND_CAR_IND_ANALOG_DIG   3
751
752 const value_string isup_cvr_cg_car_ind_value[ ] = {
753 { CVR_CG_IND_CAR_IND_UNKNOWN   , "Carrier Type Unknown" },
754 { CVR_CG_IND_CAR_IND_ANALOG    ,   "Carrier Type Analog" },
755 { CVR_CG_IND_CAR_IND_DIGITAL   ,   "Carrier Type Digital"},
756 { CVR_CG_IND_CAR_IND_ANALOG_DIG, "Carrier Type Digital And Analog"},
757 { 0, NULL }
758 };
759
760 #define CVR_CG_IND_ALARM_CAR_IND_UNKNOW         0
761 #define CVR_CG_IND_ALARM_CAR_IND_SOFTWARE       1
762 #define CVR_CG_IND_ALARM_CAR_IND_HARDWARE       2
763 #define CVR_CG_IND_ALARM_CAR_IND_SPARE          3
764
765 const value_string isup_cvr_alarm_car_ind_value[ ] = {
766         { CVR_CG_IND_ALARM_CAR_IND_UNKNOW     , "Alarm Carrier Ind Default"},
767         { CVR_CG_IND_ALARM_CAR_IND_SOFTWARE   , "Alarm Carrier Ind Software"},
768         { CVR_CG_IND_ALARM_CAR_IND_HARDWARE   , "Alarm Carrier Ind Hardware"},
769         { CVR_CG_IND_ALARM_CAR_IND_SPARE          , "Alarm Carrier Ind Spare"},
770         { 0, NULL }
771 };
772
773 #define CVR_CG_IND_CONT_CHK_UNKNOWN  0
774 #define CVR_CG_IND_CONT_CHK_NONE         1
775 #define CVR_CG_IND_CONT_CHK_STAT         2
776 #define CVR_CG_IND_CONT_CHK_PER_CALL 3
777
778 const value_string isup_cvr_cont_chk_ind_value[ ] = {
779
780         { CVR_CG_IND_CONT_CHK_UNKNOWN  , "Continuity Check Unknown"},
781         { CVR_CG_IND_CONT_CHK_NONE     , "Continuity Check NONE"},
782         { CVR_CG_IND_CONT_CHK_STAT     ,"Continuity Check Statistical"},
783         { CVR_CG_IND_CONT_CHK_PER_CALL  ,"Continuity Check Per Call"},
784         { 0, NULL }
785 };
786
787 #define MEDIUM_SPEECH                        0
788 #define MEDIUM_64KBS                         2
789 #define MEDIUM_3_1_KHZ_AUDIO                 3
790 #define MEDIUM_RESERVED_SERVICE2_1           4
791 #define MEDIUM_RESERVED_SERVICE1_2           5
792 #define MEDIUM_64KBS_PREFERED                6
793 #define MEDIUM_2_64KBS                       7
794 #define MEDIUM_384KBS                        8
795 #define MEDIUM_1536KBS                       9
796 #define MEDIUM_1920KBS                      10
797 #define MEDIUM_3_64KBS                      16
798 #define MEDIUM_4_64KBS                      17
799 #define MEDIUM_5_64KBS                      18
800 #define MEDIUM_7_64KBS                      20
801 #define MEDIUM_8_64KBS                      21
802 #define MEDIUM_9_64KBS                      22
803 #define MEDIUM_10_64KBS                     23
804 #define MEDIUM_11_64KBS                     24
805 #define MEDIUM_12_64KBS                     25
806 #define MEDIUM_13_64KBS                     26
807 #define MEDIUM_14_64KBS                     27
808 #define MEDIUM_15_64KBS                     28
809 #define MEDIUM_16_64KBS                     29
810 #define MEDIUM_17_64KBS                     30
811 #define MEDIUM_18_64KBS                     31
812 #define MEDIUM_19_64KBS                     32
813 #define MEDIUM_20_64KBS                     33
814 #define MEDIUM_21_64KBS                     34
815 #define MEDIUM_22_64KBS                     35
816 #define MEDIUM_23_64KBS                     36
817 #define MEDIUM_25_64KBS                     38
818 #define MEDIUM_26_64KBS                     39
819 #define MEDIUM_27_64KBS                     40
820 #define MEDIUM_28_64KBS                     41
821 #define MEDIUM_29_64KBS                     42
822
823 const value_string isup_transmission_medium_requirement_value[] = {
824   { MEDIUM_SPEECH,                       "speech"},
825   { MEDIUM_64KBS,                        "64 kbit/s unrestricted"},
826   { MEDIUM_3_1_KHZ_AUDIO,                "3.1 kHz audio"},
827   { MEDIUM_RESERVED_SERVICE2_1,          "reserved for alternate speech (service 2)/64 kbit/s unrestricted (service 1)"},
828   { MEDIUM_RESERVED_SERVICE1_2,          "reserved for alternate 64 kbit/s unrestricted (service 1)/speech (service 2)"},
829   { MEDIUM_64KBS_PREFERED,               "64 kbit/s prefered"},
830   { MEDIUM_2_64KBS,                      "2x64 kbit/s unrestricted"},
831   { MEDIUM_384KBS,                       "384 kbit/s unrestricted"},
832   { MEDIUM_1536KBS,                      "1536 kbit/s unrestricted"},
833   { MEDIUM_1920KBS,                      "1920 kbit/s unrestricted"},
834   { MEDIUM_3_64KBS,                      "3x64 kbit/s unrestricted"},
835   { MEDIUM_4_64KBS,                      "4x64 kbit/s unrestricted"},
836   { MEDIUM_5_64KBS,                      "5x64 kbit/s unrestricted"},
837   { MEDIUM_7_64KBS,                      "7x64 kbit/s unrestricted"},
838   { MEDIUM_8_64KBS,                      "8x64 kbit/s unrestricted"},
839   { MEDIUM_9_64KBS,                      "9x64 kbit/s unrestricted"},
840   { MEDIUM_10_64KBS,                     "10x64 kbit/s unrestricted"},
841   { MEDIUM_11_64KBS,                     "11x64 kbit/s unrestricted"},
842   { MEDIUM_12_64KBS,                     "12x64 kbit/s unrestricted"},
843   { MEDIUM_13_64KBS,                     "13x64 kbit/s unrestricted"},
844   { MEDIUM_14_64KBS,                     "14x64 kbit/s unrestricted"},
845   { MEDIUM_15_64KBS,                     "15x64 kbit/s unrestricted"},
846   { MEDIUM_16_64KBS,                     "16x64 kbit/s unrestricted"},
847   { MEDIUM_17_64KBS,                     "17x64 kbit/s unrestricted"},
848   { MEDIUM_18_64KBS,                     "18x64 kbit/s unrestricted"},
849   { MEDIUM_19_64KBS,                     "19x64 kbit/s unrestricted"},
850   { MEDIUM_20_64KBS,                     "20x64 kbit/s unrestricted"},
851   { MEDIUM_21_64KBS,                     "21x64 kbit/s unrestricted"},
852   { MEDIUM_22_64KBS,                     "22x64 kbit/s unrestricted"},
853   { MEDIUM_23_64KBS,                     "23x64 kbit/s unrestricted"},
854   { MEDIUM_25_64KBS,                     "25x64 kbit/s unrestricted"},
855   { MEDIUM_26_64KBS,                     "26x64 kbit/s unrestricted"},
856   { MEDIUM_27_64KBS,                     "27x64 kbit/s unrestricted"},
857   { MEDIUM_28_64KBS,                     "28x64 kbit/s unrestricted"},
858   { MEDIUM_29_64KBS,                     "29x64 kbit/s unrestricted"},
859   { 0,                                 NULL}};
860 static const value_string isup_transmission_medium_requirement_prime_value[] = {
861   { MEDIUM_SPEECH,                       "speech"},
862   { MEDIUM_64KBS,                        "reserved for 64 kbit/s unrestricted"},
863   { MEDIUM_3_1_KHZ_AUDIO,                "3.1 kHz audio"},
864   { MEDIUM_RESERVED_SERVICE2_1,          "reserved for alternate speech (service 2)/64 kbit/s unrestricted (service 1)"},
865   { MEDIUM_RESERVED_SERVICE1_2,          "reserved for alternate 64 kbit/s unrestricted (service 1)/speech (service 2)"},
866   { MEDIUM_64KBS_PREFERED,               "reserved for 64 kbit/s prefered"},
867   { MEDIUM_2_64KBS,                      "reserved for 2x64 kbit/s unrestricted"},
868   { MEDIUM_384KBS,                       "reserved for 384 kbit/s unrestricted"},
869   { MEDIUM_1536KBS,                      "reserved for 1536 kbit/s unrestricted"},
870   { MEDIUM_1920KBS,                      "reserved for 1920 kbit/s unrestricted"},
871   { 0,                                 NULL}};
872
873
874 /* Definitions for Called and Calling Party number */
875 #define ISUP_ODD_EVEN_MASK                       0x80
876 #define ISUP_NATURE_OF_ADDRESS_IND_MASK          0x7F
877 #define ISUP_INN_MASK                            0x80
878 #define ISUP_NI_MASK                             0x80
879 #define ISUP_NUMBERING_PLAN_IND_MASK             0x70
880 #define ISUP_ADDRESS_PRESENTATION_RESTR_IND_MASK 0x0C
881 #define ISUP_SCREENING_IND_MASK                  0x03
882 #define ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK       0x0F
883 #define ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK      0xF0
884
885 static const true_false_string isup_odd_even_ind_value = {
886   "odd number of address signals",
887   "even number of address signals"
888 };
889
890 #define ISUP_CALLED_PARTY_NATURE_SUBSCRIBER_NR  1
891 #define ISUP_CALLED_PARTY_NATURE_UNKNOWN        2
892 #define ISUP_CALLED_PARTY_NATURE_NATIONAL_NR    3
893 #define ISUP_CALLED_PARTY_NATURE_INTERNATNL_NR  4
894 #define ISUP_CALLED_PARTY_NATURE_NETW_SPEC_NR   5
895 static const value_string isup_called_party_nature_of_address_ind_value[] = {
896   { ISUP_CALLED_PARTY_NATURE_SUBSCRIBER_NR,     "subscriber number (national use)"},
897   { ISUP_CALLED_PARTY_NATURE_UNKNOWN,           "unknown (national use)"},
898   { ISUP_CALLED_PARTY_NATURE_NATIONAL_NR,       "national (significant) number"},
899   { ISUP_CALLED_PARTY_NATURE_INTERNATNL_NR,     "international number"},
900   { ISUP_CALLED_PARTY_NATURE_NETW_SPEC_NR,      "network-specific number (national use)"},
901   { 0,                                 NULL}};
902
903 static const value_string isup_calling_party_nature_of_address_ind_value[] = {
904   { ISUP_CALLED_PARTY_NATURE_SUBSCRIBER_NR,     "subscriber number (national use)"},
905   { ISUP_CALLED_PARTY_NATURE_UNKNOWN,           "unknown (national use)"},
906   { ISUP_CALLED_PARTY_NATURE_NATIONAL_NR,       "national (significant) number"},
907   { ISUP_CALLED_PARTY_NATURE_INTERNATNL_NR,     "international number"},
908   { 0,                                 NULL}};
909
910 static const true_false_string isup_INN_ind_value = {
911   "routing to internal network number not allowed",
912   "routing to internal network number allowed "
913 };
914 static const true_false_string isup_NI_ind_value = {
915   "incomplete",
916   "complete"
917 };
918
919 #define ISDN_NUMBERING_PLAN                     1
920 #define DATA_NUMBERING_PLAN                     3
921 #define TELEX_NUMBERING_PLAN                    4
922 static const value_string isup_numbering_plan_ind_value[] = {
923   { ISDN_NUMBERING_PLAN,     "ISDN (Telephony) numbering plan"},
924   { DATA_NUMBERING_PLAN,     "Data numbering plan (national use)"},
925   { TELEX_NUMBERING_PLAN,    "Telex numbering plan (national use)"},
926   { 5,                       "Reserved for national use"},
927   { 6,                       "Reserved for national use"},
928   { 0,                                 NULL}};
929
930 #define ADDRESS_PRESETATION_ALLOWED      0
931 #define ADDRESS_PRESETATION_RESTRICTED   1
932 #define ADDRESS_NOT_AVAILABLE            2
933 static const value_string isup_address_presentation_restricted_ind_value[] = {
934   { ADDRESS_PRESETATION_ALLOWED,     "presentation allowed"},
935   { ADDRESS_PRESETATION_RESTRICTED,  "presentation restricted"},
936   { ADDRESS_NOT_AVAILABLE,           "address not available (national use)"},
937   { 3,                                 "spare"},
938   { 0,                                 NULL}};
939
940 static const value_string isup_screening_ind_value[] = {
941   { 0,     "reserved"},
942   { 1,     "user provided, verified and passed"},
943   { 2,     "reserved"},
944   { 3,     "network provided"},
945   { 0,     NULL}};
946
947 static const value_string isup_screening_ind_enhanced_value[] = {
948   { 0,     "user provided, not verified"},
949   { 1,     "user provided, verified and passed"},
950   { 2,     "user provided, verified and failed"},
951   { 3,     "network provided"},
952   { 0,     NULL}};
953
954 static const value_string isup_called_party_address_digit_value[] = {
955   { 0,  "0"},
956   { 1,  "1"},
957   { 2,  "2"},
958   { 3,  "3"},
959   { 4,  "4"},
960   { 5,  "5"},
961   { 6,  "6"},
962   { 7,  "7"},
963   { 8,  "8"},
964   { 9,  "9"},
965   { 10, "spare"},
966   { 11, "code 11 "},
967   { 12, "code 12"},
968   { 15, "Stop sending"},
969   { 0,  NULL}};
970
971 static const value_string isup_calling_party_address_digit_value[] = {
972   { 0,  "0"},
973   { 1,  "1"},
974   { 2,  "2"},
975   { 3,  "3"},
976   { 4,  "4"},
977   { 5,  "5"},
978   { 6,  "6"},
979   { 7,  "7"},
980   { 8,  "8"},
981   { 9,  "9"},
982   { 10, "spare"},
983   { 11, "code 11 "},
984   { 12, "code 12"},
985   { 15, "spare"},
986   { 0,  NULL}};
987
988 /*End of Called/Calling party address definitions */
989
990
991 static const true_false_string isup_calling_party_address_request_ind_value = {
992   "calling party address requested",
993   "calling party address not requested"
994 };
995 static const true_false_string isup_holding_ind_value = {
996   "holding requested",
997   "holding not requested"
998 };
999 static const true_false_string isup_calling_partys_category_request_ind_value = {
1000   "Calling Party's category requested",
1001   "Calling Party's category not requested",
1002 };
1003 static const true_false_string isup_charge_information_request_ind_value = {
1004   "Charge Information requested",
1005   "Charge Information not requested"
1006 };
1007 static const true_false_string isup_malicious_call_identification_request_ind_value = {
1008   "Malicious call identification requested",
1009   "Malicious call identification not requested"
1010 };
1011
1012 #define CALLING_PARTY_ADDRESS_NOT_INCLUDED             0
1013 #define CALLING_PARTY_ADDRESS_NOT_AVAILABLE            1
1014 #define CALLING_PARTY_ADDRESS_INCLUDED                 3
1015 static const value_string isup_calling_party_address_response_ind_value[] = {
1016   { CALLING_PARTY_ADDRESS_NOT_INCLUDED, "Calling party address not included"},
1017   { CALLING_PARTY_ADDRESS_NOT_AVAILABLE,"Calling party address not available"},
1018   { 4,                                  "spare"},
1019   { CALLING_PARTY_ADDRESS_INCLUDED,     "Calling party address included"},
1020   { 0,                                 NULL}};
1021
1022 static const true_false_string isup_hold_provided_ind_value = {
1023   "hold provided",
1024   "hold not provided"
1025 };
1026 static const true_false_string isup_calling_partys_category_response_ind_value = {
1027   "Calling Party's category included",
1028   "Calling Party's category not included",
1029 };
1030 static const true_false_string isup_charge_information_response_ind_value = {
1031   "Charge Information included",
1032   "Charge Information not included"
1033 };
1034 static const true_false_string isup_solicited_information_ind_value = {
1035   "unsolicited",
1036   "solicited"
1037 };
1038
1039 static const true_false_string isup_continuity_ind_value = {
1040   "Continuity check successful",
1041   "Continuity ckec failed"
1042 };
1043
1044 #define CHARGE_NO_IND       0
1045 #define CHARGE_NO_CHARGE    1
1046 #define CHARGE_CHARGE       2
1047 static const value_string isup_charge_ind_value[] = {
1048   { CHARGE_NO_IND,    "No indication"},
1049   { CHARGE_NO_CHARGE, "No charge"},
1050   { CHARGE_CHARGE,    "Charge"},
1051   { 3,                "spare"},
1052   { 0,                NULL}};
1053
1054 #define CALLED_PARTYS_STATUS_NO_IND            0
1055 #define CALLED_PARTYS_STATUS_SUBSCR_FREE       1
1056 #define CALLED_PARTYS_STATUS_CONNECT_WHEN_FREE 2
1057 static const value_string isup_called_partys_status_ind_value[] = {
1058   { CALLED_PARTYS_STATUS_NO_IND,            "No indication"},
1059   { CALLED_PARTYS_STATUS_SUBSCR_FREE,       "Subscriber free"},
1060   { CALLED_PARTYS_STATUS_CONNECT_WHEN_FREE, "Connect when free (national use)"},
1061   { 3,                                      "spare"},
1062   { 0,                NULL}};
1063
1064 #define CALLED_PARTYS_CATEGORY_NO_IND            0
1065 #define CALLED_PARTYS_CATEGORY_ORDINARY_SUBSCR   1
1066 #define CALLED_PARTYS_CATEGORY_PAYPHONE          2
1067 static const value_string isup_called_partys_category_ind_value[] = {
1068   { CALLED_PARTYS_CATEGORY_NO_IND,             "No indication"},
1069   { CALLED_PARTYS_CATEGORY_ORDINARY_SUBSCR,    "Ordinary subscriber"},
1070   { CALLED_PARTYS_CATEGORY_PAYPHONE,           "Payphone"},
1071   { 3,                                         "spare"},
1072   { 0,                NULL}};
1073
1074 static const true_false_string isup_ISDN_terminating_access_ind_value = {
1075   "terminating access ISDN",
1076   "terminating access non-ISDN"
1077 };
1078
1079 static const true_false_string isup_suspend_resume_ind_value = {
1080   "network initiated",
1081   "ISDN subscriber initiated"
1082 };
1083 #define MAINTENANCE            0
1084 #define HARDWARE_FAILURE       1
1085 #define RES_FOR_NATNL_USE      2
1086 static const value_string isup_cgs_message_type_value[] = {
1087   { MAINTENANCE,            "maintenance oriented"},
1088   { HARDWARE_FAILURE,       "hardware failure oriented"},
1089   { RES_FOR_NATNL_USE,      "reserved for national use (ISUP'84)"},
1090   { 3,                      "spare"},
1091   { 0,                NULL}};
1092
1093 #define USER_TO_USER_SERVICE      2
1094 static const value_string isup_facility_ind_value[] = {
1095   { USER_TO_USER_SERVICE,     "user-to-user service"},
1096   { 0,                NULL}};
1097
1098 #define MTC_BLCK_STATE_TRANSIENT  0
1099 #define MTC_BLCK_STATE_UNEQUIPPED 3
1100 static const value_string isup_mtc_blocking_state_DC00_value[] = {
1101   {  MTC_BLCK_STATE_TRANSIENT,  "transient"},
1102   { 1,                          "spare"},
1103   { 2,                          "spare"},
1104   {  MTC_BLCK_STATE_UNEQUIPPED, "unequipped"},
1105   { 0,                NULL}};
1106
1107 #define MTC_BLCK_NO_BLOCKING      0
1108 #define MTC_LOCALLY_BLOCKED       1
1109 #define MTC_REMOTELY_BLOCKED      2
1110 #define MTC_LOCAL_REMOTE_BLOCKED  3
1111 static const value_string isup_mtc_blocking_state_DCnot00_value[] = {
1112   {  MTC_BLCK_NO_BLOCKING,     "no blocking (active)"},
1113   {  MTC_LOCALLY_BLOCKED,      "locally blocked"},
1114   {  MTC_REMOTELY_BLOCKED,     "remotely blocked"},
1115   {  MTC_LOCAL_REMOTE_BLOCKED, "locally and remotely blocked"},
1116   {  0,                NULL}};
1117
1118 #define CALL_PROC_INCOMING_BUSY 1
1119 #define CALL_PROC_OUTGOING_BUSY 2
1120 #define CALL_PROC_IDLE          3
1121 static const value_string isup_call_processing_state_value[] = {
1122   {  CALL_PROC_INCOMING_BUSY,     "circuit incoming busy"},
1123   {  CALL_PROC_OUTGOING_BUSY,     "circuit outgoing busy"},
1124   {  CALL_PROC_IDLE,              "idle"},
1125   {  0,                NULL}};
1126
1127 #define HW_BLCK_NO_BLOCKING          0
1128 #define HW_LOCALLY_BLOCKED           1
1129 #define HW_REMOTELY_BLOCKED          2
1130 #define HW_LOCAL_REMOTE_BLOCKED      3
1131 static const value_string isup_HW_blocking_state_value[] = {
1132   {  HW_BLCK_NO_BLOCKING,     "no blocking (active)"},
1133   {  HW_LOCALLY_BLOCKED,      "locally blocked"},
1134   {  HW_REMOTELY_BLOCKED,     "remotely blocked"},
1135   {  HW_LOCAL_REMOTE_BLOCKED, "locally and remotely blocked"},
1136   {  0,                NULL}};
1137
1138 #define EVENT_ALERTING      1
1139 #define EVENT_PROGRESS      2
1140 #define EVENT_INBAND_INFO   3
1141 #define EVENT_ON_BUSY       4
1142 #define EVENT_ON_NO_REPLY   5
1143 #define EVENT_UNCONDITIONAL 6
1144 static const value_string isup_event_ind_value[] = {
1145   /* according 3.21/Q.763 */
1146   {  EVENT_ALERTING,     "ALERTING"},
1147   {  EVENT_PROGRESS,     "PROGRESS"},
1148   {  EVENT_INBAND_INFO,  "in-band information or an appropriate pattern is now available"},
1149   {  EVENT_ON_BUSY,      "call forwarded on busy (national use)"},
1150   {  EVENT_ON_NO_REPLY,  "call forwarded on no reply (national use)"},
1151   {  EVENT_UNCONDITIONAL,"call forwarded unconditional (national use)"},
1152   {  0,                NULL}};
1153
1154 static const true_false_string isup_event_presentation_restricted_ind_value = {
1155   /* according 3.21/Q.763 */
1156   "presentation restricted",
1157   "no indication"
1158 };
1159 #define CUG_NON_CUG_CALL                      0
1160 #define CUG_CALL_OUTGOING_ACCESS_ALLOWED      2
1161 #define CUG_CALL_OUTGOING_ACCESS_NOT_ALLOWED  3
1162 static const value_string isup_CUG_call_ind_value[] = {
1163   /* according 3.38/Q.763 */
1164   {  CUG_NON_CUG_CALL,                     "non-CUG call"},
1165   {  1,                                    "spare"},
1166   {  CUG_CALL_OUTGOING_ACCESS_ALLOWED,     "closed user group call, outgoing access allowed"},
1167   {  CUG_CALL_OUTGOING_ACCESS_NOT_ALLOWED, "closed user group call, outgoing access not allowed"},
1168   {  0,                NULL}};
1169
1170
1171 static const true_false_string isup_simple_segmentation_ind_value = {
1172   /* according 3.38/Q.763 */
1173   "additional information will be sent in a segmentation message",
1174   "no additional information will be sent"
1175 };
1176
1177 static const true_false_string isup_connected_line_identity_request_ind_value = {
1178   /* according 3.38/Q.763 */
1179   "requested",
1180   "not requested"
1181 };
1182
1183 static const value_string isup_redirecting_ind_value[] = {
1184   /* according 3.45/Q.763 */
1185   {  0,        "no redirection (national use)"},
1186   {  1,        "call rerouted (national use)"},
1187   {  2,        "call rerouted, all redirection information presentation restricted (national use)"},
1188   {  3,        "call diverted"},
1189   {  4,        "call diverted, all redirection information presentation restricted"},
1190   {  5,        "call rerouted, redirection number presentation restricted (national use)"},
1191   {  6,        "call diversion, redirection number presentation restricted (national use)"},
1192   {  7,        "spare"},
1193   {  0,         NULL}};
1194
1195 static const value_string isup_original_redirection_reason_value[] = {
1196   /* according 3.45/Q.763 */
1197   {  0,        "unknown/not available"},
1198   {  1,        "user busy (national use)"},
1199   {  2,        "no reply (national use)"},
1200   {  3,        "unconditional (national use)"},
1201   {  0,         NULL}};
1202
1203 static const value_string isup_redirection_reason_value[] = {
1204   /* according 3.45/Q.763 */
1205   {  0,        "unknown/not available"},
1206   {  1,        "user busy (national use)"},
1207   {  2,        "no reply (national use)"},
1208   {  3,        "unconditional (national use)"},
1209   {  4,        "deflection during alerting"},
1210   {  5,        "deflection immediate response"},
1211   {  6,        "mobile subscriber not reachable"},
1212   {  0,         NULL}};
1213
1214 static const value_string isup_type_of_network_identification_value[] = {
1215   /* according 3.53/Q.763 */
1216   {  0,        "CCITT/ITU-T-standardized identification"},
1217   {  2,        "national network identification"},
1218   {  0,         NULL}};
1219
1220 static const value_string isup_network_identification_plan_value[] = {
1221   /* according 3.53/Q.763 */
1222   {  0,        "if CCITT/ITU-T id - unknown"},
1223   {  3,        "if CCITT/ITU-T id - public data network id code (X.121)"},
1224   {  6,        "if CCITT/ITU-T id - public land Mobile Network id code (E.211)"},
1225   {  0,         NULL}};
1226
1227 static const value_string isup_map_type_value[] = {
1228   /* according 3.69/Q.763 */
1229   {  1,        "1544 kbit/s digital path map format (64 kbit/s base rate"},
1230   {  2,        "2048 kbit/s digital path map format (64 kbit/s base rate"},
1231   {  0,         NULL}};
1232
1233 static const value_string isup_auto_congestion_level_value[] = {
1234   /* according 3.4/Q.763 */
1235   {  1,        "Congestion level 1 exceeded"},
1236   {  2,        "Congestion level 2 exceeded"},
1237   {  0,         NULL}};
1238
1239 static const true_false_string isup_inband_information_ind_value = {
1240   /* according 3.37/Q.763 */
1241   "in-band information or an appropirate pattern is now available",
1242   "no indication"
1243 };
1244 static const true_false_string isup_call_diversion_may_occur_ind_value = {
1245   /* according 3.37/Q.763 */
1246   "call diversion may occur",
1247   "no indication"
1248 };
1249 static const true_false_string isup_MLPP_user_ind_value = {
1250   /* according 3.37/Q.763 */
1251   "MLPP user",
1252   "no indication"
1253 };
1254
1255 static const true_false_string isup_access_delivery_ind_value = {
1256   /* according 3.2/Q.763 */
1257   "No set-up message generated",
1258   "Set-up message generated"
1259 };
1260
1261 static const value_string isup_loop_prevention_response_ind_value[] = {
1262   /* according 3.67/Q.763 */
1263   {  0,        "insufficient information"},
1264   {  1,        "no loop exists"},
1265   {  2,        "simultaneous transfer"},
1266   {  0,         NULL}};
1267
1268 static const true_false_string isup_temporary_alternative_routing_ind_value = {
1269   /* according 3.68/Q.763 */
1270   "TAR controlled call",
1271   "no indication"
1272 };
1273 static const true_false_string isup_extension_ind_value = {
1274   /* according 3.68/Q.763 */
1275   "last octet",
1276   "information continues through the next octet"
1277 };
1278
1279
1280
1281 static const value_string isup_call_to_be_diverted_ind_value[] = {
1282   /* according 3.72/Q.763 */
1283   {  0,        "no indication"},
1284   {  1,        "call diversion allowed"},
1285   {  2,        "call diversion not allowed"},
1286   {  3,        "spare"},
1287   {  0,         NULL}};
1288
1289 static const value_string isup_call_to_be_offered_ind_value[] = {
1290   /* according 3.72/Q.763 */
1291   {  0,        "no indication"},
1292   {  1,        "call offering not allowed"},
1293   {  2,        "call offering allowed"},
1294   {  3,        "spare"},
1295   {  0,         NULL}};
1296
1297 static const value_string isup_conference_acceptance_ind_value[] = {
1298   /* according 3.76/Q.763 */
1299   {  0,        "no indication"},
1300   {  1,        "accept conference request"},
1301   {  2,        "reject conference request"},
1302   {  3,        "spare"},
1303   {  0,         NULL}};
1304
1305 static const value_string isup_application_transport_parameter_value[] = {
1306   /* according 3.82/Q.763 */
1307   {  0,         "Unidentified Context and Error Handling (UCEH) ASE"},
1308   {  1,         "PSS1 ASE (VPN)"},
1309   {  2,         "spare"},
1310   {  3,         "Charging ASE"},
1311   {  4,         "GAT"},
1312   {  5,         "BAT ASE"},
1313   {  6,         "Enhanced Unidentified Context and Error Handling ASE (EUCEH ASE)"},
1314   {  0,         NULL}};
1315
1316 static const true_false_string isup_Release_call_indicator_value = {
1317   "release call",
1318   "do not release call"
1319 };
1320
1321 static const true_false_string isup_Send_notification_ind_value = {
1322   "send notification",
1323   "do not send notification"
1324 };
1325 static const value_string isup_APM_segmentation_ind_value[] = {
1326
1327   {  0x00,                     "final segment"},
1328   {  0x01,                     "number of following segments"},
1329   {  0x02,                     "number of following segments"},
1330   {  0x03,                     "number of following segments"},
1331   {  0x04,                     "number of following segments"},
1332   {  0x05,                     "number of following segments"},
1333   {  0x06,                     "number of following segments"},
1334   {  0x07,                     "number of following segments"},
1335   {  0x08,                     "number of following segments"},
1336   {  0x09,                     "number of following segments"},
1337   {  0,                NULL}};
1338
1339 static const true_false_string isup_Sequence_ind_value = {
1340   "new sequence",
1341   "subsequent segment to first segment"
1342 };
1343
1344
1345 /* Generalized bit masks for 8 and 16 bits fields */
1346 #define A_8BIT_MASK  0x01
1347 #define B_8BIT_MASK  0x02
1348 #define C_8BIT_MASK  0x04
1349 #define D_8BIT_MASK  0x08
1350 #define E_8BIT_MASK  0x10
1351 #define F_8BIT_MASK  0x20
1352 #define G_8BIT_MASK  0x40
1353 #define H_8BIT_MASK  0x80
1354
1355 #define BA_8BIT_MASK 0x03
1356 #define CB_8BIT_MASK 0x06
1357 #define DC_8BIT_MASK 0x0C
1358 #define ED_8BIT_MASK 0x18
1359 #define FE_8BIT_MASK 0x30
1360 #define GF_8BIT_MASK 0x60
1361 #define HG_8BIT_MASK 0xC0
1362 #define GFE_8BIT_MASK 0x70
1363 #define DCBA_8BIT_MASK 0x0F
1364 #define EDCBA_8BIT_MASK 0x1F
1365 #define HGFE_8BIT_MASK 0xF0
1366 #define GFEDCBA_8BIT_MASK 0x7F
1367 #define FEDCBA_8BIT_MASK 0x3F
1368
1369 #define A_16BIT_MASK  0x0100
1370 #define B_16BIT_MASK  0x0200
1371 #define C_16BIT_MASK  0x0400
1372 #define D_16BIT_MASK  0x0800
1373 #define E_16BIT_MASK  0x1000
1374 #define F_16BIT_MASK  0x2000
1375 #define G_16BIT_MASK  0x4000
1376 #define H_16BIT_MASK  0x8000
1377 #define I_16BIT_MASK  0x0001
1378 #define J_16BIT_MASK  0x0002
1379 #define K_16BIT_MASK  0x0004
1380 #define L_16BIT_MASK  0x0008
1381 #define M_16BIT_MASK  0x0010
1382 #define N_16BIT_MASK  0x0020
1383 #define O_16BIT_MASK  0x0040
1384 #define P_16BIT_MASK  0x0080
1385
1386 #define BA_16BIT_MASK 0x0300
1387 #define CB_16BIT_MASK 0x0600
1388 #define DC_16BIT_MASK 0x0C00
1389 #define FE_16BIT_MASK 0x3000
1390 #define HG_16BIT_MASK 0xC000
1391 #define KJ_16BIT_MASK 0x0006
1392 #define PO_16BIT_MASK 0x00C0
1393
1394 #define CBA_16BIT_MASK 0x0700
1395 #define KJI_16BIT_MASK 0x0007
1396 #define HGFE_16BIT_MASK 0xF000
1397 #define PONM_16BIT_MASK 0x00F0
1398
1399 /* Initialize the protocol and registered fields */
1400 static int proto_isup = -1;
1401 static int proto_bicc = -1;
1402 static module_t *isup_module;
1403
1404 static gboolean isup_show_cic_in_info = TRUE;
1405
1406 static int hf_isup_called = -1;
1407 static int hf_isup_calling = -1;
1408 static int hf_isup_redirecting = -1;
1409
1410 static int hf_isup_cic = -1;
1411 static int hf_bicc_cic = -1;
1412
1413 static int isup_tap = -1;
1414
1415 static int hf_isup_message_type = -1;
1416 static int hf_isup_parameter_type = -1;
1417 static int hf_isup_parameter_length = -1;
1418 static int hf_isup_mandatory_variable_parameter_pointer = -1;
1419 static int hf_isup_pointer_to_start_of_optional_part = -1;
1420
1421 static int hf_isup_cvr_rsp_ind = -1;
1422 static int hf_isup_cvr_cg_car_ind = -1;
1423 static int hf_isup_cvr_cg_double_seize = -1;
1424 static int hf_isup_cvr_cg_alarm_car_ind = -1;
1425 static int hf_isup_cvr_cont_chk_ind = -1;
1426
1427 static int hf_isup_satellite_indicator = -1;
1428 static int hf_isup_continuity_check_indicator = -1;
1429 static int hf_isup_echo_control_device_indicator = -1;
1430
1431 static int hf_isup_forw_call_natnl_inatnl_call_indicator = -1;
1432 static int hf_isup_forw_call_end_to_end_method_indicator = -1;
1433 static int hf_isup_forw_call_interworking_indicator = -1;
1434 static int hf_isup_forw_call_end_to_end_info_indicator = -1;
1435 static int hf_isup_forw_call_isdn_user_part_indicator = -1;
1436 static int hf_isup_forw_call_preferences_indicator = -1;
1437 static int hf_isup_forw_call_isdn_access_indicator = -1;
1438 static int hf_isup_forw_call_sccp_method_indicator = -1;
1439
1440 static int hf_isup_calling_partys_category = -1;
1441
1442 static int hf_isup_transmission_medium_requirement = -1;
1443
1444 static int hf_isup_odd_even_indicator = -1;
1445 static int hf_isup_called_party_nature_of_address_indicator = -1;
1446 static int hf_isup_calling_party_nature_of_address_indicator = -1;
1447 static int hf_isup_inn_indicator = -1;
1448 static int hf_isup_ni_indicator = -1;
1449 static int hf_isup_numbering_plan_indicator = -1;
1450 static int hf_isup_address_presentation_restricted_indicator = -1;
1451 static int hf_isup_screening_indicator = -1;
1452 static int hf_isup_screening_indicator_enhanced = -1;
1453 static int hf_isup_called_party_odd_address_signal_digit = -1;
1454 static int hf_isup_calling_party_odd_address_signal_digit = -1;
1455 static int hf_isup_called_party_even_address_signal_digit               = -1;
1456 static int hf_isup_calling_party_even_address_signal_digit              = -1;
1457
1458 static int hf_isup_OECD_inf_ind                                         = -1;
1459 static int hf_isup_IECD_inf_ind                                         = -1;
1460 static int hf_isup_OECD_req_ind                                         = -1;
1461 static int hf_isup_IECD_req_ind                                         = -1;
1462
1463 static int hf_isup_calling_party_address_request_indicator = -1;
1464 static int hf_isup_info_req_holding_indicator = -1;
1465 static int hf_isup_calling_partys_category_request_indicator = -1;
1466 static int hf_isup_charge_information_request_indicator = -1;
1467 static int hf_isup_malicious_call_identification_request_indicator = -1;
1468
1469 static int hf_isup_calling_party_address_response_indicator = -1;
1470 static int hf_isup_hold_provided_indicator = -1;
1471 static int hf_isup_calling_partys_category_response_indicator = -1;
1472 static int hf_isup_charge_information_response_indicator = -1;
1473 static int hf_isup_solicited_indicator = -1;
1474
1475 static int hf_isup_continuity_indicator = -1;
1476
1477 static int hf_isup_backw_call_charge_ind = -1 ;
1478 static int hf_isup_backw_call_called_partys_status_ind = -1;
1479 static int hf_isup_backw_call_called_partys_category_ind = -1;
1480 static int hf_isup_backw_call_end_to_end_method_ind = -1;
1481 static int hf_isup_backw_call_interworking_ind = -1;
1482 static int hf_isup_backw_call_end_to_end_info_ind = -1;
1483 static int hf_isup_backw_call_isdn_user_part_ind = -1;
1484 static int hf_isup_backw_call_holding_ind = -1;
1485 static int hf_isup_backw_call_isdn_access_ind = -1;
1486 static int hf_isup_backw_call_echo_control_device_ind = -1;
1487 static int hf_isup_backw_call_sccp_method_ind = -1;
1488
1489 static int hf_isup_cause_indicator = -1;
1490 static int hf_ansi_isup_cause_indicator = -1;
1491
1492 static int hf_isup_suspend_resume_indicator = -1;
1493
1494 static int hf_isup_range_indicator = -1;
1495 static int hf_isup_cgs_message_type = -1;
1496
1497 static int hf_isup_mtc_blocking_state1 = -1;
1498 static int hf_isup_mtc_blocking_state2 = -1;
1499 static int hf_isup_call_proc_state = -1;
1500 static int hf_isup_hw_blocking_state = -1;
1501
1502 static int hf_isup_event_ind = -1;
1503 static int hf_isup_event_presentation_restricted_ind = -1;
1504
1505 static int hf_isup_cug_call_ind = -1;
1506 static int hf_isup_simple_segmentation_ind = -1;
1507 static int hf_isup_connected_line_identity_request_ind = -1;
1508
1509 static int hf_isup_redirecting_ind = -1;
1510 static int hf_isup_original_redirection_reason = -1;
1511 static int hf_isup_redirection_counter = -1;
1512 static int hf_isup_redirection_reason = -1;
1513
1514 static int hf_isup_type_of_network_identification = -1;
1515 static int hf_isup_network_identification_plan = -1;
1516
1517 static int hf_isup_map_type = -1;
1518
1519 static int hf_isup_automatic_congestion_level                           = -1;
1520
1521 static int hf_isup_inband_information_ind                                       = -1;
1522 static int hf_isup_call_diversion_may_occur_ind                         = -1;
1523 static int hf_isup_mlpp_user_ind                                                        = -1;
1524
1525 static int hf_isup_UUI_type                                                                     = -1;
1526 static int hf_isup_UUI_req_service1                                                     = -1;
1527 static int hf_isup_UUI_req_service2                                                     = -1;
1528 static int hf_isup_UUI_req_service3                                                     = -1;
1529 static int hf_isup_UUI_res_service1                                                     = -1;
1530 static int hf_isup_UUI_res_service2                                                     = -1;
1531 static int hf_isup_UUI_res_service3                                                     = -1;
1532 static int hf_isup_UUI_network_discard_ind                                      = -1;
1533 static int hf_isup_access_delivery_ind                                          = -1;
1534
1535 static int hf_isup_transmission_medium_requirement_prime        = -1;
1536
1537 static int hf_isup_loop_prevention_response_ind                         = -1;
1538
1539 static int hf_isup_temporary_alternative_routing_ind            = -1;
1540 static int hf_isup_extension_ind                                                        = -1;
1541
1542 static int hf_isup_call_to_be_diverted_ind                                      = -1;
1543
1544 static int hf_isup_call_to_be_offered_ind                                       = -1;
1545
1546 static int hf_isup_conference_acceptance_ind                            = -1;
1547
1548 static int hf_isup_transit_at_intermediate_exchange_ind         = -1;
1549 static int hf_isup_Release_call_ind                                             = -1;
1550 static int hf_isup_Send_notification_ind                                        = -1;
1551 static int hf_isup_Discard_message_ind_value                            = -1;
1552 static int hf_isup_Discard_parameter_ind                                        = -1;
1553 static int hf_isup_Pass_on_not_possible_indicator                       = -1;
1554 static int hf_isup_pass_on_not_possible_indicator2                      = -1;
1555 static int hf_isup_Broadband_narrowband_interworking_ind        = -1;
1556 static int hf_isup_Broadband_narrowband_interworking_ind2       = -1;
1557
1558 static int hf_isup_app_cont_ident                                       = -1;
1559 static int hf_isup_app_Send_notification_ind            = -1;
1560 static int hf_isup_apm_segmentation_ind                         = -1;
1561 static int hf_isup_apm_si_ind                                           = -1;
1562 static int hf_isup_apm_slr                                                      = -1;
1563 static int hf_isup_orig_addr_len                                        = -1;
1564 static int hf_isup_dest_addr_len                                        = -1;
1565 static int hf_isup_app_Release_call_ind                         = -1;
1566 static int hf_isup_cause_location                                       = -1;
1567
1568 static int hf_ansi_isup_coding_standard                         = -1;
1569
1570 static int hf_length_indicator                                          = -1;
1571 static int hf_afi                                                                       = -1;
1572 static int hf_bicc_nsap_dsp                                                     = -1;
1573 static int hf_bat_ase_identifier                                        = -1;
1574
1575 static int hf_Action_Indicator                                          = -1;
1576
1577 static int hf_Instruction_ind_for_general_action                                = -1;
1578
1579 static int hf_Send_notification_ind_for_general_action                  = -1;
1580
1581 static int hf_Instruction_ind_for_pass_on_not_possible                  = -1;
1582
1583 static int hf_Send_notification_ind_for_pass_on_not_possible    = -1;
1584 static int hf_BCTP_Version_Indicator                                    = -1;
1585 static int hf_Tunnelled_Protocol_Indicator                              = -1;
1586 static int hf_TPEI                                                      = -1;
1587 static int hf_BVEI                                                      = -1;
1588 static int hf_bncid                                                     = -1;
1589 static int hf_bat_ase_biwfa                                             = -1;
1590 static int hf_characteristics                                           = -1;
1591
1592 static int hf_Organization_Identifier                                   = -1;
1593 static int hf_codec_type                                                = -1;
1594 static int hf_etsi_codec_type                                           = -1;
1595 static int hf_active_code_set  = -1;
1596 static int hf_active_code_set_12_2  = -1;
1597 static int hf_active_code_set_10_2  = -1;
1598 static int hf_active_code_set_7_95  = -1;
1599 static int hf_active_code_set_7_40  = -1;
1600 static int hf_active_code_set_6_70  = -1;
1601 static int hf_active_code_set_5_90  = -1;
1602 static int hf_active_code_set_5_15  = -1;
1603 static int hf_active_code_set_4_75  = -1;
1604 static int hf_supported_code_set  = -1;
1605 static int hf_supported_code_set_12_2  = -1;
1606 static int hf_supported_code_set_10_2  = -1;
1607 static int hf_supported_code_set_7_95  = -1;
1608 static int hf_supported_code_set_7_40  = -1;
1609 static int hf_supported_code_set_6_70  = -1;
1610 static int hf_supported_code_set_5_90  = -1;
1611 static int hf_supported_code_set_5_15  = -1;
1612 static int hf_supported_code_set_4_75  = -1;
1613 static int hf_optimisation_mode  = -1;
1614 static int hf_max_codec_modes  = -1;
1615 static int hf_bearer_control_tunneling                  = -1;
1616 static int hf_Local_BCU_ID                                              = -1;
1617 static int hf_late_cut_trough_cap_ind                   = -1;
1618 static int hf_bat_ase_signal                                    = -1;
1619 static int hf_bat_ase_duration                                  = -1;
1620 static int hf_bat_ase_bearer_redir_ind                  = -1;
1621 static int hf_BAT_ASE_Comp_Report_Reason                = -1;
1622 static int hf_BAT_ASE_Comp_Report_ident                 = -1;
1623 static int hf_BAT_ASE_Comp_Report_diagnostic    = -1;
1624 static int hf_nsap_ipv4_addr                                    = -1;
1625 static int hf_nsap_ipv6_addr                                    = -1;
1626 static int hf_iana_icp                                                  = -1;
1627
1628 static int hf_isup_apm_msg_fragments = -1;
1629 static int hf_isup_apm_msg_fragment = -1;
1630 static int hf_isup_apm_msg_fragment_overlap = -1;
1631 static int hf_isup_apm_msg_fragment_overlap_conflicts = -1;
1632 static int hf_isup_apm_msg_fragment_multiple_tails = -1;
1633 static int hf_isup_apm_msg_fragment_too_long_fragment = -1;
1634 static int hf_isup_apm_msg_fragment_error = -1;
1635 static int hf_isup_apm_msg_reassembled_in = -1;
1636
1637 /* Initialize the subtree pointers */
1638 static gint ett_isup                                                    = -1;
1639 static gint ett_isup_parameter                                  = -1;
1640 static gint ett_isup_address_digits                     = -1;
1641 static gint ett_isup_pass_along_message                 = -1;
1642 static gint ett_isup_circuit_state_ind                  = -1;
1643 static gint ett_bat_ase                                                 = -1;
1644 static gint ett_bicc                                                    = -1;
1645 static gint ett_bat_ase_element                                 = -1;
1646 static gint ett_bat_ase_iwfa                                    = -1;
1647 static gint ett_acs                                                             = -1;
1648 static gint ett_scs                                                             = -1;
1649
1650 static gint ett_isup_apm_msg_fragment = -1;
1651 static gint ett_isup_apm_msg_fragments = -1;
1652
1653
1654 static dissector_handle_t sdp_handle = NULL;
1655 static dissector_handle_t q931_ie_handle = NULL;
1656
1657 /* Declarations to desegment APM Messages */
1658 static gboolean isup_apm_desegment = TRUE;
1659
1660 static const fragment_items isup_apm_msg_frag_items = {
1661         /* Fragment subtrees */
1662         &ett_isup_apm_msg_fragment,
1663         &ett_isup_apm_msg_fragments,
1664         /* Fragment fields */
1665         &hf_isup_apm_msg_fragments,
1666         &hf_isup_apm_msg_fragment,
1667         &hf_isup_apm_msg_fragment_overlap,
1668         &hf_isup_apm_msg_fragment_overlap_conflicts,
1669         &hf_isup_apm_msg_fragment_multiple_tails,
1670         &hf_isup_apm_msg_fragment_too_long_fragment,
1671         &hf_isup_apm_msg_fragment_error,
1672         /* Reassembled in field */
1673         &hf_isup_apm_msg_reassembled_in,
1674         /* Tag */
1675         "ISUP APM Message fragments"
1676 };
1677
1678 static GHashTable *isup_apm_msg_fragment_table = NULL;
1679 static GHashTable *isup_apm_msg_reassembled_table = NULL;
1680
1681
1682 static void
1683 isup_apm_defragment_init(void)
1684 {
1685         fragment_table_init (&isup_apm_msg_fragment_table);
1686         reassembled_table_init(&isup_apm_msg_reassembled_table);
1687 }
1688
1689 /* Info for the tap that must be passed between procedures */
1690 gchar *tap_called_number = NULL;
1691 gchar *tap_calling_number = NULL;
1692 guint8 tap_cause_value = 0;
1693
1694 /* ------------------------------------------------------------------
1695   Mapping number to ASCII-character
1696  ------------------------------------------------------------------ */
1697 static char number_to_char(int number)
1698 {
1699   if (number < 10)
1700     return ((char) number + ASCII_NUMBER_DELTA);
1701   else
1702     return ((char) number + ASCII_LETTER_DELTA);
1703 }
1704
1705 /* ------------------------------------------------------------------ */
1706 /* Dissectors for all used parameter types                            */
1707 /* ------------------------------------------------------------------ */
1708 /* argument tvbuff_t contains only parameter-specific length          */
1709 /* length indicator is already dissected in dissect_isup_message() or */
1710 /* dissect_isup_optional_parameter()                                  */
1711 /* ------------------------------------------------------------------ */
1712 /* ------------------------------------------------------------------
1713  Dissector Parameter circuit validation response indicator
1714  */
1715
1716 static void
1717 dissect_isup_cvr_response_ind_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1718 {
1719         guint8 cvr_response_ind;
1720
1721         cvr_response_ind = tvb_get_guint8(parameter_tvb, 0);
1722         proto_tree_add_uint(parameter_tree, hf_isup_cvr_rsp_ind, parameter_tvb, 0, CVR_RESP_IND_LENGTH, cvr_response_ind );
1723         proto_item_set_text(parameter_item, "Circuit Validation Test Response Indicator: 0x%x", cvr_response_ind );
1724
1725 }
1726
1727 /* ------------------------------------------------------------------
1728  Dissector Parameter circuit validation response - circuit group
1729  characters
1730  */
1731 static void
1732 dissect_isup_circuit_group_char_ind_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1733 {
1734         guint8 cvr_cg_char_ind;
1735
1736         cvr_cg_char_ind = tvb_get_guint8(parameter_tvb, 0);
1737         proto_tree_add_uint(parameter_tree, hf_isup_cvr_cg_car_ind, parameter_tvb, 0, CG_CHAR_IND_LENGTH, cvr_cg_char_ind );
1738         proto_tree_add_uint(parameter_tree, hf_isup_cvr_cg_double_seize, parameter_tvb, 0, CG_CHAR_IND_LENGTH, cvr_cg_char_ind );
1739         proto_tree_add_uint(parameter_tree, hf_isup_cvr_cg_alarm_car_ind, parameter_tvb, 0, CG_CHAR_IND_LENGTH, cvr_cg_char_ind );
1740         proto_tree_add_uint(parameter_tree, hf_isup_cvr_cont_chk_ind, parameter_tvb, 0, CG_CHAR_IND_LENGTH, cvr_cg_char_ind );
1741
1742         proto_item_set_text(parameter_item, "Circuit Validation Test Response Circuit Group Characterstics: 0x%x", cvr_cg_char_ind );
1743 }
1744
1745 /* ------------------------------------------------------------------
1746  Dissector Parameter nature of connection flags
1747  */
1748 static void
1749 dissect_isup_nature_of_connection_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1750 {
1751   guint8 nature_of_connection_ind;
1752
1753   nature_of_connection_ind = tvb_get_guint8(parameter_tvb, 0);
1754   proto_tree_add_uint(parameter_tree, hf_isup_satellite_indicator, parameter_tvb, 0,NATURE_OF_CONNECTION_IND_LENGTH, nature_of_connection_ind);
1755   proto_tree_add_uint(parameter_tree, hf_isup_continuity_check_indicator, parameter_tvb, 0,NATURE_OF_CONNECTION_IND_LENGTH, nature_of_connection_ind);
1756   proto_tree_add_boolean(parameter_tree, hf_isup_echo_control_device_indicator, parameter_tvb, 0,  NATURE_OF_CONNECTION_IND_LENGTH, nature_of_connection_ind);
1757
1758   proto_item_set_text(parameter_item, "Nature of Connection Indicators: 0x%x", nature_of_connection_ind);
1759 }
1760
1761 /* ------------------------------------------------------------------
1762  Dissector Parameter Forward Call Indicators
1763  */
1764 static void
1765 dissect_isup_forward_call_indicators_parameter(tvbuff_t *parameter_tvb,proto_tree *parameter_tree, proto_item *parameter_item)
1766 {
1767   guint16 forward_call_ind;
1768
1769   forward_call_ind = tvb_get_ntohs(parameter_tvb, 0);
1770   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_natnl_inatnl_call_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1771   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);
1772   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_interworking_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1773   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);
1774   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_isdn_user_part_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1775   proto_tree_add_uint(parameter_tree, hf_isup_forw_call_preferences_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1776   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_isdn_access_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1777   proto_tree_add_uint(parameter_tree, hf_isup_forw_call_sccp_method_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1778
1779   proto_item_set_text(parameter_item, "Forward Call Indicators: 0x%x", forward_call_ind );
1780 }
1781
1782 /* ------------------------------------------------------------------
1783  Dissector Parameter Calling Party's Category
1784  */
1785 static void
1786 dissect_isup_calling_partys_category_parameter(tvbuff_t *parameter_tvb,proto_tree *parameter_tree, proto_item *parameter_item)
1787 {
1788   guint8 calling_partys_category;
1789
1790   calling_partys_category = tvb_get_guint8(parameter_tvb, 0);
1791   proto_tree_add_uint(parameter_tree, hf_isup_calling_partys_category, parameter_tvb, 0, CALLING_PRTYS_CATEGORY_LENGTH, calling_partys_category);
1792
1793   proto_item_set_text(parameter_item, "Calling Party's category: 0x%x (%s)", calling_partys_category, val_to_str(calling_partys_category, isup_calling_partys_category_value, "reserved/spare"));
1794 }
1795
1796
1797 /* ------------------------------------------------------------------
1798   Dissector Parameter Transmission medium requirement
1799  */
1800 static void
1801 dissect_isup_transmission_medium_requirement_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1802 {
1803   guint8 transmission_medium_requirement;
1804
1805   transmission_medium_requirement = tvb_get_guint8(parameter_tvb, 0);
1806   proto_tree_add_uint(parameter_tree, hf_isup_transmission_medium_requirement, parameter_tvb, 0, TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH,transmission_medium_requirement);
1807
1808   proto_item_set_text(parameter_item, "Transmission medium requirement: %u (%s)",  transmission_medium_requirement, val_to_str(transmission_medium_requirement, isup_transmission_medium_requirement_value, "spare"));
1809 }
1810 /* ------------------------------------------------------------------
1811   Dissector Parameter Called party number
1812  */
1813 void
1814 dissect_isup_called_party_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1815 {
1816   proto_item *address_digits_item;
1817   proto_tree *address_digits_tree;
1818   guint8 indicators1, indicators2;
1819   guint8 address_digit_pair=0;
1820   gint offset=0;
1821   gint i=0;
1822   gint length;
1823   char called_number[MAXDIGITS + 1]="";
1824   e164_info_t e164_info;
1825   gint number_plan;
1826
1827   indicators1 = tvb_get_guint8(parameter_tvb, 0);
1828   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
1829   proto_tree_add_uint(parameter_tree, hf_isup_called_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
1830   indicators2 = tvb_get_guint8(parameter_tvb, 1);
1831   number_plan = (indicators2 & 0x70)>> 4;
1832   proto_tree_add_boolean(parameter_tree, hf_isup_inn_indicator, parameter_tvb, 1, 1, indicators2);
1833   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
1834   offset = 2;
1835
1836   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
1837                                             offset, -1,
1838                                             "Called Party Number");
1839   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
1840
1841   while((length = tvb_reported_length_remaining(parameter_tvb, offset)) > 0){
1842           address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
1843           proto_tree_add_uint(address_digits_tree, hf_isup_called_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1844           called_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
1845                 if (i > MAXDIGITS)
1846                         THROW(ReportedBoundsError);
1847                 if ((length - 1) > 0 ){
1848                         proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1849                         called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1850                         if (i > MAXDIGITS)
1851                                 THROW(ReportedBoundsError);
1852                         }
1853                 offset++;
1854                 }
1855   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
1856                 proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
1857                 called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1858                 if (i > MAXDIGITS)
1859                         THROW(ReportedBoundsError);
1860   }
1861
1862   called_number[i++] = '\0';
1863   proto_item_set_text(address_digits_item, "Called Party Number: %s", called_number);
1864   proto_item_set_text(parameter_item, "Called Party Number: %s", called_number);
1865   if ( number_plan == 1 ) {
1866                 e164_info.e164_number_type = CALLED_PARTY_NUMBER;
1867                 e164_info.nature_of_address = indicators1 & 0x7f;
1868                 e164_info.E164_number_str = called_number;
1869                 e164_info.E164_number_length = i - 1;
1870                 dissect_e164_number(parameter_tvb, address_digits_tree, 2, (offset - 2), e164_info);
1871                 proto_tree_add_string_hidden(address_digits_tree, hf_isup_called, parameter_tvb,
1872                 offset - length, length, called_number);
1873   } else {
1874                 proto_tree_add_string(address_digits_tree, hf_isup_called, parameter_tvb,
1875                         offset - length, length, called_number);
1876   }
1877   tap_called_number = ep_strdup(called_number);
1878 }
1879 /* ------------------------------------------------------------------
1880   Dissector Parameter  Subsequent number
1881  */
1882 static void
1883 dissect_isup_subsequent_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1884 {
1885   proto_item *address_digits_item;
1886   proto_tree *address_digits_tree;
1887   guint8 indicators1;
1888   guint8 address_digit_pair=0;
1889   gint offset=0;
1890   gint i=0;
1891   gint length;
1892   char called_number[MAXDIGITS + 1]="";
1893
1894   indicators1 = tvb_get_guint8(parameter_tvb, 0);
1895   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
1896   offset = 1;
1897
1898   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
1899                                             offset, -1,
1900                                             "Subsequent Number");
1901   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
1902
1903   while((length = tvb_reported_length_remaining(parameter_tvb, offset)) > 0){
1904     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
1905     proto_tree_add_uint(address_digits_tree, hf_isup_called_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1906     called_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
1907     if (i > MAXDIGITS)
1908       THROW(ReportedBoundsError);
1909     if ((length - 1) > 0 ){
1910       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1911       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1912       if (i > MAXDIGITS)
1913         THROW(ReportedBoundsError);
1914     }
1915     offset++;
1916   }
1917
1918   if (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
1919       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
1920       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1921       if (i > MAXDIGITS)
1922         THROW(ReportedBoundsError);
1923   }
1924   called_number[i++] = '\0';
1925
1926   proto_item_set_text(address_digits_item, "Subsequent Number: %s", called_number);
1927   proto_item_set_text(parameter_item, "Subsequent Number: %s", called_number);
1928
1929 }
1930 /* ------------------------------------------------------------------
1931   Dissector Parameter Information Request Indicators
1932  */
1933 static void
1934 dissect_isup_information_request_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1935 {
1936   guint16 information_request_indicators;
1937
1938   information_request_indicators = tvb_get_ntohs(parameter_tvb, 0);
1939   proto_tree_add_boolean(parameter_tree, hf_isup_calling_party_address_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
1940   proto_tree_add_boolean(parameter_tree, hf_isup_info_req_holding_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
1941   proto_tree_add_boolean(parameter_tree, hf_isup_calling_partys_category_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
1942   proto_tree_add_boolean(parameter_tree, hf_isup_charge_information_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
1943   proto_tree_add_boolean(parameter_tree, hf_isup_malicious_call_identification_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
1944
1945
1946   proto_item_set_text(parameter_item, "Information request indicators: 0x%x", information_request_indicators);
1947 }
1948 /* ------------------------------------------------------------------
1949   Dissector Parameter Information Indicators
1950  */
1951 static void
1952 dissect_isup_information_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1953 {
1954   guint16 information_indicators;
1955
1956   information_indicators = tvb_get_ntohs(parameter_tvb, 0);
1957   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_address_response_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
1958   proto_tree_add_boolean(parameter_tree, hf_isup_hold_provided_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
1959   proto_tree_add_boolean(parameter_tree, hf_isup_calling_partys_category_response_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
1960   proto_tree_add_boolean(parameter_tree, hf_isup_charge_information_response_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
1961   proto_tree_add_boolean(parameter_tree, hf_isup_solicited_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
1962
1963
1964   proto_item_set_text(parameter_item, "Information indicators: 0x%x", information_indicators);
1965 }
1966 /* ------------------------------------------------------------------
1967   Dissector Parameter Continuity Indicators
1968  */
1969 static void
1970 dissect_isup_continuity_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1971 {
1972   guint8 continuity_indicators;
1973
1974   continuity_indicators = tvb_get_guint8(parameter_tvb, 0);
1975   proto_tree_add_boolean(parameter_tree, hf_isup_continuity_indicator, parameter_tvb, 0, CONTINUITY_IND_LENGTH,  continuity_indicators);
1976
1977   proto_item_set_text(parameter_item, "Continuity indicators: 0x%x", continuity_indicators);
1978 }
1979 /* ------------------------------------------------------------------
1980  Dissector Parameter Backward Call Indicators
1981  */
1982 static void
1983 dissect_isup_backward_call_indicators_parameter(tvbuff_t *parameter_tvb,proto_tree *parameter_tree, proto_item *parameter_item)
1984 {
1985   guint16 backward_call_ind;
1986
1987   backward_call_ind = tvb_get_ntohs(parameter_tvb, 0);
1988
1989
1990   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_charge_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1991   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_called_partys_status_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1992   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_called_partys_category_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1993   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);
1994   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_interworking_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1995   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);
1996   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_isdn_user_part_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1997   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_holding_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH,  backward_call_ind);
1998   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_isdn_access_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1999   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_echo_control_device_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2000   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_sccp_method_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2001
2002   proto_item_set_text(parameter_item, "Backward Call Indicators: 0x%x", backward_call_ind);
2003 }
2004 /* ------------------------------------------------------------------
2005   Dissector Parameter Cause Indicators - no detailed dissection since defined in Rec. Q.850
2006  */
2007
2008 /*
2009  * Cause codes for Cause.
2010  * The decoding of cause indicators parameter field are defined in ITU-T
2011  * Recommendation Q.850; those are different from the ones in the Q.931
2012  * dissector, as that has some values not specified by the standard but
2013  * that appear to be used for purposes other than the ones in Q.850.
2014  */
2015 const value_string q850_cause_code_vals[] = {
2016         { 0x00, "Valid cause code not yet received" },
2017         { 0x01, "Unallocated (unassigned) number" },
2018         { 0x02, "No route to specified transit network" },
2019         { 0x03, "No route to destination" },
2020         { 0x04, "Send special information tone" },
2021         { 0x05, "Misdialled trunk prefix" },
2022         { 0x06, "Channel unacceptable" },
2023         { 0x07, "Call awarded and being delivered in an established channel" },
2024         { 0x08, "Preemption" },
2025         { 0x09, "Preemption - circuit reserved for reuse" },
2026         { 0x0E, "QoR: ported number" },
2027         { 0x10, "Normal call clearing" },
2028         { 0x11, "User busy" },
2029         { 0x12, "No user responding" },
2030         { 0x13, "No answer from user (user alerted)" },
2031         { 0x14, "Subscriber absent" },
2032         { 0x15, "Call rejected" },
2033         { 0x16, "Number changed" },
2034         { 0x17, "Redirection to new destination" },
2035         { 0x18, "Call rejected due to feature at the destination" },
2036         { 0x19, "Exchange routing error" },
2037         { 0x1A, "Non-selected user clearing" },
2038         { 0x1B, "Destination out of order" },
2039         { 0x1C, "Invalid number format (address incomplete)" },
2040         { 0x1D, "Facility rejected" },
2041         { 0x1E, "Response to STATUS ENQUIRY" },
2042         { 0x1F, "Normal unspecified" },
2043         { 0x21, "Circuit out of order" },
2044         { 0x22, "No circuit/channel available" },
2045         { 0x26, "Network out of order" },
2046         { 0x27, "Permanent frame mode connection out of service" },
2047         { 0x28, "Permanent frame mode connection operational" },
2048         { 0x29, "Temporary failure" },
2049         { 0x2A, "Switching equipment congestion" },
2050         { 0x2B, "Access information discarded" },
2051         { 0x2C, "Requested circuit/channel not available" },
2052         { 0x2E, "Precedence call blocked" },
2053         { 0x2F, "Resources unavailable, unspecified" },
2054         { 0x31, "Quality of service unavailable" },
2055         { 0x32, "Requested facility not subscribed" },
2056         { 0x35, "Outgoing calls barred within CUG" },
2057         { 0x37, "Incoming calls barred within CUG" },
2058         { 0x38, "Call waiting not subscribed" },
2059         { 0x39, "Bearer capability not authorized" },
2060         { 0x3A, "Bearer capability not presently available" },
2061         { 0x3E, "Inconsistency in designated outgoing access information and subscriber class" },
2062         { 0x3F, "Service or option not available, unspecified" },
2063         { 0x41, "Bearer capability not implemented" },
2064         { 0x42, "Channel type not implemented" },
2065         { 0x45, "Requested facility not implemented" },
2066         { 0x46, "Only restricted digital information bearer capability is available" },
2067         { 0x4F, "Service or option not implemented, unspecified" },
2068         { 0x51, "Invalid call reference value" },
2069         { 0x52, "Identified channel does not exist" },
2070         { 0x53, "Call identity does not exist for suspended call" },
2071         { 0x54, "Call identity in use" },
2072         { 0x55, "No call suspended" },
2073         { 0x56, "Call having the requested call identity has been cleared" },
2074         { 0x57, "Called user not member of CUG" },
2075         { 0x58, "Incompatible destination" },
2076         { 0x5A, "Non-existing CUG" },
2077         { 0x5B, "Invalid transit network selection (national use)" },
2078         { 0x5F, "Invalid message, unspecified" },
2079         { 0x60, "Mandatory information element is missing" },
2080         { 0x61, "Message type non-existent or not implemented" },
2081         { 0x62, "Message not compatible with call state or message type non-existent or not implemented" },
2082         { 0x63, "Information element nonexistant or not implemented" },
2083         { 0x64, "Invalid information element contents" },
2084         { 0x65, "Message not compatible with call state" },
2085         { 0x66, "Recovery on timer expiry" },
2086         { 0x67, "Parameter non-existent or not implemented - passed on" },
2087         { 0x6E, "Message with unrecognized parameter discarded" },
2088         { 0x6F, "Protocol error, unspecified" },
2089         { 0x7F, "Internetworking, unspecified" },
2090         { 0,    NULL }
2091 };
2092
2093 static const value_string ansi_isup_cause_code_vals[] = {
2094         { 23, "Unallocated destination number" },
2095         { 24, "Undefined buissines group" },
2096         { 25, "Exchange routeing error" },
2097         { 45, "Preemption" },
2098         { 46, "Precedence call blocked" },
2099         { 51, "Call type incompatible with service request" },
2100         { 54, "Call blocked due to group restriction" },
2101         { 0,    NULL }
2102 };
2103
2104 static const value_string ansi_isup_coding_standard_vals[] = {
2105         { 0, "CCITT Standard" },
2106         { 1, "Reserved for other international standards" },
2107         { 2, "ANSI Standard" },
2108         { 3, "Reserved" },
2109         { 0,    NULL }
2110 };
2111 void
2112 dissect_isup_cause_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2113 { guint length = tvb_reported_length(parameter_tvb);
2114   proto_tree_add_text(parameter_tree, parameter_tvb,0, -1, "Cause indicators (-> Q.850)");
2115   dissect_q931_cause_ie(parameter_tvb,0,length,
2116                                             parameter_tree,
2117                                             hf_isup_cause_indicator, &tap_cause_value);
2118   proto_item_set_text(parameter_item, "Cause indicators, see Q.850 (%u byte%s length)", length , plurality(length, "", "s"));
2119 }
2120
2121 static void
2122 dissect_ansi_isup_cause_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2123 {
2124         guint8 coding_standard;
2125         int offset = 0;
2126         guint length = tvb_reported_length(parameter_tvb);
2127
2128         coding_standard = (tvb_get_guint8(parameter_tvb, offset)&& 0x60)>>5;
2129         proto_tree_add_text(parameter_tree, parameter_tvb,0, -1, "Cause indicators");
2130
2131         switch (coding_standard) {
2132         case 1:
2133                 /* ITU Cause */
2134                 dissect_q931_cause_ie(parameter_tvb,0,length,
2135                                             parameter_tree,
2136                                             hf_isup_cause_indicator, &tap_cause_value);
2137                 break;
2138         case 2:
2139                 /*ANSI*/
2140                 proto_tree_add_item(parameter_tree, hf_isup_cause_location, parameter_tvb, offset, 1, FALSE);
2141                 proto_tree_add_item(parameter_tree, hf_ansi_isup_coding_standard, parameter_tvb, offset, 1, FALSE);
2142                 proto_tree_add_item(parameter_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, FALSE);
2143                 offset ++;
2144                 length--;
2145                 if (length == 0)
2146                         return;
2147                 proto_tree_add_item(parameter_tree, hf_ansi_isup_cause_indicator, parameter_tvb, offset, 1, FALSE);
2148                 offset ++;
2149                 length--;
2150                 if (length == 0)
2151                         return;
2152                 proto_tree_add_text(parameter_tree, parameter_tvb, offset,
2153                     length, "Diagnostic: %s",
2154                     tvb_bytes_to_str(parameter_tvb, offset, length));
2155                 return;
2156                 break;
2157         default:
2158                 proto_tree_add_item(parameter_tree, hf_ansi_isup_coding_standard, parameter_tvb, offset, 1, FALSE);
2159                 proto_tree_add_item(parameter_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, FALSE);
2160                 break;
2161         }
2162         proto_item_set_text(parameter_item, "Cause indicators(%u byte%s length)", length , plurality(length, "", "s"));
2163 }
2164
2165 /* ------------------------------------------------------------------
2166   Dissector Parameter Suspend/Resume Indicators
2167  */
2168 static void
2169 dissect_isup_suspend_resume_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2170 {
2171   guint8 indicators;
2172
2173   indicators = tvb_get_guint8(parameter_tvb, 0);
2174   proto_tree_add_boolean(parameter_tree, hf_isup_suspend_resume_indicator, parameter_tvb, 0, SUSPEND_RESUME_IND_LENGTH,  indicators);
2175
2176   proto_item_set_text(parameter_item, "Suspend/Resume indicator: 0x%x", indicators);
2177 }
2178 /* ------------------------------------------------------------------
2179   Dissector Parameter Range and Status Indicators
2180  */
2181 static void
2182 dissect_isup_range_and_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2183 {
2184   guint8 range, actual_status_length;
2185
2186   range = tvb_get_guint8(parameter_tvb, 0);
2187   proto_tree_add_uint_format(parameter_tree, hf_isup_range_indicator, parameter_tvb, 0, RANGE_LENGTH, range, "Range: %u", range);
2188   actual_status_length = tvb_reported_length_remaining(parameter_tvb, RANGE_LENGTH);
2189   if (actual_status_length > 0)
2190     proto_tree_add_text(parameter_tree, parameter_tvb , RANGE_LENGTH, -1, "Status subfield");
2191   else
2192     proto_tree_add_text(parameter_tree, parameter_tvb , 0, 0, "Status subfield is not present with this message type");
2193
2194
2195   proto_item_set_text(parameter_item, "Range (%u) and status", range);
2196 }
2197 /* ------------------------------------------------------------------
2198   Dissector Parameter Circuit group supervision message type
2199  */
2200 static void
2201 dissect_isup_circuit_group_supervision_message_type_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2202 {
2203   guint8 cgs_message_type;
2204
2205   cgs_message_type = tvb_get_guint8(parameter_tvb, 0);
2206   proto_tree_add_uint(parameter_tree, hf_isup_cgs_message_type, parameter_tvb, 0, CIRC_GRP_SV_MSG_TYPE_LENGTH, cgs_message_type);
2207
2208   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);
2209 }
2210 /* ------------------------------------------------------------------
2211   Dissector Parameter Facility indicator parameter
2212  */
2213 static void
2214 dissect_isup_facility_ind_parameter(tvbuff_t *parameter_tvb, proto_item *parameter_item)
2215 {
2216   guint8 indicator;
2217
2218   indicator = tvb_get_guint8(parameter_tvb, 0);
2219
2220   proto_item_set_text(parameter_item, "Facility indicator: %s (%u)"  ,val_to_str(indicator, isup_facility_ind_value,"spare"), indicator);
2221 }
2222 /* ------------------------------------------------------------------
2223   Dissector Parameter Circuit state indicator
2224  */
2225 static void
2226 dissect_isup_circuit_state_ind_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2227 {
2228   proto_item *circuit_state_item;
2229   proto_tree *circuit_state_tree;
2230   guint8 circuit_state;
2231   gint offset=0;
2232   gint i=0;
2233   gint length;
2234
2235   while((length = tvb_reported_length_remaining(parameter_tvb, offset)) > 0){
2236     circuit_state_item = proto_tree_add_text(parameter_tree, parameter_tvb,
2237                                              offset, -1,
2238                                              "Circuit# CIC+%u state", i);
2239     circuit_state_tree = proto_item_add_subtree(circuit_state_item, ett_isup_circuit_state_ind);
2240     circuit_state = tvb_get_guint8(parameter_tvb, offset);
2241     if ((circuit_state & DC_8BIT_MASK) == 0){
2242       proto_tree_add_uint(circuit_state_tree, hf_isup_mtc_blocking_state1, parameter_tvb, offset, 1, circuit_state);
2243       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"));
2244     }
2245     else {
2246       proto_tree_add_uint(circuit_state_tree, hf_isup_mtc_blocking_state2, parameter_tvb, offset, 1, circuit_state);
2247       proto_tree_add_uint(circuit_state_tree, hf_isup_call_proc_state, parameter_tvb, offset, 1, circuit_state);
2248       proto_tree_add_uint(circuit_state_tree, hf_isup_hw_blocking_state, parameter_tvb, offset, 1, circuit_state);
2249       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"));
2250     }
2251     offset++;
2252   }
2253   proto_item_set_text(parameter_item, "Circuit state indicator (national use)");
2254 }
2255 /* ------------------------------------------------------------------
2256   Dissector Parameter Event information
2257  */
2258 static void
2259 dissect_isup_event_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2260 {
2261   guint8 indicators;
2262
2263   indicators = tvb_get_guint8(parameter_tvb, 0);
2264   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);
2265   proto_tree_add_boolean(parameter_tree, hf_isup_event_presentation_restricted_ind, parameter_tvb, 0, EVENT_INFO_LENGTH, indicators);
2266
2267   proto_item_set_text(parameter_item,"Event information: %s (%u)", val_to_str(indicators & GFEDCBA_8BIT_MASK, isup_event_ind_value, "spare"),indicators );
2268 }
2269 /* ------------------------------------------------------------------
2270   Dissector Parameter User-to-user information- no detailed dissection since defined in Rec. Q.931
2271  */
2272 static void
2273 dissect_isup_user_to_user_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2274 { guint length = tvb_reported_length(parameter_tvb);
2275   proto_tree_add_text(parameter_tree, parameter_tvb, 0, -1,
2276           "User-to-user info (-> Q.931)");
2277   dissect_q931_user_user_ie(parameter_tvb, 0, length,
2278     parameter_tree );
2279   proto_item_set_text(parameter_item, "User-to-user information,(%u byte%s length)",
2280         length , plurality(length, "", "s"));
2281 }
2282 /* ------------------------------------------------------------------
2283   Dissector Parameter Call Reference
2284  */
2285 static void
2286 dissect_isup_call_reference_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2287 {
2288   guint32 call_id;
2289   guint16 spc;
2290
2291   call_id = tvb_get_ntoh24(parameter_tvb, 0);
2292   spc = tvb_get_letohs(parameter_tvb, CALL_ID_LENGTH) & 0x3FFF; /*since 1st 2 bits spare */
2293   proto_tree_add_text(parameter_tree, parameter_tvb, 0, CALL_ID_LENGTH, "Call identity: %u", call_id);
2294   proto_tree_add_text(parameter_tree, parameter_tvb, CALL_ID_LENGTH, SPC_LENGTH, "Signalling Point Code: %u", spc);
2295
2296   proto_item_set_text(parameter_item, "Call Reference: Call ID = %u, SPC = %u", call_id, spc);
2297 }
2298 /* ------------------------------------------------------------------
2299   Dissector Parameter Access Transport - no detailed dissection since defined in Rec. Q.931
2300  */
2301 static void
2302 dissect_isup_access_transport_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree,
2303                          proto_item *parameter_item, packet_info *pinfo)
2304 { guint length = tvb_reported_length(parameter_tvb);
2305
2306   proto_tree_add_text(parameter_tree, parameter_tvb, 0, -1,
2307           "Access transport parameter field (-> Q.931)");
2308
2309   if (q931_ie_handle)
2310     call_dissector(q931_ie_handle, parameter_tvb, pinfo, parameter_tree);
2311
2312   proto_item_set_text(parameter_item, "Access transport (%u byte%s length)",
2313           length , plurality(length, "", "s"));
2314 }
2315
2316 /* dissect x.213 NSAP coded Address */
2317
2318 static const value_string x213_afi_value[] = {
2319         { 0x34, "IANA ICP"},
2320         { 0x35, "IANA ICP"},
2321         { 0x36, "X.121"},
2322         { 0x37, "X.121"},
2323         { 0x38, "ISO DCC"},
2324         { 0x39, "ISO DCC"},
2325         { 0x40, "F.69"},
2326         { 0x41, "F.69"},
2327         { 0x42, "E.163"},
2328         { 0x43, "E.163"},
2329         { 0x44, "E.164"},
2330         { 0x45, "E.164"},
2331         { 0x46, "ISO 6523-ICD"},
2332         { 0x47, "ISO 6523-ICD"},
2333         { 0x48, "Local"},
2334         { 0x49, "Local"},
2335         { 0x50, "Local ISO/IEC 646 character "},
2336         { 0x51, "Local ( National character )"},
2337         { 0x52, "X.121"},
2338         { 0x53, "X.121"},
2339         { 0x54, "F.69"},
2340         { 0x55, "F.69"},
2341         { 0x56, "E.163"},
2342         { 0x57, "E.163"},
2343         { 0x58, "E.164"},
2344         { 0x59, "E.164"},
2345
2346         { 0x76, "ITU-T IND"},
2347         { 0x77, "ITU-T IND"},
2348
2349         { 0xb8, "IANA ICP Group no"},
2350         { 0xb9, "IANA ICP Group no"},
2351         { 0xba, "X.121 Group no"},
2352         { 0xbb, "X.121 Group no"},
2353         { 0xbc, "ISO DCC Group no"},
2354         { 0xbd, "ISO DCC Group no"},
2355         { 0xbe, "F.69 Group no"},
2356         { 0xbf, "F.69 Group no"},
2357         { 0xc0, "E.163 Group no"},
2358         { 0xc1, "E.163 Group no"},
2359         { 0xc2, "E.164 Group no"},
2360         { 0xc3, "E.164 Group no"},
2361         { 0xc4, "ISO 6523-ICD Group no"},
2362         { 0xc5, "ISO 6523-ICD Group no"},
2363         { 0xc6, "Local Group no"},
2364         { 0xc7, "Local Group no"},
2365         { 0xc8, "Local ISO/IEC 646 character Group no"},
2366         { 0xc9, "Local ( National character ) Group no"},
2367         { 0xca, "X.121 Group no"},
2368         { 0xcb, "X.121 Group no"},
2369         { 0xcd, "F.69 Group no"},
2370         { 0xce, "F.69 Group no"},
2371         { 0xcf, "E.163 Group no"},
2372         { 0xde, "E.163 Group no"},
2373         { 0xd0, "E.164 Group no"},
2374         { 0xd1, "E.164 Group no"},
2375
2376         { 0xe2, "ITU-T IND Group no"},
2377         { 0xe3, "ITU-T IND Group no"},
2378         { 0,    NULL }
2379 };
2380
2381
2382 /* Up-to-date information on the allocated ICP values can be found in   */
2383 /*draft-gray-rfc1888bis-01 at                                           */
2384 /*http://www.ietf.org/internet-drafts/draft-gray-rfc1888bis-01.txt      */
2385 static const value_string iana_icp_values[] = {
2386         {   0x0, "IP Version 6 Address"},
2387         {   0x1, "IP Version 4 Address"},
2388         { 0,    NULL }
2389 };
2390
2391 /*
2392  * XXX - shouldn't there be a centralized routine for dissecting NSAPs?
2393  * See also "dissect_atm_nsap()" in epan/dissectors/packet-arp.c and
2394  * "print_nsap_net_buf()" and "print_nsap_net()" in epan/osi_utils.c.
2395  */
2396 void
2397 dissect_nsap(tvbuff_t *parameter_tvb,gint offset,gint len, proto_tree *parameter_tree)
2398 {
2399         guint8 afi, cc_length = 0;
2400         guint8 length = 0, address_digit_pair = 0;
2401         guint icp,  cc, id_code, cc_offset;
2402
2403         afi = tvb_get_guint8(parameter_tvb, offset);
2404
2405         switch ( afi ) {
2406                 case 0x35:      /* IANA ICP Binary fortmat*/
2407                         proto_tree_add_text(parameter_tree, parameter_tvb, offset, 3,
2408                             "IDP = %s", tvb_bytes_to_str(parameter_tvb, offset, 3));
2409
2410                         proto_tree_add_uint(parameter_tree, hf_afi, parameter_tvb, offset, 1, afi );
2411                         offset = offset + 1;
2412                         icp = tvb_get_ntohs(parameter_tvb, offset);
2413                         proto_tree_add_uint(parameter_tree, hf_iana_icp, parameter_tvb, offset, 1, icp );
2414                         if ( icp == 0 ){ /* IPv6 addr */
2415                                 proto_tree_add_text(parameter_tree, parameter_tvb, offset + 2 , 17,
2416                                     "DSP = %s", tvb_bytes_to_str(parameter_tvb, offset + 2, 17));
2417                                 proto_tree_add_item(parameter_tree, hf_nsap_ipv6_addr, parameter_tvb, offset + 2,
2418                                     16, FALSE);
2419
2420                         }
2421                         else { /* IPv4 addr */
2422                                 /* XXX - this is really only for ICP 1 */
2423                                 proto_tree_add_text(parameter_tree, parameter_tvb, offset + 2, 17,
2424                                     "DSP = %s", tvb_bytes_to_str(parameter_tvb, offset + 2, 17));
2425                                 proto_tree_add_item(parameter_tree, hf_nsap_ipv4_addr, parameter_tvb, offset + 2, 4, FALSE);
2426                         }
2427
2428                         break;
2429                 case 0x45:      /* E.164 ATM format */
2430                 case 0xC3:      /* E.164 ATM group format */
2431                         proto_tree_add_text(parameter_tree, parameter_tvb, offset, 9,
2432                             "IDP = %s", tvb_bytes_to_str(parameter_tvb, offset, 9));
2433
2434                         proto_tree_add_uint(parameter_tree, hf_afi, parameter_tvb, offset, 1, afi );
2435
2436                         proto_tree_add_text(parameter_tree, parameter_tvb, offset + 1, 8,
2437                             "IDI = %s", tvb_bytes_to_str(parameter_tvb, offset + 1, 8));
2438                         offset = offset +1;
2439                         /* Dissect country code after removing non significant zeros */
2440                         cc_offset = offset;
2441                         address_digit_pair = tvb_get_guint8(parameter_tvb, cc_offset);
2442                         while ( address_digit_pair == 0 ) {
2443                                 cc_offset = cc_offset + 1;
2444                                 address_digit_pair = tvb_get_guint8(parameter_tvb, cc_offset);
2445                         }
2446                         cc = tvb_get_ntohs(parameter_tvb, cc_offset);
2447                         if (( address_digit_pair & 0xf0 ) != 0 )
2448                                 cc = cc >> 4;
2449
2450                         switch ( cc & 0x0f00 ) {
2451
2452                         case 0x0 :
2453                                 cc_length = 1;
2454                                 break;
2455
2456                         case 0x0100 : cc_length = 1;
2457                                 break;
2458
2459                         case 0x0200 :
2460                                 switch ( cc & 0x00f0 ) {
2461                                         case 0 :
2462                                         case 7 :
2463                                                 cc_length = 2;
2464                                                 break;
2465                                         default :
2466                                                 cc_length = 3;
2467                                                 break;
2468                                         }
2469                                 break;
2470
2471                         case 0x0300 :
2472                                 switch ( cc & 0x00f0 ) {
2473                                         case 0 :
2474                                         case 0x10 :
2475                                         case 0x20 :
2476                                         case 0x30 :
2477                                         case 0x40 :
2478                                         case 0x60 :
2479                                         case 0x90 :
2480                                                 cc_length = 2;
2481                                                 break;
2482                                         default :
2483                                                 cc_length = 3;
2484                                                 break;
2485                                 }
2486                                 break;
2487                         case 0x0400 :
2488                                 switch ( cc & 0x00f0 ) {
2489                                         case 0x20 :
2490                                                 cc_length = 3;
2491                                                 break;
2492                                 default :
2493                                         cc_length = 2;
2494                                         break;
2495                                 }
2496                                 break;
2497
2498                         case 0x0500 :
2499                                 switch ( cc & 0x00f0 ) {
2500                                         case 0 :
2501                                         case 0x90 :
2502                                                 cc_length = 3;
2503                                                 break;
2504                                 default :
2505                                         cc_length = 2;
2506                                         break;
2507                                 }
2508                                 break;
2509
2510                         case 0x0600 :
2511                                 switch ( cc & 0x00f0 ) {
2512                                         case 0x70 :
2513                                         case 0x80 :
2514                                         case 0x90 :
2515                                                 cc_length = 3;
2516                                                 break;
2517                                         default :
2518                                                 cc_length = 2;
2519                                                 break;
2520                                 }
2521                                 break;
2522
2523                         case 0x0700 : cc_length = 1;
2524                                 break;
2525
2526                         case 0x0800 :
2527                                 switch ( cc & 0x00f0 ) {
2528                                         case 0x10:
2529                                         case 0x20:
2530                                         case 0x40:
2531                                         case 0x60:
2532                                                 cc_length = 2;
2533                                                 break;
2534                                 default :
2535                                         cc_length = 3;
2536                                         break;
2537                                 }
2538                                 break;
2539
2540                         case 0x0900 :
2541                                 switch ( cc & 0x00f0 ) {
2542                                         case 0 :
2543                                         case 0x10 :
2544                                         case 0x20 :
2545                                         case 0x30 :
2546                                         case 0x40 :
2547                                         case 0x50 :
2548                                         case 0x80 :
2549                                                 cc_length = 2;
2550                                                 break;
2551                                         default :
2552                                                 cc_length = 3;
2553                                                 break;
2554                                 }
2555                                 break;
2556
2557                         default:
2558                                 break;
2559                         }/* End switch cc */
2560                         switch ( cc_length ) {
2561                         case 0x1 :      cc = cc >> 8;
2562                                 length = 1;
2563                                 break;
2564                         case 0x2 :      cc = cc >> 4;
2565                                 length = 1;
2566                                 break;
2567                         default:
2568                                 length = 2;
2569                                 break;
2570                         }/* end switch cc_length */
2571                         proto_tree_add_text(parameter_tree,parameter_tvb, cc_offset, length,"Country Code: %x %s length %u",cc,
2572                                         val_to_str(cc,E164_country_code_value,"unknown (%x)"),cc_length);
2573                         switch ( cc ) {
2574                         case 0x882 :
2575                                         id_code = tvb_get_ntohs(parameter_tvb, cc_offset + 1);
2576                                         id_code = (id_code & 0x0fff) >> 4;
2577                                         proto_tree_add_text(parameter_tree,parameter_tvb, (cc_offset + 1), 2,"Identification Code: %x %s ",id_code,
2578                                                 val_to_str(id_code,E164_International_Networks_vals,"unknown (%x)"));
2579                                 break;
2580                         default:;
2581                         }
2582                         proto_tree_add_text(parameter_tree,parameter_tvb, cc_offset, length,"DSP length %u(len %u -9 )",(len-9),len );
2583
2584                         proto_tree_add_item(parameter_tree, hf_bicc_nsap_dsp, parameter_tvb, offset + 8, (len - 9),FALSE);
2585
2586                         break;
2587                 default:
2588                         proto_tree_add_uint(parameter_tree, hf_afi, parameter_tvb, offset, len, afi );
2589                 }/* end switch afi */
2590
2591 }
2592
2593
2594 #define  ACTION_INDICATOR                               0x01
2595 #define  BACKBONE_NETWORK_CONNECTION_IDENTIFIER         0x02
2596 #define  INTERWORKING_FUNCTION_ADDRESS                  0x03
2597 #define  CODEC_LIST                                     0x04
2598 #define  CODEC                                          0x05
2599 #define  BAT_COMPATIBILITY_REPORT                       0x06
2600 #define  BEARER_NETWORK_CONNECTION_CHARACTERISTICS      0x07
2601 #define  BEARER_CONTROL_INFORMATION                     0x08
2602 #define  BEARER_CONTROL_TUNNELLING                      0x09
2603 #define  BEARER_CONTROL_UNIT_IDENTIFIER                 0x0A
2604 #define  SIGNAL                                         0x0B
2605 #define  BEARER_REDIRECTION_CAPABILITY                  0x0C
2606 #define  BEARER_REDIRECTION_INDICATORS                  0x0D
2607 #define  SIGNAL_TYPE                                    0x0E
2608 #define  DURATION                                       0x0F
2609
2610
2611 static const value_string bat_ase_list_of_Identifiers_vals[] = {
2612
2613         { 0x00                                          ,       "spare" },
2614         { ACTION_INDICATOR                              ,       "Action Indicator" },
2615         { BACKBONE_NETWORK_CONNECTION_IDENTIFIER        ,       "Backbone Network Connection Identifier" },
2616         { INTERWORKING_FUNCTION_ADDRESS                 ,       "Interworking Function Address" },
2617         { CODEC_LIST                                    ,       "Codec List" },
2618         { CODEC                                         ,       "Codec" },
2619         { BAT_COMPATIBILITY_REPORT                      ,       "BAT Compatibility Report" },
2620         { BEARER_NETWORK_CONNECTION_CHARACTERISTICS     ,       "Bearer Network Connection Characteristics" },
2621         { BEARER_CONTROL_INFORMATION                    ,       "Bearer Control Information"},
2622         { BEARER_CONTROL_TUNNELLING                     ,       "Bearer Control Tunnelling"},
2623         { BEARER_CONTROL_UNIT_IDENTIFIER                ,       "Bearer Control Unit Identifier" },
2624         { SIGNAL                                        ,       "Signal"},
2625         { BEARER_REDIRECTION_CAPABILITY                 ,       "Bearer Redirection Capability"},
2626         { BEARER_REDIRECTION_INDICATORS                 ,       "Bearer Redirection Indicators"},
2627         { SIGNAL_TYPE                                   ,       "Signal Type"},
2628         { DURATION                                      ,       "Duration" },
2629         { 0,    NULL }
2630 };
2631
2632 /*ITU-T Q.765.5 (06/2000) 13*/
2633 static const value_string Instruction_indicator_for_general_action_vals[] =
2634 {
2635   { 0,     "Pass on information element"},
2636   { 1,     "Discard information element"},
2637   { 2,     "Discard BICC data"},
2638   { 3,     "Release call"},
2639   { 0,     NULL}};
2640
2641 static const value_string Instruction_indicator_for_pass_on_not_possible_vals[] = {
2642   { 0,     "Release call"},
2643   { 1,     "Discard information element"},
2644   { 2,     "Discard BICC data"},
2645   { 3,     "reserved (interpreted as 00)"},
2646   { 0,     NULL}};
2647
2648 static value_string bat_ase_action_indicator_field_vals[] = {
2649
2650         { 0x00, "no indication"},
2651         { 0x01, "connect backward"},
2652         { 0x02, "connect forward"},
2653         { 0x03, "connect forward, no notification"},
2654         { 0x04, "connect forward, plus notification"},
2655         { 0x05, "connect forward, no notification + selected codec"},
2656         { 0x06, "connect forward, plus notification + selected codec"},
2657         { 0x07, "use idle"},
2658         { 0x08, "connected"},
2659         { 0x09, "switched"},
2660         { 0x0a, "selected codec"},
2661         { 0x0b, "modify codec"},
2662         { 0x0c, "successful codec modification"},
2663         { 0x0d, "codec modification failure"},
2664         { 0x0e, "mid-call codec negotiation"},
2665         { 0x0f, "modify to selected codec information"},
2666         { 0x10, "mid-call codec negotiation failure"},
2667         { 0x11, "start signal, notify"},
2668         { 0x12, "start signal, no notify"},
2669         { 0x13, "stop signal, notify"},
2670         { 0x14, "stop signal, no notify"},
2671         { 0x15, "start signal acknowledge"},
2672         { 0x16, "start signal reject"},
2673         { 0x17, "stop signal acknowledge"},
2674         { 0x18, "bearer redirect"},
2675         { 0,    NULL }
2676 };
2677
2678 static const true_false_string BCTP_BVEI_value  = {
2679   "Version Error Indication, BCTP version not supported",
2680   "No indication"
2681 };
2682
2683 static value_string BCTP_Tunnelled_Protocol_Indicator_vals[] = {
2684
2685         { 0x20, "IPBCP (text encoded)"},
2686         { 0x21, "spare (text encoded protocol)"},
2687         { 0x22, "not used"},
2688         { 0,    NULL }
2689 };
2690
2691 static const true_false_string BCTP_TPEI_value  = {
2692   "Protocol Error Indication, Bearer Control Protocol not supported",
2693   "No indication"
2694 };
2695
2696
2697 #define  ITU_T                                  0x01
2698 #define  ETSI                                   0x02
2699
2700 static const value_string bat_ase_organization_identifier_subfield_vals[] = {
2701
2702         { 0x00, "no indication"},
2703         { 0x01, "ITU-T"},
2704         { 0x02, "ETSI (refer to TS 26.103)"},
2705         { 0,    NULL }
2706 };
2707
2708 #define G_711_64_A                                              0x01
2709 #define G_711_64_U                                              0x02
2710 #define G_711_56_A                                              0x03
2711 #define G_711_56_U                                              0x04
2712 #define G_722_SB_ADPCM                                  0x05
2713 #define G_723_1                                                 0x06
2714 #define G_723_1_Annex_A                                 0x07
2715 #define G_726_ADPCM                                             0x08
2716 #define G_727_Embedded_ADPCM                    0x09
2717 #define G_728                                                   0x0a
2718 #define G_729_CS_ACELP                                  0x0b
2719 #define G_729_Annex_B                                   0x0c
2720
2721 static const value_string ITU_T_codec_type_subfield_vals[] = {
2722
2723         { 0x00,                                 "no indication"},
2724         { G_711_64_A,                   "G.711 64 kbit/s A-law"},
2725         { G_711_64_U,                   "G.711 64 kbit/s -law"},
2726         { G_711_56_A,                   "G.711 56 kbit/s A-law"},
2727         { G_711_56_U,                   "G.711 56 kbit/s -law"},
2728         { G_722_SB_ADPCM,               "G.722 (SB-ADPCM)"},
2729         { G_723_1,                              "G.723.1"},
2730         { G_723_1_Annex_A,              "G.723.1 Annex A (silence suppression)"},
2731         { G_726_ADPCM,                  "G.726 (ADPCM)"},
2732         { G_727_Embedded_ADPCM, "G.727 (Embedded ADPCM)"},
2733         { G_728,                                "G.728"},
2734         { G_729_CS_ACELP,               "G.729 (CS-ACELP)"},
2735         { G_729_Annex_B,                "G.729 Annex B (silence suppression)"},
2736         { 0,    NULL }
2737 };
2738
2739 static const value_string ETSI_codec_type_subfield_vals[] = {
2740
2741         { 0x00, "GSM Full Rate (13.0 kBit/s)( GSM FR )"},
2742         { 0x01, "GSM Half Rate (5.6 kBit/s) ( GSM HR )"},
2743         { 0x02, "GSM Enhanced Full Rate (12.2 kBit/s)( GSM EFR )"},
2744         { 0x03, "Full Rate Adaptive Multi-Rate ( FR AMR )"},
2745         { 0x04, "Half Rate Adaptive Multi-Rate ( HR AMR )"},
2746         { 0x05, "UMTS Adaptive Multi-Rate ( UMTS AMR )"},
2747         { 0x06, "UMTS Adaptive Multi-Rate 2 ( UMTS AMR 2 )"},
2748         { 0x07, "TDMA Enhanced Full Rate (7.4 kBit/s) ( TDMA EFR )"},
2749         { 0x08, "PDC Enhanced Full Rate (6.7 kBit/s) ( PDC EFR )"},
2750         { 0x09, "Full Rate Adaptive Multi-Rate WideBand ( FR AMR-WB )"},
2751         { 0x0a, "UMTS Adaptive Multi-Rate WideBand ( UMTS AMR-WB )"},
2752         { 0x0b, "8PSK Half Rate Adaptive Multi-Rate ( OHR AMR )"},
2753         { 0x0c, "8PSK Full Rate Adaptive Multi-Rate WideBand  ( OFR AMR-WB )"},
2754         { 0x0d, "8PSK Half Rate Adaptive Multi-Rate WideBand ( OHR AMR-WB )"},
2755         { 0xfe, "Reserved for future use."},
2756         { 0xff, "Reserved for MuMe dummy Codec Type ( MuMe )"},
2757         { 0,    NULL }
2758 };
2759
2760 static const value_string bat_initial_codec_mode_vals[] = {
2761         {0x7, "12.2 kbps"},
2762         {0x6, "10.2 kbps"},
2763         {0x5, "7.95 kbps"},
2764         {0x4, "7.40 kbps"},
2765         {0x3, "6.70 kbps"},
2766         {0x2, "5.90 kbps"},
2767         {0x1, "5.15 kbps"},
2768         {0x0, "4.75 kbps"},
2769         {0, NULL}
2770 };
2771
2772 static const value_string optimisation_mode_vals[] = {
2773         { 0,    "Optimisation of the ACS not supported,"},
2774         { 1,    "Optimisation of the ACS supported,"},
2775         { 0,    NULL }
2776 };
2777
2778 const value_string bearer_network_connection_characteristics_vals[] = {
2779
2780         { 0x00, "no indication"},
2781         { 0x01, "AAL type 1"},
2782         { 0x02, "AAL type 2"},
2783         { 0x03, "Structured AAL type 1"},
2784         { 0x04, "IP/RTP"},
2785         { 0x05, "TDM (reserved for use by ITU-T Rec. Q.1950)"},
2786         { 0,    NULL }
2787 };
2788
2789 static const true_false_string Bearer_Control_Tunnelling_ind_value  = {
2790   "Tunnelling to be used",
2791   "No indication"
2792 };
2793
2794 static const true_false_string late_cut_trough_cap_ind_value  = {
2795   "Late Cut-through supported",
2796   "Late Cut-through not supported"
2797 };
2798 /*  ITU-T Rec. Q.765.5/Amd.1 (07/2001) */
2799 static const value_string Bearer_Redirection_Indicator_vals[] = {
2800         { 0x00, " no indication"},
2801         { 0x01, "late cut-through request"},
2802         { 0x02, "redirect temporary reject"},
2803         { 0x03, "redirect backwards request"},
2804         { 0x04, "redirect forwards request"},
2805         { 0x05, "redirect bearer release request"},
2806         { 0x06, "redirect bearer release proceed"},
2807         { 0x07, "redirect bearer release complete"},
2808         { 0x08, "redirect cut-through request"},
2809         { 0x09, "redirect bearer connected indication"},
2810         { 0x0a, "redirect failure"},
2811         { 0x0b, "new connection identifier"},
2812         { 0,    NULL }
2813 };
2814
2815 /*26/Q.765.5 - Signal Type */
2816 static const value_string BAt_ASE_Signal_Type_vals[] = {
2817         { 0x00, "DTMF 0"},
2818         { 0x01, "DTMF 1"},
2819         { 0x02, "DTMF 2"},
2820         { 0x03, "DTMF 3"},
2821         { 0x04, "DTMF 4"},
2822         { 0x05, "DTMF 5"},
2823         { 0x06, "DTMF 6"},
2824         { 0x07, "DTMF 7"},
2825         { 0x08, "DTMF 8"},
2826         { 0x09, "DTMF 9"},
2827         { 0x0a, "DTMF *"},
2828         { 0x0b, "DTMF #"},
2829         { 0x0c, "DTMF A"},
2830         { 0x0d, "DTMF B"},
2831         { 0x0e, "DTMF C"},
2832         { 0x1f, "DTMF D"},
2833         { 0x40, "dial tone"},
2834         { 0x41, "PABX internal dial tone"},
2835         { 0x42, "special dial tone"},
2836         { 0x43, "second dial tone"},
2837         { 0x44, "ringing tone"},
2838         { 0x45, "special ringing tone"},
2839         { 0x46, "busy tone"},
2840         { 0x47, "congestion tone"},
2841         { 0x48, "special information tone"},
2842         { 0x49, "warning tone"},
2843         { 0x4a, "intrusion tone"},
2844         { 0x4b, "call waiting tone"},
2845         { 0x4c, "pay tone"},
2846         { 0x4d, "payphone recognition tone"},
2847         { 0x4e, "comfort tone"},
2848         { 0x4f, "tone on hold"},
2849         { 0x50, "record tone"},
2850         { 0x51, "Caller waiting tone"},
2851         { 0x52, "positive indication tone"},
2852         { 0x53, "negative indication tone"},
2853         { 0,    NULL }
2854 };
2855
2856 static const value_string BAT_ASE_Report_Reason_vals[] = {
2857
2858         { 0x00, "no indication"},
2859         { 0x01, "information element non-existent or not implemented"},
2860         { 0x02, "BICC data with unrecognized information element, discarded"},
2861         { 0,    NULL }
2862 };
2863 /* This routine should bve called with offset at Organization_Identifier not the lengh indicator
2864  * because of use from other disectors.
2865  */
2866 extern int dissect_codec_mode(proto_tree *tree, tvbuff_t *tvb, int offset, int len) {
2867         guint8 tempdata;
2868         proto_tree *scs_item, *acs_item;
2869         proto_tree *scs_tree, *acs_tree;
2870
2871
2872         tempdata = tvb_get_guint8(tvb, offset);
2873         proto_tree_add_uint(tree, hf_Organization_Identifier , tvb, offset, 1, tempdata );
2874         switch ( tempdata ){
2875                 case ITU_T :
2876                         offset = offset + 1;
2877                         tempdata = tvb_get_guint8(tvb, offset);
2878                         proto_tree_add_uint(tree, hf_codec_type , tvb, offset, 1, tempdata );
2879                         offset = offset + 1;
2880                         switch ( tempdata ) {
2881                                 case G_711_64_A :
2882                                 case G_711_64_U :
2883                                 case G_711_56_A :
2884                                 case G_711_56_U :
2885                                 case G_722_SB_ADPCM :
2886                                 case G_723_1 :
2887                                 case G_723_1_Annex_A :
2888                                         /* These codecs have no configuration data */
2889                                         break;
2890                                 case G_726_ADPCM :
2891                                 case G_727_Embedded_ADPCM :
2892                                         /* four bit config data, TODO decode config */
2893                                         if ( len > 2 ) {
2894                                                 tempdata = tvb_get_guint8(tvb, offset);
2895                                                 proto_tree_add_text(tree, tvb, offset, 1, "Configuration data : 0x%x", tempdata);
2896                                                 offset = offset + 1;
2897                                         }
2898                                         break;
2899                                 case G_728 :
2900                                 case G_729_CS_ACELP :
2901                                 case G_729_Annex_B :
2902                                         /* three bit config data, TODO decode config */
2903                                         if ( len > 2 ) {
2904                                                 tempdata = tvb_get_guint8(tvb, offset);
2905                                                 proto_tree_add_text(tree, tvb, offset, 1 , "Configuration data : 0x%x", tempdata);
2906                                                 offset = offset + 1;
2907                                         }
2908                                         break;
2909                                 default:
2910                                         break;
2911
2912                         }
2913                                 break;
2914                 case ETSI:
2915                         offset = offset + 1;
2916                         tempdata = tvb_get_guint8(tvb, offset);
2917                         proto_tree_add_uint(tree, hf_etsi_codec_type , tvb, offset, 1, tempdata );
2918                         if ( len > 2 )  {
2919                                 offset = offset + 1;
2920                                 tempdata = tvb_get_guint8(tvb, offset);
2921
2922                                 acs_item = proto_tree_add_item(tree, hf_active_code_set, tvb, offset, 1, TRUE);
2923                                 acs_tree = proto_item_add_subtree(acs_item,ett_acs);
2924                                 proto_tree_add_item(acs_tree, hf_active_code_set_12_2, tvb, offset, 1, TRUE);
2925                                 proto_tree_add_item(acs_tree, hf_active_code_set_10_2, tvb, offset, 1, TRUE);
2926                                 proto_tree_add_item(acs_tree, hf_active_code_set_7_95, tvb, offset, 1, TRUE);
2927                                 proto_tree_add_item(acs_tree, hf_active_code_set_7_40, tvb, offset, 1, TRUE);
2928                                 proto_tree_add_item(acs_tree, hf_active_code_set_6_70, tvb, offset, 1, TRUE);
2929                                 proto_tree_add_item(acs_tree, hf_active_code_set_5_90, tvb, offset, 1, TRUE);
2930                                 proto_tree_add_item(acs_tree, hf_active_code_set_5_15, tvb, offset, 1, TRUE);
2931                                 proto_tree_add_item(acs_tree, hf_active_code_set_4_75, tvb, offset, 1, TRUE);
2932
2933                         }
2934                         if ( len > 3 )  {
2935                                 offset = offset + 1;
2936                                 tempdata = tvb_get_guint8(tvb, offset);
2937
2938                                 scs_item = proto_tree_add_item(tree, hf_supported_code_set, tvb, offset, 1, TRUE);
2939                                 scs_tree = proto_item_add_subtree(scs_item,ett_scs);
2940                                 proto_tree_add_item(scs_tree, hf_supported_code_set_12_2, tvb, offset, 1, TRUE);
2941                                 proto_tree_add_item(scs_tree, hf_supported_code_set_10_2, tvb, offset, 1, TRUE);
2942                                 proto_tree_add_item(scs_tree, hf_supported_code_set_7_95, tvb, offset, 1, TRUE);
2943                                 proto_tree_add_item(scs_tree, hf_supported_code_set_7_40, tvb, offset, 1, TRUE);
2944                                 proto_tree_add_item(scs_tree, hf_supported_code_set_6_70, tvb, offset, 1, TRUE);
2945                                 proto_tree_add_item(scs_tree, hf_supported_code_set_5_90, tvb, offset, 1, TRUE);
2946                                 proto_tree_add_item(scs_tree, hf_supported_code_set_5_15, tvb, offset, 1, TRUE);
2947                                 proto_tree_add_item(scs_tree, hf_supported_code_set_4_75, tvb, offset, 1, TRUE);
2948                         }
2949                         if ( len > 4 )  {
2950                                 offset = offset + 1;
2951                                 proto_tree_add_item(tree, hf_optimisation_mode, tvb, offset, 1, TRUE);
2952                                 proto_tree_add_item(tree, hf_max_codec_modes, tvb, offset, 1, TRUE);
2953                         }
2954                         offset = offset + 1;
2955                         break;
2956                 default:
2957                         offset = offset + 1;
2958                         tempdata = tvb_get_guint8(tvb, offset);
2959                         proto_tree_add_text(tree, tvb, offset, len ,
2960                                                                 "Unknown organisation Identifier ( Non ITU-T/ETSI codec ) %u", tempdata);
2961                         offset = offset + len - 1;
2962                         break;
2963         }
2964         /* switch OID */
2965
2966         return offset;
2967 }
2968
2969 static int
2970 dissect_codec(tvbuff_t *parameter_tvb, proto_tree *bat_ase_element_tree, gint length_indicator, gint offset,gint identifier)
2971 {
2972 /* offset is at length indicator e.g 1 step past identifier */
2973 guint8 compatibility_info;
2974
2975         proto_tree_add_uint(bat_ase_element_tree , hf_bat_ase_identifier , parameter_tvb, offset - 1, 1, identifier );
2976         proto_tree_add_uint(bat_ase_element_tree , hf_length_indicator  , parameter_tvb, offset, 1, length_indicator );
2977         offset = offset + 1;
2978         compatibility_info = tvb_get_guint8(parameter_tvb, offset);
2979         proto_tree_add_uint(bat_ase_element_tree, hf_Instruction_ind_for_general_action , parameter_tvb, offset, 1, compatibility_info );
2980         proto_tree_add_boolean(bat_ase_element_tree, hf_Send_notification_ind_for_general_action , parameter_tvb, offset, 1, compatibility_info );
2981         proto_tree_add_uint(bat_ase_element_tree, hf_Instruction_ind_for_pass_on_not_possible , parameter_tvb, offset, 1, compatibility_info );
2982         proto_tree_add_boolean(bat_ase_element_tree, hf_Send_notification_ind_for_pass_on_not_possible , parameter_tvb, offset, 1, compatibility_info );
2983         proto_tree_add_boolean(bat_ase_element_tree, hf_isup_extension_ind , parameter_tvb, offset, 1, compatibility_info );
2984
2985         offset = dissect_codec_mode(bat_ase_element_tree, parameter_tvb, offset+1,length_indicator-1);
2986 return offset;
2987 }
2988
2989 /* Dissect BAT ASE message according to Q.765.5 200006 and Amendment 1 200107
2990  * Layout of message            Length                  Octet
2991  *      Element name
2992  *      Identifier                                      1                       1
2993  *      Length indicator                        1                       2
2994  *      Compatibility information       1                       3
2995  *      Contents                                        1                       4
2996  *      Identifier                                      n                       m
2997  *      Length indicator                        n
2998  *      Compatibility information       n
2999  *      Contents                                        n                       p
3000  */
3001
3002 static void
3003 dissect_bat_ase_Encapsulated_Application_Information(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *parameter_tree, gint offset)
3004 {
3005         gint            length = tvb_reported_length_remaining(parameter_tvb, offset), list_end;
3006         tvbuff_t        *next_tvb;
3007         proto_tree      *bat_ase_tree, *bat_ase_element_tree, *bat_ase_iwfa_tree;
3008         proto_item      *bat_ase_item, *bat_ase_element_item, *bat_ase_iwfa_item;
3009         guint8 identifier,content, BCTP_Indicator_field_1, BCTP_Indicator_field_2;
3010         guint8 tempdata, element_no, number_of_indicators;
3011         guint16 sdp_length;
3012         guint8 diagnostic_len;
3013         guint8 length_ind_len;
3014         guint tempdata16;
3015         guint content_len, length_indicator;
3016         guint duration;
3017         guint diagnostic;
3018         guint32 bncid, Local_BCU_ID;
3019         element_no = 0;
3020
3021         bat_ase_item = proto_tree_add_text(parameter_tree,parameter_tvb, offset, -1,
3022                 "Bearer Association Transport (BAT) Application Service Element (ASE) Encapsulated Application Information:");
3023         bat_ase_tree = proto_item_add_subtree(bat_ase_item , ett_bat_ase);
3024
3025         proto_tree_add_text(bat_ase_tree, parameter_tvb, offset, -1,
3026                 "BAT ASE Encapsulated Application Information, (%u byte%s length)", length, plurality(length, "", "s"));
3027         while(tvb_reported_length_remaining(parameter_tvb, offset) > 0){
3028                 element_no = element_no + 1;
3029                 identifier = tvb_get_guint8(parameter_tvb, offset);
3030
3031                 /* length indicator may be 11 bits long                         */
3032                 offset = offset + 1;
3033                 proto_tree_add_item( bat_ase_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, FALSE );
3034                 tempdata = tvb_get_guint8(parameter_tvb, offset);
3035                 if ( tempdata & 0x80 ) {
3036                         length_indicator = tempdata & 0x7f;
3037                         length_ind_len = 1;
3038                 }
3039                 else {
3040                         offset = offset + 1;
3041                         tempdata16 = ( tempdata & 0x7f );
3042                         length_indicator = tvb_get_guint8(parameter_tvb, offset)& 0x0f;
3043                         length_indicator = length_indicator << 7;
3044                         length_indicator = length_indicator + tempdata16;
3045                         length_ind_len = 2;
3046                 }
3047
3048                 bat_ase_element_item = proto_tree_add_text(bat_ase_tree,parameter_tvb,
3049                         ( offset - length_ind_len),(length_indicator + 2),"BAT ASE Element %u, Identifier: %s",element_no,
3050                                         val_to_str(identifier,bat_ase_list_of_Identifiers_vals,"unknown (%u)"));
3051                 bat_ase_element_tree = proto_item_add_subtree(bat_ase_element_item ,
3052                         ett_bat_ase_element);
3053                 if ( identifier != CODEC ) {
3054                 /* identifier, lengt indicator and compabillity info must be printed inside CODEC */
3055                 /* dissection in order to use dissect_codec routine for codec list */
3056                 proto_tree_add_uint(bat_ase_element_tree , hf_bat_ase_identifier , parameter_tvb,
3057                         offset - length_ind_len, 1, identifier );
3058                 proto_tree_add_uint(bat_ase_element_tree , hf_length_indicator  , parameter_tvb,
3059                         offset - length_ind_len + 1, length_ind_len, length_indicator );
3060
3061                 offset = offset + 1;
3062                 proto_tree_add_item( bat_ase_element_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, FALSE );
3063                 proto_tree_add_item( bat_ase_element_tree, hf_Send_notification_ind_for_pass_on_not_possible, parameter_tvb, offset, 1, FALSE );
3064                 proto_tree_add_item( bat_ase_element_tree, hf_Instruction_ind_for_pass_on_not_possible, parameter_tvb, offset, 1, FALSE );
3065                 proto_tree_add_item( bat_ase_element_tree, hf_Send_notification_ind_for_general_action, parameter_tvb, offset, 1, FALSE );
3066                 proto_tree_add_item( bat_ase_element_tree, hf_Instruction_ind_for_general_action, parameter_tvb, offset, 1, FALSE );
3067                 offset = offset + 1;
3068                 }
3069                 content_len = length_indicator - 1 ; /* exclude the treated Compatibility information */
3070
3071                 /* content will be different depending on identifier */
3072                 switch ( identifier ){
3073
3074                         case ACTION_INDICATOR :
3075
3076                                 content = tvb_get_guint8(parameter_tvb, offset);
3077                                 proto_tree_add_uint(bat_ase_element_tree, hf_Action_Indicator , parameter_tvb, offset, 1, content );
3078                                 proto_item_append_text(bat_ase_element_item, " - %s",
3079                                                  val_to_str(content,bat_ase_action_indicator_field_vals, "unknown (%u)"));
3080                                 offset = offset + 1;
3081                                 break;
3082                         case BACKBONE_NETWORK_CONNECTION_IDENTIFIER :
3083
3084                                 bncid = tvb_get_ntohl(parameter_tvb, offset);
3085                                 switch ( content_len ){
3086                                 case 1:
3087                                                 bncid = bncid & 0x000000ff;
3088                                                 break;
3089                                 case 2:
3090                                                 bncid = bncid & 0x0000ffff;
3091                                                 break;
3092                                 case 3:
3093                                                 bncid = bncid & 0x00ffffff;
3094                                                 break;
3095                                 case 4:;
3096                                 default:;
3097                                 }
3098                                 proto_tree_add_uint_format(bat_ase_element_tree, hf_bncid, parameter_tvb, offset, content_len, bncid, "BNCId: 0x%08x", bncid);
3099                                 proto_item_append_text(bat_ase_element_item, " - 0x%08x",bncid);
3100                                 offset = offset + content_len;
3101
3102                         break;
3103                         case INTERWORKING_FUNCTION_ADDRESS :
3104                                 bat_ase_iwfa_item = proto_tree_add_item(bat_ase_element_tree, hf_bat_ase_biwfa, parameter_tvb, offset, content_len,
3105                                                             FALSE);
3106                                 bat_ase_iwfa_tree = proto_item_add_subtree(bat_ase_iwfa_item , ett_bat_ase_iwfa);
3107                                 dissect_nsap(parameter_tvb, offset, content_len, bat_ase_iwfa_tree);
3108
3109                                 offset = offset + content_len;
3110                         break;
3111                         case CODEC_LIST :
3112                                 list_end = offset + content_len;
3113                                 while ( offset < ( list_end - 1 )) {
3114                                         identifier = tvb_get_guint8(parameter_tvb, offset);
3115                                         offset = offset + 1;
3116                                         tempdata = tvb_get_guint8(parameter_tvb, offset);
3117                                                 if ( tempdata & 0x80 ) {
3118                                                         length_indicator = tempdata & 0x7f;
3119                                                 }
3120                                                 else {
3121                                                         offset = offset +1;
3122                                                         length_indicator = tvb_get_guint8(parameter_tvb, offset);
3123                                                         length_indicator = length_indicator << 7;
3124                                                         length_indicator = length_indicator & ( tempdata & 0x7f );
3125                                                 }
3126                                         offset = dissect_codec(parameter_tvb, bat_ase_element_tree, length_indicator , offset, identifier);
3127                                 }
3128                         break;
3129                         case CODEC :
3130                                 /* offset is at length indicator in this case */
3131                                 offset = dissect_codec(parameter_tvb, bat_ase_element_tree, length_indicator , offset, identifier);
3132                                 break;/* case codec */
3133                         case BAT_COMPATIBILITY_REPORT :
3134                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
3135                                 proto_tree_add_uint(bat_ase_element_tree, hf_BAT_ASE_Comp_Report_Reason, parameter_tvb, offset, 1, tempdata );
3136                                 offset = offset + 1;
3137
3138                                 diagnostic_len = content_len - 1;
3139                                 while ( diagnostic_len > 0 ) {
3140                                         tempdata = tvb_get_guint8(parameter_tvb, offset);
3141                                         proto_tree_add_uint(bat_ase_element_tree, hf_BAT_ASE_Comp_Report_ident, parameter_tvb, offset, 1, tempdata );
3142                                         offset = offset + 1;
3143                                         diagnostic = tvb_get_letohs(parameter_tvb, offset);
3144                                         proto_tree_add_uint(bat_ase_element_tree, hf_BAT_ASE_Comp_Report_diagnostic, parameter_tvb, offset, 2, diagnostic);
3145                                         offset = offset + 2;
3146                                         diagnostic_len = diagnostic_len - 3;
3147                                 }
3148                         break;
3149                         case BEARER_NETWORK_CONNECTION_CHARACTERISTICS :
3150                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
3151                                 proto_tree_add_uint(bat_ase_element_tree, hf_characteristics , parameter_tvb,
3152                                                  offset, 1, tempdata );
3153                                 proto_item_append_text(bat_ase_element_item, " - %s",
3154                                                  val_to_str(tempdata,bearer_network_connection_characteristics_vals, "unknown (%u)"));
3155
3156                                 offset = offset + content_len;
3157                         break;
3158 /* The Bearer Control Information information element contains the bearer control tunnelling protocol */
3159 /* ITU-T Q.1990 (2001), BICC bearer control tunnelling protocol. */
3160
3161                         case BEARER_CONTROL_INFORMATION :
3162                                 BCTP_Indicator_field_1 = tvb_get_guint8(parameter_tvb, offset);
3163                                 proto_tree_add_uint(bat_ase_element_tree, hf_BCTP_Version_Indicator,
3164                                         parameter_tvb, offset, 1, BCTP_Indicator_field_1 );
3165
3166                                 proto_tree_add_boolean(bat_ase_element_tree, hf_BVEI,
3167                                         parameter_tvb, offset, 1, BCTP_Indicator_field_1 );
3168                                 offset = offset + 1;
3169
3170                                 BCTP_Indicator_field_2 = tvb_get_guint8(parameter_tvb, offset);
3171
3172                                 proto_tree_add_uint(bat_ase_element_tree, hf_Tunnelled_Protocol_Indicator ,
3173                                         parameter_tvb, offset, 1, BCTP_Indicator_field_2 );
3174
3175                                 proto_tree_add_boolean(bat_ase_element_tree, hf_TPEI,
3176                                         parameter_tvb, offset, 1, BCTP_Indicator_field_2 );
3177                                 offset = offset + 1;
3178
3179                                 sdp_length = ( length_indicator ) - 3;
3180
3181                                 if(sdp_length > tvb_length_remaining(parameter_tvb,offset)){
3182                                         /* If this is a segmented message we may not have all the data */
3183                                         next_tvb = tvb_new_subset(parameter_tvb, offset, -1, -1);
3184                                 }else{
3185                                         next_tvb = tvb_new_subset(parameter_tvb, offset, sdp_length, sdp_length);
3186                                 }
3187                                 call_dissector(sdp_handle, next_tvb, pinfo, bat_ase_element_tree);
3188                                 offset = offset + sdp_length;
3189
3190
3191                         break;
3192                         case BEARER_CONTROL_TUNNELLING :
3193
3194                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
3195                                 proto_tree_add_boolean(bat_ase_element_tree, hf_bearer_control_tunneling , parameter_tvb, offset, 1, ( tempdata & 0x01 ) );
3196                                 if ( tempdata & 0x01 )
3197                                         proto_item_append_text(bat_ase_element_item, " - Tunnelling to be used ");
3198
3199                                 offset = offset + content_len;
3200                         break;
3201                         case BEARER_CONTROL_UNIT_IDENTIFIER :
3202                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
3203                                 proto_tree_add_text(bat_ase_element_tree, parameter_tvb, offset, 1, "Network ID Length indicator= %u",tempdata);
3204                                 offset = offset +1;
3205                                 if ( tempdata > 0 ) {
3206                                         offset = offset +1;
3207
3208 /* Q.765.5 amd 1
3209         Network ID
3210         The coding of the Network ID field is identical to the coding of the Network ID field in the
3211         Global Call Reference parameter as specified in clause 6/Q.1902.3 (see [3]).
3212         NOTE .When used inside a network domain, the Network ID may be omitted by setting the
3213         Network ID Length indicator to the value "0".
3214         Q.1902.3
3215         The following codes are used in the subfields of the global call reference parameter field:
3216         a) Network ID
3217         The Network ID contains the value field (coded according to ASN.1 BER) of an object
3218         identifier identifying the network. This means that the tag and length fields are omitted.
3219         An example of such an object identifier can be the following:
3220         .{itu-t (0) administration (2) national regulatory authority (x) network (y)}
3221         The value for x is the value of the national regulatory authority (one of the Data Country
3222         Codes associated to the country as specified in ITU-T X.121 shall be used for "national
3223         regulatory authority"), the value for y is under the control of the national regulatory
3224         authority concerned.
3225         b) Node ID
3226         A binary number that uniquely identifies within the network the node which generates the
3227         call reference.
3228         c) Call Reference ID
3229         A binary number used for the call reference of the call. This is generated by the node for
3230         each call.
3231
3232 */
3233                                         proto_tree_add_text(bat_ase_element_tree, parameter_tvb, offset, tempdata , "Network ID: %s",
3234                                                             tvb_bytes_to_str(parameter_tvb, offset, tempdata));
3235                                         offset = offset + tempdata;
3236                                 } /* end if */
3237
3238                                 Local_BCU_ID = tvb_get_letohl(parameter_tvb, offset);
3239                                 proto_tree_add_uint_format(bat_ase_element_tree, hf_Local_BCU_ID , parameter_tvb, offset, 4, Local_BCU_ID , "Local BCU ID : 0x%08x", Local_BCU_ID );
3240                                 offset = offset + 4;
3241                         break;
3242                         case SIGNAL :
3243                                 /* As type is Constructor new elements follow, return to main loop */
3244                         break;
3245                         case BEARER_REDIRECTION_CAPABILITY :
3246                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
3247                                 proto_tree_add_boolean(bat_ase_element_tree, hf_late_cut_trough_cap_ind , parameter_tvb, offset, 1, tempdata );
3248                                 offset = offset + content_len;
3249                         break;
3250                         case BEARER_REDIRECTION_INDICATORS :
3251                                 number_of_indicators = 0;
3252                                 while ( number_of_indicators < content_len ) {
3253                                         tempdata = tvb_get_guint8(parameter_tvb, offset);
3254                                         proto_tree_add_uint(bat_ase_element_tree, hf_bat_ase_bearer_redir_ind , parameter_tvb, offset, 1, tempdata );
3255                                         offset = offset + 1;
3256                                         number_of_indicators = number_of_indicators + 1;
3257                                 }
3258                         break;
3259                         case SIGNAL_TYPE :
3260                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
3261                                 proto_tree_add_uint(bat_ase_element_tree, hf_bat_ase_signal , parameter_tvb, offset, 1, tempdata );
3262                                 offset = offset + content_len;
3263                         break;
3264                         case DURATION :
3265                                 duration = tvb_get_letohs(parameter_tvb, offset);
3266                                 proto_tree_add_uint(bat_ase_element_tree, hf_bat_ase_duration , parameter_tvb, offset, 2, duration );
3267                                 offset = offset + content_len;
3268                         break;
3269                         default :
3270                                 proto_tree_add_text(bat_ase_element_tree, parameter_tvb, offset,content_len , "Default ?, (%u byte%s length)", (content_len), plurality(content_len, "", "s"));
3271                                 offset = offset + content_len;
3272                         }
3273         }
3274
3275 }
3276
3277
3278
3279 /*
3280 Octet
3281         -------------------------------------------
3282 1       | ext. Application context identifier lsb
3283         -------------------------------------------
3284 1a      | ext. msb
3285         -------------------------------------------
3286 2       | ext. spare                                            SNI RCI
3287         -------------------------------------------
3288 3       | ext. SI APM segmentation indicator
3289         -------------------------------------------
3290 3a      | ext. Segmentation local reference
3291         -------------------------------------------
3292 4a      |
3293 :       |       APM-user information
3294 4n      |
3295         +-------------------------------------------
3296
3297         Figure 77/Q.763 . Application transport parameter field
3298   */
3299 static void
3300 dissect_isup_application_transport_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *parameter_tree, proto_item *parameter_item)
3301 {
3302
3303         guint8 application_transport_instruction_ind;
3304         guint8 si_and_apm_seg_ind;
3305         guint8 apm_Segmentation_local_ref = 0;
3306         guint16 aci16;
3307         gint offset = 0;
3308         guint8 octet;
3309         guint length = tvb_reported_length(parameter_tvb);
3310
3311         gboolean more_frag;
3312         gboolean   save_fragmented;
3313         tvbuff_t* new_tvb = NULL;
3314         tvbuff_t* next_tvb = NULL;
3315         fragment_data *frag_msg = NULL;
3316
3317         proto_tree_add_text(parameter_tree, parameter_tvb, offset, -1, "Application transport parameter fields:");
3318         proto_item_set_text(parameter_item, "Application transport, (%u byte%s length)", length , plurality(length, "", "s"));
3319         aci16 = tvb_get_guint8(parameter_tvb, offset);
3320
3321         if ( (aci16 & H_8BIT_MASK) == 0x80) {
3322                 /* Octet 1 */
3323                 aci16 = aci16 & 0x7f;
3324                 proto_tree_add_item( parameter_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, FALSE );
3325                 proto_tree_add_uint(parameter_tree, hf_isup_app_cont_ident , parameter_tvb, offset, 1, aci16);
3326                 offset = offset + 1;
3327                 }
3328         /* Octet 1a */
3329         else {
3330                 aci16 = (aci16<<8) | (tvb_get_guint8(parameter_tvb, offset) & 0x7f);
3331                 proto_tree_add_uint(parameter_tree, hf_isup_app_cont_ident , parameter_tvb, offset, 2, aci16);
3332                 offset = offset + 2;
3333         }
3334
3335         /* Octet 2 */
3336         proto_tree_add_text(parameter_tree, parameter_tvb, offset, -1, "Application transport instruction indicators: ");
3337         application_transport_instruction_ind = tvb_get_guint8(parameter_tvb, offset);
3338         proto_tree_add_item( parameter_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, FALSE );
3339         proto_tree_add_item( parameter_tree, hf_isup_app_Send_notification_ind, parameter_tvb, offset, 1, FALSE );
3340         proto_tree_add_item( parameter_tree, hf_isup_app_Release_call_ind, parameter_tvb, offset, 1, FALSE );
3341         offset = offset + 1;
3342
3343         /* Octet 3*/
3344         proto_tree_add_text(parameter_tree, parameter_tvb, offset, 1, "APM segmentation indicator:");
3345         si_and_apm_seg_ind  = tvb_get_guint8(parameter_tvb, offset);
3346         proto_tree_add_item( parameter_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, FALSE );
3347         proto_tree_add_item( parameter_tree, hf_isup_apm_si_ind, parameter_tvb, offset, 1, FALSE );
3348         proto_tree_add_item( parameter_tree, hf_isup_apm_segmentation_ind, parameter_tvb, offset, 1, FALSE );
3349         offset = offset + 1;
3350
3351         /* Octet 3a */
3352         if ( (si_and_apm_seg_ind & H_8BIT_MASK) == 0x00) {
3353                 apm_Segmentation_local_ref  = tvb_get_guint8(parameter_tvb, offset);
3354                 proto_tree_add_item( parameter_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, FALSE );
3355                 proto_tree_add_item( parameter_tree, hf_isup_apm_slr, parameter_tvb, offset, 1, FALSE );
3356                 offset = offset + 1;
3357         }
3358         /* For APM'98'-user applications. ( aci 0 - 3 ), APM-user information field starts at octet 4 */
3359         if (aci16 > 3) {
3360                 /* Octet 4 Originating Address length */
3361                 octet = tvb_get_guint8(parameter_tvb,offset);
3362                 proto_tree_add_item( parameter_tree, hf_isup_orig_addr_len, parameter_tvb, offset, 1, FALSE );
3363                 offset++;
3364                 if ( octet != 0){
3365                         /* 4b */
3366                         proto_tree_add_item( parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, offset, 1, FALSE );
3367                         /* nature of address indicator */
3368                         offset++;
3369                         proto_tree_add_item( parameter_tree, hf_isup_inn_indicator, parameter_tvb, offset, 1, FALSE );
3370                         proto_tree_add_item( parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, offset, 1, FALSE );
3371                         offset++;
3372                         /* Address digits */
3373                         proto_tree_add_text(parameter_tree, parameter_tvb, offset, octet - 2, "Address digits");
3374                         offset = offset + octet - 2;
3375                 }
3376                 /* Octet 5 Destination Address length */
3377                 octet = tvb_get_guint8(parameter_tvb,offset);
3378                 proto_tree_add_item( parameter_tree, hf_isup_dest_addr_len, parameter_tvb, offset, 1, FALSE );
3379                 offset++;
3380                 if ( octet != 0){
3381                         /* 4b */
3382                         proto_tree_add_item( parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, offset, 1, FALSE );
3383                         /* nature of address indicator */
3384                         offset++;
3385                         proto_tree_add_item( parameter_tree, hf_isup_inn_indicator, parameter_tvb, offset, 1, FALSE );
3386                         proto_tree_add_item( parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, offset, 1, FALSE );
3387                         offset++;
3388                         /* Address digits */
3389                         proto_tree_add_text(parameter_tree, parameter_tvb, offset, octet - 2, "Address digits");
3390                         offset = offset + octet - 2;
3391                 }
3392         }
3393         /*
3394          * Defragment ?
3395          * (si_and_apm_seg_ind != 0xc0) -> Non segmented APM message
3396          * (si_and_apm_seg_ind & H_8BIT_MASK)
3397          *    -> NO Segmentation local ref ( without SLR defrag. does not work)
3398          *
3399          */
3400         if (isup_apm_desegment &&
3401             (si_and_apm_seg_ind != 0xc0 || si_and_apm_seg_ind & H_8BIT_MASK)){
3402                 /* Segmented message */
3403                 save_fragmented = pinfo->fragmented;
3404                 pinfo->fragmented = TRUE;
3405                 more_frag = TRUE;
3406                 if ((si_and_apm_seg_ind == 0))
3407                         more_frag = FALSE;
3408
3409                 frag_msg = fragment_add_seq_next(parameter_tvb, offset, pinfo,
3410                                 (apm_Segmentation_local_ref & 0x7f),                    /* ID for fragments belonging together */
3411                                 isup_apm_msg_fragment_table,                                    /* list of message fragments */
3412                                 isup_apm_msg_reassembled_table,                                 /* list of reassembled messages */
3413                                 tvb_length_remaining(parameter_tvb, offset),    /* fragment length - to the end */
3414                                 more_frag);                                                                             /* More fragments? */
3415
3416                 if ((si_and_apm_seg_ind & 0x3f) !=0 && (si_and_apm_seg_ind &0x40) !=0){
3417                         /* First fragment set number of fragments */
3418                         fragment_set_tot_len(pinfo, apm_Segmentation_local_ref & 0x7f, isup_apm_msg_fragment_table, (si_and_apm_seg_ind & 0x3f));
3419                 }
3420
3421                 new_tvb = process_reassembled_data(parameter_tvb, offset, pinfo,
3422                         "Reassembled Message", frag_msg, &isup_apm_msg_frag_items,
3423                         NULL, parameter_tree);
3424
3425                 if (frag_msg) { /* Reassembled */
3426                         if (check_col(pinfo->cinfo, COL_INFO))
3427                                 col_append_str(pinfo->cinfo, COL_INFO,
3428                                 " (Message Reassembled)");
3429                 } else { /* Not last packet of reassembled Short Message */
3430                         if (check_col(pinfo->cinfo, COL_INFO))
3431                                 col_append_fstr(pinfo->cinfo, COL_INFO,
3432                                 " (Message fragment )");
3433                 }
3434
3435                 pinfo->fragmented = save_fragmented;
3436         }/*isup_apm_desegment*/
3437
3438         if ( offset == (gint)length){
3439                 /* No data */
3440                 proto_tree_add_text(parameter_tree, parameter_tvb, offset, 0, "Empty APM-user information field"  );
3441                 return;
3442         }
3443         if (new_tvb) { /* take it all */
3444                 next_tvb = new_tvb;
3445         } else { /* make a new subset */
3446                 next_tvb = tvb_new_subset(parameter_tvb, offset, -1, -1);
3447         }
3448
3449         proto_tree_add_text(parameter_tree, parameter_tvb, offset, -1,
3450                 "APM-user information field (%u Bytes)",tvb_length_remaining(parameter_tvb, offset));
3451
3452         /* dissect BAT ASE element, without transparent data ( Q.765.5-200006) */
3453         if ((aci16 & 0x7fff) != 5) {
3454                 proto_tree_add_text(parameter_tree, parameter_tvb, offset, -1, "No further dissection of APM-user information field");
3455                 return;
3456         }
3457
3458         dissect_bat_ase_Encapsulated_Application_Information(next_tvb, pinfo, parameter_tree, 0);
3459 }
3460
3461
3462
3463 /* ------------------------------------------------------------------
3464   Dissector Parameter Optional Forward Call indicators
3465  */
3466 static void
3467 dissect_isup_optional_forward_call_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3468 {
3469   guint8 indicators;
3470
3471   indicators = tvb_get_guint8(parameter_tvb, 0);
3472   proto_tree_add_uint(parameter_tree, hf_isup_cug_call_ind, parameter_tvb, 0, OPTIONAL_FORWARD_CALL_IND_LENGTH, indicators);
3473   proto_tree_add_boolean(parameter_tree, hf_isup_simple_segmentation_ind, parameter_tvb, 0, OPTIONAL_FORWARD_CALL_IND_LENGTH, indicators);
3474   proto_tree_add_boolean(parameter_tree, hf_isup_connected_line_identity_request_ind, parameter_tvb, 0, OPTIONAL_FORWARD_CALL_IND_LENGTH, indicators);
3475
3476
3477   proto_item_set_text(parameter_item,"Optional forward call indicators: %s (%u)", val_to_str(indicators & BA_8BIT_MASK, isup_CUG_call_ind_value, "spare"),indicators );
3478 }
3479 /* ------------------------------------------------------------------
3480   Dissector Parameter calling party number
3481  */
3482 void
3483 dissect_isup_calling_party_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3484 {
3485   proto_item *address_digits_item;
3486   proto_tree *address_digits_tree;
3487   guint8 indicators1, indicators2;
3488   guint8 address_digit_pair=0;
3489   gint offset=0;
3490   gint i=0;
3491   gint length;
3492   char calling_number[MAXDIGITS + 1]="";
3493   e164_info_t e164_info;
3494   gint number_plan;
3495
3496   indicators1 = tvb_get_guint8(parameter_tvb, 0);
3497   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
3498   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
3499   indicators2 = tvb_get_guint8(parameter_tvb, 1);
3500   number_plan = (indicators2 & 0x70)>> 4;
3501   proto_tree_add_boolean(parameter_tree, hf_isup_ni_indicator, parameter_tvb, 1, 1, indicators2);
3502   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
3503   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
3504   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator, parameter_tvb, 1, 1, indicators2);
3505   offset = 2;
3506
3507   length = tvb_length_remaining(parameter_tvb, offset);
3508   if (length > 0) {
3509     address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
3510                                               offset, -1,
3511                                               "Calling Party Number");
3512     address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
3513
3514     while(length > 0){
3515       address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
3516       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3517       calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
3518       if (i > MAXDIGITS)
3519         THROW(ReportedBoundsError);
3520       if ((length - 1) > 0 ){
3521         proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3522         calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3523         if (i > MAXDIGITS)
3524           THROW(ReportedBoundsError);
3525       }
3526       offset++;
3527       length = tvb_length_remaining(parameter_tvb, offset);
3528     }
3529
3530     if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
3531       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
3532       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3533       if (i > MAXDIGITS)
3534         THROW(ReportedBoundsError);
3535     }
3536     proto_item_set_text(address_digits_item, "Calling Party Number: %s", calling_number);
3537     calling_number[i++] = '\0';
3538     if ( number_plan == 1 ) {
3539       e164_info.e164_number_type = CALLING_PARTY_NUMBER;
3540       e164_info.nature_of_address = indicators1 & 0x7f;
3541       e164_info.E164_number_str = calling_number;
3542       e164_info.E164_number_length = i - 1;
3543       dissect_e164_number(parameter_tvb, address_digits_tree, 2, (offset - 2), e164_info);
3544       proto_tree_add_string_hidden(address_digits_tree, hf_isup_calling, parameter_tvb,
3545             offset - length, length, calling_number);
3546     } else {
3547       proto_tree_add_string(address_digits_tree, hf_isup_calling, parameter_tvb,
3548           offset - length, length, calling_number);
3549     }
3550   }
3551   proto_item_set_text(parameter_item, "Calling Party Number: %s", calling_number);
3552   tap_calling_number = ep_strdup(calling_number);
3553 }
3554 /* ------------------------------------------------------------------
3555   Dissector Parameter Original called  number
3556  */
3557 void
3558 dissect_isup_original_called_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3559 {
3560   proto_item *address_digits_item;
3561   proto_tree *address_digits_tree;
3562   guint8 indicators1, indicators2;
3563   guint8 address_digit_pair=0;
3564   gint offset=0;
3565   gint i=0;
3566   gint length;
3567   char calling_number[MAXDIGITS + 1]="";
3568
3569   indicators1 = tvb_get_guint8(parameter_tvb, 0);
3570   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
3571   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
3572   indicators2 = tvb_get_guint8(parameter_tvb, 1);
3573   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
3574   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
3575   offset = 2;
3576
3577   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
3578                                             offset, -1,
3579                                             "Original Called Number");
3580   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
3581
3582   length = tvb_length_remaining(parameter_tvb, offset);
3583   while(length > 0){
3584     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
3585     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3586     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
3587     if (i > MAXDIGITS)
3588       THROW(ReportedBoundsError);
3589     if ((length - 1) > 0 ){
3590       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3591       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3592       if (i > MAXDIGITS)
3593         THROW(ReportedBoundsError);
3594     }
3595     offset++;
3596     length = tvb_length_remaining(parameter_tvb, offset);
3597   }
3598
3599   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
3600       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
3601       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3602       if (i > MAXDIGITS)
3603         THROW(ReportedBoundsError);
3604   }
3605   calling_number[i++] = '\0';
3606
3607   proto_item_set_text(address_digits_item, "Original Called Number: %s", calling_number);
3608   proto_item_set_text(parameter_item, "Original Called Number: %s", calling_number);
3609
3610 }
3611 /* ------------------------------------------------------------------
3612   Dissector Parameter Redirecting number
3613  */
3614 void
3615 dissect_isup_redirecting_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3616 {
3617   proto_item *address_digits_item;
3618   proto_tree *address_digits_tree;
3619   guint8 indicators1, indicators2;
3620   guint8 address_digit_pair=0;
3621   gint offset=0;
3622   gint i=0;
3623   gint length;
3624   char calling_number[MAXDIGITS + 1]="";
3625
3626   indicators1 = tvb_get_guint8(parameter_tvb, 0);
3627   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
3628   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
3629   indicators2 = tvb_get_guint8(parameter_tvb, 1);
3630   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
3631   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
3632   offset = 2;
3633
3634   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
3635                                             offset, -1,
3636                                             "Redirecting Number");
3637   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
3638
3639   length = tvb_length_remaining(parameter_tvb, offset);
3640   while(length > 0){
3641     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
3642     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3643     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
3644     if (i > MAXDIGITS)
3645       THROW(ReportedBoundsError);
3646     if ((length - 1) > 0 ){
3647       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3648       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3649       if (i > MAXDIGITS)
3650         THROW(ReportedBoundsError);
3651     }
3652     offset++;
3653     length = tvb_length_remaining(parameter_tvb, offset);
3654   }
3655
3656   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
3657       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
3658       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3659       if (i > MAXDIGITS)
3660         THROW(ReportedBoundsError);
3661   }
3662   calling_number[i++] = '\0';
3663
3664   proto_item_set_text(address_digits_item, "Redirecting Number: %s", calling_number);
3665   proto_tree_add_string(address_digits_tree, hf_isup_redirecting, parameter_tvb, offset - length, length, calling_number);
3666   proto_item_set_text(parameter_item, "Redirecting Number: %s", calling_number);
3667 }
3668 /* ------------------------------------------------------------------
3669   Dissector Parameter Redirection number
3670  */
3671 static void
3672 dissect_isup_redirection_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3673 {
3674   proto_item *address_digits_item;
3675   proto_tree *address_digits_tree;
3676   guint8 indicators1, indicators2;
3677   guint8 address_digit_pair=0;
3678   gint offset=0;
3679   gint i=0;
3680   gint length;
3681   char called_number[MAXDIGITS + 1]="";
3682
3683   indicators1 = tvb_get_guint8(parameter_tvb, 0);
3684   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
3685   proto_tree_add_uint(parameter_tree, hf_isup_called_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
3686   indicators2 = tvb_get_guint8(parameter_tvb, 1);
3687   proto_tree_add_boolean(parameter_tree, hf_isup_inn_indicator, parameter_tvb, 1, 1, indicators2);
3688   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
3689   offset = 2;
3690
3691   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
3692                                             offset, -1,
3693                                             "Redirection Number");
3694   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
3695
3696   length = tvb_length_remaining(parameter_tvb, offset);
3697   while(length > 0){
3698     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
3699     proto_tree_add_uint(address_digits_tree, hf_isup_called_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3700     called_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
3701     if (i > MAXDIGITS)
3702       THROW(ReportedBoundsError);
3703     if ((length - 1) > 0 ){
3704       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3705       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3706       if (i > MAXDIGITS)
3707         THROW(ReportedBoundsError);
3708     }
3709     offset++;
3710     length = tvb_length_remaining(parameter_tvb, offset);
3711   }
3712
3713   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
3714       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
3715       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3716       if (i > MAXDIGITS)
3717         THROW(ReportedBoundsError);
3718   }
3719   called_number[i++] = '\0';
3720
3721   proto_item_set_text(address_digits_item, "Redirection Number: %s", called_number);
3722   proto_item_set_text(parameter_item, "Redirection Number: %s", called_number);
3723 }
3724 /* ------------------------------------------------------------------
3725   Dissector Parameter Connection request
3726  */
3727 static void
3728 dissect_isup_connection_request_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3729 {
3730   guint32 local_ref;
3731   guint16 spc;
3732   guint8 protocol_class, credit, offset=0;
3733
3734   local_ref = tvb_get_ntoh24(parameter_tvb, 0);
3735   proto_tree_add_text(parameter_tree, parameter_tvb, offset, LOCAL_REF_LENGTH, "Local Reference: %u", local_ref);
3736   offset = LOCAL_REF_LENGTH;
3737   spc = tvb_get_letohs(parameter_tvb,offset) & 0x3FFF; /*since 1st 2 bits spare */
3738   proto_tree_add_text(parameter_tree, parameter_tvb, offset, SPC_LENGTH, "Signalling Point Code: %u", spc);
3739   offset += SPC_LENGTH;
3740   protocol_class = tvb_get_guint8(parameter_tvb, offset);
3741   proto_tree_add_text(parameter_tree, parameter_tvb, offset, PROTOCOL_CLASS_LENGTH, "Protocol Class: %u", protocol_class);
3742   offset += PROTOCOL_CLASS_LENGTH;
3743   credit = tvb_get_guint8(parameter_tvb, offset);
3744   proto_tree_add_text(parameter_tree, parameter_tvb, offset, CREDIT_LENGTH, "Credit: %u", credit);
3745   offset += CREDIT_LENGTH;
3746
3747   proto_item_set_text(parameter_item, "Connection request: Local Reference = %u, SPC = %u, Protocol Class = %u, Credit = %u", local_ref, spc, protocol_class, credit);
3748 }
3749 /* ------------------------------------------------------------------
3750   Dissector Parameter Redirection information
3751  */
3752 void
3753 dissect_isup_redirection_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3754 {
3755   if (tvb_length(parameter_tvb) == 2){
3756     guint16 indicators;
3757     indicators = tvb_get_ntohs(parameter_tvb, 0);
3758     proto_tree_add_uint(parameter_tree, hf_isup_redirecting_ind, parameter_tvb,0 , REDIRECTION_INFO_LENGTH, indicators);
3759     proto_tree_add_uint(parameter_tree, hf_isup_original_redirection_reason, parameter_tvb,0 , REDIRECTION_INFO_LENGTH, indicators);
3760     proto_tree_add_uint(parameter_tree, hf_isup_redirection_counter, parameter_tvb,0 , REDIRECTION_INFO_LENGTH, indicators);
3761     proto_tree_add_uint(parameter_tree, hf_isup_redirection_reason, parameter_tvb,0 , REDIRECTION_INFO_LENGTH, indicators);
3762     proto_item_set_text(parameter_item, "Redirection Information");
3763   }
3764   else { /* ISUP'88 (blue book) */
3765     guint16 indicators;
3766     indicators = tvb_get_guint8(parameter_tvb, 0) * 0x100; /*since 2nd octet isn't present*/
3767     proto_tree_add_uint(parameter_tree, hf_isup_redirecting_ind, parameter_tvb, 0, 1, indicators);
3768     proto_tree_add_uint(parameter_tree, hf_isup_original_redirection_reason, parameter_tvb,0 , 1, indicators);
3769     proto_item_set_text(parameter_item, "Redirection Information (2nd octet not present since ISUP '88)");
3770   }
3771 }
3772 /* ------------------------------------------------------------------
3773   Dissector Parameter Closed user group interlock code
3774  */
3775 static void
3776 dissect_isup_closed_user_group_interlock_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3777 {
3778   char NI_digits[5]="";
3779   guint8 digit_pair;
3780   guint16 bin_code;
3781
3782   digit_pair = tvb_get_guint8(parameter_tvb, 0);
3783   NI_digits[0] = number_to_char((digit_pair & HGFE_8BIT_MASK) / 0x10);
3784   NI_digits[1] = number_to_char(digit_pair & DCBA_8BIT_MASK);
3785   digit_pair = tvb_get_guint8(parameter_tvb, 1);
3786   NI_digits[2] = number_to_char((digit_pair & HGFE_8BIT_MASK) / 0x10);
3787   NI_digits[3] = number_to_char(digit_pair & DCBA_8BIT_MASK);
3788   NI_digits[4] = '\0';
3789   proto_tree_add_text(parameter_tree, parameter_tvb, 0, 2, "Network Identity: %s", NI_digits);
3790   bin_code = tvb_get_ntohs(parameter_tvb, 2);
3791   proto_tree_add_text(parameter_tree, parameter_tvb, 3, 2, "Binary Code: 0x%x", bin_code);
3792   proto_item_set_text(parameter_item, "Closed user group interlock code: NI = %s, Binary code = 0x%x", NI_digits, bin_code);
3793 }
3794 /* ------------------------------------------------------------------
3795   Dissector Parameter User service information- no detailed dissection since defined in Rec. Q.931
3796  */
3797 static void
3798 dissect_isup_user_service_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3799 { guint length = tvb_length(parameter_tvb);
3800   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length,
3801           "User service information (-> Q.931 Bearer_capability)");
3802   proto_item_set_text(parameter_item, "User service information, (%u byte%s length)",
3803           length , plurality(length, "", "s"));
3804   dissect_q931_bearer_capability_ie(parameter_tvb,
3805                                             0, length,
3806                                             parameter_tree);
3807 }
3808 /* ------------------------------------------------------------------
3809   Dissector Parameter Signalling point code
3810  */
3811 static void
3812 dissect_isup_signalling_point_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3813 {
3814   guint16 spc;
3815
3816   spc = tvb_get_letohs(parameter_tvb, 0) & 0x3FFF; /*since 1st 2 bits spare */
3817   proto_tree_add_text(parameter_tree, parameter_tvb, 0, SIGNALLING_POINT_CODE_LENGTH, "Signalling Point Code: %u", spc);
3818
3819   proto_item_set_text(parameter_item, "Signalling point code: %u", spc);
3820 }
3821 /* ------------------------------------------------------------------
3822   Dissector Parameter Connected number
3823  */
3824 static void
3825 dissect_isup_connected_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3826 {
3827   proto_item *address_digits_item;
3828   proto_tree *address_digits_tree;
3829   guint8 indicators1, indicators2;
3830   guint8 address_digit_pair=0;
3831   gint offset=0;
3832   gint i=0;
3833   gint length;
3834   char calling_number[MAXDIGITS + 1]="";
3835
3836   indicators1 = tvb_get_guint8(parameter_tvb, 0);
3837   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
3838   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
3839   indicators2 = tvb_get_guint8(parameter_tvb, 1);
3840   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
3841   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
3842   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator, parameter_tvb, 1, 1, indicators2);
3843   offset = 2;
3844
3845   length = tvb_length_remaining(parameter_tvb, offset);
3846   if (length == 0)
3847         return; /* empty connected number */
3848   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
3849                                             offset, -1,
3850                                             "Connected Number");
3851   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
3852
3853   while(length > 0){
3854     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
3855     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3856     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
3857     if (i > MAXDIGITS)
3858       THROW(ReportedBoundsError);
3859     if ((length - 1) > 0 ){
3860       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3861       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3862       if (i > MAXDIGITS)
3863         THROW(ReportedBoundsError);
3864     }
3865     offset++;
3866     length = tvb_length_remaining(parameter_tvb, offset);
3867   }
3868
3869   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
3870       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
3871       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3872       if (i > MAXDIGITS)
3873         THROW(ReportedBoundsError);
3874   }
3875   calling_number[i++] = '\0';
3876
3877   proto_item_set_text(address_digits_item, "Connected Number: %s", calling_number);
3878   proto_item_set_text(parameter_item, "Connected Number: %s", calling_number);
3879
3880 }
3881 /* ------------------------------------------------------------------
3882   Dissector Transit network selection
3883  */
3884 static void
3885 dissect_isup_transit_network_selection_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3886 {
3887   proto_item *address_digits_item;
3888   proto_tree *address_digits_tree;
3889   guint8 indicators;
3890   guint8 address_digit_pair=0;
3891   gint offset=0;
3892   gint i=0;
3893   gint length;
3894   char network_id[MAXDIGITS + 1]="";
3895
3896   indicators = tvb_get_guint8(parameter_tvb, 0);
3897   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators);
3898   proto_tree_add_uint(parameter_tree, hf_isup_type_of_network_identification, parameter_tvb, 0, 1, indicators);
3899   proto_tree_add_uint(parameter_tree, hf_isup_network_identification_plan, parameter_tvb, 0, 1, indicators);
3900   offset = 1;
3901
3902   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
3903                                             offset, -1,
3904                                             "Network identification");
3905   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
3906
3907   length = tvb_length_remaining(parameter_tvb, offset);
3908   while(length > 0){
3909     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
3910     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3911     network_id[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
3912     if (i > MAXDIGITS)
3913       THROW(ReportedBoundsError);
3914     if ((length - 1) > 0 ){
3915       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3916       network_id[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3917       if (i > MAXDIGITS)
3918         THROW(ReportedBoundsError);
3919     }
3920     offset++;
3921     length = tvb_length_remaining(parameter_tvb, offset);
3922   }
3923
3924   if  (((indicators & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
3925       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
3926       network_id[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3927       if (i > MAXDIGITS)
3928         THROW(ReportedBoundsError);
3929   }
3930   network_id[i++] = '\0';
3931
3932   proto_item_set_text(address_digits_item, "Network identification: %s", network_id);
3933   proto_item_set_text(parameter_item, "Transit network selection: %s", network_id);
3934
3935 }
3936 /* ------------------------------------------------------------------
3937   Dissector Parameter Circuit assignment map
3938  */
3939 static void
3940 dissect_isup_circuit_assignment_map_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3941 { guint8 map_type;
3942
3943   map_type = tvb_get_guint8(parameter_tvb, 0);
3944   proto_tree_add_uint(parameter_tree, hf_isup_map_type, parameter_tvb, 0, 1, map_type);
3945   proto_tree_add_text(parameter_tree, parameter_tvb, 1, 5, "Circuit assignment map (bit position indicates usage of corresponding circuit->3.69/Q.763)");
3946   proto_item_set_text(parameter_item, "Circuit assignment map");
3947 }
3948 /* ------------------------------------------------------------------
3949   Dissector Parameter Automatic congestion level
3950  */
3951 static void
3952 dissect_isup_automatic_congestion_level_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3953 { guint8 congestion_level;
3954
3955   congestion_level = tvb_get_guint8(parameter_tvb, 0);
3956   proto_tree_add_uint(parameter_tree, hf_isup_automatic_congestion_level, parameter_tvb, 0, AUTO_CONGEST_LEVEL_LENGTH, congestion_level);
3957   proto_item_set_text(parameter_item, "Automatic congestion level: %s (%u)", val_to_str(congestion_level, isup_auto_congestion_level_value, "spare"), congestion_level);
3958 }
3959 /* ------------------------------------------------------------------
3960   Dissector Parameter Optional backward Call indicators
3961  */
3962 static void
3963 dissect_isup_optional_backward_call_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3964 {
3965   guint8 indicators;
3966
3967   indicators = tvb_get_guint8(parameter_tvb, 0);
3968   proto_tree_add_boolean(parameter_tree, hf_isup_inband_information_ind, parameter_tvb, 0, OPTIONAL_BACKWARD_CALL_IND_LENGTH, indicators);
3969   proto_tree_add_boolean(parameter_tree, hf_isup_call_diversion_may_occur_ind, parameter_tvb, 0, OPTIONAL_BACKWARD_CALL_IND_LENGTH, indicators);
3970   proto_tree_add_boolean(parameter_tree, hf_isup_simple_segmentation_ind, parameter_tvb, 0, OPTIONAL_BACKWARD_CALL_IND_LENGTH, indicators);
3971   proto_tree_add_boolean(parameter_tree, hf_isup_mlpp_user_ind, parameter_tvb, 0, OPTIONAL_BACKWARD_CALL_IND_LENGTH, indicators);
3972
3973
3974   proto_item_set_text(parameter_item,"Optional backward call indicators: 0x%x", indicators );
3975 }
3976 /* ------------------------------------------------------------------
3977   Dissector Parameter User-to-user indicators
3978  */
3979 static const true_false_string isup_UUI_type_value = {
3980   "Response",
3981   "Request"
3982 };
3983 static const value_string isup_UUI_request_service_values[] = {
3984   { 0,  "No information"},
3985   { 1,  "Spare"},
3986   { 2,  "Request, not essential"},
3987   { 3,  "Request,essential"},
3988   { 0,  NULL}
3989 };
3990
3991 static const value_string isup_UUI_response_service_values[] = {
3992   { 0,  "No information"},
3993   { 1,  "Not provided"},
3994   { 2,  "Provided"},
3995   { 3,  "Spare"},
3996   { 0,  NULL}
3997 };
3998 static const true_false_string isup_UUI_network_discard_ind_value= {
3999   "User-to-user information discarded by the network",
4000   "No information"
4001 };
4002
4003 static void
4004 dissect_isup_user_to_user_indicators_parameter(tvbuff_t *parameter_tvb,
4005                                                                                            proto_tree *parameter_tree,
4006                                                                                            proto_item *parameter_item)
4007 {
4008   guint8 indicators;
4009
4010   indicators = tvb_get_guint8(parameter_tvb, 0);
4011   proto_tree_add_boolean(parameter_tree, hf_isup_UUI_type, parameter_tvb, 0, 1, indicators);
4012   if ( (indicators & 0x01) == 0 ){
4013           /* Request */
4014           proto_tree_add_uint(parameter_tree, hf_isup_UUI_req_service1, parameter_tvb, 0, 1, indicators);
4015           proto_tree_add_uint(parameter_tree, hf_isup_UUI_req_service2, parameter_tvb, 0, 1, indicators);
4016           proto_tree_add_uint(parameter_tree, hf_isup_UUI_req_service3, parameter_tvb, 0, 1, indicators);
4017   }
4018   else {
4019           /* Response */
4020           proto_tree_add_uint(parameter_tree, hf_isup_UUI_res_service1, parameter_tvb, 0, 1, indicators);
4021           proto_tree_add_uint(parameter_tree, hf_isup_UUI_res_service2, parameter_tvb, 0, 1, indicators);
4022           proto_tree_add_uint(parameter_tree, hf_isup_UUI_res_service3, parameter_tvb, 0, 1, indicators);
4023           proto_tree_add_boolean(parameter_tree, hf_isup_UUI_network_discard_ind, parameter_tvb, 0, 1, indicators);
4024
4025   }
4026   proto_item_set_text(parameter_item,"User-to-user indicators: 0x%x", indicators );
4027 }
4028 /* ------------------------------------------------------------------
4029   Dissector Parameter Original ISC point code
4030  */
4031 static void
4032 dissect_isup_original_isc_point_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4033 {
4034   guint16 spc;
4035
4036   spc = tvb_get_letohs(parameter_tvb, 0) & 0x3FFF; /*since 1st 2 bits spare */
4037   proto_tree_add_text(parameter_tree, parameter_tvb, 0, ORIGINAL_ISC_POINT_CODE_LENGTH, "Origination ISC Point Code: %u", spc);
4038
4039   proto_item_set_text(parameter_item, "Origination ISC point code: %u", spc);
4040 }
4041 /* ------------------------------------------------------------------
4042   Dissector Parameter Generic notification indicator
4043  */
4044 static void
4045 dissect_isup_generic_notification_indicator_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4046 {
4047   guint8 indicators;
4048
4049   indicators = tvb_get_guint8(parameter_tvb, 0);
4050   proto_tree_add_text(parameter_tree, parameter_tvb, 0, GENERIC_NOTIFICATION_IND_LENGTH, "Generic notification indicator: 0x%x (refer to 3.25/Q.763 for detailed decoding)", indicators );
4051   proto_item_set_text(parameter_item,"Generic notification indicator: 0x%x", indicators );
4052 }
4053 /* ------------------------------------------------------------------
4054   Dissector Parameter Call history information
4055  */
4056 static void
4057 dissect_isup_call_history_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4058 {
4059   guint16 info;
4060
4061   info = tvb_get_ntohs(parameter_tvb, 0);
4062   proto_tree_add_text(parameter_tree, parameter_tvb, 0, CALL_HISTORY_INFO_LENGTH, "Call history info: propagation delay = %u ms", info);
4063   proto_item_set_text(parameter_item,"Call history info: propagation delay = %u ms", info);
4064 }
4065 /* ------------------------------------------------------------------
4066   Dissector Parameter Access delivery information
4067  */
4068 static void
4069 dissect_isup_access_delivery_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4070 { guint8 indicator;
4071
4072   indicator = tvb_get_guint8(parameter_tvb, 0);
4073   proto_tree_add_boolean(parameter_tree, hf_isup_access_delivery_ind, parameter_tvb, 0, ACCESS_DELIVERY_INFO_LENGTH, indicator);
4074   proto_item_set_text(parameter_item, "Access delivery information: 0x%x", indicator);
4075 }
4076 /* ------------------------------------------------------------------
4077   Dissector Parameter Network specific facility
4078  */
4079 static void
4080 dissect_isup_network_specific_facility_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4081 { guint length = tvb_length(parameter_tvb);
4082   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Network specific facility (refer to 3.36/Q.763 for detailed decoding)");
4083   proto_item_set_text(parameter_item, "Network specific facility (%u byte%s length)", length , plurality(length, "", "s"));
4084 }
4085 /* ------------------------------------------------------------------
4086   Dissector Parameter User service information prime
4087  */
4088 static void
4089 dissect_isup_user_service_information_prime_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4090 { guint length = tvb_length(parameter_tvb);
4091   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length,
4092           "User service information prime (-> Q.931 Bearer capability information IE)");
4093   dissect_q931_bearer_capability_ie(parameter_tvb,
4094                                             0, length,
4095                                             parameter_tree);
4096
4097   proto_item_set_text(parameter_item, "User service information prime, (%u byte%s length)",
4098           length , plurality(length, "", "s"));
4099 }
4100 /* ------------------------------------------------------------------
4101   Dissector Parameter Propagation delay counter
4102  */
4103 static void
4104 dissect_isup_propagation_delay_counter_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4105 {
4106   guint16 info;
4107
4108   info = tvb_get_ntohs(parameter_tvb, 0);
4109   proto_tree_add_text(parameter_tree, parameter_tvb, 0, PROPAGATION_DELAY_COUNT_LENGTH, "Propagation delay counter = %u ms", info);
4110   proto_item_set_text(parameter_item,"Propagation delay counter = %u ms", info);
4111 }
4112 /* ------------------------------------------------------------------
4113   Dissector Parameter Remote operations
4114  */
4115 static void
4116 dissect_isup_remote_operations_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4117 { guint length = tvb_length(parameter_tvb);
4118   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Remote operations");
4119   proto_item_set_text(parameter_item, "Remote operations (%u byte%s length)", length , plurality(length, "", "s"));
4120 }
4121 /* ------------------------------------------------------------------
4122   Dissector Parameter Service activation
4123  */
4124 static void
4125 dissect_isup_service_activation_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4126 {
4127   guint i;
4128   guint8 feature_code;
4129   guint length = tvb_length(parameter_tvb);
4130   for (i=0; i< length; i++){
4131     feature_code = tvb_get_guint8(parameter_tvb, i);
4132     proto_tree_add_text(parameter_tree, parameter_tvb, i, 1, "Feature Code %u: %u", i+1, feature_code);
4133   }
4134   proto_item_set_text(parameter_item, "Service Activation (%u byte%s length)", length , plurality(length, "", "s"));
4135 }
4136 /* ------------------------------------------------------------------
4137   Dissector Parameter User service information prime - no detailed dissection since defined in Rec. Q.931
4138  */
4139 static void
4140 dissect_isup_user_teleservice_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4141 {
4142   guint length = tvb_length(parameter_tvb);
4143   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length,
4144           "User teleservice information (-> Q.931 High Layer Compatibility IE)");
4145
4146   dissect_q931_high_layer_compat_ie(parameter_tvb, 0, length, parameter_tree);
4147
4148   proto_item_set_text(parameter_item,
4149           "User teleservice information");
4150 }
4151 /* ------------------------------------------------------------------
4152   Dissector Parameter Transmission medium requirement used
4153  */
4154 static void
4155 dissect_isup_transmission_medium_used_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4156 {
4157   guint8 transmission_medium_requirement;
4158
4159   transmission_medium_requirement = tvb_get_guint8(parameter_tvb, 0);
4160   proto_tree_add_uint(parameter_tree, hf_isup_transmission_medium_requirement_prime, parameter_tvb, 0, TRANSMISSION_MEDIUM_RQMT_PRIME_LENGTH,transmission_medium_requirement);
4161
4162   proto_item_set_text(parameter_item, "Transmission medium used: %u (%s)",  transmission_medium_requirement, val_to_str(transmission_medium_requirement, isup_transmission_medium_requirement_prime_value, "spare/reserved"));
4163 }
4164 /* ------------------------------------------------------------------
4165   Dissector Parameter Call diversion information
4166  */
4167 static void
4168 dissect_isup_call_diversion_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4169 { guint8 indicator;
4170
4171   indicator = tvb_get_guint8(parameter_tvb, 0);
4172   proto_tree_add_text(parameter_tree, parameter_tvb, 0, CALL_DIV_INFO_LENGTH, "Call diversion information: 0x%x (refer to 3.6/Q.763 for detailed decoding)", indicator);
4173   proto_item_set_text(parameter_item, "Call diversion information: 0x%x", indicator);
4174 }
4175 /* ------------------------------------------------------------------
4176   Dissector Parameter Echo control  information
4177  */
4178 static const value_string OECD_inf_ind_vals[] = {
4179         {0x00, "no information"},
4180         {0x01, "outgoing echo control device not included and not available"},
4181         {0x02, "outgoing echo control device included"},
4182         {0x03, "outgoing echo control device not included but available"},
4183         { 0,    NULL }
4184 };
4185 static const value_string IECD_inf_ind_vals[] = {
4186         {0x00, "no information"},
4187         {0x01, "incoming echo control device not included and not available"},
4188         {0x02, "incoming echo control device included"},
4189         {0x03, "incoming echo control device not included but available"},
4190         { 0,    NULL }
4191 };
4192
4193 static const value_string OECD_req_ind_vals[] = {
4194         {0x00, "no information"},
4195         {0x01, "outgoing echo control device activation request"},
4196         {0x02, "outgoing echo control device deactivation request"},
4197         {0x03, "spare"},
4198         { 0,    NULL }
4199 };
4200
4201 static const value_string IECD_req_ind_vals[] = {
4202         {0x00, "no information"},
4203         {0x01, "incoming echo control device activation request"},
4204         {0x02, "incoming echo control device deactivation request"},
4205         {0x03, "spare"},
4206         { 0,    NULL }
4207 };
4208
4209 static void
4210 dissect_isup_echo_control_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4211 { guint8 indicator;
4212   gint offset = 0;
4213   indicator = tvb_get_guint8(parameter_tvb, 0);
4214   proto_tree_add_text(parameter_tree, parameter_tvb, 0, ECHO_CONTROL_INFO_LENGTH,
4215           "Echo control information: 0x%x", indicator);
4216
4217   proto_tree_add_uint(parameter_tree, hf_isup_OECD_inf_ind,
4218                 parameter_tvb, offset, 1, indicator );
4219
4220   proto_tree_add_uint(parameter_tree, hf_isup_IECD_inf_ind,
4221                 parameter_tvb, offset, 1, indicator );
4222
4223   proto_tree_add_uint(parameter_tree, hf_isup_OECD_req_ind,
4224                 parameter_tvb, offset, 1, indicator );
4225
4226   proto_tree_add_uint(parameter_tree, hf_isup_IECD_req_ind,
4227                 parameter_tvb, offset, 1, indicator );
4228
4229   proto_item_set_text(parameter_item, "Echo control information: 0x%x", indicator);
4230 }
4231 /* ------------------------------------------------------------------
4232   Dissector Parameter Message compatibility information
4233  */
4234
4235 static const true_false_string isup_pass_on_not_possible_indicator_value = {
4236         "discard information",
4237         "release call",
4238 };
4239
4240 static void
4241 dissect_isup_message_compatibility_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4242 {
4243  guint length = tvb_length(parameter_tvb);
4244  guint instruction_indicators;
4245  gint offset = 0;
4246  instruction_indicators = tvb_get_guint8(parameter_tvb, offset);
4247
4248  proto_tree_add_text(parameter_tree, parameter_tvb, 0, length,
4249           "Message compatibility information");
4250
4251  proto_tree_add_boolean(parameter_tree, hf_isup_transit_at_intermediate_exchange_ind,
4252                 parameter_tvb, offset, 1, instruction_indicators );
4253
4254  proto_tree_add_boolean(parameter_tree, hf_isup_Release_call_ind,
4255          parameter_tvb, offset, 1, instruction_indicators );
4256
4257  proto_tree_add_boolean(parameter_tree, hf_isup_Send_notification_ind,
4258          parameter_tvb, offset, 1, instruction_indicators );
4259
4260  proto_tree_add_boolean(parameter_tree, hf_isup_Discard_message_ind_value,
4261          parameter_tvb, offset, 1, instruction_indicators );
4262
4263  proto_tree_add_boolean(parameter_tree, hf_isup_pass_on_not_possible_indicator2,
4264          parameter_tvb, offset, 1,instruction_indicators);
4265
4266  proto_tree_add_uint(parameter_tree, hf_isup_Broadband_narrowband_interworking_ind2,
4267          parameter_tvb, offset, 1,instruction_indicators);
4268
4269  proto_tree_add_boolean(parameter_tree, hf_isup_extension_ind ,
4270          parameter_tvb, offset, 1, instruction_indicators );
4271
4272   proto_item_set_text(parameter_item, "Message compatibility information (%u byte%s length)",
4273           length , plurality(length, "", "s"));
4274 }
4275 /* ------------------------------------------------------------------
4276   Dissector Parameter compatibility information
4277  */
4278 static const true_false_string isup_transit_at_intermediate_exchange_ind_value  = {
4279   "End node interpretation",
4280   "Transit interpretation"
4281 };
4282
4283
4284 static const true_false_string isup_Discard_message_ind_value = {
4285         "Discard message",
4286         "Do not discard message (pass on)",
4287 };
4288
4289 static const true_false_string isup_Discard_parameter_ind_value = {
4290         "Discard parameter",
4291         "Do not discard parameter (pass on)",
4292 };
4293
4294 static const value_string isup_Pass_on_not_possible_indicator_vals[] = {
4295         { 0x00, "Release call" },
4296         { 0x01, "Discard message" },
4297         { 0x02, "Discard parameter" },
4298         { 0x03, "Reserved (interpreted as 00)" },
4299         { 0, NULL },
4300 };
4301 static const value_string ISUP_Broadband_narrowband_interworking_indicator_vals[] = {
4302         { 0x00, "Pass on" },
4303         { 0x01, "Discard message" },
4304         { 0x02, "Release call" },
4305         { 0x03, "Discard parameter" },
4306         { 0, NULL },
4307 };
4308
4309 static void
4310 dissect_isup_parameter_compatibility_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4311 {
4312   guint  length = tvb_length(parameter_tvb);
4313   guint  len = length;
4314   guint8 upgraded_parameter, upgraded_parameter_no;
4315   guint8 offset;
4316   guint8 instruction_indicators;
4317   offset = 0;
4318   upgraded_parameter_no = 0;
4319
4320   proto_item_set_text(parameter_item, "Parameter compatibility information (%u byte%s length)", length , plurality(length, "", "s"));
4321 /* etxrab Decoded as per Q.763 section 3.41 */
4322
4323   while ( len > 0 ) {
4324   upgraded_parameter_no = upgraded_parameter_no + 1;
4325   upgraded_parameter = tvb_get_guint8(parameter_tvb, offset);
4326
4327   proto_tree_add_text(parameter_tree, parameter_tvb, offset, 1,
4328             "Upgraded parameter no: %u = %s", upgraded_parameter_no,
4329             val_to_str(upgraded_parameter, isup_parameter_type_value, "unknown (%u)"));
4330   offset += 1;
4331   len -= 1;
4332   instruction_indicators = tvb_get_guint8(parameter_tvb, offset);
4333
4334   proto_tree_add_text(parameter_tree, parameter_tvb, offset, 1,
4335                     "Instruction indicators: 0x%x ",
4336                     instruction_indicators);
4337
4338  proto_tree_add_boolean(parameter_tree, hf_isup_transit_at_intermediate_exchange_ind,
4339                 parameter_tvb, offset, 1, instruction_indicators );
4340
4341  proto_tree_add_boolean(parameter_tree, hf_isup_Release_call_ind, parameter_tvb, offset, 1, instruction_indicators );
4342
4343  proto_tree_add_boolean(parameter_tree, hf_isup_Send_notification_ind, parameter_tvb, offset, 1, instruction_indicators );
4344
4345  proto_tree_add_boolean(parameter_tree, hf_isup_Discard_message_ind_value, parameter_tvb, offset, 1, instruction_indicators );
4346
4347  proto_tree_add_boolean(parameter_tree, hf_isup_Discard_parameter_ind, parameter_tvb, offset, 1, instruction_indicators );
4348
4349  proto_tree_add_uint(parameter_tree, hf_isup_Pass_on_not_possible_indicator, parameter_tvb, offset, 1,instruction_indicators);
4350
4351  proto_tree_add_boolean(parameter_tree, hf_isup_extension_ind , parameter_tvb, offset, 1, instruction_indicators );
4352
4353   offset += 1;
4354   len -= 1;
4355   if (!(instruction_indicators & H_8BIT_MASK)) {
4356                 if (len == 0)
4357                         return;
4358                   instruction_indicators = tvb_get_guint8(parameter_tvb, offset);
4359                  proto_tree_add_uint(parameter_tree, hf_isup_Broadband_narrowband_interworking_ind, parameter_tvb, offset, 1,instruction_indicators);
4360                  offset += 1;
4361                   len -= 1;
4362                   }
4363    if (len == 0)
4364    return;
4365   ;
4366  }
4367 /* etxrab */
4368
4369 }
4370 /* ------------------------------------------------------------------
4371   Dissector Parameter MLPP precedence
4372  */
4373 static void
4374 dissect_isup_mlpp_precedence_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4375 {
4376   char NI_digits[5]="";
4377   guint8 indicators, digit_pair;
4378   guint32 bin_code;
4379
4380   indicators = tvb_get_guint8(parameter_tvb, 0);
4381   proto_tree_add_text(parameter_tree, parameter_tvb, 0, 1, "LFB (Bits 6+7) and precedence level (Bits 1-4): 0x%x",indicators);
4382   digit_pair = tvb_get_guint8(parameter_tvb, 1);
4383   NI_digits[0] = number_to_char((digit_pair & HGFE_8BIT_MASK) / 0x10);
4384   NI_digits[1] = number_to_char(digit_pair & DCBA_8BIT_MASK);
4385   digit_pair = tvb_get_guint8(parameter_tvb, 2);
4386   NI_digits[2] = number_to_char((digit_pair & HGFE_8BIT_MASK) / 0x10);
4387   NI_digits[3] = number_to_char(digit_pair & DCBA_8BIT_MASK);
4388   NI_digits[4] = '\0';
4389   proto_tree_add_text(parameter_tree, parameter_tvb, 1, 2, "Network Identity: %s", NI_digits);
4390   bin_code = tvb_get_ntoh24(parameter_tvb, 3);
4391   proto_tree_add_text(parameter_tree, parameter_tvb, 3, 3, "MLPP service domain: 0x%x", bin_code);
4392   proto_item_set_text(parameter_item, "MLPP precedence: NI = %s, MLPP service domain = 0x%x", NI_digits, bin_code);
4393 }
4394 /* ------------------------------------------------------------------
4395   Dissector Parameter MCID request indicators
4396  */
4397 static void
4398 dissect_isup_mcid_request_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4399 { guint8 indicator;
4400
4401   indicator = tvb_get_guint8(parameter_tvb, 0);
4402   proto_tree_add_text(parameter_tree, parameter_tvb, 0,MCID_REQUEST_IND_LENGTH, "MCID request indicators: 0x%x (MCID requested by Bit1=1, Holding requested by Bit2=1 see 3.31/Q.763)", indicator);
4403   proto_item_set_text(parameter_item, "MCID request indicators: 0x%x", indicator);
4404 }
4405 /* ------------------------------------------------------------------
4406   Dissector Parameter MCID response indicators
4407  */
4408 static void
4409 dissect_isup_mcid_response_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4410 { guint8 indicator;
4411
4412   indicator = tvb_get_guint8(parameter_tvb, 0);
4413   proto_tree_add_text(parameter_tree, parameter_tvb, 0,MCID_RESPONSE_IND_LENGTH, "MCID response indicators: 0x%x (MCID included if Bit1=1, Holding provided if Bit2=1 see 3.32/Q.763)", indicator);
4414   proto_item_set_text(parameter_item, "MCID response indicators: 0x%x", indicator);
4415 }
4416 /* ------------------------------------------------------------------
4417   Dissector Parameter Hop counter
4418  */
4419 static void
4420 dissect_isup_hop_counter_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4421 { guint8 counter;
4422
4423   counter = tvb_get_guint8(parameter_tvb, 0) & EDCBA_8BIT_MASK; /* since bits H,G and F are spare */
4424   proto_tree_add_text(parameter_tree, parameter_tvb, 0, HOP_COUNTER_LENGTH, "Hop counter: %u", counter);
4425   proto_item_set_text(parameter_item,  "Hop counter: %u", counter);
4426 }
4427 /* ------------------------------------------------------------------
4428   Dissector Parameter Transmission medium requirement prime
4429  */
4430 static void
4431 dissect_isup_transmission_medium_requirement_prime_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4432 {
4433   guint8 transmission_medium_requirement;
4434
4435   transmission_medium_requirement = tvb_get_guint8(parameter_tvb, 0);
4436   proto_tree_add_uint(parameter_tree, hf_isup_transmission_medium_requirement_prime, parameter_tvb, 0, TRANSMISSION_MEDIUM_RQMT_PRIME_LENGTH,transmission_medium_requirement);
4437
4438   proto_item_set_text(parameter_item, "Transmission medium requirement prime: %u (%s)",  transmission_medium_requirement, val_to_str(transmission_medium_requirement, isup_transmission_medium_requirement_prime_value, "spare/reserved"));
4439 }
4440
4441 /* ------------------------------------------------------------------
4442   Dissector Parameter location number
4443  */
4444 static void
4445 dissect_isup_location_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4446 {
4447   proto_item *address_digits_item;
4448   proto_tree *address_digits_tree;
4449   guint8 indicators1, indicators2;
4450   guint8 address_digit_pair=0;
4451   gint offset=0;
4452   gint i=0;
4453   gint length;
4454   char calling_number[MAXDIGITS + 1]="";
4455
4456   indicators1 = tvb_get_guint8(parameter_tvb, 0);
4457   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
4458   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
4459   indicators2 = tvb_get_guint8(parameter_tvb, 1);
4460   proto_tree_add_boolean(parameter_tree, hf_isup_inn_indicator, parameter_tvb, 1, 1, indicators2);
4461   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
4462   if ((indicators2 & GFE_8BIT_MASK) == 0x50)
4463     proto_tree_add_text(parameter_tree, parameter_tvb, 1, 1, "Different meaning for Location Number: Numbering plan indicator = private numbering plan");
4464   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
4465   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator, parameter_tvb, 1, 1, indicators2);
4466
4467    /* NOTE  When the address presentation restricted indicator indicates address not available, the
4468     * subfields in items a), b), c) and d) are coded with 0's, and the screening indicator is set to 11
4469     * (network provided).
4470         * BUG 938 - Just check if there is someting more to dissect.
4471     */
4472   if (tvb_length_remaining(parameter_tvb, offset) < 3){
4473     proto_tree_add_text(parameter_tree, parameter_tvb, 1, -1, "Location number: address not available");
4474     proto_item_set_text(parameter_item, "Location number: address not available");
4475     return;
4476   }
4477
4478   offset = 2;
4479
4480   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
4481                                             offset, -1,
4482                                             "Location number");
4483   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
4484
4485   length = tvb_length_remaining(parameter_tvb, offset);
4486   while(length > 0){
4487     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
4488     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
4489     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
4490     if (i > MAXDIGITS)
4491       THROW(ReportedBoundsError);
4492     if ((length - 1) > 0 ){
4493       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
4494       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
4495       if (i > MAXDIGITS)
4496         THROW(ReportedBoundsError);
4497     }
4498     offset++;
4499     length = tvb_length_remaining(parameter_tvb, offset);
4500   }
4501
4502   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
4503       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
4504       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
4505       if (i > MAXDIGITS)
4506         THROW(ReportedBoundsError);
4507   }
4508   calling_number[i++] = '\0';
4509
4510   proto_item_set_text(address_digits_item, "Location number: %s", calling_number);
4511   proto_item_set_text(parameter_item, "Location number: %s", calling_number);
4512
4513 }
4514 /* ------------------------------------------------------------------
4515   Dissector Parameter Redirection number restiriction
4516  */
4517 static void
4518 dissect_isup_redirection_number_restriction_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4519 {
4520   guint8 indicator;
4521
4522   indicator = tvb_get_guint8(parameter_tvb, 0);
4523   switch (indicator & BA_8BIT_MASK) {
4524   case 0:
4525     proto_tree_add_text(parameter_tree, parameter_tvb, 0, REDIRECTION_NUMBER_RESTRICTION_LENGTH, "Presentation indicator: Presentation allowed");
4526     break;
4527   case 1:
4528     proto_tree_add_text(parameter_tree, parameter_tvb, 0, REDIRECTION_NUMBER_RESTRICTION_LENGTH, "Presentation indicator: Presentation restricted");
4529     break;
4530   default:
4531     proto_tree_add_text(parameter_tree, parameter_tvb, 0, REDIRECTION_NUMBER_RESTRICTION_LENGTH, "Presentation indicator: spare");
4532     break;
4533   }
4534   proto_item_set_text(parameter_item, "Redirection number restriction: 0x%x ", indicator);
4535 }
4536 /* ------------------------------------------------------------------
4537   Dissector Parameter Call transfer identity
4538  */
4539 static void
4540 dissect_isup_call_transfer_reference_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4541 { guint8 id;
4542
4543   id = tvb_get_guint8(parameter_tvb, 0);
4544   proto_tree_add_text(parameter_tree, parameter_tvb, 0, CALL_TRANSFER_REF_LENGTH, "Call transfer identity: %u", id);
4545   proto_item_set_text(parameter_item,  "Call transfer reference: %u", id);
4546 }
4547 /* ------------------------------------------------------------------
4548   Dissector Parameter Loop prevention
4549  */
4550 static void
4551 dissect_isup_loop_prevention_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4552 {
4553   guint8 indicator;
4554
4555   indicator = tvb_get_guint8(parameter_tvb, 0);
4556   if ((indicator & A_8BIT_MASK)==0) {
4557     proto_tree_add_text(parameter_tree, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, "Type: Request");
4558     proto_item_set_text(parameter_item, "Loop prevention indicators: Request (%u)", indicator);
4559   }
4560   else {
4561     proto_tree_add_text(parameter_tree, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, "Type: Response");
4562     proto_tree_add_uint(parameter_tree, hf_isup_loop_prevention_response_ind, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, indicator);
4563     proto_item_set_text(parameter_item, "Loop prevention indicators: Response (%u)", indicator);
4564   }
4565 }
4566 /* ------------------------------------------------------------------
4567   Dissector Parameter Call transfer number
4568  */
4569 static void
4570 dissect_isup_call_transfer_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4571 {
4572   proto_item *address_digits_item;
4573   proto_tree *address_digits_tree;
4574   guint8 indicators1, indicators2;
4575   guint8 address_digit_pair=0;
4576   gint offset=0;
4577   gint i=0;
4578   gint length;
4579   char calling_number[MAXDIGITS + 1]="";
4580
4581   indicators1 = tvb_get_guint8(parameter_tvb, 0);
4582   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
4583   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
4584   indicators2 = tvb_get_guint8(parameter_tvb, 1);
4585   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
4586   if ((indicators2 & GFE_8BIT_MASK) == 0x50)
4587     proto_tree_add_text(parameter_tree, parameter_tvb, 1, 1, "Different meaning for Call Transfer Number: Numbering plan indicator = private numbering plan");
4588   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
4589   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator_enhanced, parameter_tvb, 1, 1, indicators2);
4590   offset = 2;
4591
4592   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
4593                                             offset, -1,
4594                                             "Call transfer number");
4595   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
4596
4597   length = tvb_length_remaining(parameter_tvb, offset);
4598   while(length > 0){
4599     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
4600     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
4601     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
4602     if (i > MAXDIGITS)
4603       THROW(ReportedBoundsError);
4604     if ((length - 1) > 0 ){
4605       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
4606       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
4607       if (i > MAXDIGITS)
4608         THROW(ReportedBoundsError);
4609     }
4610     offset++;
4611     length = tvb_length_remaining(parameter_tvb, offset);
4612   }
4613
4614   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
4615       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
4616       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
4617       if (i > MAXDIGITS)
4618         THROW(ReportedBoundsError);
4619   }
4620   calling_number[i++] = '\0';
4621
4622   proto_item_set_text(address_digits_item, "Call transfer number: %s", calling_number);
4623   proto_item_set_text(parameter_item, "Call transfer number: %s", calling_number);
4624
4625 }
4626 /* ------------------------------------------------------------------
4627   Dissector Parameter CCSS
4628  */
4629 static void
4630 dissect_isup_ccss_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4631 {
4632   guint8 indicator;
4633
4634   indicator = tvb_get_guint8(parameter_tvb, 0);
4635   if ((indicator & A_8BIT_MASK)==0) {
4636     proto_tree_add_text(parameter_tree, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, "CCSS call indicator: no indication");
4637     proto_item_set_text(parameter_item, "CCSS call indicator: no indication (%u)", indicator);
4638   }
4639   else {
4640     proto_tree_add_text(parameter_tree, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, "CCSS call indicator: CCSS call");
4641     proto_item_set_text(parameter_item, "CCSS call indicator: CCSS call (%u)", indicator);
4642   }
4643 }
4644 /* ------------------------------------------------------------------
4645  Parameter Forward GVNS
4646  */
4647 static void
4648 dissect_isup_forward_gvns_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4649 { guint length = tvb_length(parameter_tvb);
4650   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Forward GVNS (refer to 3.66/Q.763 for detailed decoding)");
4651   proto_item_set_text(parameter_item, "Forward GVNS (%u Byte%s)", length , plurality(length, "", "s"));
4652 }
4653 /* ------------------------------------------------------------------
4654  Parameter Redirect capability
4655  */
4656 static void
4657 dissect_isup_redirect_capability_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4658 { guint length = tvb_length(parameter_tvb);
4659   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Redirect capability (format is a national matter)");
4660   proto_item_set_text(parameter_item, "Redirect Capability (%u Byte%s)", length , plurality(length, "", "s"));
4661 }
4662 /* ------------------------------------------------------------------
4663   Dissector Parameter Backward GVNS
4664  */
4665 static void
4666 dissect_isup_backward_gvns_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4667 { guint8 indicator;
4668
4669   indicator = tvb_get_guint8(parameter_tvb, 0);
4670   proto_tree_add_text(parameter_tree, parameter_tvb, 0, BACKWARD_GVNS_LENGTH, "Backward GVNS: 0x%x (refer to 3.62/Q.763 for detailed decoding)", indicator);
4671   proto_item_set_text(parameter_item, "Backward GVNS: 0x%x", indicator);
4672 }
4673 /* ------------------------------------------------------------------
4674   Dissector Parameter Network management controls
4675  */
4676 static void
4677 dissect_isup_network_management_controls_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4678 { guint8 indicator;
4679
4680   indicator = tvb_get_guint8(parameter_tvb, 0);
4681   proto_tree_add_boolean(parameter_tree, hf_isup_temporary_alternative_routing_ind, parameter_tvb, 0,NETWORK_MANAGEMENT_CONTROLS_LENGTH, indicator);
4682   proto_tree_add_boolean(parameter_tree, hf_isup_extension_ind, parameter_tvb, 0,NETWORK_MANAGEMENT_CONTROLS_LENGTH, indicator);
4683   proto_item_set_text(parameter_item, "Network management controls: 0x%x", indicator);
4684 }
4685 /* ------------------------------------------------------------------
4686   Dissector Parameter Correlation id - no detailed dissection since defined in Rec. Q.1281
4687  */
4688 static void
4689 dissect_isup_correlation_id_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4690 { guint length = tvb_length(parameter_tvb);
4691   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Correlation ID (-> Q.1281)");
4692   proto_item_set_text(parameter_item, "Correlation ID, see Q.1281 (%u Byte%s)", length , plurality(length, "", "s"));
4693 }
4694 /* ------------------------------------------------------------------
4695   Dissector Parameter SCF id - no detailed dissection since defined in Rec. Q.1281
4696  */
4697 static void
4698 dissect_isup_scf_id_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4699 { guint length = tvb_length(parameter_tvb);
4700   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "SCF ID (-> Q.1281)");
4701   proto_item_set_text(parameter_item, "SCF ID, see Q.1281 (%u Byte%s)", length , plurality(length, "", "s"));
4702 }
4703 /* ------------------------------------------------------------------
4704   Dissector Parameter Call diversion treatment indicators
4705  */
4706 static void
4707 dissect_isup_call_diversion_treatment_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4708 { guint8 indicator;
4709
4710   indicator = tvb_get_guint8(parameter_tvb, 0);
4711   proto_tree_add_uint(parameter_tree, hf_isup_call_to_be_diverted_ind, parameter_tvb, 0,CALL_DIV_TREATMENT_IND_LENGTH, indicator);
4712   proto_tree_add_boolean(parameter_tree, hf_isup_extension_ind, parameter_tvb, 0, CALL_DIV_TREATMENT_IND_LENGTH, indicator);
4713   proto_item_set_text(parameter_item, "Call diversion treatment indicators: 0x%x", indicator);
4714 }
4715 /* ------------------------------------------------------------------
4716   Dissector Parameter called IN  number
4717  */
4718 static void
4719 dissect_isup_called_in_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4720 {
4721   proto_item *address_digits_item;
4722   proto_tree *address_digits_tree;
4723   guint8 indicators1, indicators2;
4724   guint8 address_digit_pair=0;
4725   gint offset=0;
4726   gint i=0;
4727   gint length;
4728   char calling_number[MAXDIGITS + 1]="";
4729
4730   indicators1 = tvb_get_guint8(parameter_tvb, 0);
4731   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
4732   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
4733   indicators2 = tvb_get_guint8(parameter_tvb, 1);
4734   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
4735   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
4736   offset = 2;
4737
4738   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
4739                                             offset, -1,
4740                                             "Called IN Number");
4741   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
4742
4743   length = tvb_length_remaining(parameter_tvb, offset);
4744   while(length > 0){
4745     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
4746     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
4747     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
4748     if (i > MAXDIGITS)
4749       THROW(ReportedBoundsError);
4750     if ((length - 1) > 0 ){
4751       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
4752       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
4753       if (i > MAXDIGITS)
4754         THROW(ReportedBoundsError);
4755     }
4756     offset++;
4757     length = tvb_length_remaining(parameter_tvb, offset);
4758   }
4759
4760   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
4761       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
4762       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
4763       if (i > MAXDIGITS)
4764         THROW(ReportedBoundsError);
4765   }
4766   calling_number[i++] = '\0';
4767
4768   proto_item_set_text(address_digits_item, "Called IN Number: %s", calling_number);
4769   proto_item_set_text(parameter_item, "Called IN Number: %s", calling_number);
4770
4771 }
4772 /* ------------------------------------------------------------------
4773   Dissector Parameter Call offering treatment indicators
4774  */
4775 static void
4776 dissect_isup_call_offering_treatment_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4777 { guint8 indicator;
4778
4779   indicator = tvb_get_guint8(parameter_tvb, 0);
4780   proto_tree_add_uint(parameter_tree, hf_isup_call_to_be_offered_ind, parameter_tvb, 0,CALL_OFFERING_TREATMENT_IND_LENGTH, indicator);
4781   proto_tree_add_boolean(parameter_tree, hf_isup_extension_ind, parameter_tvb, 0, CALL_OFFERING_TREATMENT_IND_LENGTH, indicator);
4782   proto_item_set_text(parameter_item, "Call offering treatment indicators: 0x%x", indicator);
4783 }
4784 /* ------------------------------------------------------------------
4785  Parameter Charged party identification
4786  */
4787 static void
4788 dissect_isup_charged_party_identification_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4789 { guint length = tvb_length(parameter_tvb);
4790   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Charged party identification (format is national network specific)");
4791   proto_item_set_text(parameter_item, "Charged party identification (%u Byte%s)", length , plurality(length, "", "s"));
4792 }
4793 /* ------------------------------------------------------------------
4794   Dissector Parameter Conference treatment indicators
4795  */
4796 static void
4797 dissect_isup_conference_treatment_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4798 { guint8 indicator;
4799
4800   indicator = tvb_get_guint8(parameter_tvb, 0);
4801   proto_tree_add_uint(parameter_tree, hf_isup_conference_acceptance_ind, parameter_tvb, 0,CONFERENCE_TREATMENT_IND_LENGTH, indicator);
4802   proto_tree_add_boolean(parameter_tree, hf_isup_extension_ind, parameter_tvb, 0, CONFERENCE_TREATMENT_IND_LENGTH, indicator);
4803   proto_item_set_text(parameter_item, "Conference treatment indicators: 0x%x", indicator);
4804 }
4805 /* ------------------------------------------------------------------
4806   Dissector Parameter Display information
4807  * TODO Output Display info :
4808  * Quote from Q.931:
4809  * 4.5.16 Display
4810  * The purpose of the Display information element is to supply display information
4811  * that may be displayed by the user. The information contained in this element is coded
4812  * in IA5 characters.
4813  * 8 7 6 5 4 3 2 1   Octet
4814  * 0 0 1 0 1 0 0 0   1      Display information element identifier
4815  *                   2      Length of display contents
4816  * 0                 3      Display information (IA5 characters)
4817  * etc.
4818  * - end - quote -
4819  * Assuming octet 2 and onwards is pased here - just output text ?
4820  */
4821 static void
4822 dissect_isup_display_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4823 { guint length = tvb_length(parameter_tvb);
4824   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length,
4825           "Display information (-> Q.931)");
4826   proto_item_set_text(parameter_item, "Display information (%u Byte%s)",
4827           length , plurality(length, "", "s"));
4828 }
4829 /* ------------------------------------------------------------------
4830  Parameter UID action indicators
4831  */
4832 static void
4833 dissect_isup_uid_action_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4834 { guint8 indicator;
4835
4836   indicator = tvb_get_guint8(parameter_tvb, 0);
4837   proto_tree_add_text(parameter_tree, parameter_tvb, 0,UID_ACTION_IND_LENGTH, "UID action indicators: 0x%x (refer to 3.78/Q.763 for detailed decoding)", indicator);
4838   proto_item_set_text(parameter_item, "UID action indicators: 0x%x", indicator);
4839 }
4840 /* ------------------------------------------------------------------
4841  Parameter UID capability indicators
4842  */
4843 static void
4844 dissect_isup_uid_capability_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4845 { guint8 indicator;
4846
4847   indicator = tvb_get_guint8(parameter_tvb, 0);
4848   proto_tree_add_text(parameter_tree, parameter_tvb, 0,UID_CAPABILITY_IND_LENGTH, "UID capability indicators: 0x%x (refer to 3.79/Q.763 for detailed decoding)", indicator);
4849   proto_item_set_text(parameter_item, "UID capability indicators: 0x%x", indicator);
4850 }
4851 /* ------------------------------------------------------------------
4852  Parameter Redirect counter
4853  */
4854 static void
4855 dissect_isup_redirect_counter_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4856 { guint length = tvb_length(parameter_tvb);
4857   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Redirect counter (format is a national matter)");
4858   proto_item_set_text(parameter_item, "Redirect counter (%u Byte%s)", length , plurality(length, "", "s"));
4859 }
4860 /* ------------------------------------------------------------------
4861   Dissector Parameter Collect call request
4862  */
4863 static void
4864 dissect_isup_collect_call_request_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4865 { guint8 indicator;
4866
4867   indicator = tvb_get_guint8(parameter_tvb, 0);
4868   if ((indicator & A_8BIT_MASK) == 0) {
4869     proto_tree_add_text(parameter_tree, parameter_tvb, 0, COLLECT_CALL_REQUEST_LENGTH, "Collect call request indicator: no indication");
4870     proto_item_set_text(parameter_item, "Collect call reqeust: no indication (0x%x)", indicator);
4871   }
4872   else {
4873     proto_tree_add_text(parameter_tree, parameter_tvb, 0, COLLECT_CALL_REQUEST_LENGTH, "Collect call request indicator: collect call requested");
4874     proto_item_set_text(parameter_item, "Collect call reqeust: collect call requested (0x%x)", indicator);
4875   }
4876 }
4877 /* ------------------------------------------------------------------
4878   Dissector Parameter Generic number
4879  */
4880 static void
4881 dissect_isup_generic_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4882 {
4883   proto_item *address_digits_item;
4884   proto_tree *address_digits_tree;
4885   guint8 indicators1, indicators2, nr_qualifier_ind;
4886   guint8 address_digit_pair=0;
4887   gint offset=0;
4888   gint i=0;
4889   gint length;
4890   char calling_number[MAXDIGITS + 1]="";
4891
4892   nr_qualifier_ind = tvb_get_guint8(parameter_tvb, 0);
4893   proto_tree_add_text(parameter_tree, parameter_tvb, 0, 1, "Number qualifier indicator: 0x%x (refer to 3.26/Q.763 for detailed decoding)", nr_qualifier_ind);
4894   indicators1 = tvb_get_guint8(parameter_tvb, 1);
4895   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 1, 1, indicators1);
4896   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
4897   indicators2 = tvb_get_guint8(parameter_tvb, 2);
4898   proto_tree_add_boolean(parameter_tree, hf_isup_ni_indicator, parameter_tvb, 2, 1, indicators2);
4899   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 2, 1, indicators2);
4900   if ((indicators2 & GFE_8BIT_MASK) == 0x50)
4901     proto_tree_add_text(parameter_tree, parameter_tvb, 2, 1, "Different meaning for Generic Number: Numbering plan indicator = private numbering plan");
4902   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 2, 1, indicators2);
4903   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator_enhanced, parameter_tvb, 2, 1, indicators2);
4904   offset = 3;
4905
4906   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
4907                                             offset, -1,
4908                                             "Generic number");
4909   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
4910
4911   length = tvb_length_remaining(parameter_tvb, offset);
4912   while(length > 0){
4913     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
4914     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
4915     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
4916     if (i > MAXDIGITS)
4917       THROW(ReportedBoundsError);
4918     if ((length - 1) > 0 ){
4919       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
4920       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
4921       if (i > MAXDIGITS)
4922         THROW(ReportedBoundsError);
4923     }
4924     offset++;
4925     length = tvb_length_remaining(parameter_tvb, offset);
4926   }
4927
4928   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
4929       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
4930       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
4931       if (i > MAXDIGITS)
4932         THROW(ReportedBoundsError);
4933   }
4934   calling_number[i++] = '\0';
4935
4936   proto_item_set_text(address_digits_item, "Generic number: %s", calling_number);
4937   proto_item_set_text(parameter_item, "Generic number: %s", calling_number);
4938
4939 }
4940 /* ------------------------------------------------------------------
4941  Dissector Parameter Generic digits
4942  */
4943 static void
4944 dissect_isup_generic_digits_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4945 { guint length = tvb_length(parameter_tvb);
4946   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Generic digits (refer to 3.24/Q.673 for detailed decoding)");
4947   proto_item_set_text(parameter_item, "Generic digits (%u Byte%s)", length , plurality(length, "", "s"));
4948 }
4949 /* ------------------------------------------------------------------ */
4950 static void
4951 dissect_isup_unknown_parameter(tvbuff_t *parameter_tvb, proto_item *parameter_item)
4952 { guint length = tvb_length(parameter_tvb);
4953   proto_item_set_text(parameter_item, "Parameter Type unknown/reserved (%u Byte%s)", length , plurality(length, "", "s"));
4954 }
4955 /* ------------------------------------------------------------------ */
4956
4957 /* ------------------------------------------------------------------
4958   Dissector all optional parameters
4959 */
4960 static void
4961 dissect_isup_optional_parameter(tvbuff_t *optional_parameters_tvb,packet_info *pinfo, proto_tree *isup_tree)
4962 { proto_item* parameter_item;
4963   proto_tree* parameter_tree;
4964   gint offset = 0;
4965   guint parameter_type, parameter_length, actual_length;
4966   tvbuff_t *parameter_tvb;
4967   guint8 octet;
4968
4969   /* Dissect all optional parameters while end of message isn't reached */
4970   parameter_type = 0xFF; /* Start-initializiation since parameter_type is used for while-condition */
4971
4972   while ((tvb_length_remaining(optional_parameters_tvb, offset)  >= 1) && (parameter_type != PARAM_TYPE_END_OF_OPT_PARAMS)){
4973     parameter_type = tvb_get_guint8(optional_parameters_tvb, offset);
4974
4975     if (parameter_type != PARAM_TYPE_END_OF_OPT_PARAMS){
4976       parameter_length = tvb_get_guint8(optional_parameters_tvb, offset + PARAMETER_TYPE_LENGTH);
4977
4978       parameter_item = proto_tree_add_text(isup_tree, optional_parameters_tvb,
4979                                            offset,
4980                                            parameter_length  + PARAMETER_TYPE_LENGTH + PARAMETER_LENGTH_IND_LENGTH,
4981                                            "Parameter: type %u",
4982                                            parameter_type);
4983       parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4984       proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, optional_parameters_tvb, offset, PARAMETER_TYPE_LENGTH, parameter_type, "Optional Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
4985       offset += PARAMETER_TYPE_LENGTH;
4986
4987           octet = tvb_get_guint8(optional_parameters_tvb,offset);
4988
4989       proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, optional_parameters_tvb, offset, PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length);
4990       offset += PARAMETER_LENGTH_IND_LENGTH;
4991           if ( octet == 0 )
4992                   continue;
4993
4994       actual_length = tvb_length_remaining(optional_parameters_tvb, offset);
4995       if (actual_length > 0){
4996                   parameter_tvb = tvb_new_subset(optional_parameters_tvb, offset, MIN(parameter_length, actual_length), parameter_length);
4997                   switch (parameter_type) {
4998                         case PARAM_TYPE_CALL_REF:
4999                                 dissect_isup_call_reference_parameter(parameter_tvb, parameter_tree, parameter_item);
5000                                 break;
5001                         case PARAM_TYPE_TRANSM_MEDIUM_REQU:
5002                                 dissect_isup_transmission_medium_requirement_parameter(parameter_tvb, parameter_tree, parameter_item);
5003                                 break;
5004                         case PARAM_TYPE_ACC_TRANSP:
5005                                 dissect_isup_access_transport_parameter(parameter_tvb, parameter_tree, parameter_item, pinfo);
5006                                 break;
5007                         case PARAM_TYPE_CALLED_PARTY_NR:
5008                                 dissect_isup_called_party_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5009                                 break;
5010                         case PARAM_TYPE_SUBSQT_NR:
5011                                 dissect_isup_subsequent_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5012                                 break;
5013                         case PARAM_TYPE_NATURE_OF_CONN_IND:
5014                                 dissect_isup_nature_of_connection_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5015                                 break;
5016                         case PARAM_TYPE_FORW_CALL_IND:
5017                                 dissect_isup_forward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5018                                 break;
5019                         case PARAM_TYPE_OPT_FORW_CALL_IND:
5020                                 dissect_isup_optional_forward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5021                                 break;
5022                         case PARAM_TYPE_CALLING_PRTY_CATEG:
5023                                 dissect_isup_calling_partys_category_parameter(parameter_tvb, parameter_tree, parameter_item);
5024                                 break;
5025                         case PARAM_TYPE_CALLING_PARTY_NR:
5026                                 dissect_isup_calling_party_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5027                                 break;
5028                         case PARAM_TYPE_REDIRECTING_NR:
5029                                 dissect_isup_redirecting_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5030                                 break;
5031                         case PARAM_TYPE_REDIRECTION_NR:
5032                                 dissect_isup_redirection_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5033                                 break;
5034                         case PARAM_TYPE_CONNECTION_REQ:
5035                                 dissect_isup_connection_request_parameter(parameter_tvb, parameter_tree, parameter_item);
5036                                 break;
5037                         case PARAM_TYPE_INFO_REQ_IND:
5038                                 dissect_isup_information_request_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5039                                 break;
5040                         case PARAM_TYPE_INFO_IND:
5041                                 dissect_isup_information_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5042                                 break;
5043                         case PARAM_TYPE_CONTINUITY_IND:
5044                                 dissect_isup_continuity_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5045                                 break;
5046                         case PARAM_TYPE_BACKW_CALL_IND:
5047                                 dissect_isup_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5048                                 break;
5049                         case PARAM_TYPE_CAUSE_INDICATORS:
5050                                 dissect_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5051                                 break;
5052                         case PARAM_TYPE_REDIRECTION_INFO:
5053                                 dissect_isup_redirection_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5054                                 break;
5055                         case PARAM_TYPE_CIRC_GRP_SV_MSG_TYPE:
5056                                 dissect_isup_circuit_group_supervision_message_type_parameter(parameter_tvb, parameter_tree, parameter_item);
5057                                 break;
5058                         case PARAM_TYPE_RANGE_AND_STATUS:
5059                                 dissect_isup_range_and_status_parameter(parameter_tvb, parameter_tree, parameter_item);
5060                                 break;
5061                         case PARAM_TYPE_FACILITY_IND:
5062                                 dissect_isup_facility_ind_parameter(parameter_tvb, parameter_item);
5063                                 break;
5064                         case PARAM_TYPE_CLSD_USR_GRP_ILOCK_CD:
5065                                 dissect_isup_closed_user_group_interlock_code_parameter(parameter_tvb, parameter_tree, parameter_item);
5066                                 break;
5067                         case PARAM_TYPE_USER_SERVICE_INFO:
5068                                 dissect_isup_user_service_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5069                                 break;
5070                         case PARAM_TYPE_SIGNALLING_POINT_CODE:
5071                                 dissect_isup_signalling_point_code_parameter(parameter_tvb, parameter_tree, parameter_item);
5072                                 break;
5073                         case PARAM_TYPE_USER_TO_USER_INFO:
5074                                 dissect_isup_user_to_user_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5075                                 break;
5076                         case PARAM_TYPE_CONNECTED_NR:
5077                                 dissect_isup_connected_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5078                                 break;
5079                         case PARAM_TYPE_SUSP_RESUME_IND:
5080                                 dissect_isup_suspend_resume_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5081                                 break;
5082                         case PARAM_TYPE_TRANSIT_NETW_SELECT:
5083                                 dissect_isup_transit_network_selection_parameter(parameter_tvb, parameter_tree, parameter_item);
5084                                 break;
5085                         case PARAM_TYPE_EVENT_INFO:
5086                                 dissect_isup_event_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5087                                 break;
5088                         case PARAM_TYPE_CIRC_ASSIGN_MAP:
5089                                 dissect_isup_circuit_assignment_map_parameter(parameter_tvb, parameter_tree, parameter_item);
5090                                 break;
5091                         case PARAM_TYPE_CIRC_STATE_IND:
5092                                 dissect_isup_circuit_state_ind_parameter(parameter_tvb, parameter_tree, parameter_item);
5093                                 break;
5094                         case PARAM_TYPE_AUTO_CONG_LEVEL:
5095                                 dissect_isup_automatic_congestion_level_parameter(parameter_tvb, parameter_tree, parameter_item);
5096                                 break;
5097                         case PARAM_TYPE_ORIG_CALLED_NR:
5098                                 dissect_isup_original_called_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5099                                 break;
5100                         case PARAM_TYPE_OPT_BACKW_CALL_IND:
5101                                 dissect_isup_optional_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5102                                 break;
5103                         case PARAM_TYPE_USER_TO_USER_IND:
5104                                 dissect_isup_user_to_user_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5105                                 break;
5106                         case PARAM_TYPE_ORIG_ISC_POINT_CODE:
5107                                 dissect_isup_original_isc_point_code_parameter(parameter_tvb, parameter_tree, parameter_item);
5108                                 break;
5109                         case PARAM_TYPE_GENERIC_NOTIF_IND:
5110                                 dissect_isup_generic_notification_indicator_parameter(parameter_tvb, parameter_tree, parameter_item);
5111                                 break;
5112                         case PARAM_TYPE_CALL_HIST_INFO :
5113                                 dissect_isup_call_history_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5114                                 break;
5115                         case PARAM_TYPE_ACC_DELIV_INFO:
5116                                 dissect_isup_access_delivery_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5117                                 break;
5118                         case PARAM_TYPE_NETW_SPECIFIC_FACLTY:
5119                                 dissect_isup_network_specific_facility_parameter(parameter_tvb, parameter_tree, parameter_item);
5120                                 break;
5121                         case PARAM_TYPE_USER_SERVICE_INFO_PR:
5122                                 dissect_isup_user_service_information_prime_parameter(parameter_tvb, parameter_tree, parameter_item);
5123                                 break;
5124                         case PARAM_TYPE_PROPAG_DELAY_COUNTER:
5125                                 dissect_isup_propagation_delay_counter_parameter(parameter_tvb, parameter_tree, parameter_item);
5126                                 break;
5127                         case PARAM_TYPE_REMOTE_OPERATIONS:
5128                                 dissect_isup_remote_operations_parameter(parameter_tvb, parameter_tree, parameter_item);
5129                                 break;
5130                         case PARAM_TYPE_SERVICE_ACTIVATION:
5131                                 dissect_isup_service_activation_parameter(parameter_tvb, parameter_tree, parameter_item);
5132                                 break;
5133                         case PARAM_TYPE_USER_TELESERV_INFO:
5134                                 dissect_isup_user_teleservice_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5135                                 break;
5136                         case PARAM_TYPE_TRANSM_MEDIUM_USED:
5137                                 dissect_isup_transmission_medium_used_parameter(parameter_tvb, parameter_tree, parameter_item);
5138                                 break;
5139                         case PARAM_TYPE_CALL_DIV_INFO:
5140                                 dissect_isup_call_diversion_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5141                                 break;
5142                         case PARAM_TYPE_ECHO_CTRL_INFO:
5143                                 dissect_isup_echo_control_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5144                                 break;
5145                         case PARAM_TYPE_MSG_COMPAT_INFO:
5146                                 dissect_isup_message_compatibility_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5147                                 break;
5148                         case PARAM_TYPE_PARAM_COMPAT_INFO:
5149                                 dissect_isup_parameter_compatibility_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5150                                 break;
5151                         case PARAM_TYPE_MLPP_PRECEDENCE:
5152                                 dissect_isup_mlpp_precedence_parameter(parameter_tvb, parameter_tree, parameter_item);
5153                                 break;
5154                         case PARAM_TYPE_MCID_REQ_IND:
5155                                 dissect_isup_mcid_request_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5156                                 break;
5157                         case PARAM_TYPE_MCID_RSP_IND:
5158                                 dissect_isup_mcid_response_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5159                                 break;
5160                         case PARAM_TYPE_HOP_COUNTER:
5161                                 dissect_isup_hop_counter_parameter(parameter_tvb, parameter_tree, parameter_item);
5162                                 break;
5163                         case PARAM_TYPE_TRANSM_MEDIUM_RQUR_PR:
5164                                 dissect_isup_transmission_medium_requirement_prime_parameter(parameter_tvb, parameter_tree, parameter_item);
5165                                 break;
5166                         case PARAM_TYPE_LOCATION_NR:
5167                                 dissect_isup_location_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5168                                 break;
5169                         case PARAM_TYPE_REDIR_NR_RSTRCT:
5170                                 dissect_isup_redirection_number_restriction_parameter(parameter_tvb, parameter_tree, parameter_item);
5171                                 break;
5172                         case PARAM_TYPE_CALL_TRANS_REF:
5173                                 dissect_isup_call_transfer_reference_parameter(parameter_tvb, parameter_tree, parameter_item);
5174                                 break;
5175                         case PARAM_TYPE_LOOP_PREV_IND:
5176                                 dissect_isup_loop_prevention_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5177                                 break;
5178                         case PARAM_TYPE_CALL_TRANS_NR:
5179                                 dissect_isup_call_transfer_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5180                                 break;
5181                         case PARAM_TYPE_CCSS:
5182                                 dissect_isup_ccss_parameter(parameter_tvb, parameter_tree, parameter_item);
5183                                 break;
5184                         case PARAM_TYPE_FORW_GVNS:
5185                                 dissect_isup_forward_gvns_parameter(parameter_tvb, parameter_tree, parameter_item);
5186                                 break;
5187                         case PARAM_TYPE_BACKW_GVNS:
5188                                 dissect_isup_backward_gvns_parameter(parameter_tvb, parameter_tree, parameter_item);
5189                                 break;
5190                         case PARAM_TYPE_REDIRECT_CAPAB:
5191                                 dissect_isup_redirect_capability_parameter(parameter_tvb, parameter_tree, parameter_item);
5192                                 break;
5193                         case PARAM_TYPE_NETW_MGMT_CTRL:
5194                                 dissect_isup_network_management_controls_parameter(parameter_tvb, parameter_tree, parameter_item);
5195                                 break;
5196                         case PARAM_TYPE_CORRELATION_ID:
5197                                 dissect_isup_correlation_id_parameter(parameter_tvb, parameter_tree, parameter_item);
5198                                 break;
5199                         case PARAM_TYPE_SCF_ID:
5200                                 dissect_isup_scf_id_parameter(parameter_tvb, parameter_tree, parameter_item);
5201                                 break;
5202                         case PARAM_TYPE_CALL_DIV_TREAT_IND:
5203                                 dissect_isup_call_diversion_treatment_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5204                                 break;
5205                         case PARAM_TYPE_CALLED_IN_NR:
5206                                 dissect_isup_called_in_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5207                                 break;
5208                         case PARAM_TYPE_CALL_OFF_TREAT_IND:
5209                                 dissect_isup_call_offering_treatment_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5210                                 break;
5211                         case PARAM_TYPE_CHARGED_PARTY_IDENT:
5212                                 dissect_isup_charged_party_identification_parameter(parameter_tvb, parameter_tree, parameter_item);
5213                                 break;
5214                         case PARAM_TYPE_CONF_TREAT_IND:
5215                                 dissect_isup_conference_treatment_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5216                                 break;
5217                         case PARAM_TYPE_DISPLAY_INFO:
5218                                 dissect_isup_display_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5219                                 break;
5220                         case PARAM_TYPE_UID_ACTION_IND:
5221                                 dissect_isup_uid_action_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5222                                 break;
5223                         case PARAM_TYPE_UID_CAPAB_IND:
5224                                 dissect_isup_uid_capability_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5225                                 break;
5226                         case PARAM_TYPE_REDIRECT_COUNTER:
5227                                 dissect_isup_redirect_counter_parameter(parameter_tvb, parameter_tree, parameter_item);
5228                                 break;
5229                         case PARAM_TYPE_COLLECT_CALL_REQ:
5230                                 dissect_isup_collect_call_request_parameter(parameter_tvb, parameter_tree, parameter_item);
5231                                 break;
5232                         case PARAM_TYPE_GENERIC_NR:
5233                                 dissect_isup_generic_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5234                                 break;
5235                         case PARAM_TYPE_GENERIC_DIGITS:
5236                                 dissect_isup_generic_digits_parameter(parameter_tvb, parameter_tree, parameter_item);
5237                                 break;
5238                         case PARAM_TYPE_APPLICATON_TRANS:
5239                                 dissect_isup_application_transport_parameter(parameter_tvb, pinfo, parameter_tree, parameter_item);
5240                                 break;
5241
5242                         default:
5243                                 dissect_isup_unknown_parameter(parameter_tvb, parameter_item);
5244                                 break;
5245                         }
5246
5247
5248                         offset += MIN(parameter_length, actual_length);
5249                 }
5250
5251          }
5252     else {
5253                 /* End of optional parameters is reached */
5254                 proto_tree_add_uint_format(isup_tree, hf_isup_parameter_type, optional_parameters_tvb , offset, PARAMETER_TYPE_LENGTH, parameter_type, "End of optional parameters (%u)", parameter_type);
5255     }
5256   }
5257 }
5258
5259 /* ------------------------------------------------------------------
5260   Dissector all ANSI optional parameters
5261   TODO: Actullay make this dissect ANSI :) - It's still plain old ITU for now
5262 */
5263 static void
5264 dissect_ansi_isup_optional_parameter(tvbuff_t *optional_parameters_tvb,packet_info *pinfo, proto_tree *isup_tree)
5265 { proto_item* parameter_item;
5266   proto_tree* parameter_tree;
5267   gint offset = 0;
5268   guint parameter_type, parameter_length, actual_length;
5269   tvbuff_t *parameter_tvb;
5270   guint8 octet;
5271
5272   /* Dissect all optional parameters while end of message isn't reached */
5273   parameter_type = 0xFF; /* Start-initializiation since parameter_type is used for while-condition */
5274
5275   while ((tvb_length_remaining(optional_parameters_tvb, offset)  >= 1) && (parameter_type != PARAM_TYPE_END_OF_OPT_PARAMS)){
5276     parameter_type = tvb_get_guint8(optional_parameters_tvb, offset);
5277
5278     if (parameter_type != PARAM_TYPE_END_OF_OPT_PARAMS){
5279       parameter_length = tvb_get_guint8(optional_parameters_tvb, offset + PARAMETER_TYPE_LENGTH);
5280
5281       parameter_item = proto_tree_add_text(isup_tree, optional_parameters_tvb,
5282                                            offset,
5283                                            parameter_length  + PARAMETER_TYPE_LENGTH + PARAMETER_LENGTH_IND_LENGTH,
5284                                            "Parameter: type %u",
5285                                            parameter_type);
5286       parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5287       proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, optional_parameters_tvb, offset, PARAMETER_TYPE_LENGTH, parameter_type, "Optional Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, ansi_isup_parameter_type_value,"unknown"));
5288       offset += PARAMETER_TYPE_LENGTH;
5289
5290           octet = tvb_get_guint8(optional_parameters_tvb,offset);
5291
5292       proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, optional_parameters_tvb, offset, PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length);
5293       offset += PARAMETER_LENGTH_IND_LENGTH;
5294           if ( octet == 0 )
5295                   continue;
5296
5297       actual_length = tvb_length_remaining(optional_parameters_tvb, offset);
5298       if (actual_length > 0){
5299                   parameter_tvb = tvb_new_subset(optional_parameters_tvb, offset, MIN(parameter_length, actual_length), parameter_length);
5300                   switch (parameter_type) {
5301                         case PARAM_TYPE_CALL_REF:
5302                                 dissect_isup_call_reference_parameter(parameter_tvb, parameter_tree, parameter_item);
5303                                 break;
5304                         case PARAM_TYPE_TRANSM_MEDIUM_REQU:
5305                                 dissect_isup_transmission_medium_requirement_parameter(parameter_tvb, parameter_tree, parameter_item);
5306                                 break;
5307                         case PARAM_TYPE_ACC_TRANSP:
5308                                 dissect_isup_access_transport_parameter(parameter_tvb, parameter_tree, parameter_item, pinfo);
5309                                 break;
5310                         case PARAM_TYPE_CALLED_PARTY_NR:
5311                                 dissect_isup_called_party_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5312                                 break;
5313                         case PARAM_TYPE_SUBSQT_NR:
5314                                 dissect_isup_subsequent_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5315                                 break;
5316                         case PARAM_TYPE_NATURE_OF_CONN_IND:
5317                                 dissect_isup_nature_of_connection_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5318                                 break;
5319                         case PARAM_TYPE_FORW_CALL_IND:
5320                                 dissect_isup_forward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5321                                 break;
5322                         case PARAM_TYPE_OPT_FORW_CALL_IND:
5323                                 dissect_isup_optional_forward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5324                                 break;
5325                         case PARAM_TYPE_CALLING_PRTY_CATEG:
5326                                 dissect_isup_calling_partys_category_parameter(parameter_tvb, parameter_tree, parameter_item);
5327                                 break;
5328                         case PARAM_TYPE_CALLING_PARTY_NR:
5329                                 dissect_isup_calling_party_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5330                                 break;
5331                         case PARAM_TYPE_REDIRECTING_NR:
5332                                 dissect_isup_redirecting_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5333                                 break;
5334                         case PARAM_TYPE_REDIRECTION_NR:
5335                                 dissect_isup_redirection_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5336                                 break;
5337                         case PARAM_TYPE_CONNECTION_REQ:
5338                                 dissect_isup_connection_request_parameter(parameter_tvb, parameter_tree, parameter_item);
5339                                 break;
5340                         case PARAM_TYPE_INFO_REQ_IND:
5341                                 dissect_isup_information_request_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5342                                 break;
5343                         case PARAM_TYPE_INFO_IND:
5344                                 dissect_isup_information_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5345                                 break;
5346                         case PARAM_TYPE_CONTINUITY_IND:
5347                                 dissect_isup_continuity_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5348                                 break;
5349                         case PARAM_TYPE_BACKW_CALL_IND:
5350                                 dissect_isup_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5351                                 break;
5352                         case PARAM_TYPE_CAUSE_INDICATORS:
5353                                 dissect_ansi_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5354                                 break;
5355                         case PARAM_TYPE_REDIRECTION_INFO:
5356                                 dissect_isup_redirection_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5357                                 break;
5358                         case PARAM_TYPE_CIRC_GRP_SV_MSG_TYPE:
5359                                 dissect_isup_circuit_group_supervision_message_type_parameter(parameter_tvb, parameter_tree, parameter_item);
5360                                 break;
5361                         case PARAM_TYPE_RANGE_AND_STATUS:
5362                                 dissect_isup_range_and_status_parameter(parameter_tvb, parameter_tree, parameter_item);
5363                                 break;
5364                         case PARAM_TYPE_FACILITY_IND:
5365                                 dissect_isup_facility_ind_parameter(parameter_tvb, parameter_item);
5366                                 break;
5367                         case PARAM_TYPE_CLSD_USR_GRP_ILOCK_CD:
5368                                 dissect_isup_closed_user_group_interlock_code_parameter(parameter_tvb, parameter_tree, parameter_item);
5369                                 break;
5370                         case PARAM_TYPE_USER_SERVICE_INFO:
5371                                 dissect_isup_user_service_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5372                                 break;
5373                         case PARAM_TYPE_SIGNALLING_POINT_CODE:
5374                                 dissect_isup_signalling_point_code_parameter(parameter_tvb, parameter_tree, parameter_item);
5375                                 break;
5376                         case PARAM_TYPE_USER_TO_USER_INFO:
5377                                 dissect_isup_user_to_user_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5378                                 break;
5379                         case PARAM_TYPE_CONNECTED_NR:
5380                                 dissect_isup_connected_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5381                                 break;
5382                         case PARAM_TYPE_SUSP_RESUME_IND:
5383                                 dissect_isup_suspend_resume_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5384                                 break;
5385                         case PARAM_TYPE_TRANSIT_NETW_SELECT:
5386                                 dissect_isup_transit_network_selection_parameter(parameter_tvb, parameter_tree, parameter_item);
5387                                 break;
5388                         case PARAM_TYPE_EVENT_INFO:
5389                                 dissect_isup_event_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5390                                 break;
5391                         case PARAM_TYPE_CIRC_ASSIGN_MAP:
5392                                 dissect_isup_circuit_assignment_map_parameter(parameter_tvb, parameter_tree, parameter_item);
5393                                 break;
5394                         case PARAM_TYPE_CIRC_STATE_IND:
5395                                 dissect_isup_circuit_state_ind_parameter(parameter_tvb, parameter_tree, parameter_item);
5396                                 break;
5397                         case PARAM_TYPE_AUTO_CONG_LEVEL:
5398                                 dissect_isup_automatic_congestion_level_parameter(parameter_tvb, parameter_tree, parameter_item);
5399                                 break;
5400                         case PARAM_TYPE_ORIG_CALLED_NR:
5401                                 dissect_isup_original_called_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5402                                 break;
5403                         case PARAM_TYPE_OPT_BACKW_CALL_IND:
5404                                 dissect_isup_optional_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5405                                 break;
5406                         case PARAM_TYPE_USER_TO_USER_IND:
5407                                 dissect_isup_user_to_user_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5408                                 break;
5409                         case PARAM_TYPE_ORIG_ISC_POINT_CODE:
5410                                 dissect_isup_original_isc_point_code_parameter(parameter_tvb, parameter_tree, parameter_item);
5411                                 break;
5412                         case PARAM_TYPE_GENERIC_NOTIF_IND:
5413                                 dissect_isup_generic_notification_indicator_parameter(parameter_tvb, parameter_tree, parameter_item);
5414                                 break;
5415                         case PARAM_TYPE_CALL_HIST_INFO :
5416                                 dissect_isup_call_history_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5417                                 break;
5418                         case PARAM_TYPE_ACC_DELIV_INFO:
5419                                 dissect_isup_access_delivery_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5420                                 break;
5421                         case PARAM_TYPE_NETW_SPECIFIC_FACLTY:
5422                                 dissect_isup_network_specific_facility_parameter(parameter_tvb, parameter_tree, parameter_item);
5423                                 break;
5424                         case PARAM_TYPE_USER_SERVICE_INFO_PR:
5425                                 dissect_isup_user_service_information_prime_parameter(parameter_tvb, parameter_tree, parameter_item);
5426                                 break;
5427                         case PARAM_TYPE_PROPAG_DELAY_COUNTER:
5428                                 dissect_isup_propagation_delay_counter_parameter(parameter_tvb, parameter_tree, parameter_item);
5429                                 break;
5430                         case PARAM_TYPE_REMOTE_OPERATIONS:
5431                                 dissect_isup_remote_operations_parameter(parameter_tvb, parameter_tree, parameter_item);
5432                                 break;
5433                         case PARAM_TYPE_SERVICE_ACTIVATION:
5434                                 dissect_isup_service_activation_parameter(parameter_tvb, parameter_tree, parameter_item);
5435                                 break;
5436                         case PARAM_TYPE_USER_TELESERV_INFO:
5437                                 dissect_isup_user_teleservice_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5438                                 break;
5439                         case PARAM_TYPE_TRANSM_MEDIUM_USED:
5440                                 dissect_isup_transmission_medium_used_parameter(parameter_tvb, parameter_tree, parameter_item);
5441                                 break;
5442                         case PARAM_TYPE_CALL_DIV_INFO:
5443                                 dissect_isup_call_diversion_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5444                                 break;
5445                         case PARAM_TYPE_ECHO_CTRL_INFO:
5446                                 dissect_isup_echo_control_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5447                                 break;
5448                         case PARAM_TYPE_MSG_COMPAT_INFO:
5449                                 dissect_isup_message_compatibility_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5450                                 break;
5451                         case PARAM_TYPE_PARAM_COMPAT_INFO:
5452                                 dissect_isup_parameter_compatibility_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5453                                 break;
5454                         case PARAM_TYPE_MLPP_PRECEDENCE:
5455                                 dissect_isup_mlpp_precedence_parameter(parameter_tvb, parameter_tree, parameter_item);
5456                                 break;
5457                         case PARAM_TYPE_MCID_REQ_IND:
5458                                 dissect_isup_mcid_request_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5459                                 break;
5460                         case PARAM_TYPE_MCID_RSP_IND:
5461                                 dissect_isup_mcid_response_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5462                                 break;
5463                         case PARAM_TYPE_HOP_COUNTER:
5464                                 dissect_isup_hop_counter_parameter(parameter_tvb, parameter_tree, parameter_item);
5465                                 break;
5466                         case PARAM_TYPE_TRANSM_MEDIUM_RQUR_PR:
5467                                 dissect_isup_transmission_medium_requirement_prime_parameter(parameter_tvb, parameter_tree, parameter_item);
5468                                 break;
5469                         case PARAM_TYPE_LOCATION_NR:
5470                                 dissect_isup_location_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5471                                 break;
5472                         case PARAM_TYPE_REDIR_NR_RSTRCT:
5473                                 dissect_isup_redirection_number_restriction_parameter(parameter_tvb, parameter_tree, parameter_item);
5474                                 break;
5475                         case PARAM_TYPE_CALL_TRANS_REF:
5476                                 dissect_isup_call_transfer_reference_parameter(parameter_tvb, parameter_tree, parameter_item);
5477                                 break;
5478                         case PARAM_TYPE_LOOP_PREV_IND:
5479                                 dissect_isup_loop_prevention_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5480                                 break;
5481                         case PARAM_TYPE_CALL_TRANS_NR:
5482                                 dissect_isup_call_transfer_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5483                                 break;
5484                         case PARAM_TYPE_CCSS:
5485                                 dissect_isup_ccss_parameter(parameter_tvb, parameter_tree, parameter_item);
5486                                 break;
5487                         case PARAM_TYPE_FORW_GVNS:
5488                                 dissect_isup_forward_gvns_parameter(parameter_tvb, parameter_tree, parameter_item);
5489                                 break;
5490                         case PARAM_TYPE_BACKW_GVNS:
5491                                 dissect_isup_backward_gvns_parameter(parameter_tvb, parameter_tree, parameter_item);
5492                                 break;
5493                         case PARAM_TYPE_REDIRECT_CAPAB:
5494                                 dissect_isup_redirect_capability_parameter(parameter_tvb, parameter_tree, parameter_item);
5495                                 break;
5496                         case PARAM_TYPE_NETW_MGMT_CTRL:
5497                                 dissect_isup_network_management_controls_parameter(parameter_tvb, parameter_tree, parameter_item);
5498                                 break;
5499                         case PARAM_TYPE_CORRELATION_ID:
5500                                 dissect_isup_correlation_id_parameter(parameter_tvb, parameter_tree, parameter_item);
5501                                 break;
5502                         case PARAM_TYPE_SCF_ID:
5503                                 dissect_isup_scf_id_parameter(parameter_tvb, parameter_tree, parameter_item);
5504                                 break;
5505                         case PARAM_TYPE_CALL_DIV_TREAT_IND:
5506                                 dissect_isup_call_diversion_treatment_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5507                                 break;
5508                         case PARAM_TYPE_CALLED_IN_NR:
5509                                 dissect_isup_called_in_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5510                                 break;
5511                         case PARAM_TYPE_CALL_OFF_TREAT_IND:
5512                                 dissect_isup_call_offering_treatment_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5513                                 break;
5514                         case PARAM_TYPE_CHARGED_PARTY_IDENT:
5515                                 dissect_isup_charged_party_identification_parameter(parameter_tvb, parameter_tree, parameter_item);
5516                                 break;
5517                         case PARAM_TYPE_CONF_TREAT_IND:
5518                                 dissect_isup_conference_treatment_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5519                                 break;
5520                         case PARAM_TYPE_DISPLAY_INFO:
5521                                 dissect_isup_display_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5522                                 break;
5523                         case PARAM_TYPE_UID_ACTION_IND:
5524                                 dissect_isup_uid_action_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5525                                 break;
5526                         case PARAM_TYPE_UID_CAPAB_IND:
5527                                 dissect_isup_uid_capability_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5528                                 break;
5529                         case PARAM_TYPE_REDIRECT_COUNTER:
5530                                 dissect_isup_redirect_counter_parameter(parameter_tvb, parameter_tree, parameter_item);
5531                                 break;
5532                         case PARAM_TYPE_COLLECT_CALL_REQ:
5533                                 dissect_isup_collect_call_request_parameter(parameter_tvb, parameter_tree, parameter_item);
5534                                 break;
5535                         case PARAM_TYPE_GENERIC_NR:
5536                                 dissect_isup_generic_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5537                                 break;
5538                         case PARAM_TYPE_GENERIC_DIGITS:
5539                                 dissect_isup_generic_digits_parameter(parameter_tvb, parameter_tree, parameter_item);
5540                                 break;
5541                         case PARAM_TYPE_APPLICATON_TRANS:
5542                                 dissect_isup_application_transport_parameter(parameter_tvb, pinfo, parameter_tree, parameter_item);
5543                                 break;
5544
5545                         default:
5546                                 dissect_isup_unknown_parameter(parameter_tvb, parameter_item);
5547                                 break;
5548                         }
5549
5550
5551                         offset += MIN(parameter_length, actual_length);
5552                 }
5553
5554          }
5555     else {
5556                 /* End of optional parameters is reached */
5557                 proto_tree_add_uint_format(isup_tree, hf_isup_parameter_type, optional_parameters_tvb , offset, PARAMETER_TYPE_LENGTH, parameter_type, "End of optional parameters (%u)", parameter_type);
5558     }
5559   }
5560 }
5561 /* ------------------------------------------------------------------ */
5562 /* Dissectors for all used message types                              */
5563 /* Called by dissect_isup_message(),                                  */
5564 /* call parameter dissectors in order of mandatory parameters         */
5565 /* (since not labeled)                                                */
5566 /* ------------------------------------------------------------------
5567   Dissector Message Type Circuit Validation Test Response
5568  */
5569 static gint
5570 dissect_ansi_isup_circuit_validation_test_resp_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
5571 {
5572   proto_item* parameter_item;
5573   proto_tree* parameter_tree;
5574   tvbuff_t *parameter_tvb;
5575   gint offset = 0;
5576   gint parameter_type,actual_length;
5577
5578   /* Do stuff for first mandatory fixed parameter: CVR Repsonse Indicator */
5579   parameter_type = ANSI_ISUP_PARAM_TYPE_CVR_RESP_IND;
5580   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset, CVR_RESP_IND_LENGTH, "CVR Reponse Indicator");
5581
5582   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5583   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"CVR Reponse Indicator"));
5584
5585   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5586
5587   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CVR_RESP_IND_LENGTH, actual_length), CVR_RESP_IND_LENGTH);
5588   dissect_isup_cvr_response_ind_parameter(parameter_tvb, parameter_tree, parameter_item);
5589   offset += CVR_RESP_IND_LENGTH;
5590
5591   /* Do stuff for second mandatory fixed parameter: CG Characterstics Indicator */
5592   parameter_type = ANSI_ISUP_PARAM_TYPE_CG_CHAR_IND;
5593   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
5594                                                                            CG_CHAR_IND_LENGTH,
5595                                                                        "Circuit Group Characterstics Indicators");
5596   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5597   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"Circuit Group Characters"));
5598   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5599   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CG_CHAR_IND_LENGTH, actual_length), CG_CHAR_IND_LENGTH);
5600   dissect_isup_circuit_group_char_ind_parameter(parameter_tvb, parameter_tree, parameter_item);
5601   offset += CG_CHAR_IND_LENGTH;
5602
5603   return offset;
5604 }
5605 /* ------------------------------------------------------------------
5606   Dissector Message Type Circuit Reservation
5607  */
5608 static gint
5609 dissect_ansi_isup_circuit_reservation_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
5610 { proto_item* parameter_item;
5611   proto_tree* parameter_tree;
5612   tvbuff_t *parameter_tvb;
5613   gint offset = 0;
5614   gint parameter_type, actual_length;
5615
5616   /* Do stuff for mandatory fixed parameter: Nature of Connection Indicators */
5617   parameter_type = PARAM_TYPE_NATURE_OF_CONN_IND;
5618   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
5619                                        NATURE_OF_CONNECTION_IND_LENGTH,
5620                                        "Nature of Connection Indicators");
5621   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5622   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
5623   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5624   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(NATURE_OF_CONNECTION_IND_LENGTH, actual_length), NATURE_OF_CONNECTION_IND_LENGTH);
5625   dissect_isup_nature_of_connection_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5626   offset += NATURE_OF_CONNECTION_IND_LENGTH;
5627
5628   return offset;
5629 }
5630 /* ------------------------------------------------------------------
5631   Dissector Message Type Initial address message
5632  */
5633 static gint
5634 dissect_isup_initial_address_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
5635 { proto_item* parameter_item;
5636   proto_tree* parameter_tree;
5637   tvbuff_t *parameter_tvb;
5638   gint offset = 0;
5639   gint parameter_type, parameter_pointer, parameter_length, actual_length;
5640
5641   /* Do stuff for first mandatory fixed parameter: Nature of Connection Indicators */
5642   parameter_type = PARAM_TYPE_NATURE_OF_CONN_IND;
5643   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
5644                                        NATURE_OF_CONNECTION_IND_LENGTH,
5645                                        "Nature of Connection Indicators");
5646   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5647   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
5648   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5649   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(NATURE_OF_CONNECTION_IND_LENGTH, actual_length), NATURE_OF_CONNECTION_IND_LENGTH);
5650   dissect_isup_nature_of_connection_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5651   offset += NATURE_OF_CONNECTION_IND_LENGTH;
5652
5653   /* Do stuff for 2nd mandatory fixed parameter: Forward Call Indicators */
5654   parameter_type =  PARAM_TYPE_FORW_CALL_IND;
5655   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
5656                                        FORWARD_CALL_IND_LENGTH,
5657                                        "Forward Call Indicators");
5658   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5659   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
5660   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5661   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(FORWARD_CALL_IND_LENGTH, actual_length), FORWARD_CALL_IND_LENGTH );
5662   dissect_isup_forward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5663   offset +=  FORWARD_CALL_IND_LENGTH;
5664
5665   /* Do stuff for 3nd mandatory fixed parameter: Calling party's category */
5666   parameter_type = PARAM_TYPE_CALLING_PRTY_CATEG;
5667   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
5668                                        CALLING_PRTYS_CATEGORY_LENGTH,
5669                                        "Calling Party's category");
5670   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5671   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
5672   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5673   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CALLING_PRTYS_CATEGORY_LENGTH, actual_length),CALLING_PRTYS_CATEGORY_LENGTH );
5674   dissect_isup_calling_partys_category_parameter(parameter_tvb, parameter_tree, parameter_item);
5675   offset += CALLING_PRTYS_CATEGORY_LENGTH;
5676
5677   /* Do stuff for 4th mandatory fixed parameter: Transmission medium requirement */
5678   parameter_type = PARAM_TYPE_TRANSM_MEDIUM_REQU;
5679   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
5680                                        TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH,
5681                                        "Transmission medium requirement");
5682   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5683   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
5684   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5685   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH, actual_length), TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH);
5686   dissect_isup_transmission_medium_requirement_parameter(parameter_tvb, parameter_tree, parameter_item);
5687   offset += TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH;
5688
5689
5690   /* Do stuff for mandatory variable parameter Called party number */
5691   parameter_type = PARAM_TYPE_CALLED_PARTY_NR;
5692   parameter_pointer = tvb_get_guint8(message_tvb, offset);
5693   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
5694
5695   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
5696                                        offset +  parameter_pointer,
5697                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
5698                                        "Called Party Number");
5699   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5700   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
5701   proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer);
5702   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length);
5703   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5704   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
5705   dissect_isup_called_party_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5706   offset += PARAMETER_POINTER_LENGTH;
5707
5708   return offset;
5709 }
5710 /* ------------------------------------------------------------------
5711   Dissector Message Type subsequent address message
5712  */
5713 static gint dissect_isup_subsequent_address_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
5714 { proto_item* parameter_item;
5715   proto_tree* parameter_tree;
5716   tvbuff_t *parameter_tvb;
5717   gint offset = 0;
5718   gint parameter_type, parameter_pointer, parameter_length, actual_length;
5719
5720   /* Do stuff for mandatory variable parameter Subsequent number */
5721   parameter_type = PARAM_TYPE_SUBSQT_NR;
5722
5723   parameter_pointer = tvb_get_guint8(message_tvb, offset);
5724   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
5725
5726   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
5727                                        offset +  parameter_pointer,
5728                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
5729                                        "Subsequent Number");
5730   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5731   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
5732   proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer);
5733   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length);
5734   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5735   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
5736   dissect_isup_subsequent_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5737   offset += PARAMETER_POINTER_LENGTH;
5738
5739   return offset;
5740 }
5741
5742 /* ------------------------------------------------------------------
5743   Dissector Message Type Information request message
5744  */
5745 static gint
5746 dissect_isup_information_request_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
5747 { proto_item* parameter_item;
5748   proto_tree* parameter_tree;
5749   tvbuff_t *parameter_tvb;
5750   gint offset = 0;
5751   gint parameter_type, actual_length;
5752
5753   /* Do stuff for first mandatory fixed parameter: Information request indicators*/
5754   parameter_type = PARAM_TYPE_INFO_REQ_IND;
5755   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
5756                                        INFO_REQUEST_IND_LENGTH,
5757                                        "Information request indicators");
5758   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5759   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
5760   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5761   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(INFO_REQUEST_IND_LENGTH, actual_length), INFO_REQUEST_IND_LENGTH);
5762   dissect_isup_information_request_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5763   offset += INFO_REQUEST_IND_LENGTH;
5764   return offset;
5765 }
5766 /* ------------------------------------------------------------------
5767   Dissector Message Type Information
5768  */
5769 static gint
5770 dissect_isup_information_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
5771 { proto_item* parameter_item;
5772   proto_tree* parameter_tree;
5773   tvbuff_t *parameter_tvb;
5774   gint offset = 0;
5775   gint parameter_type, actual_length;
5776
5777   /* Do stuff for first mandatory fixed parameter: Information  indicators*/
5778   parameter_type = PARAM_TYPE_INFO_IND;
5779   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
5780                                        INFO_IND_LENGTH,
5781                                        "Information indicators");
5782   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5783   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
5784   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5785   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(INFO_IND_LENGTH, actual_length), INFO_IND_LENGTH);
5786   dissect_isup_information_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5787   offset += INFO_IND_LENGTH;
5788   return offset;
5789 }
5790 /* ------------------------------------------------------------------
5791   Dissector Message Type Continuity
5792  */
5793 static gint
5794 dissect_isup_continuity_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
5795 { proto_item* parameter_item;
5796   proto_tree* parameter_tree;
5797   tvbuff_t *parameter_tvb;
5798   gint offset = 0;
5799   gint parameter_type, actual_length;
5800
5801   /* Do stuff for first mandatory fixed parameter: Continuity indicators*/
5802   parameter_type = PARAM_TYPE_CONTINUITY_IND;
5803   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
5804                                        CONTINUITY_IND_LENGTH,
5805                                        "Continuity indicators");
5806   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5807   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
5808   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5809   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CONTINUITY_IND_LENGTH, actual_length), CONTINUITY_IND_LENGTH);
5810   dissect_isup_continuity_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5811   offset += CONTINUITY_IND_LENGTH;
5812   return offset;
5813 }
5814 /* ------------------------------------------------------------------
5815   Dissector Message Type Address complete
5816  */
5817 static gint
5818 dissect_isup_address_complete_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
5819 { proto_item* parameter_item;
5820   proto_tree* parameter_tree;
5821   tvbuff_t *parameter_tvb;
5822   gint offset = 0;
5823   gint parameter_type, actual_length;
5824
5825   /* Do stuff for first mandatory fixed parameter: backward call indicators*/
5826   parameter_type = PARAM_TYPE_BACKW_CALL_IND;
5827   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
5828                                        BACKWARD_CALL_IND_LENGTH,
5829                                        "Backward Call Indicators");
5830   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5831   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
5832   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5833   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(BACKWARD_CALL_IND_LENGTH, actual_length), BACKWARD_CALL_IND_LENGTH);
5834   dissect_isup_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5835   offset += BACKWARD_CALL_IND_LENGTH;
5836   return offset;
5837 }
5838 /* ------------------------------------------------------------------
5839   Dissector Message Type Connect
5840  */
5841 static gint
5842 dissect_isup_connect_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
5843 { proto_item* parameter_item;
5844   proto_tree* parameter_tree;
5845   tvbuff_t *parameter_tvb;
5846   gint offset = 0;
5847   gint parameter_type, actual_length;
5848
5849   /* Do stuff for first mandatory fixed parameter: backward call indicators*/
5850   parameter_type = PARAM_TYPE_BACKW_CALL_IND;
5851   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
5852                                        BACKWARD_CALL_IND_LENGTH,
5853                                        "Backward Call Indicators");
5854   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5855   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
5856   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5857   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(BACKWARD_CALL_IND_LENGTH, actual_length), BACKWARD_CALL_IND_LENGTH);
5858   dissect_isup_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5859   offset += BACKWARD_CALL_IND_LENGTH;
5860   return offset;
5861 }
5862 /* ------------------------------------------------------------------
5863   Dissector Message Type release message
5864  */
5865 static gint
5866 dissect_isup_release_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
5867 { proto_item* parameter_item;
5868   proto_tree* parameter_tree;
5869   tvbuff_t *parameter_tvb;
5870   gint offset = 0;
5871   gint parameter_type, parameter_pointer, parameter_length, actual_length;
5872
5873   /* Do stuff for mandatory variable parameter Cause indicators */
5874   parameter_type =  PARAM_TYPE_CAUSE_INDICATORS;
5875
5876   parameter_pointer = tvb_get_guint8(message_tvb, offset);
5877   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
5878
5879   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
5880                                        offset +  parameter_pointer,
5881                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
5882                                        "Cause indicators, see Q.850");
5883   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5884   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
5885   proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer);
5886   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length);
5887   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5888   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
5889   switch (isup_standard){
5890   case ITU_STANDARD:
5891           dissect_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5892           break;
5893   case ANSI_STANDARD:
5894           dissect_ansi_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5895           break;
5896   }
5897   offset += PARAMETER_POINTER_LENGTH;
5898
5899   return offset;
5900 }
5901 /* ------------------------------------------------------------------
5902   Dissector Message Type Resume/Suspend
5903  */
5904 static gint
5905 dissect_isup_suspend_resume_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
5906 { proto_item* parameter_item;
5907   proto_tree* parameter_tree;
5908   tvbuff_t *parameter_tvb;
5909   gint offset = 0;
5910   gint parameter_type, actual_length;
5911
5912   /* Do stuff for first mandatory fixed parameter: backward call indicators*/
5913   parameter_type = PARAM_TYPE_SUSP_RESUME_IND;
5914   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
5915                                        SUSPEND_RESUME_IND_LENGTH,
5916                                        "Suspend/Resume indicator");
5917   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5918   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
5919   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5920   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(SUSPEND_RESUME_IND_LENGTH, actual_length), SUSPEND_RESUME_IND_LENGTH);
5921   dissect_isup_suspend_resume_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5922   offset += SUSPEND_RESUME_IND_LENGTH;
5923   return offset;
5924 }
5925 /* ------------------------------------------------------------------
5926   Dissector Message Type Circuit group reset/query message
5927  */
5928 static gint
5929 dissect_isup_circuit_group_reset_query_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
5930 { proto_item* parameter_item;
5931   proto_tree* parameter_tree;
5932   tvbuff_t *parameter_tvb;
5933   gint offset = 0;
5934   gint parameter_type, parameter_pointer, parameter_length, actual_length;
5935
5936   /* Do stuff for mandatory variable parameter range and status*/
5937   parameter_type =  PARAM_TYPE_RANGE_AND_STATUS;
5938
5939   parameter_pointer = tvb_get_guint8(message_tvb, offset);
5940   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
5941
5942   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
5943                                        offset +  parameter_pointer,
5944                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
5945                                        "Range and status");
5946   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5947   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
5948   proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer);
5949   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length);
5950   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5951   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
5952   dissect_isup_range_and_status_parameter(parameter_tvb, parameter_tree, parameter_item);
5953   offset += PARAMETER_POINTER_LENGTH;
5954
5955   return offset;
5956 }
5957 /* ------------------------------------------------------------------
5958   Dissector Message Type Circuit group blocking/blocking ack/unblocking/unblocking ack messages
5959  */
5960 static gint
5961 dissect_isup_circuit_group_blocking_messages(tvbuff_t *message_tvb, proto_tree *isup_tree)
5962 { proto_item* parameter_item;
5963   proto_tree* parameter_tree;
5964   tvbuff_t *parameter_tvb;
5965   gint offset = 0;
5966   gint parameter_type, parameter_pointer, parameter_length, actual_length;
5967
5968    /* Do stuff for first mandatory fixed parameter: circuit group supervision message type*/
5969   parameter_type = PARAM_TYPE_CIRC_GRP_SV_MSG_TYPE;
5970   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
5971                                        CIRC_GRP_SV_MSG_TYPE_LENGTH,
5972                                        "Circuit group supervision message type");
5973   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5974   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
5975   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5976   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CIRC_GRP_SV_MSG_TYPE_LENGTH, actual_length), CIRC_GRP_SV_MSG_TYPE_LENGTH);
5977   dissect_isup_circuit_group_supervision_message_type_parameter(parameter_tvb, parameter_tree, parameter_item);
5978   offset += CIRC_GRP_SV_MSG_TYPE_LENGTH;
5979
5980   /* Do stuff for mandatory variable parameter range and status*/
5981   parameter_type =  PARAM_TYPE_RANGE_AND_STATUS;
5982
5983   parameter_pointer = tvb_get_guint8(message_tvb, offset);
5984   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
5985
5986   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
5987                                        offset +  parameter_pointer,
5988                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
5989                                        "Range and status");
5990   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5991   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
5992   proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer);
5993   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length);
5994   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5995   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
5996   dissect_isup_range_and_status_parameter(parameter_tvb, parameter_tree, parameter_item);
5997   offset += PARAMETER_POINTER_LENGTH;
5998
5999   return offset;
6000 }
6001
6002 /* ------------------------------------------------------------------
6003   Dissector Message Type Facility request/accepted
6004  */
6005 static gint
6006 dissect_isup_facility_request_accepted_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6007 { proto_item* parameter_item;
6008   proto_tree* parameter_tree;
6009   tvbuff_t *parameter_tvb;
6010   gint offset = 0;
6011   gint parameter_type, actual_length;
6012
6013   /* Do stuff for first mandatory fixed parameter: facility indicators*/
6014   parameter_type = PARAM_TYPE_FACILITY_IND;
6015   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
6016                                        FACILITY_IND_LENGTH,
6017                                        "Facility indicator");
6018   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6019   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
6020   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6021   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(FACILITY_IND_LENGTH, actual_length), FACILITY_IND_LENGTH);
6022   dissect_isup_facility_ind_parameter(parameter_tvb, parameter_item);
6023   offset += FACILITY_IND_LENGTH;
6024   return offset;
6025 }
6026 /* ------------------------------------------------------------------
6027   Dissector Message Type Facility reject
6028  */
6029 static gint
6030 dissect_isup_facility_reject_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6031 { proto_item* parameter_item;
6032   proto_tree* parameter_tree;
6033   tvbuff_t *parameter_tvb;
6034   gint offset = 0;
6035   gint parameter_type, parameter_pointer, parameter_length, actual_length;
6036
6037   /* Do stuff for first mandatory fixed parameter: facility indicators*/
6038   parameter_type = PARAM_TYPE_FACILITY_IND;
6039   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
6040                                        FACILITY_IND_LENGTH,
6041                                        "Facility indicator");
6042   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6043   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
6044   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6045   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(FACILITY_IND_LENGTH, actual_length), FACILITY_IND_LENGTH);
6046   dissect_isup_facility_ind_parameter(parameter_tvb, parameter_item);
6047   offset += FACILITY_IND_LENGTH;
6048
6049   /* Do stuff for mandatory variable parameter Cause indicators */
6050   parameter_type =  PARAM_TYPE_CAUSE_INDICATORS;
6051
6052   parameter_pointer = tvb_get_guint8(message_tvb, offset);
6053   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
6054
6055   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
6056                                        offset +  parameter_pointer,
6057                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
6058                                        "Cause indicators, see Q.850");
6059   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6060   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
6061   proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer);
6062   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length);
6063   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6064   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
6065   switch (isup_standard){
6066   case ITU_STANDARD:
6067           dissect_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
6068           break;
6069   case ANSI_STANDARD:
6070           dissect_ansi_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
6071           break;
6072   }
6073   offset += PARAMETER_POINTER_LENGTH;
6074
6075   return offset;
6076 }
6077 /* ------------------------------------------------------------------
6078   Dissector Message Type Circuit group reset acknowledgement message
6079  */
6080 static gint
6081 dissect_isup_circuit_group_reset_acknowledgement_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6082 { proto_item* parameter_item;
6083   proto_tree* parameter_tree;
6084   tvbuff_t *parameter_tvb;
6085   gint offset = 0;
6086   gint parameter_type, parameter_pointer, parameter_length, actual_length;
6087
6088   /* Do stuff for mandatory variable parameter range and status*/
6089   parameter_type =  PARAM_TYPE_RANGE_AND_STATUS;
6090
6091   parameter_pointer = tvb_get_guint8(message_tvb, offset);
6092   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
6093
6094   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
6095                                        offset +  parameter_pointer,
6096                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
6097                                        "Range and status");
6098   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6099   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
6100   proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer);
6101   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length);
6102   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6103   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
6104   dissect_isup_range_and_status_parameter(parameter_tvb, parameter_tree, parameter_item);
6105   offset += PARAMETER_POINTER_LENGTH;
6106
6107   return offset;
6108 }
6109 /* ------------------------------------------------------------------
6110   Dissector Message Type Circuit group query response message
6111  */
6112 static gint
6113 dissect_isup_circuit_group_query_response_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6114 { proto_item* parameter_item;
6115   proto_tree* parameter_tree;
6116   tvbuff_t *parameter_tvb;
6117   gint offset = 0;
6118   gint parameter_type, parameter_pointer, parameter_length, actual_length;
6119
6120   /* Do stuff for 1. mandatory variable parameter range and status*/
6121   parameter_type =  PARAM_TYPE_RANGE_AND_STATUS;
6122
6123   parameter_pointer = tvb_get_guint8(message_tvb, offset);
6124   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
6125
6126   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
6127                                        offset +  parameter_pointer,
6128                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
6129                                        "Range and status");
6130   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6131   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
6132   proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer);
6133   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length);
6134   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6135   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
6136   dissect_isup_range_and_status_parameter(parameter_tvb, parameter_tree, parameter_item);
6137   offset += PARAMETER_POINTER_LENGTH;
6138
6139   /* Do stuff for 2. mandatory variable parameter Circuit state indicator*/
6140   parameter_type = PARAM_TYPE_CIRC_STATE_IND;
6141
6142   parameter_pointer = tvb_get_guint8(message_tvb, offset);
6143   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
6144
6145   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
6146                                        offset +  parameter_pointer,
6147                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
6148                                        "Circuit state indicator (national use)");
6149   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6150   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
6151   proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer);
6152   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length);
6153   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6154   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
6155   dissect_isup_circuit_state_ind_parameter(parameter_tvb, parameter_tree, parameter_item);
6156   offset += PARAMETER_POINTER_LENGTH;
6157
6158   return offset;
6159 }
6160 /* ------------------------------------------------------------------
6161   Dissector Message Type Call Progress
6162 */
6163 static gint
6164 dissect_isup_call_progress_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6165 { proto_item* parameter_item;
6166   proto_tree* parameter_tree;
6167   tvbuff_t *parameter_tvb;
6168   gint offset = 0;
6169   gint parameter_type, actual_length;
6170
6171   /* Do stuff for first mandatory fixed parameter: Event information*/
6172   parameter_type = PARAM_TYPE_EVENT_INFO;
6173   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
6174                                        EVENT_INFO_LENGTH,
6175                                        "Event information");
6176   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6177   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
6178   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6179   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(EVENT_INFO_LENGTH, actual_length), EVENT_INFO_LENGTH);
6180   dissect_isup_event_information_parameter(parameter_tvb, parameter_tree, parameter_item);
6181   offset += EVENT_INFO_LENGTH;
6182   return offset;
6183 }
6184 /* ------------------------------------------------------------------
6185   Dissector Message Type User-to-User information
6186  */
6187 static gint
6188 dissect_isup_user_to_user_information_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6189 { proto_item* parameter_item;
6190   proto_tree* parameter_tree;
6191   tvbuff_t *parameter_tvb;
6192   gint offset = 0;
6193   gint parameter_type, parameter_pointer, parameter_length, actual_length;
6194
6195   /* Do stuff for mandatory variable parameter User-to-user information*/
6196   parameter_type =  PARAM_TYPE_USER_TO_USER_INFO;
6197
6198   parameter_pointer = tvb_get_guint8(message_tvb, offset);
6199   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
6200
6201   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
6202                                        offset +  parameter_pointer,
6203                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
6204                                        "User-to-user information, see Q.931");
6205   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6206   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
6207   proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer);
6208   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length);
6209   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6210   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
6211   dissect_isup_user_to_user_information_parameter(parameter_tvb, parameter_tree, parameter_item);
6212   offset += PARAMETER_POINTER_LENGTH;
6213
6214   return offset;
6215 }
6216 /* ------------------------------------------------------------------
6217   Dissector Message Type Confusion
6218  */
6219 static gint
6220 dissect_isup_confusion_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6221 { proto_item* parameter_item;
6222   proto_tree* parameter_tree;
6223   tvbuff_t *parameter_tvb;
6224   gint offset = 0;
6225   gint parameter_type, parameter_pointer, parameter_length, actual_length;
6226
6227   /* Do stuff for mandatory variable parameter Cause indicators */
6228   parameter_type =  PARAM_TYPE_CAUSE_INDICATORS;
6229
6230   parameter_pointer = tvb_get_guint8(message_tvb, offset);
6231   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
6232
6233   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
6234                                        offset +  parameter_pointer,
6235                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
6236                                        "Cause indicators, see Q.850");
6237   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6238   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_type, message_tvb, 0, 0, parameter_type, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str(parameter_type, isup_parameter_type_value,"unknown"));
6239   proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer);
6240   proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length);
6241   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6242   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
6243
6244   switch (isup_standard){
6245   case ITU_STANDARD:
6246           dissect_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
6247           break;
6248   case ANSI_STANDARD:
6249           dissect_ansi_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
6250           break;
6251   }
6252   offset += PARAMETER_POINTER_LENGTH;
6253
6254   return offset;
6255 }
6256 /* ------------------------------------------------------------------ */
6257 static void
6258 dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup_tree)
6259 {
6260   static isup_tap_rec_t tap_rec;
6261   tvbuff_t *parameter_tvb;
6262   tvbuff_t *optional_parameter_tvb;
6263   proto_item* pass_along_item;
6264   proto_tree* pass_along_tree;
6265   gint offset, bufferlength;
6266   guint8 message_type, opt_parameter_pointer;
6267   gint opt_part_possible = FALSE; /* default setting - for message types allowing optional
6268                                      params explicitely set to TRUE in case statement */
6269   tap_calling_number = NULL;
6270   offset = 0;
6271
6272   /* Extract message type field */
6273   message_type = tvb_get_guint8(message_tvb,0);
6274
6275   switch (isup_standard){
6276   case ITU_STANDARD:
6277           proto_tree_add_uint_format(isup_tree, hf_isup_message_type, message_tvb, 0, MESSAGE_TYPE_LENGTH, message_type, "Message type: %s (%u)", val_to_str(message_type, isup_message_type_value, "reserved"), message_type);
6278           break;
6279   case ANSI_STANDARD:
6280           proto_tree_add_uint_format(isup_tree, hf_isup_message_type, message_tvb, 0, MESSAGE_TYPE_LENGTH, message_type, "Message type: %s (%u)", val_to_str(message_type, ansi_isup_message_type_value, "reserved"), message_type);
6281           break;
6282   }
6283    offset +=  MESSAGE_TYPE_LENGTH;
6284
6285    tap_rec.message_type = message_type;
6286    tap_rec.calling_number = NULL;
6287    tap_rec.called_number = NULL;
6288
6289    parameter_tvb = tvb_new_subset(message_tvb, offset, -1, -1);
6290
6291    /* distinguish between message types:*/
6292         switch (isup_standard){
6293                 case ITU_STANDARD:
6294                         switch (message_type) {
6295                         case MESSAGE_TYPE_INITIAL_ADDR:
6296                                 offset += dissect_isup_initial_address_message(parameter_tvb, isup_tree);
6297                                 opt_part_possible = TRUE;
6298                                 break;
6299                         case MESSAGE_TYPE_SUBSEQ_ADDR:
6300                                 offset += dissect_isup_subsequent_address_message(parameter_tvb, isup_tree);
6301                                 opt_part_possible = TRUE;
6302                                 break;
6303                         case MESSAGE_TYPE_INFO_REQ:
6304                                 offset += dissect_isup_information_request_message(parameter_tvb, isup_tree);
6305                                 opt_part_possible = TRUE;
6306                                 break;
6307                         case MESSAGE_TYPE_INFO:
6308                                 offset += dissect_isup_information_message(parameter_tvb, isup_tree);
6309                                 opt_part_possible = TRUE;
6310                                 break;
6311                         case MESSAGE_TYPE_CONTINUITY:
6312                                 offset += dissect_isup_continuity_message(parameter_tvb, isup_tree);
6313                                 break;
6314                         case MESSAGE_TYPE_ADDR_CMPL:
6315                                 offset += dissect_isup_address_complete_message(parameter_tvb, isup_tree);
6316                                 opt_part_possible = TRUE;
6317                                 break;
6318                         case MESSAGE_TYPE_CONNECT:
6319                                 offset += dissect_isup_connect_message(parameter_tvb, isup_tree);
6320                                 opt_part_possible = TRUE;
6321                                 break;
6322                         case MESSAGE_TYPE_FORW_TRANS:
6323                                 /* no dissector necessary since no mandatory parameters included */
6324                                 opt_part_possible = TRUE;
6325                                 break;
6326                         case MESSAGE_TYPE_ANSWER:
6327                                 /* no dissector necessary since no mandatory parameters included */
6328                                 opt_part_possible = TRUE;
6329                                 break;
6330                         case MESSAGE_TYPE_RELEASE:
6331                                 offset += dissect_isup_release_message(parameter_tvb, isup_tree);
6332                                 opt_part_possible = TRUE;
6333                                 break;
6334                         case MESSAGE_TYPE_SUSPEND:
6335                                 offset += dissect_isup_suspend_resume_message(parameter_tvb, isup_tree);
6336                                 opt_part_possible = TRUE;
6337                                 break;
6338                         case MESSAGE_TYPE_RESUME:
6339                                 offset += dissect_isup_suspend_resume_message(parameter_tvb, isup_tree);
6340                                 opt_part_possible = TRUE;
6341                                 break;
6342                         case MESSAGE_TYPE_REL_CMPL:
6343                                 /* no dissector necessary since no mandatory parameters included */
6344                                 opt_part_possible = TRUE;
6345                                 break;
6346                         case MESSAGE_TYPE_CONT_CHECK_REQ:
6347                                 /* no dissector necessary since no mandatory parameters included */
6348                                 break;
6349                         case MESSAGE_TYPE_RESET_CIRCUIT:
6350                                 /* no dissector necessary since no mandatory parameters included */
6351                                 break;
6352                         case MESSAGE_TYPE_BLOCKING:
6353                                 /* no dissector necessary since no mandatory parameters included */
6354                                 break;
6355                         case MESSAGE_TYPE_UNBLOCKING:
6356                                 /* no dissector necessary since no mandatory parameters included */
6357                                 break;
6358                         case MESSAGE_TYPE_BLOCK_ACK:
6359                                 /* no dissector necessary since no mandatory parameters included */
6360                                 break;
6361                         case MESSAGE_TYPE_UNBLOCK_ACK:
6362                                 /* no dissector necessary since no mandatory parameters included */
6363                                 break;
6364                         case MESSAGE_TYPE_CIRC_GRP_RST:
6365                                 offset += dissect_isup_circuit_group_reset_query_message(parameter_tvb, isup_tree);
6366                                 break;
6367                         case MESSAGE_TYPE_CIRC_GRP_BLCK:
6368                                 offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
6369                                 break;
6370                         case MESSAGE_TYPE_CIRC_GRP_UNBL:
6371                                 offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
6372                                 break;
6373                         case MESSAGE_TYPE_CIRC_GRP_BL_ACK:
6374                                 offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
6375                                 break;
6376                         case MESSAGE_TYPE_CIRC_GRP_UNBL_ACK:
6377                                 offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
6378                                 break;
6379                         case MESSAGE_TYPE_FACILITY_REQ:
6380                                 offset += dissect_isup_facility_request_accepted_message(parameter_tvb, isup_tree);
6381                                 opt_part_possible = TRUE;
6382                                 break;
6383                         case MESSAGE_TYPE_FACILITY_ACC:
6384                                 offset += dissect_isup_facility_request_accepted_message(parameter_tvb, isup_tree);
6385                                 opt_part_possible = TRUE;
6386                                 break;
6387                         case MESSAGE_TYPE_FACILITY_REJ:
6388                                 offset += dissect_isup_facility_reject_message(parameter_tvb, isup_tree);
6389                                 opt_part_possible = TRUE;
6390                                 break;
6391                         case MESSAGE_TYPE_LOOP_BACK_ACK:
6392                                 /* no dissector necessary since no mandatory parameters included */
6393                                 break;
6394                         case MESSAGE_TYPE_PASS_ALONG:
6395                                 /* call dissect_isup_message recursively */
6396                                 {       guint8 pa_message_type;
6397                                         pa_message_type = tvb_get_guint8(parameter_tvb, 0);
6398                                         pass_along_item = proto_tree_add_text(isup_tree, parameter_tvb, offset, -1, "Pass-along: %s Message (%u)", val_to_str(pa_message_type, isup_message_type_value_acro, "reserved"), pa_message_type);
6399                                         pass_along_tree = proto_item_add_subtree(pass_along_item, ett_isup_pass_along_message);
6400                                         dissect_isup_message(parameter_tvb, pinfo, pass_along_tree);
6401                                         break;
6402                                 }
6403                         case MESSAGE_TYPE_CIRC_GRP_RST_ACK:
6404                                 offset += dissect_isup_circuit_group_reset_acknowledgement_message(parameter_tvb, isup_tree);
6405                                 break;
6406                         case MESSAGE_TYPE_CIRC_GRP_QRY:
6407                                 offset += dissect_isup_circuit_group_reset_query_message(parameter_tvb, isup_tree);
6408                                 break;
6409                         case MESSAGE_TYPE_CIRC_GRP_QRY_RSP:
6410                                 offset += dissect_isup_circuit_group_query_response_message(parameter_tvb, isup_tree);
6411                                 break;
6412                         case MESSAGE_TYPE_CALL_PROGRSS:
6413                                 offset += dissect_isup_call_progress_message(parameter_tvb, isup_tree);
6414                                 opt_part_possible = TRUE;
6415                                 break;
6416                         case MESSAGE_TYPE_USER2USER_INFO:
6417                                 offset += dissect_isup_user_to_user_information_message(parameter_tvb, isup_tree);
6418                                 opt_part_possible = TRUE;
6419                                 break;
6420                         case MESSAGE_TYPE_UNEQUIPPED_CIC:
6421                                 /* no dissector necessary since no mandatory parameters included */
6422                                 break;
6423                         case MESSAGE_TYPE_CONFUSION:
6424                                 offset += dissect_isup_confusion_message(parameter_tvb, isup_tree);
6425                                 opt_part_possible = TRUE;
6426                                 break;
6427                         case MESSAGE_TYPE_OVERLOAD:
6428                                 /* no dissector necessary since no mandatory parameters included */
6429                                 break;
6430                         case MESSAGE_TYPE_CHARGE_INFO:
6431                                 /* do nothing since format is a national matter */
6432                                 bufferlength = tvb_length_remaining(message_tvb, offset);
6433                                 if (bufferlength != 0)
6434                                         proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Format is a national matter");
6435                                 break;
6436                         case MESSAGE_TYPE_NETW_RESRC_MGMT:
6437                                 /* no dissector necessary since no mandatory parameters included */
6438                                 opt_part_possible = TRUE;
6439                                 break;
6440                         case MESSAGE_TYPE_FACILITY:
6441                                 /* no dissector necessary since no mandatory parameters included */
6442                                 opt_part_possible = TRUE;
6443                                 break;
6444                         case MESSAGE_TYPE_USER_PART_TEST:
6445                                 /* no dissector necessary since no mandatory parameters included */
6446                                 opt_part_possible = TRUE;
6447                                 break;
6448                         case MESSAGE_TYPE_USER_PART_AVAIL:
6449                                 /* no dissector necessary since no mandatory parameters included */
6450                                 opt_part_possible = TRUE;
6451                                 break;
6452                         case MESSAGE_TYPE_IDENT_REQ:
6453                                 /* no dissector necessary since no mandatory parameters included */
6454                                 opt_part_possible = TRUE;
6455                                 break;
6456                         case MESSAGE_TYPE_IDENT_RSP:
6457                                 /* no dissector necessary since no mandatory parameters included */
6458                                 opt_part_possible = TRUE;
6459                                 break;
6460                         case MESSAGE_TYPE_SEGMENTATION:
6461                                 /* no dissector necessary since no mandatory parameters included */
6462                                 opt_part_possible = TRUE;
6463                                 break;
6464                         case MESSAGE_TYPE_LOOP_PREVENTION:
6465                                 /* no dissector necessary since no mandatory parameters included */
6466                                 opt_part_possible = TRUE;
6467                                 break;
6468                         case MESSAGE_TYPE_APPLICATION_TRANS:
6469                                 /* no dissector necessary since no mandatory parameters included */
6470                                 opt_part_possible = TRUE;
6471                                 break;
6472                         case MESSAGE_TYPE_PRE_RELEASE_INFO:
6473                                 /* no dissector necessary since no mandatory parameters included */
6474                                 opt_part_possible = TRUE;
6475                                 break;
6476                         case MESSAGE_TYPE_SUBSEQUENT_DIR_NUM:
6477                                 /* do nothing since format is a national matter */
6478                                 bufferlength = tvb_length_remaining(message_tvb, offset);
6479                                 if (bufferlength != 0)
6480                                         proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Format is a national matter");
6481                                 break;
6482                         default:
6483                                 bufferlength = tvb_length_remaining(message_tvb, offset);
6484                                 if (bufferlength != 0)
6485                                         proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Unknown Message type (possibly reserved/used in former ISUP version)");
6486                                 break;
6487                         }
6488                         break;
6489                 case ANSI_STANDARD:
6490                         /* TODO if neccessary make new "dissect_ansi_isup_xxx() routines or add branches in the current ones.
6491                          */
6492                         switch (message_type) {
6493                         case MESSAGE_TYPE_INITIAL_ADDR:
6494                                 offset += dissect_isup_initial_address_message(parameter_tvb, isup_tree);
6495                                 opt_part_possible = TRUE;
6496                                 break;
6497                         case MESSAGE_TYPE_SUBSEQ_ADDR:
6498                                 offset += dissect_isup_subsequent_address_message(parameter_tvb, isup_tree);
6499                                 opt_part_possible = TRUE;
6500                                 break;
6501                         case MESSAGE_TYPE_INFO_REQ:
6502                                 offset += dissect_isup_information_request_message(parameter_tvb, isup_tree);
6503                                 opt_part_possible = TRUE;
6504                                 break;
6505                         case MESSAGE_TYPE_INFO:
6506                                 offset += dissect_isup_information_message(parameter_tvb, isup_tree);
6507                                 opt_part_possible = TRUE;
6508                                 break;
6509                         case MESSAGE_TYPE_CONTINUITY:
6510                                 offset += dissect_isup_continuity_message(parameter_tvb, isup_tree);
6511                                 break;
6512                         case MESSAGE_TYPE_ADDR_CMPL:
6513                                 offset += dissect_isup_address_complete_message(parameter_tvb, isup_tree);
6514                                 opt_part_possible = TRUE;
6515                                 break;
6516                         case MESSAGE_TYPE_CONNECT:
6517                                 offset += dissect_isup_connect_message(parameter_tvb, isup_tree);
6518                                 opt_part_possible = TRUE;
6519                                 break;
6520                         case MESSAGE_TYPE_FORW_TRANS:
6521                                 /* no dissector necessary since no mandatory parameters included */
6522                                 opt_part_possible = TRUE;
6523                                 break;
6524                         case MESSAGE_TYPE_ANSWER:
6525                                 /* no dissector necessary since no mandatory parameters included */
6526                                 opt_part_possible = TRUE;
6527                                 break;
6528                         case MESSAGE_TYPE_RELEASE:
6529                                 offset += dissect_isup_release_message(parameter_tvb, isup_tree);
6530                                 opt_part_possible = TRUE;
6531                                 break;
6532                         case MESSAGE_TYPE_SUSPEND:
6533                                 offset += dissect_isup_suspend_resume_message(parameter_tvb, isup_tree);
6534                                 opt_part_possible = TRUE;
6535                                 break;
6536                         case MESSAGE_TYPE_RESUME:
6537                                 offset += dissect_isup_suspend_resume_message(parameter_tvb, isup_tree);
6538                                 opt_part_possible = TRUE;
6539                                 break;
6540                         case MESSAGE_TYPE_REL_CMPL:
6541                                 /* no dissector necessary since no mandatory parameters included */
6542                                 break;
6543                         case MESSAGE_TYPE_CONT_CHECK_REQ:
6544                                 /* no dissector necessary since no mandatory parameters included */
6545                                 break;
6546                         case MESSAGE_TYPE_RESET_CIRCUIT:
6547                                 /* no dissector necessary since no mandatory parameters included */
6548                                 break;
6549                         case MESSAGE_TYPE_BLOCKING:
6550                                 /* no dissector necessary since no mandatory parameters included */
6551                                 break;
6552                         case MESSAGE_TYPE_UNBLOCKING:
6553                                 /* no dissector necessary since no mandatory parameters included */
6554                                 break;
6555                         case MESSAGE_TYPE_BLOCK_ACK:
6556                                 /* no dissector necessary since no mandatory parameters included */
6557                                 break;
6558                         case MESSAGE_TYPE_UNBLOCK_ACK:
6559                                 /* no dissector necessary since no mandatory parameters included */
6560                                 break;
6561                         case MESSAGE_TYPE_CIRC_GRP_RST:
6562                                 offset += dissect_isup_circuit_group_reset_query_message(parameter_tvb, isup_tree);
6563                                 break;
6564                         case MESSAGE_TYPE_CIRC_GRP_BLCK:
6565                                 offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
6566                                 break;
6567                         case MESSAGE_TYPE_CIRC_GRP_UNBL:
6568                                 offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
6569                                 break;
6570                         case MESSAGE_TYPE_CIRC_GRP_BL_ACK:
6571                                 offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
6572                                 break;
6573                         case MESSAGE_TYPE_CIRC_GRP_UNBL_ACK:
6574                                 offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
6575                                 break;
6576                         case MESSAGE_TYPE_FACILITY_REQ:
6577                                 offset += dissect_isup_facility_request_accepted_message(parameter_tvb, isup_tree);
6578                                 opt_part_possible = TRUE;
6579                                 break;
6580                         case MESSAGE_TYPE_FACILITY_ACC:
6581                                 offset += dissect_isup_facility_request_accepted_message(parameter_tvb, isup_tree);
6582                                 opt_part_possible = TRUE;
6583                                 break;
6584                         case MESSAGE_TYPE_FACILITY_REJ:
6585                                 offset += dissect_isup_facility_reject_message(parameter_tvb, isup_tree);
6586                                 opt_part_possible = TRUE;
6587                                 break;
6588                         case MESSAGE_TYPE_LOOP_BACK_ACK:
6589                                 /* no dissector necessary since no mandatory parameters included */
6590                                 break;
6591                         case MESSAGE_TYPE_PASS_ALONG:
6592                                 /* call dissect_isup_message recursively */
6593                                 {       guint8 pa_message_type;
6594                                         pa_message_type = tvb_get_guint8(parameter_tvb, 0);
6595                                         pass_along_item = proto_tree_add_text(isup_tree, parameter_tvb, offset, -1, "Pass-along: %s Message (%u)", val_to_str(pa_message_type, isup_message_type_value_acro, "reserved"), pa_message_type);
6596                                         pass_along_tree = proto_item_add_subtree(pass_along_item, ett_isup_pass_along_message);
6597                                         dissect_isup_message(parameter_tvb, pinfo, pass_along_tree);
6598                                         break;
6599                                 }
6600                         case MESSAGE_TYPE_CIRC_GRP_RST_ACK:
6601                                 offset += dissect_isup_circuit_group_reset_acknowledgement_message(parameter_tvb, isup_tree);
6602                                 break;
6603                         case MESSAGE_TYPE_CIRC_GRP_QRY:
6604                                 offset += dissect_isup_circuit_group_reset_query_message(parameter_tvb, isup_tree);
6605                                 break;
6606                         case MESSAGE_TYPE_CIRC_GRP_QRY_RSP:
6607                                 offset += dissect_isup_circuit_group_query_response_message(parameter_tvb, isup_tree);
6608                                 break;
6609                         case MESSAGE_TYPE_CALL_PROGRSS:
6610                                 offset += dissect_isup_call_progress_message(parameter_tvb, isup_tree);
6611                                 opt_part_possible = TRUE;
6612                                 break;
6613                         case MESSAGE_TYPE_USER2USER_INFO:
6614                                 offset += dissect_isup_user_to_user_information_message(parameter_tvb, isup_tree);
6615                                 opt_part_possible = TRUE;
6616                                 break;
6617                         case MESSAGE_TYPE_UNEQUIPPED_CIC:
6618                                 /* no dissector necessary since no mandatory parameters included */
6619                                 break;
6620                         case MESSAGE_TYPE_CONFUSION:
6621                                 offset += dissect_isup_confusion_message(parameter_tvb, isup_tree);
6622                                 opt_part_possible = TRUE;
6623                                 break;
6624                         case MESSAGE_TYPE_OVERLOAD:
6625                                 /* no dissector necessary since no mandatory parameters included */
6626                                 break;
6627                         case MESSAGE_TYPE_CHARGE_INFO:
6628                                 /* do nothing since format is a national matter */
6629                                 bufferlength = tvb_length_remaining(message_tvb, offset);
6630                                 if (bufferlength != 0)
6631                                         proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Format is a national matter");
6632                                 break;
6633                         case MESSAGE_TYPE_NETW_RESRC_MGMT:
6634                                 /* no dissector necessary since no mandatory parameters included */
6635                                 opt_part_possible = TRUE;
6636                                 break;
6637                         case MESSAGE_TYPE_FACILITY:
6638                                 /* no dissector necessary since no mandatory parameters included */
6639                                 opt_part_possible = TRUE;
6640                                 break;
6641                         case MESSAGE_TYPE_USER_PART_TEST:
6642                                 /* no dissector necessary since no mandatory parameters included */
6643                                 opt_part_possible = TRUE;
6644                                 break;
6645                         case MESSAGE_TYPE_USER_PART_AVAIL:
6646                                 /* no dissector necessary since no mandatory parameters included */
6647                                 opt_part_possible = TRUE;
6648                                 break;
6649                         case MESSAGE_TYPE_IDENT_REQ:
6650                                 /* no dissector necessary since no mandatory parameters included */
6651                                 opt_part_possible = TRUE;
6652                                 break;
6653                         case MESSAGE_TYPE_IDENT_RSP:
6654                                 /* no dissector necessary since no mandatory parameters included */
6655                                 opt_part_possible = TRUE;
6656                                 break;
6657                         case MESSAGE_TYPE_SEGMENTATION:
6658                                 /* no dissector necessary since no mandatory parameters included */
6659                                 opt_part_possible = TRUE;
6660                                 break;
6661                         case MESSAGE_TYPE_LOOP_PREVENTION:
6662                                 /* no dissector necessary since no mandatory parameters included */
6663                                 opt_part_possible = TRUE;
6664                                 break;
6665                         case MESSAGE_TYPE_APPLICATION_TRANS:
6666                                 /* no dissector necessary since no mandatory parameters included */
6667                                 opt_part_possible = TRUE;
6668                                 break;
6669                         case MESSAGE_TYPE_PRE_RELEASE_INFO:
6670                                 /* no dissector necessary since no mandatory parameters included */
6671                                 opt_part_possible = TRUE;
6672                                 break;
6673                         case MESSAGE_TYPE_SUBSEQUENT_DIR_NUM:
6674                                 /* do nothing since format is a national matter */
6675                                 bufferlength = tvb_length_remaining(message_tvb, offset);
6676                                 if (bufferlength != 0)
6677                                         proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Format is a national matter");
6678                                 break;
6679                         case ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES_ACK:
6680                                 /* no dissector necessary since no mandatory parameters included */
6681                                 break;
6682                         case ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES:
6683                                 offset += dissect_ansi_isup_circuit_reservation_message( parameter_tvb, isup_tree );
6684                                 break;
6685                         case ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST_RSP:
6686                                 opt_part_possible = TRUE;
6687                                 offset += dissect_ansi_isup_circuit_validation_test_resp_message( parameter_tvb, isup_tree );
6688                                 break;
6689                         case ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST:
6690                                 /* no dissector necessary since no mandatory parameters included */
6691                                 break;
6692                         default:
6693                                 bufferlength = tvb_length_remaining(message_tvb, offset);
6694                                 if (bufferlength != 0)
6695                                         proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Unknown Message type (possibly reserved/used in former ISUP version)");
6696                                 break;
6697                         }
6698                         break;
6699   }
6700
6701    /* extract pointer to start of optional part (if any) */
6702    if (opt_part_possible == TRUE){
6703      opt_parameter_pointer = tvb_get_guint8(message_tvb, offset);
6704      if (opt_parameter_pointer > 0){
6705        proto_tree_add_uint_format(isup_tree, hf_isup_pointer_to_start_of_optional_part, message_tvb, offset, PARAMETER_POINTER_LENGTH, opt_parameter_pointer, "Pointer to start of optional part: %u", opt_parameter_pointer);
6706        offset += opt_parameter_pointer;
6707        optional_parameter_tvb = tvb_new_subset(message_tvb, offset, -1, -1 );
6708            switch(isup_standard){
6709            case ITU_STANDARD:
6710                    dissect_isup_optional_parameter(optional_parameter_tvb, pinfo, isup_tree);
6711                    break;
6712            case ANSI_STANDARD:
6713                    dissect_ansi_isup_optional_parameter(optional_parameter_tvb, pinfo, isup_tree);
6714                    break;
6715            }
6716      }
6717      else
6718        proto_tree_add_uint_format(isup_tree, hf_isup_pointer_to_start_of_optional_part, message_tvb, offset, PARAMETER_POINTER_LENGTH, opt_parameter_pointer, "No optional parameter present (Pointer: %u)", opt_parameter_pointer);
6719    }
6720    else if (message_type !=MESSAGE_TYPE_CHARGE_INFO)
6721      proto_tree_add_text(isup_tree, message_tvb, 0, 0, "No optional parameters are possible with this message type");
6722    /* if there are calling/called number, we'll get them for the tap */
6723
6724    tap_rec.calling_number=tap_calling_number?tap_calling_number:ep_strdup("");
6725    tap_rec.called_number=tap_called_number;
6726    tap_rec.cause_value=tap_cause_value;
6727    tap_queue_packet(isup_tap, pinfo, &tap_rec);
6728 }
6729
6730 /* ------------------------------------------------------------------ */
6731 static void
6732 dissect_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
6733 {
6734
6735 /* Set up structures needed to add the protocol subtree and manage it */
6736         proto_item *ti;
6737         proto_tree *isup_tree = NULL;
6738         tvbuff_t *message_tvb;
6739         guint16 cic;
6740         guint8 message_type;
6741
6742         switch(mtp3_standard){
6743         case ANSI_STANDARD:
6744                 isup_standard = ANSI_STANDARD;
6745                 break;
6746         default:
6747                 isup_standard = ITU_STANDARD;
6748         }
6749
6750 /* Make entries in Protocol column and Info column on summary display */
6751         switch (isup_standard){
6752         case ITU_STANDARD:
6753                 if (check_col(pinfo->cinfo, COL_PROTOCOL))
6754                         col_set_str(pinfo->cinfo, COL_PROTOCOL, "ISUP(ITU)");
6755                 break;
6756         case ANSI_STANDARD:
6757                 if (check_col(pinfo->cinfo, COL_PROTOCOL))
6758                         col_set_str(pinfo->cinfo, COL_PROTOCOL, "ISUP(ANSI)");
6759                 break;
6760         }
6761
6762 /* Extract message type field */
6763         message_type = tvb_get_guint8(tvb, CIC_OFFSET + CIC_LENGTH);
6764         /* dissect CIC in main dissector since pass-along message type carrying complete IUSP message w/o CIC needs
6765            recursive message dissector call */
6766         if (mtp3_standard == ANSI_STANDARD)
6767                 cic = tvb_get_letohs(tvb, CIC_OFFSET) & 0x3FFF; /*since upper 2 bits spare */
6768         else /* ITU, China, and Japan; yes, J7's CICs are a different size */
6769                 cic = tvb_get_letohs(tvb, CIC_OFFSET) & 0x0FFF; /*since upper 4 bits spare */
6770
6771         pinfo->ctype = CT_ISUP;
6772         pinfo->circuit_id = cic;
6773
6774         if (check_col(pinfo->cinfo, COL_INFO))
6775         {
6776                 if (isup_show_cic_in_info){
6777                         switch (isup_standard){
6778                         case ITU_STANDARD:
6779                                 col_add_fstr(pinfo->cinfo, COL_INFO, "%s (CIC %u) ", val_to_str(message_type, isup_message_type_value_acro, "reserved"), cic);
6780                                 break;
6781                         case ANSI_STANDARD:
6782                                 col_add_fstr(pinfo->cinfo, COL_INFO, "%s (CIC %u) ", val_to_str(message_type, ansi_isup_message_type_value_acro, "reserved"), cic);
6783                                 break;
6784                         }
6785                 }else{
6786                         switch (isup_standard){
6787                         case ITU_STANDARD:
6788                                 col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_type, isup_message_type_value_acro, "reserved"));
6789                                 break;
6790                         case ANSI_STANDARD:
6791                                 col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_type, ansi_isup_message_type_value_acro, "reserved"));
6792                                 break;
6793                         }
6794                 }
6795         }
6796
6797         /* In the interest of speed, if "tree" is NULL, don't do any work not
6798      * necessary to generate protocol tree items.
6799          */
6800         if (tree) {
6801                 ti = proto_tree_add_item(tree, proto_isup, tvb, 0, -1, FALSE);
6802                 isup_tree = proto_item_add_subtree(ti, ett_isup);
6803
6804
6805                 proto_tree_add_uint_format(isup_tree, hf_isup_cic, tvb, CIC_OFFSET, CIC_LENGTH, cic, "CIC: %u", cic);
6806         }
6807
6808         message_tvb = tvb_new_subset(tvb, CIC_LENGTH, -1, -1);
6809         dissect_isup_message(message_tvb, pinfo, isup_tree);
6810 }
6811
6812 /* ------------------------------------------------------------------ */
6813 static void
6814 dissect_bicc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
6815 {
6816
6817 /* Set up structures needed to add the protocol subtree and manage it */
6818         proto_item *ti;
6819         proto_tree *bicc_tree = NULL;
6820         tvbuff_t *message_tvb;
6821         guint32 bicc_cic;
6822         guint8 message_type;
6823
6824         /*circuit_t *circuit;*/
6825
6826 /* Make entries in Protocol column and Info column on summary display */
6827         if (check_col(pinfo->cinfo, COL_PROTOCOL))
6828                 col_set_str(pinfo->cinfo, COL_PROTOCOL, "BICC");
6829
6830 /* Extract message type field */
6831         message_type = tvb_get_guint8(tvb, BICC_CIC_OFFSET + BICC_CIC_LENGTH);
6832
6833         if (check_col(pinfo->cinfo, COL_INFO))
6834                 col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_type, isup_message_type_value_acro, "reserved"));
6835
6836         /* dissect CIC in main dissector since pass-along message type carrying complete BICC/ISUP message w/o CIC needs
6837          * recursive message dissector call
6838          */
6839         bicc_cic = tvb_get_letohl(tvb, BICC_CIC_OFFSET);
6840
6841         pinfo->ctype = CT_BICC;
6842         pinfo->circuit_id = bicc_cic;
6843
6844         /* In the interest of speed, if "tree" is NULL, don't do any work not
6845          * necessary to generate protocol tree items.
6846          */
6847         if (tree) {
6848                 ti = proto_tree_add_item(tree, proto_bicc, tvb, 0, -1, FALSE);
6849                 bicc_tree = proto_item_add_subtree(ti, ett_bicc);
6850
6851
6852                 proto_tree_add_uint_format(bicc_tree, hf_bicc_cic, tvb, BICC_CIC_OFFSET, BICC_CIC_LENGTH, bicc_cic, "CIC: %u", bicc_cic);
6853         }
6854
6855         message_tvb = tvb_new_subset(tvb, BICC_CIC_LENGTH, -1, -1);
6856         dissect_isup_message(message_tvb, pinfo, bicc_tree);
6857 }
6858
6859 static void
6860 dissect_application_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
6861 {
6862 /* Set up structures needed to add the protocol subtree and manage it */
6863         proto_item *ti;
6864         proto_tree *isup_tree = NULL;
6865         tvbuff_t *message_tvb;
6866         guint8 message_type;
6867
6868 /* Make entries in Protocol column and Info column on summary display */
6869         if (check_col(pinfo->cinfo, COL_PROTOCOL))
6870                 col_append_str(pinfo->cinfo, COL_PROTOCOL, "/ISUP(ITU)");
6871
6872 /* Extract message type field */
6873         message_type = tvb_get_guint8(tvb, 0);
6874         /* application/ISUP has no  CIC  */
6875         if (check_col(pinfo->cinfo, COL_INFO))
6876                 col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "ISUP:%s", val_to_str(message_type, isup_message_type_value_acro, "reserved"));
6877
6878 /* In the interest of speed, if "tree" is NULL, don't do any work not
6879    necessary to generate protocol tree items. */
6880         if (tree) {
6881                 ti = proto_tree_add_item(tree, proto_isup, tvb, 0, -1, FALSE);
6882                 isup_tree = proto_item_add_subtree(ti, ett_isup);
6883         }
6884
6885         message_tvb = tvb_new_subset(tvb, 0, -1, -1);
6886         dissect_isup_message(message_tvb, pinfo, isup_tree);
6887 }
6888 /* ---------------------------------------------------- stats tree
6889 */
6890 static int st_node_msg = -1;
6891 static int st_node_dir = -1;
6892
6893 static void msg_stats_tree_init(stats_tree* st) {
6894         st_node_msg = stats_tree_create_node(st, "Messages by Type", 0, TRUE);
6895         st_node_dir = stats_tree_create_node(st, "Messages by Direction", 0, TRUE);
6896 }
6897
6898 static int msg_stats_tree_packet(stats_tree *st  , packet_info *pinfo, epan_dissect_t *edt _U_, const void *p ) {
6899         const gchar* msg = match_strval(((const isup_tap_rec_t*)p)->message_type, isup_message_type_value_acro);
6900         gchar src[MAX_ADDR_STR_LEN];
6901         gchar dst[MAX_ADDR_STR_LEN];
6902         gchar dir[MAX_ADDR_STR_LEN];
6903         int msg_node;
6904         int dir_node;
6905
6906         address_to_str_buf(&(pinfo->src), src, sizeof src);
6907         address_to_str_buf(&(pinfo->dst), dst, sizeof dst);
6908         g_snprintf(dir,sizeof(dir),"%s->%s",src,dst);
6909
6910         msg_node = tick_stat_node(st, msg, st_node_msg, TRUE);
6911         tick_stat_node(st, dir, msg_node, FALSE);
6912
6913         dir_node = tick_stat_node(st, dir, st_node_dir, TRUE);
6914         tick_stat_node(st, msg, dir_node, FALSE);
6915
6916         return 1;
6917 }
6918
6919 /*---------------------------------------------------------------------*/
6920 /* Register the protocol with Wireshark */
6921 void
6922 proto_register_isup(void)
6923 {
6924 /* Setup list of header fields  See Section 1.6.1 for details*/
6925         static hf_register_info hf[] = {
6926                 { &hf_isup_cic,
6927                         { "CIC",           "isup.cic",
6928                         FT_UINT16, BASE_HEX, NULL, 0x0,
6929                           "", HFILL }},
6930
6931                 { &hf_isup_message_type,
6932                         { "Message Type",  "isup.message_type",
6933                         FT_UINT8, BASE_DEC, NULL, 0x0,
6934                         "", HFILL }},
6935
6936                 { &hf_isup_parameter_type,
6937                         { "Parameter Type",  "isup.parameter_type",
6938                         FT_UINT8, BASE_DEC, NULL, 0x0,
6939                         "", HFILL }},
6940
6941                 { &hf_isup_parameter_length,
6942                         { "Parameter Length",  "isup.parameter_length",
6943                         FT_UINT8, BASE_DEC, NULL, 0x0,
6944                         "", HFILL }},
6945
6946                 { &hf_isup_mandatory_variable_parameter_pointer,
6947                         { "Pointer to Parameter",  "isup.mandatory_variable_parameter_pointer",
6948                         FT_UINT8, BASE_DEC, NULL, 0x0,
6949                         "", HFILL }},
6950
6951                 { &hf_isup_pointer_to_start_of_optional_part,
6952                         { "Pointer to optional parameter part",  "isup.optional_parameter_part_pointer",
6953                         FT_UINT8, BASE_DEC, NULL, 0x0,
6954                         "", HFILL }},
6955
6956                 { &hf_isup_satellite_indicator,
6957                         { "Satellite Indicator",  "isup.satellite_indicator",
6958                         FT_UINT8, BASE_HEX, VALS(isup_satellite_ind_value), BA_8BIT_MASK,
6959                         "", HFILL }},
6960
6961                 { &hf_isup_continuity_check_indicator,
6962                         { "Continuity Check Indicator",  "isup.continuity_check_indicator",
6963                         FT_UINT8, BASE_HEX, VALS(isup_continuity_check_ind_value), DC_8BIT_MASK,
6964                         "", HFILL }},
6965
6966                 { &hf_isup_echo_control_device_indicator,
6967                         { "Echo Control Device Indicator",  "isup.echo_control_device_indicator",
6968                         FT_BOOLEAN, 8, TFS(&isup_echo_control_device_ind_value),E_8BIT_MASK,
6969                         "", HFILL }},
6970
6971                 { &hf_isup_forw_call_natnl_inatnl_call_indicator,
6972                         { "National/international call indicator",  "isup.forw_call_natnl_inatnl_call_indicator",
6973                         FT_BOOLEAN, 16, TFS(&isup_natnl_inatnl_call_ind_value),A_16BIT_MASK,
6974                         "", HFILL }},
6975
6976                 { &hf_isup_forw_call_end_to_end_method_indicator,
6977                         { "End-to-end method indicator",  "isup.forw_call_end_to_end_method_indicator",
6978                         FT_UINT16, BASE_HEX, VALS(isup_end_to_end_method_ind_value), CB_16BIT_MASK,
6979                         "", HFILL }},
6980
6981                 { &hf_isup_forw_call_interworking_indicator,
6982                         { "Interworking indicator",  "isup.forw_call_interworking_indicator",
6983                         FT_BOOLEAN, 16, TFS(&isup_interworking_ind_value), D_16BIT_MASK,
6984                         "", HFILL }},
6985
6986                 { &hf_isup_forw_call_end_to_end_info_indicator,
6987                         { "End-to-end information indicator",  "isup.forw_call_end_to_end_information_indicator",
6988                         FT_BOOLEAN, 16, TFS(&isup_end_to_end_info_ind_value), E_16BIT_MASK,
6989                         "", HFILL }},
6990
6991                 { &hf_isup_forw_call_isdn_user_part_indicator,
6992                         { "ISDN user part indicator",  "isup.forw_call_isdn_user_part_indicator",
6993                         FT_BOOLEAN, 16, TFS(&isup_ISDN_user_part_ind_value), F_16BIT_MASK,
6994                         "", HFILL }},
6995
6996                 { &hf_isup_forw_call_preferences_indicator,
6997                         { "ISDN user part preference indicator",  "isup.forw_call_preferences_indicator",
6998                         FT_UINT16, BASE_HEX, VALS(isup_preferences_ind_value), HG_16BIT_MASK,
6999                         "", HFILL }},
7000
7001                 { &hf_isup_forw_call_isdn_access_indicator,
7002                         { "ISDN access indicator",  "isup.forw_call_isdn_access_indicator",
7003                         FT_BOOLEAN, 16, TFS(&isup_ISDN_originating_access_ind_value), I_16BIT_MASK,
7004                         "", HFILL }},
7005
7006                 { &hf_isup_forw_call_sccp_method_indicator,
7007                         { "SCCP method indicator",  "isup.forw_call_sccp_method_indicator",
7008                         FT_UINT16, BASE_HEX, VALS(isup_SCCP_method_ind_value), KJ_16BIT_MASK,
7009                         "", HFILL }},
7010
7011                 { &hf_isup_calling_partys_category,
7012                         { "Calling Party's category",  "isup.calling_partys_category",
7013                         FT_UINT8, BASE_HEX, VALS(isup_calling_partys_category_value), 0x0,
7014                         "", HFILL }},
7015
7016                 { &hf_isup_transmission_medium_requirement,
7017                         { "Transmission medium requirement",  "isup.transmission_medium_requirement",
7018                         FT_UINT8, BASE_DEC, VALS(isup_transmission_medium_requirement_value), 0x0,
7019                         "", HFILL }},
7020
7021                 { &hf_isup_odd_even_indicator,
7022                         { "Odd/even indicator",  "isup.isdn_odd_even_indicator",
7023                         FT_BOOLEAN, 8, TFS(&isup_odd_even_ind_value), ISUP_ODD_EVEN_MASK,
7024                         "", HFILL }},
7025
7026                 { &hf_isup_called_party_nature_of_address_indicator,
7027                         { "Nature of address indicator",  "isup.called_party_nature_of_address_indicator",
7028                         FT_UINT8, BASE_DEC, VALS(isup_called_party_nature_of_address_ind_value), ISUP_NATURE_OF_ADDRESS_IND_MASK,
7029                         "", HFILL }},
7030
7031                 { &hf_isup_calling_party_nature_of_address_indicator,
7032                         { "Nature of address indicator",  "isup.calling_party_nature_of_address_indicator",
7033                         FT_UINT8, BASE_DEC, VALS(isup_calling_party_nature_of_address_ind_value), ISUP_NATURE_OF_ADDRESS_IND_MASK,
7034                         "", HFILL }},
7035
7036                 { &hf_isup_inn_indicator,
7037                         { "INN indicator",  "isup.inn_indicator",
7038                         FT_BOOLEAN, 8, TFS(&isup_INN_ind_value), ISUP_INN_MASK,
7039                         "", HFILL }},
7040
7041                 { &hf_isup_ni_indicator,
7042                         { "NI indicator",  "isup.ni_indicator",
7043                         FT_BOOLEAN, 8, TFS(&isup_NI_ind_value), ISUP_NI_MASK,
7044                         "", HFILL }},
7045
7046                 { &hf_isup_numbering_plan_indicator,
7047                         { "Numbering plan indicator",  "isup.numbering_plan_indicator",
7048                         FT_UINT8, BASE_DEC, VALS(isup_numbering_plan_ind_value), ISUP_NUMBERING_PLAN_IND_MASK,
7049                         "", HFILL }},
7050
7051                 { &hf_isup_address_presentation_restricted_indicator,
7052                         { "Address presentation restricted indicator",  "isup.address_presentation_restricted_indicator",
7053                         FT_UINT8, BASE_DEC, VALS(isup_address_presentation_restricted_ind_value), ISUP_ADDRESS_PRESENTATION_RESTR_IND_MASK,
7054                         "", HFILL }},
7055
7056                 { &hf_isup_screening_indicator,
7057                         { "Screening indicator",  "isup.screening_indicator",
7058                         FT_UINT8, BASE_DEC, VALS(isup_screening_ind_value), ISUP_SCREENING_IND_MASK,
7059                         "", HFILL }},
7060
7061                 { &hf_isup_screening_indicator_enhanced,
7062                         { "Screening indicator",  "isup.screening_indicator_enhanced",
7063                         FT_UINT8, BASE_DEC, VALS(isup_screening_ind_enhanced_value), ISUP_SCREENING_IND_MASK,
7064                         "", HFILL }},
7065
7066                 { &hf_isup_called_party_odd_address_signal_digit,
7067                         { "Address signal digit",  "isup.called_party_odd_address_signal_digit",
7068                         FT_UINT8, BASE_DEC, VALS(isup_called_party_address_digit_value), ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK,
7069                         "", HFILL }},
7070
7071                 { &hf_isup_calling_party_odd_address_signal_digit,
7072                         { "Address signal digit",  "isup.calling_party_odd_address_signal_digit",
7073                         FT_UINT8, BASE_DEC, VALS(isup_calling_party_address_digit_value), ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK,
7074                         "", HFILL }},
7075
7076                 { &hf_isup_called_party_even_address_signal_digit,
7077                         { "Address signal digit",  "isup.called_party_even_address_signal_digit",
7078                         FT_UINT8, BASE_DEC, VALS(isup_called_party_address_digit_value), ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK,
7079                         "", HFILL }},
7080
7081                 { &hf_isup_calling_party_even_address_signal_digit,
7082                         { "Address signal digit",  "isup.calling_party_even_address_signal_digit",
7083                         FT_UINT8, BASE_DEC, VALS(isup_calling_party_address_digit_value), ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK,
7084                         "", HFILL }},
7085
7086                 { &hf_isup_calling_party_address_request_indicator,
7087                         { "Calling party address request indicator",  "isup.calling_party_address_request_indicator",
7088                         FT_BOOLEAN, 16, TFS(&isup_calling_party_address_request_ind_value), A_16BIT_MASK,
7089                         "", HFILL }},
7090
7091                 { &hf_isup_info_req_holding_indicator,
7092                         { "Holding indicator",  "isup.info_req_holding_indicator",
7093                         FT_BOOLEAN, 16, TFS(&isup_holding_ind_value), B_16BIT_MASK,
7094                         "", HFILL }},
7095
7096                 { &hf_isup_calling_partys_category_request_indicator,
7097                         { "Calling party's category request indicator",  "isup.calling_partys_category_request_indicator",
7098                         FT_BOOLEAN, 16, TFS(&isup_calling_partys_category_request_ind_value), D_16BIT_MASK,
7099                         "", HFILL }},
7100
7101                 { &hf_isup_charge_information_request_indicator,
7102                         { "Charge information request indicator",  "isup.charge_information_request_indicator",
7103                         FT_BOOLEAN, 16, TFS(&isup_charge_information_request_ind_value), E_16BIT_MASK,
7104                         "", HFILL }},
7105
7106                 { &hf_isup_malicious_call_identification_request_indicator,
7107                         { "Malicious call identification request indicator (ISUP'88)",  "isup.malicious_call_ident_request_indicator",
7108                         FT_BOOLEAN, 16, TFS(&isup_malicious_call_identification_request_ind_value), H_16BIT_MASK,
7109                         "", HFILL }},
7110
7111                 { &hf_isup_calling_party_address_response_indicator,
7112                         { "Calling party address response indicator",  "isup.calling_party_address_response_indicator",
7113                         FT_UINT16, BASE_HEX, VALS(isup_calling_party_address_response_ind_value), BA_16BIT_MASK,
7114                         "", HFILL }},
7115
7116                 { &hf_isup_OECD_inf_ind,
7117                         { "OECD information indicator",  "isup.OECD_inf_ind_vals",
7118                         FT_UINT8, BASE_HEX, VALS(OECD_inf_ind_vals), BA_8BIT_MASK,
7119                         "", HFILL }},
7120
7121                 { &hf_isup_IECD_inf_ind,
7122                         { "IECD information indicator",  "isup.IECD_inf_ind_vals",
7123                         FT_UINT8, BASE_HEX, VALS(IECD_inf_ind_vals), DC_8BIT_MASK,
7124                         "", HFILL }},
7125
7126                 { &hf_isup_OECD_req_ind,
7127                         { "OECD request indicator",  "isup.OECD_req_ind_vals",
7128                         FT_UINT8, BASE_HEX, VALS(OECD_req_ind_vals), FE_8BIT_MASK,
7129                         "", HFILL }},
7130
7131                 { &hf_isup_IECD_req_ind,
7132                         { "IECD request indicator",  "isup.IECD_req_ind_vals",
7133                         FT_UINT8, BASE_HEX, VALS(IECD_req_ind_vals), HG_8BIT_MASK,
7134                         "", HFILL }},
7135
7136                 { &hf_isup_hold_provided_indicator,
7137                         { "Hold provided indicator",  "isup.hold_provided_indicator",
7138                         FT_BOOLEAN, 16, TFS(&isup_hold_provided_ind_value), C_16BIT_MASK,
7139                         "", HFILL }},
7140
7141                 { &hf_isup_calling_partys_category_response_indicator,
7142                         { "Calling party's category response indicator",  "isup.calling_partys_category_response_indicator",
7143                         FT_BOOLEAN, 16, TFS(&isup_calling_partys_category_response_ind_value), F_16BIT_MASK,
7144                         "", HFILL }},
7145
7146                 { &hf_isup_charge_information_response_indicator,
7147                         { "Charge information response indicator",  "isup.charge_information_response_indicator",
7148                         FT_BOOLEAN, 16, TFS(&isup_charge_information_response_ind_value), G_16BIT_MASK,
7149                         "", HFILL }},
7150
7151                 { &hf_isup_solicited_indicator,
7152                         { "Solicited indicator",  "isup.solicided_indicator",
7153                         FT_BOOLEAN, 16, TFS(&isup_solicited_information_ind_value), H_16BIT_MASK,
7154                         "", HFILL }},
7155
7156                 { &hf_isup_continuity_indicator,
7157                         { "Continuity indicator",  "isup.continuity_indicator",
7158                         FT_BOOLEAN, 8, TFS(&isup_continuity_ind_value), A_8BIT_MASK,
7159                         "", HFILL }},
7160
7161                 { &hf_isup_backw_call_charge_ind,
7162                         { "Charge indicator",  "isup.charge_indicator",
7163                         FT_UINT16, BASE_HEX, VALS(isup_charge_ind_value), BA_16BIT_MASK,
7164                         "", HFILL }},
7165
7166                 { &hf_isup_backw_call_called_partys_status_ind,
7167                         { "Called party's status indicator",  "isup.called_partys_status_indicator",
7168                         FT_UINT16, BASE_HEX, VALS(isup_called_partys_status_ind_value), DC_16BIT_MASK,
7169                         "", HFILL }},
7170
7171                 { &hf_isup_backw_call_called_partys_category_ind,
7172                         { "Called party's category indicator",  "isup.called_partys_category_indicator",
7173                         FT_UINT16, BASE_HEX, VALS(isup_called_partys_category_ind_value), FE_16BIT_MASK,
7174                         "", HFILL }},
7175
7176                 { &hf_isup_backw_call_end_to_end_method_ind,
7177                         { "End-to-end method indicator",  "isup.backw_call_end_to_end_method_indicator",
7178                         FT_UINT16, BASE_HEX, VALS(isup_end_to_end_method_ind_value), HG_16BIT_MASK,
7179                         "", HFILL }},
7180
7181                 { &hf_isup_backw_call_interworking_ind,
7182                         { "Interworking indicator",  "isup.backw_call_interworking_indicator",
7183                         FT_BOOLEAN, 16, TFS(&isup_interworking_ind_value), I_16BIT_MASK,
7184                         "", HFILL }},
7185
7186                 { &hf_isup_backw_call_end_to_end_info_ind,
7187                         { "End-to-end information indicator",  "isup.backw_call_end_to_end_information_indicator",
7188                         FT_BOOLEAN, 16, TFS(&isup_end_to_end_info_ind_value), J_16BIT_MASK,
7189                         "", HFILL }},
7190
7191                 { &hf_isup_backw_call_isdn_user_part_ind,
7192                         { "ISDN user part indicator",  "isup.backw_call_isdn_user_part_indicator",
7193                         FT_BOOLEAN, 16, TFS(&isup_ISDN_user_part_ind_value), K_16BIT_MASK,
7194                         "", HFILL }},
7195
7196                 { &hf_isup_backw_call_holding_ind,
7197                         { "Holding indicator",  "isup.backw_call_holding_indicator",
7198                         FT_BOOLEAN, 16, TFS(&isup_holding_ind_value), L_16BIT_MASK,
7199                         "", HFILL }},
7200
7201                 { &hf_isup_backw_call_isdn_access_ind,
7202                         { "ISDN access indicator",  "isup.backw_call_isdn_access_indicator",
7203                         FT_BOOLEAN, 16, TFS(&isup_ISDN_terminating_access_ind_value), M_16BIT_MASK,
7204                         "", HFILL }},
7205
7206                 { &hf_isup_backw_call_echo_control_device_ind,
7207                         { "Echo Control Device Indicator",  "isup.backw_call_echo_control_device_indicator",
7208                         FT_BOOLEAN, 16, TFS(&isup_echo_control_device_ind_value), N_16BIT_MASK,
7209                         "", HFILL }},
7210
7211                 { &hf_isup_backw_call_sccp_method_ind,
7212                         { "SCCP method indicator",  "isup.backw_call_sccp_method_indicator",
7213                         FT_UINT16, BASE_HEX, VALS(isup_SCCP_method_ind_value), PO_16BIT_MASK,
7214                         "", HFILL }},
7215
7216                 { &hf_isup_cause_indicator,
7217                         { "Cause indicator",  "isup.cause_indicator",
7218                         FT_UINT8, BASE_DEC, VALS(q850_cause_code_vals), 0x7f,
7219                         "", HFILL }},
7220
7221                 { &hf_ansi_isup_cause_indicator,
7222                         { "Cause indicator",  "ansi_isup.cause_indicator",
7223                         FT_UINT8, BASE_DEC, VALS(ansi_isup_cause_code_vals), 0x7f,
7224                         "", HFILL }},
7225
7226                 { &hf_isup_suspend_resume_indicator,
7227                         { "Suspend/Resume indicator",  "isup.suspend_resume_indicator",
7228                         FT_BOOLEAN, 8, TFS(&isup_suspend_resume_ind_value), A_8BIT_MASK,
7229                         "", HFILL }},
7230
7231                 { &hf_isup_range_indicator,
7232                         { "Range indicator",  "isup.range_indicator",
7233                           FT_UINT8, BASE_DEC, NULL , 0x0,
7234                           "", HFILL }},
7235
7236                 { &hf_isup_cgs_message_type,
7237                         { "Circuit group supervision message type",  "isup.cgs_message_type",
7238                         FT_UINT8, BASE_DEC, VALS(isup_cgs_message_type_value), BA_8BIT_MASK,
7239                         "", HFILL }},
7240
7241                 { &hf_isup_mtc_blocking_state1,
7242                         { "Maintenance blocking state",  "isup.mtc_blocking_state",
7243                         FT_UINT8, BASE_DEC, VALS(isup_mtc_blocking_state_DC00_value), BA_8BIT_MASK,
7244                         "", HFILL }},
7245
7246                 { &hf_isup_mtc_blocking_state2,
7247                         { "Maintenance blocking state",  "isup.mtc_blocking_state",
7248                         FT_UINT8, BASE_DEC, VALS(isup_mtc_blocking_state_DCnot00_value), BA_8BIT_MASK,
7249                         "", HFILL }},
7250
7251                 { &hf_isup_call_proc_state,
7252                         { "Call processing state",  "isup.call_processing_state",
7253                         FT_UINT8, BASE_DEC, VALS(isup_call_processing_state_value), DC_8BIT_MASK,
7254                         "", HFILL }},
7255
7256                 { &hf_isup_hw_blocking_state,
7257                         { "HW blocking state",  "isup.hw_blocking_state",
7258                         FT_UINT8, BASE_DEC, VALS(isup_HW_blocking_state_value), FE_8BIT_MASK,
7259                         "", HFILL }},
7260
7261                 { &hf_isup_event_ind,
7262                         { "Event indicator",  "isup.event_ind",
7263                           FT_UINT8, 8, VALS(isup_event_ind_value), GFEDCBA_8BIT_MASK,
7264                         "", HFILL }},
7265
7266                 { &hf_isup_event_presentation_restricted_ind,
7267                         { "Event presentation restricted indicator",  "isup.event_presentatiation_restr_ind",
7268                         FT_BOOLEAN, 8, TFS(&isup_event_presentation_restricted_ind_value), H_8BIT_MASK,
7269                         "", HFILL }},
7270
7271                 { &hf_isup_cug_call_ind,
7272                         { "Closed user group call indicator",  "isup.clg_call_ind",
7273                         FT_UINT8, BASE_DEC, VALS(isup_CUG_call_ind_value), BA_8BIT_MASK,
7274                         "", HFILL }},
7275
7276                 { &hf_isup_simple_segmentation_ind,
7277                         { "Simple segmentation indicator",  "isup.simple_segmentation_ind",
7278                         FT_BOOLEAN, 8, TFS(&isup_simple_segmentation_ind_value), C_8BIT_MASK,
7279                         "", HFILL }},
7280
7281                 { &hf_isup_connected_line_identity_request_ind,
7282                         { "Connected line identity request indicator",  "isup.connected_line_identity_request_ind",
7283                         FT_BOOLEAN, 8, TFS(&isup_connected_line_identity_request_ind_value), H_8BIT_MASK,
7284                         "", HFILL }},
7285
7286                 { &hf_isup_redirecting_ind,
7287                         { "Redirection indicator",  "isup.redirecting_ind",
7288                         FT_UINT16, BASE_DEC, VALS(isup_redirecting_ind_value), CBA_16BIT_MASK,
7289                         "", HFILL }},
7290
7291                 { &hf_isup_original_redirection_reason,
7292                         { "Original redirection reason",  "isup.original_redirection_reason",
7293                         FT_UINT16, BASE_DEC, VALS(isup_original_redirection_reason_value), HGFE_16BIT_MASK,
7294                         "", HFILL }},
7295
7296                 { &hf_isup_redirection_counter,
7297                         { "Redirection counter",  "isup.redirection_counter",
7298                         FT_UINT16, BASE_DEC, NULL, KJI_16BIT_MASK,
7299                         "", HFILL }},
7300
7301                 { &hf_isup_redirection_reason,
7302                         { "Redirection reason",  "isup.redirection_reason",
7303                         FT_UINT16, BASE_DEC, VALS(isup_redirection_reason_value), PONM_16BIT_MASK,
7304                         "", HFILL }},
7305
7306                 { &hf_isup_type_of_network_identification,
7307                         { "Type of network identification",  "isup.type_of_network_identification",
7308                         FT_UINT8, BASE_DEC, VALS(isup_type_of_network_identification_value), GFE_8BIT_MASK,
7309                         "", HFILL }},
7310
7311                 { &hf_isup_network_identification_plan,
7312                         { "Network identification plan",  "isup.network_identification_plan",
7313                         FT_UINT8, BASE_DEC, VALS(isup_network_identification_plan_value), DCBA_8BIT_MASK,
7314                         "", HFILL }},
7315
7316                 { &hf_isup_map_type,
7317                         { "Map Type",  "isup.map_type",
7318                         FT_UINT8, BASE_DEC, VALS(isup_map_type_value), FEDCBA_8BIT_MASK,
7319                         "", HFILL }},
7320
7321                 { &hf_isup_automatic_congestion_level,
7322                         { "Automatic congestion level",  "isup.automatic_congestion_level",
7323                         FT_UINT8, BASE_DEC, VALS(isup_auto_congestion_level_value), 0x0,
7324                         "", HFILL }},
7325
7326                 { &hf_isup_inband_information_ind,
7327                         { "In-band information indicator",  "isup.inband_information_ind",
7328                         FT_BOOLEAN, 8, TFS(&isup_inband_information_ind_value), A_8BIT_MASK,
7329                         "", HFILL }},
7330
7331                 { &hf_isup_call_diversion_may_occur_ind,
7332                         { "Call diversion may occur indicator",  "isup.call_diversion_may_occur_ind",
7333                         FT_BOOLEAN, 8, TFS(&isup_call_diversion_may_occur_ind_value), B_8BIT_MASK,
7334                         "", HFILL }},
7335
7336                 { &hf_isup_mlpp_user_ind,
7337                         { "MLPP user indicator",  "isup.mlpp_user",
7338                         FT_BOOLEAN, 8, TFS(&isup_MLPP_user_ind_value), D_8BIT_MASK,
7339                         "", HFILL }},
7340
7341                 { &hf_isup_UUI_type,
7342                         { "User-to-User indicator type",  "isup.UUI_type",
7343                         FT_BOOLEAN, 8, TFS(&isup_UUI_type_value), A_8BIT_MASK,
7344                         "", HFILL }},
7345
7346                 { &hf_isup_UUI_req_service1,
7347                         { "User-to-User indicator request service 1",  "isup.UUI_req_service1",
7348                         FT_UINT8, BASE_DEC, VALS(isup_UUI_request_service_values), CB_8BIT_MASK,
7349                         "", HFILL }},
7350
7351                 { &hf_isup_UUI_req_service2,
7352                         { "User-to-User indicator request service 2",  "isup.UUI_req_service2",
7353                         FT_UINT8, BASE_DEC, VALS(isup_UUI_request_service_values), ED_8BIT_MASK,
7354                         "", HFILL }},
7355
7356                 { &hf_isup_UUI_req_service3,
7357                         { "User-to-User indicator request service 3",  "isup.UUI_req_service3",
7358                         FT_UINT8, BASE_DEC, VALS(isup_UUI_request_service_values), GF_8BIT_MASK,
7359                         "", HFILL }},
7360
7361                 { &hf_isup_UUI_res_service1,
7362                         { "User-to-User indicator response service 1",  "isup.UUI_res_service1",
7363                         FT_UINT8, BASE_DEC, VALS(isup_UUI_response_service_values), CB_8BIT_MASK,
7364                         "", HFILL }},
7365
7366                 { &hf_isup_UUI_res_service2,
7367                         { "User-to-User indicator response service 2",  "isup.UUI_res_service2",
7368                         FT_UINT8, BASE_DEC, VALS(isup_UUI_response_service_values), ED_8BIT_MASK,
7369                         "", HFILL }},
7370
7371                 { &hf_isup_UUI_res_service3,
7372                         { "User-to-User response service 3",  "isup.UUI_res_service3",
7373                         FT_UINT8, BASE_DEC, VALS(isup_UUI_response_service_values), GF_8BIT_MASK,
7374                         "", HFILL }},
7375
7376                 { &hf_isup_UUI_network_discard_ind,
7377                         { "User-to-User indicator network discard indicator",  "isup.UUI_network_discard_ind",
7378                         FT_BOOLEAN, 8, TFS(&isup_UUI_network_discard_ind_value), H_8BIT_MASK,
7379                         "", HFILL }},
7380
7381                 { &hf_isup_access_delivery_ind,
7382                         { "Access delivery indicator",  "isup.access_delivery_ind",
7383                         FT_BOOLEAN, 8, TFS(&isup_access_delivery_ind_value), A_8BIT_MASK,
7384                         "", HFILL }},
7385
7386                 { &hf_isup_transmission_medium_requirement_prime,
7387                         { "Transmission medium requirement prime",  "isup.transmission_medium_requirement_prime",
7388                         FT_UINT8, BASE_DEC, VALS(isup_transmission_medium_requirement_prime_value), 0x0,
7389                         "", HFILL }},
7390
7391                 { &hf_isup_loop_prevention_response_ind,
7392                         { "Response indicator",  "isup.loop_prevention_response_ind",
7393                         FT_UINT8, BASE_DEC, VALS(isup_loop_prevention_response_ind_value), CB_8BIT_MASK,
7394                         "", HFILL }},
7395
7396                 { &hf_isup_temporary_alternative_routing_ind,
7397                         { "Temporary alternative routing indicator",  "isup.temporary_alternative_routing_ind",
7398                         FT_BOOLEAN, 8, TFS(&isup_temporary_alternative_routing_ind_value), A_8BIT_MASK,
7399                         "", HFILL }},
7400
7401                 { &hf_isup_extension_ind,
7402                         { "Extension indicator",  "isup.extension_ind",
7403                         FT_BOOLEAN, 8, TFS(&isup_extension_ind_value), H_8BIT_MASK,
7404                         "", HFILL }},
7405
7406                 { &hf_isup_call_to_be_diverted_ind,
7407                         { "Call to be diverted indicator",  "isup.call_to_be_diverted_ind",
7408                         FT_UINT8, BASE_DEC, VALS(isup_call_to_be_diverted_ind_value), BA_8BIT_MASK,
7409                         "", HFILL }},
7410
7411                 { &hf_isup_call_to_be_offered_ind,
7412                         { "Call to be offered indicator",  "isup.call_to_be_offered_ind",
7413                         FT_UINT8, BASE_DEC, VALS(isup_call_to_be_offered_ind_value), BA_8BIT_MASK,
7414                         "", HFILL }},
7415
7416                 { &hf_isup_conference_acceptance_ind,
7417                         { "Conference acceptance indicator",  "isup.conference_acceptance_ind",
7418                         FT_UINT8, BASE_DEC, VALS(isup_conference_acceptance_ind_value), BA_8BIT_MASK,
7419                         "", HFILL }},
7420
7421                 { &hf_isup_transit_at_intermediate_exchange_ind,
7422                         { "Transit at intermediate exchange indicator", "isup.transit_at_intermediate_exchange_ind",
7423                         FT_BOOLEAN, 8, TFS(&isup_transit_at_intermediate_exchange_ind_value), A_8BIT_MASK,
7424                         "", HFILL }},
7425
7426                 { &hf_isup_Release_call_ind,
7427                         { "Release call indicator", "isup.Release_call_ind",
7428                         FT_BOOLEAN, 8, TFS(&isup_Release_call_indicator_value), B_8BIT_MASK,
7429                         "", HFILL }},
7430
7431                 { &hf_isup_Send_notification_ind,
7432                         { "Send notification indicator", "isup.Send_notification_ind",
7433                         FT_BOOLEAN, 8, TFS(&isup_Send_notification_ind_value),C_8BIT_MASK,
7434                         "", HFILL }},
7435
7436                 { &hf_isup_Discard_message_ind_value,
7437                         { "Discard message indicator","isup.Discard_message_ind_value",
7438                         FT_BOOLEAN, 8, TFS(&isup_Discard_message_ind_value), D_8BIT_MASK,
7439                         "", HFILL }},
7440
7441                 { &hf_isup_Discard_parameter_ind,
7442                         { "Discard parameter indicator","isup.Discard_parameter_ind",
7443                         FT_BOOLEAN, 8, TFS(&isup_Discard_parameter_ind_value), E_8BIT_MASK,
7444                         "", HFILL }},
7445
7446                 { &hf_isup_Pass_on_not_possible_indicator,
7447                         { "Pass on not possible indicator",  "isup_Pass_on_not_possible_ind",
7448                         FT_UINT8, BASE_HEX, VALS(isup_Pass_on_not_possible_indicator_vals),GF_8BIT_MASK,
7449                         "", HFILL }},
7450
7451                 { &hf_isup_pass_on_not_possible_indicator2,
7452                         { "Pass on not possible indicator",  "isup_Pass_on_not_possible_val",
7453                         FT_BOOLEAN, 8, TFS(&isup_pass_on_not_possible_indicator_value),E_8BIT_MASK,
7454                         "", HFILL }},
7455
7456                 { &hf_isup_Broadband_narrowband_interworking_ind,
7457                         { "Broadband narrowband interworking indicator Bits JF",  "isup_broadband-narrowband_interworking_ind",
7458                         FT_UINT8, BASE_HEX, VALS(ISUP_Broadband_narrowband_interworking_indicator_vals),BA_8BIT_MASK,
7459                         "", HFILL }},
7460
7461                 { &hf_isup_Broadband_narrowband_interworking_ind2,
7462                         { "Broadband narrowband interworking indicator Bits GF",  "isup_broadband-narrowband_interworking_ind2",
7463                         FT_UINT8, BASE_HEX, VALS(ISUP_Broadband_narrowband_interworking_indicator_vals),GF_8BIT_MASK,
7464                         "", HFILL }},
7465
7466                 { &hf_isup_app_cont_ident,
7467                         { "Application context identifier",  "isup.app_context_identifier",
7468                         FT_UINT16, BASE_DEC, VALS(isup_application_transport_parameter_value),GFEDCBA_8BIT_MASK,
7469                         "", HFILL }},
7470
7471                 { &hf_isup_app_Release_call_ind,
7472                         { "Release call indicator (RCI)",  "isup.app_Release_call_indicator",
7473                         FT_BOOLEAN, 8, TFS(&isup_Release_call_indicator_value), A_8BIT_MASK,
7474                         "", HFILL }},
7475
7476                 { &hf_isup_app_Send_notification_ind,
7477                         { "Send notification indicator (SNI)",  "isup.app_Send_notification_ind",
7478                         FT_BOOLEAN, 8, TFS(&isup_Send_notification_ind_value), B_8BIT_MASK,
7479                         "", HFILL }},
7480
7481                 { &hf_isup_apm_segmentation_ind,
7482                         { "APM segmentation indicator",  "isup.apm_segmentation_ind",
7483                         FT_UINT8, BASE_DEC, VALS(isup_APM_segmentation_ind_value), FEDCBA_8BIT_MASK,
7484                         "", HFILL }},
7485
7486                 { &hf_isup_apm_si_ind,
7487                         { "Sequence indicator (SI)",  "isup.APM_Sequence_ind",
7488                         FT_BOOLEAN, 8, TFS(&isup_Sequence_ind_value), G_8BIT_MASK,
7489                         "", HFILL }},
7490
7491                 { &hf_isup_orig_addr_len,
7492                         { "Originating Address length",  "isup.orig_addr_len",
7493                         FT_UINT8, BASE_DEC, NULL, 0x0,
7494                         "Originating Address length", HFILL }},
7495
7496                 { &hf_isup_dest_addr_len,
7497                         { "Destination Address length",  "isup.orig_addr_len",
7498                         FT_UINT8, BASE_DEC, NULL, 0x0,
7499                         "Destination Address length", HFILL }},
7500
7501                 { &hf_isup_apm_slr,
7502                         { "Segmentation local reference (SLR)",  "isup.APM_slr",
7503                         FT_UINT8, BASE_DEC, NULL,GFEDCBA_8BIT_MASK,
7504                         "", HFILL }},
7505                 { &hf_isup_cause_location,
7506                         { "Cause location", "isup.cause_location",
7507                         FT_UINT8, BASE_DEC, VALS(q931_cause_location_vals), 0x0f,
7508                         "", HFILL }},
7509
7510                 { &hf_ansi_isup_coding_standard,
7511                   { "Coding standard", "ansi_isup.coding_standard", FT_UINT8, BASE_HEX,
7512                          VALS(ansi_isup_coding_standard_vals), 0x60,"", HFILL }},
7513
7514                 { &hf_bat_ase_identifier,
7515                         { "BAT ASE Identifiers",  "bicc.bat_ase_identifier",
7516                         FT_UINT8, BASE_HEX, VALS(bat_ase_list_of_Identifiers_vals),0x0,
7517                         "", HFILL }},
7518
7519                 { &hf_length_indicator,
7520                         { "BAT ASE Element length indicator",  "bicc.bat_ase_length_indicator",
7521                         FT_UINT16, BASE_DEC, NULL,0x0,
7522                         "", HFILL }},
7523
7524                 { &hf_Action_Indicator,
7525                         { "BAT ASE action indicator field",  "bicc.bat_ase_bat_ase_action_indicator_field",
7526                         FT_UINT8, BASE_HEX, VALS(bat_ase_action_indicator_field_vals),0x00,
7527                         "", HFILL }},
7528
7529                 { &hf_Instruction_ind_for_general_action,
7530                         { "BAT ASE Instruction indicator for general action",  "bicc.bat_ase_Instruction_ind_for_general_action",
7531                         FT_UINT8, BASE_HEX, VALS(Instruction_indicator_for_general_action_vals),0x03,
7532                         "", HFILL }},
7533
7534                 { &hf_Send_notification_ind_for_general_action,
7535                         { "Send notification indicator for general action",  "bicc.bat_ase_Send_notification_ind_for_general_action",
7536                         FT_BOOLEAN, 8, TFS(&isup_Send_notification_ind_value), 0x04,
7537                         "", HFILL }},
7538
7539                 { &hf_Instruction_ind_for_pass_on_not_possible,
7540                         { "Instruction ind for pass-on not possible",  "bicc.bat_ase_Instruction_ind_for_pass_on_not_possible",
7541                         FT_UINT8, BASE_HEX, VALS(Instruction_indicator_for_pass_on_not_possible_vals),0x30,
7542                         "", HFILL }},
7543
7544                 { &hf_Send_notification_ind_for_pass_on_not_possible,
7545                         { "Send notification indication for pass-on not possible",  "bicc.bat_ase_Send_notification_ind_for_pass_on_not_possible",
7546                         FT_BOOLEAN, 8, TFS(&isup_Send_notification_ind_value), 0x40,
7547                         "", HFILL }},
7548
7549                 { &hf_BCTP_Version_Indicator,
7550                         { "BCTP Version Indicator",  "bicc.bat_ase_BCTP_Version_Indicator",
7551                         FT_UINT8, BASE_DEC, NULL,0x1f,
7552                         "", HFILL }},
7553
7554                 { &hf_BVEI,
7555                         { "BVEI",  "bicc.bat_ase_BCTP_BVEI",
7556                         FT_BOOLEAN, 8, TFS(&BCTP_BVEI_value), 0x40,
7557                         "", HFILL }},
7558
7559                 { &hf_Tunnelled_Protocol_Indicator,
7560                         { "Tunnelled Protocol Indicator",  "bicc.bat_ase_BCTP_Tunnelled_Protocol_Indicator",
7561                         FT_UINT8, BASE_DEC, VALS(BCTP_Tunnelled_Protocol_Indicator_vals),0x3f,
7562                         "", HFILL }},
7563
7564                 { &hf_TPEI,
7565                         { "TPEI",  "bicc.bat_ase_BCTP_tpei",
7566                         FT_BOOLEAN, 8, TFS(&BCTP_TPEI_value), 0x40,
7567                         "", HFILL }},
7568
7569                 { &hf_bncid,
7570                         { "Backbone Network Connection Identifier (BNCId)", "bat_ase.bncid",
7571                         FT_UINT32, BASE_HEX, NULL, 0x0,
7572                           "", HFILL }},
7573
7574                 { &hf_bat_ase_biwfa,
7575                         { "Interworking Function Address( X.213 NSAP encoded)", "bat_ase_biwfa",
7576                         FT_BYTES, BASE_HEX, NULL, 0x0,
7577                           "", HFILL }},
7578
7579                 { &hf_afi,
7580                         { "X.213 Address Format Information ( AFI )",  "x213.afi",
7581                         FT_UINT8, BASE_HEX, VALS(x213_afi_value),0x0,
7582                         "", HFILL }},
7583
7584                 { &hf_bicc_nsap_dsp,
7585                         { "X.213 Address Format Information ( DSP )",  "x213.dsp",
7586                         FT_BYTES, BASE_HEX, NULL,0x0,
7587                         "", HFILL }},
7588                 { &hf_characteristics,
7589                         { "Backbone network connection characteristics", "bat_ase.char",
7590                         FT_UINT8, BASE_HEX, VALS(bearer_network_connection_characteristics_vals),0x0,
7591                           "", HFILL }},
7592
7593                 { &hf_Organization_Identifier,
7594                         { "Organization identifier subfield ",  "bat_ase.organization_identifier_subfield",
7595                         FT_UINT8, BASE_DEC, VALS(bat_ase_organization_identifier_subfield_vals),0x0,
7596                         "", HFILL }},
7597
7598                 { &hf_codec_type,
7599                         { "ITU-T codec type subfield",  "bat_ase.ITU_T_codec_type_subfield",
7600                         FT_UINT8, BASE_HEX, VALS(ITU_T_codec_type_subfield_vals),0x0,
7601                         "", HFILL }},
7602
7603                 { &hf_etsi_codec_type,
7604                         { "ETSI codec type subfield",  "bat_ase.ETSI_codec_type_subfield",
7605                         FT_UINT8, BASE_HEX, VALS(ETSI_codec_type_subfield_vals),0x0,
7606                         "", HFILL }},
7607
7608                 { &hf_active_code_set,
7609                         { "Active Code Set",  "bat_ase.acs",
7610                         FT_UINT8, BASE_HEX, NULL,0x0,
7611                         "", HFILL }},
7612
7613                 { &hf_active_code_set_12_2,
7614                         { "12.2 kbps rate",  "bat_ase.acs.12_2",
7615                         FT_UINT8, BASE_HEX, NULL,0x80,
7616                         "", HFILL }},
7617
7618                 { &hf_active_code_set_10_2,
7619                         { "10.2 kbps rate",  "bat_ase.acs.10_2",
7620                         FT_UINT8, BASE_HEX, NULL,0x40,
7621                         "", HFILL }},
7622
7623                 { &hf_active_code_set_7_95,
7624                         { "7.95 kbps rate",  "bat_ase.acs.7_95",
7625                         FT_UINT8, BASE_HEX, NULL,0x20,
7626                         "", HFILL }},
7627
7628                 { &hf_active_code_set_7_40,
7629                         { "7.40 kbps rate",  "bat_ase.acs.7_40",
7630                         FT_UINT8, BASE_HEX, NULL,0x10,
7631                         "", HFILL }},
7632
7633                 { &hf_active_code_set_6_70,
7634                         { "6.70 kbps rate",  "bat_ase.acs.6_70",
7635                         FT_UINT8, BASE_HEX, NULL,0x08,
7636                         "", HFILL }},
7637
7638                 { &hf_active_code_set_5_90,
7639                         { "5.90 kbps rate",  "bat_ase.acs.5_90",
7640                         FT_UINT8, BASE_HEX, NULL,0x04,
7641                         "", HFILL }},
7642
7643                 { &hf_active_code_set_5_15,
7644                         { "5.15 kbps rate",  "bat_ase.acs.5_15",
7645                         FT_UINT8, BASE_HEX, NULL,0x02,
7646                         "", HFILL }},
7647
7648                 { &hf_active_code_set_4_75,
7649                         { "4.75 kbps rate",  "bat_ase.acs.4_75",
7650                         FT_UINT8, BASE_HEX, NULL,0x01,
7651                         "", HFILL }},
7652
7653                 { &hf_supported_code_set,
7654                         { "Supported Code Set",  "bat_ase.scs",
7655                         FT_UINT8, BASE_HEX, NULL,0x0,
7656                         "", HFILL }},
7657
7658                 { &hf_supported_code_set_12_2,
7659                         { "12.2 kbps rate",  "bat_ase.scs.12_2",
7660                         FT_UINT8, BASE_HEX, NULL,0x80,
7661                         "", HFILL }},
7662
7663                 { &hf_supported_code_set_10_2,
7664                         { "10.2 kbps rate",  "bat_ase.scs.10_2",
7665                         FT_UINT8, BASE_HEX, NULL,0x40,
7666                         "", HFILL }},
7667
7668                 { &hf_supported_code_set_7_95,
7669                         { "7.95 kbps rate",  "bat_ase.scs.7_95",
7670                         FT_UINT8, BASE_HEX, NULL,0x20,
7671                         "", HFILL }},
7672
7673                 { &hf_supported_code_set_7_40,
7674                         { "7.40 kbps rate",  "bat_ase.scs.7_40",
7675                         FT_UINT8, BASE_HEX, NULL,0x10,
7676                         "", HFILL }},
7677
7678                 { &hf_supported_code_set_6_70,
7679                         { "6.70 kbps rate",  "bat_ase.scs.6_70",
7680                         FT_UINT8, BASE_HEX, NULL,0x08,
7681                         "", HFILL }},
7682
7683                 { &hf_supported_code_set_5_90,
7684                         { "5.90 kbps rate",  "bat_ase.scs.5_90",
7685                         FT_UINT8, BASE_HEX, NULL,0x04,
7686                         "", HFILL }},
7687
7688                 { &hf_supported_code_set_5_15,
7689                         { "5.15 kbps rate",  "bat_ase.scs.5_15",
7690                         FT_UINT8, BASE_HEX, NULL,0x02,
7691                         "", HFILL }},
7692
7693                 { &hf_supported_code_set_4_75,
7694                         { "4.75 kbps rate",  "bat_ase.scs.4_75",
7695                         FT_UINT8, BASE_HEX, NULL,0x01,
7696                         "", HFILL }},
7697
7698                 { &hf_optimisation_mode,
7699                         { "Optimisation Mode for ACS , OM",  "bat_ase.optimisation_mode",
7700                         FT_UINT8, BASE_HEX, VALS(optimisation_mode_vals),0x8,
7701                         "Optimisation Mode for ACS , OM", HFILL }},
7702
7703                 { &hf_max_codec_modes,
7704                         { "Maximal number of Codec Modes, MACS",  "bat_ase.macs",
7705                         FT_UINT8, BASE_DEC, NULL,0x07,
7706                         "Maximal number of Codec Modes, MACS", HFILL }},
7707
7708
7709                 { &hf_bearer_control_tunneling,
7710                         { "Bearer control tunneling",  "bat_ase.bearer_control_tunneling",
7711                         FT_BOOLEAN, 8, TFS(&Bearer_Control_Tunnelling_ind_value),0x01,
7712                         "", HFILL }},
7713
7714                 { &hf_BAT_ASE_Comp_Report_Reason,
7715                         { "Compabillity report reason",  "bat_ase.Comp_Report_Reason",
7716                         FT_UINT8, BASE_HEX, VALS(BAT_ASE_Report_Reason_vals),0x0,
7717                         "", HFILL }},
7718
7719
7720                 { &hf_BAT_ASE_Comp_Report_ident,
7721                         { "Bearer control tunneling",  "bat_ase.bearer_control_tunneling",
7722                         FT_UINT8, BASE_HEX, VALS(bat_ase_list_of_Identifiers_vals),0x0,
7723                         "", HFILL }},
7724
7725                 { &hf_BAT_ASE_Comp_Report_diagnostic,
7726                         { "Diagnostics",  "bat_ase.Comp_Report_diagnostic",
7727                         FT_UINT16, BASE_HEX, NULL,0x0,
7728                         "", HFILL }},
7729
7730                 { &hf_Local_BCU_ID,
7731                         { "Local BCU ID",  "bat_ase.Local_BCU_ID",
7732                         FT_UINT32, BASE_HEX, NULL, 0x0,
7733                           "", HFILL }},
7734
7735                 { &hf_late_cut_trough_cap_ind,
7736                         { "Late Cut-through capability indicator",  "bat_ase.late_cut_trough_cap_ind",
7737                         FT_BOOLEAN, 8, TFS(&late_cut_trough_cap_ind_value),0x01,
7738                         "", HFILL }},
7739
7740                 { &hf_bat_ase_signal,
7741                         { "Q.765.5 - Signal Type",  "bat_ase.signal_type",
7742                         FT_UINT8, BASE_HEX, VALS(BAt_ASE_Signal_Type_vals),0x0,
7743                         "", HFILL }},
7744
7745                 { &hf_bat_ase_duration,
7746                         { "Duration in ms",  "bat_ase.signal_type",
7747                         FT_UINT16, BASE_DEC, NULL,0x0,
7748                         "", HFILL }},
7749
7750                 { &hf_bat_ase_bearer_redir_ind,
7751                         { "Redirection Indicator",  "bat_ase.bearer_redir_ind",
7752                         FT_UINT8, BASE_HEX, VALS(Bearer_Redirection_Indicator_vals),0x0,
7753                         "", HFILL }},
7754
7755                 { &hf_nsap_ipv4_addr,
7756                         { "IWFA IPv4 Address", "nsap.ipv4_addr",
7757                         FT_IPv4, BASE_NONE, NULL, 0x0,
7758                         "IPv4 address", HFILL }},
7759
7760                 { &hf_nsap_ipv6_addr,
7761                         { "IWFA IPv6 Address", "nsap.ipv6_addr",
7762                         FT_IPv6, BASE_NONE, NULL, 0x0,
7763                         "IPv6 address", HFILL}},
7764
7765                 { &hf_iana_icp,
7766                         { "IANA ICP",  "nsap.iana_icp",
7767                         FT_UINT16, BASE_HEX, VALS(iana_icp_values),0x0,
7768                       "", HFILL }},
7769
7770               { &hf_isup_called,
7771                       { "ISUP Called Number",  "isup.called",
7772                       FT_STRING, BASE_NONE, NULL,0x0,
7773                       "", HFILL }},
7774
7775               { &hf_isup_calling,
7776                       { "ISUP Calling Number",  "isup.calling",
7777                       FT_STRING, BASE_NONE, NULL,0x0,
7778                       "", HFILL }},
7779
7780               { &hf_isup_redirecting,
7781                       { "ISUP Redirecting Number",  "isup.redirecting",
7782                       FT_STRING, BASE_NONE, NULL,0x0,
7783                         "", HFILL }},
7784                 {&hf_isup_apm_msg_fragments,
7785                         {"Message fragments", "isup_apm.msg.fragments",
7786                         FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL }
7787                 },
7788                 {&hf_isup_apm_msg_fragment,
7789                         {"Message fragment", "isup_apm.msg.fragment",
7790                         FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }
7791                 },
7792                 {&hf_isup_apm_msg_fragment_overlap,
7793                         {"Message fragment overlap", "isup_apm.msg.fragment.overlap",
7794                         FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
7795                 },
7796                 {&hf_isup_apm_msg_fragment_overlap_conflicts,
7797                         {"Message fragment overlapping with conflicting data","isup_apm.msg.fragment.overlap.conflicts",
7798                         FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
7799                 },
7800                 {&hf_isup_apm_msg_fragment_multiple_tails,
7801                         {"Message has multiple tail fragments", "isup_apm.msg.fragment.multiple_tails",
7802                         FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
7803                 },
7804                 {&hf_isup_apm_msg_fragment_too_long_fragment,
7805                         {"Message fragment too long", "isup_apm.msg.fragment.too_long_fragment",
7806                         FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
7807                 },
7808                 {&hf_isup_apm_msg_fragment_error,
7809                         {"Message defragmentation error", "isup_apm.msg.fragment.error",
7810                         FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }
7811                 },
7812                 {&hf_isup_apm_msg_reassembled_in,
7813                         {"Reassembled in", "isup_apm.msg.reassembled.in",
7814                         FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }
7815                 },
7816                 {&hf_isup_cvr_rsp_ind,
7817                  {"CVR Response Ind", "conn_rsp_ind",
7818                   FT_UINT8, BASE_DEC, VALS(isup_cvr_rsp_ind_value), BA_8BIT_MASK,
7819                   "", HFILL }},
7820                 {&hf_isup_cvr_cg_car_ind,
7821                  {"CVR Circuit Group Carrier","cg_carrier_ind",
7822                  FT_UINT8, BASE_HEX, VALS(isup_cvr_cg_car_ind_value), BA_8BIT_MASK,
7823                   "", HFILL }},
7824                 {&hf_isup_cvr_cg_double_seize,
7825                  {"Doube Seize Control", "cg_char_ind.doubleSeize",
7826                   FT_UINT8, BASE_HEX, VALS(isup_cvr_cg_double_seize_value), DC_8BIT_MASK,
7827                   "", HFILL }},
7828                 {&hf_isup_cvr_cg_alarm_car_ind,
7829                  {"Alarm Carrier Indicator", "cg_alarm_car_ind",
7830                   FT_UINT8, BASE_HEX, VALS(isup_cvr_alarm_car_ind_value), FE_8BIT_MASK,
7831                   "", HFILL }},
7832                 {&hf_isup_cvr_cont_chk_ind,
7833                  {"Continuity Check Indicator","cg_alarm_cnt_chk",
7834                   FT_UINT8, BASE_HEX, VALS(isup_cvr_cont_chk_ind_value), HG_8BIT_MASK,
7835                   "",HFILL }}
7836         };
7837
7838 /* Setup protocol subtree array */
7839         static gint *ett[] = {
7840                 &ett_isup,
7841                 &ett_isup_parameter,
7842                 &ett_isup_address_digits,
7843                 &ett_isup_pass_along_message,
7844                 &ett_isup_circuit_state_ind,
7845                 &ett_bat_ase,
7846                 &ett_bat_ase_element,
7847                 &ett_bat_ase_iwfa,
7848                 &ett_scs,
7849                 &ett_acs,
7850                 &ett_isup_apm_msg_fragment,
7851                 &ett_isup_apm_msg_fragments,
7852         };
7853
7854 /* Register the protocol name and description */
7855         proto_isup = proto_register_protocol("ISDN User Part",
7856             "ISUP", "isup");
7857
7858         register_dissector("isup", dissect_isup, proto_isup);
7859
7860 /* Required function calls to register the header fields and subtrees used */
7861         proto_register_field_array(proto_isup, hf, array_length(hf));
7862         proto_register_subtree_array(ett, array_length(ett));
7863
7864         isup_tap = register_tap("isup");
7865
7866         isup_module = prefs_register_protocol(proto_isup, NULL);
7867
7868
7869         prefs_register_bool_preference(isup_module, "show_cic_in_info", "Show CIC in Info column",
7870                                  "Show the CIC value (in addition to the message type) in the Info column",
7871                                  (gint *)&isup_show_cic_in_info);
7872
7873         prefs_register_bool_preference(isup_module, "defragment_apm",
7874                 "Reassemble APM messages",
7875                 "Whether APM messages datagrams should be reassembled",
7876                 &isup_apm_desegment);
7877
7878         /* Register the stats_tree */
7879         stats_tree_register("isup","isup_msg","ISUP Messages", msg_stats_tree_packet, msg_stats_tree_init, NULL );
7880 }
7881
7882
7883 /* ------------------------------------------------------------------ */
7884 /* Register isup with the sub-laying MTP L3 dissector */
7885 void
7886 proto_reg_handoff_isup(void)
7887 {
7888   dissector_handle_t isup_handle;
7889   dissector_handle_t application_isup_handle;
7890
7891   isup_handle = create_dissector_handle(dissect_isup, proto_isup);
7892   application_isup_handle = create_dissector_handle(dissect_application_isup, proto_isup);
7893   dissector_add("mtp3.service_indicator", MTP3_ISUP_SERVICE_INDICATOR, isup_handle);
7894   dissector_add_string("media_type","application/isup", application_isup_handle);
7895   dissector_add_string("tali.opcode", "isot", isup_handle);
7896
7897 }
7898
7899 void
7900 proto_register_bicc(void)
7901 {
7902 /* Setup list of header fields  See Section 1.6.1 for details*/
7903         static hf_register_info hf[] = {
7904                 { &hf_bicc_cic,
7905                         { "Call identification Code (CIC)",           "bicc.cic",
7906                         FT_UINT32, BASE_HEX, NULL, 0x0,
7907                           "", HFILL }},
7908         };
7909
7910 /* Setup protocol subtree array */
7911         static gint *ett[] = {
7912                 &ett_bicc
7913         };
7914         proto_bicc = proto_register_protocol("Bearer Independent Call Control ",
7915             "BICC", "bicc");
7916 /* Required function calls to register the header fields and subtrees used */
7917         proto_register_field_array(proto_bicc, hf, array_length(hf));
7918         proto_register_subtree_array(ett, array_length(ett));
7919
7920         register_init_routine(isup_apm_defragment_init);
7921 }
7922
7923 /* Register isup with the sub-laying MTP L3 dissector */
7924 void
7925 proto_reg_handoff_bicc(void)
7926 {
7927   dissector_handle_t bicc_handle;
7928   sdp_handle = find_dissector("sdp");
7929   q931_ie_handle = find_dissector("q931.ie");
7930
7931   bicc_handle = create_dissector_handle(dissect_bicc, proto_bicc);
7932   dissector_add("mtp3.service_indicator", MTP3_BICC_SERVICE_INDICATOR, bicc_handle);
7933   dissector_add("sctp.ppi", BICC_PAYLOAD_PROTOCOL_ID, bicc_handle);
7934 }