Operation name updates for winreg pipe from Jean-Baptiste Marchand.
[obnox/wireshark/wip.git] / packet-isup.c
1 /* packet-isup.c
2  * Routines for ISUP dissection
3  * Copyright 2001, Martina Obermeier <martina.obermeier@icn.siemens.de>
4  * Modified 2003-09-10 by Anders Broman
5  *              <anders.broman@ericsson.com>
6  * Inserted routines for BICC dissection according to Q.765.5 Q.1902 Q.1970 Q.1990,
7  * calling SDP dissector for RFC2327 decoding.
8  * $Id: packet-isup.c,v 1.26 2003/09/27 23:51:09 guy Exp $
9  *
10  * Ethereal - Network traffic analyzer
11  * By Gerald Combs <gerald@ethereal.com>
12  * Copyright 1998 Gerald Combs
13  *
14  * Copied from README.developer
15  *
16  * This program is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU General Public License
18  * as published by the Free Software Foundation; either version 2
19  * of the License, or (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program; if not, write to the Free Software
28  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29  */
30
31 #ifdef HAVE_CONFIG_H
32 # include "config.h"
33 #endif
34
35 #include <stdio.h>
36 #include <stdlib.h>
37 #include <string.h>
38
39 #include <glib.h>
40
41 #include <epan/packet.h>
42 #include "packet-q931.h"
43
44 #define MTP3_ISUP_SERVICE_INDICATOR     5
45 #define MTP3_BICC_SERVICE_INDICATOR     13
46 #define ASCII_NUMBER_DELTA              0x30
47 #define ASCII_LETTER_DELTA              0x37
48
49 /* Definition of protocol field values und lengths */
50
51 /* Definition of Message Types */
52 #define MESSAGE_TYPE_INITIAL_ADDR       1
53 #define MESSAGE_TYPE_SUBSEQ_ADDR        2
54 #define MESSAGE_TYPE_INFO_REQ           3
55 #define MESSAGE_TYPE_INFO               4
56 #define MESSAGE_TYPE_CONTINUITY         5
57 #define MESSAGE_TYPE_ADDR_CMPL          6
58 #define MESSAGE_TYPE_CONNECT            7
59 #define MESSAGE_TYPE_FORW_TRANS         8
60 #define MESSAGE_TYPE_ANSWER             9
61 #define MESSAGE_TYPE_RELEASE           12
62 #define MESSAGE_TYPE_SUSPEND           13
63 #define MESSAGE_TYPE_RESUME            14
64 #define MESSAGE_TYPE_REL_CMPL          16
65 #define MESSAGE_TYPE_CONT_CHECK_REQ    17
66 #define MESSAGE_TYPE_RESET_CIRCUIT     18
67 #define MESSAGE_TYPE_BLOCKING          19
68 #define MESSAGE_TYPE_UNBLOCKING        20
69 #define MESSAGE_TYPE_BLOCK_ACK         21
70 #define MESSAGE_TYPE_UNBLOCK_ACK       22
71 #define MESSAGE_TYPE_CIRC_GRP_RST      23
72 #define MESSAGE_TYPE_CIRC_GRP_BLCK     24
73 #define MESSAGE_TYPE_CIRC_GRP_UNBL     25
74 #define MESSAGE_TYPE_CIRC_GRP_BL_ACK   26
75 #define MESSAGE_TYPE_CIRC_GRP_UNBL_ACK 27
76 #define MESSAGE_TYPE_FACILITY_REQ      31
77 #define MESSAGE_TYPE_FACILITY_ACC      32
78 #define MESSAGE_TYPE_FACILITY_REJ      33
79 #define MESSAGE_TYPE_LOOP_BACK_ACK     36
80 #define MESSAGE_TYPE_PASS_ALONG        40
81 #define MESSAGE_TYPE_CIRC_GRP_RST_ACK  41
82 #define MESSAGE_TYPE_CIRC_GRP_QRY      42
83 #define MESSAGE_TYPE_CIRC_GRP_QRY_RSP  43
84 #define MESSAGE_TYPE_CALL_PROGRSS      44
85 #define MESSAGE_TYPE_USER2USER_INFO    45
86 #define MESSAGE_TYPE_UNEQUIPPED_CIC    46
87 #define MESSAGE_TYPE_CONFUSION         47
88 #define MESSAGE_TYPE_OVERLOAD          48
89 #define MESSAGE_TYPE_CHARGE_INFO       49
90 #define MESSAGE_TYPE_NETW_RESRC_MGMT   50
91 #define MESSAGE_TYPE_FACILITY          51
92 #define MESSAGE_TYPE_USER_PART_TEST    52
93 #define MESSAGE_TYPE_USER_PART_AVAIL   53
94 #define MESSAGE_TYPE_IDENT_REQ         54
95 #define MESSAGE_TYPE_IDENT_RSP         55
96 #define MESSAGE_TYPE_SEGMENTATION      56
97 #define MESSAGE_TYPE_LOOP_PREVENTION   64
98 #define MESSAGE_TYPE_APPLICATION_TRANS 65
99 #define MESSAGE_TYPE_PRE_RELEASE_INFO  66
100 #define MESSAGE_TYPE_SUBSEQUENT_DIR_NUM 67
101
102
103 static const value_string isup_message_type_value[] = {
104   { MESSAGE_TYPE_INITIAL_ADDR,          "Initial address"},
105   { MESSAGE_TYPE_SUBSEQ_ADDR,           "Subsequent address"},
106   { MESSAGE_TYPE_INFO_REQ,              "Information request (national use)"},
107   { MESSAGE_TYPE_INFO,                  "Information (national use)"},
108   { MESSAGE_TYPE_CONTINUITY,            "Continuity"},
109   { MESSAGE_TYPE_ADDR_CMPL,             "Address complete"},
110   { MESSAGE_TYPE_CONNECT,               "Connect"},
111   { MESSAGE_TYPE_FORW_TRANS,            "Forward transfer"},
112   { MESSAGE_TYPE_ANSWER,                "Answer"},
113   { MESSAGE_TYPE_RELEASE,               "Release"},
114   { MESSAGE_TYPE_SUSPEND,               "Suspend"},
115   { MESSAGE_TYPE_RESUME,                "Resume"},
116   { MESSAGE_TYPE_REL_CMPL,              "Release complete"},
117   { MESSAGE_TYPE_CONT_CHECK_REQ,        "Continuity check request"},
118   { MESSAGE_TYPE_RESET_CIRCUIT,         "Reset Circuit"},
119   { MESSAGE_TYPE_BLOCKING,              "Blocking"},
120   { MESSAGE_TYPE_UNBLOCKING,            "Unblocking"},
121   { MESSAGE_TYPE_BLOCK_ACK,             "Blocking acknowledgement"},
122   { MESSAGE_TYPE_UNBLOCK_ACK,           "Unblocking acknowledgment"},
123   { MESSAGE_TYPE_CIRC_GRP_RST,          "Circuit group reset"},
124   { MESSAGE_TYPE_CIRC_GRP_BLCK,         "Circuit group blocking"},
125   { MESSAGE_TYPE_CIRC_GRP_UNBL,         "Circuit group unblocking"},
126   { MESSAGE_TYPE_CIRC_GRP_BL_ACK,       "Circuit group blocking acknowledgement"},
127   { MESSAGE_TYPE_CIRC_GRP_UNBL_ACK,     "Circuit group unblocking acknowledgement"},
128   { MESSAGE_TYPE_FACILITY_REQ,          "Facility request"},
129   { MESSAGE_TYPE_FACILITY_ACC,          "Facility accepted"},
130   { MESSAGE_TYPE_FACILITY_REJ,          "Facility reject"},
131   { MESSAGE_TYPE_LOOP_BACK_ACK,         "Loop back acknowledgement (national use)"},
132   { MESSAGE_TYPE_PASS_ALONG,            "Pass-along (national use)"},
133   { MESSAGE_TYPE_CIRC_GRP_RST_ACK,      "Circuit group reset acknowledgement"},
134   { MESSAGE_TYPE_CIRC_GRP_QRY,          "Circuit group query (national use)"},
135   { MESSAGE_TYPE_CIRC_GRP_QRY_RSP,      "Circuit group query response (national use)"},
136   { MESSAGE_TYPE_CALL_PROGRSS,          "Call progress"},
137   { MESSAGE_TYPE_USER2USER_INFO,        "User-to-user information"},
138   { MESSAGE_TYPE_UNEQUIPPED_CIC,        "Unequipped CIC (national use)"},
139   { MESSAGE_TYPE_CONFUSION,             "Confusion"},
140   { MESSAGE_TYPE_OVERLOAD,              "Overload (national use)"},
141   { MESSAGE_TYPE_CHARGE_INFO,           "Charge information (national use)"},
142   { MESSAGE_TYPE_NETW_RESRC_MGMT,       "Network resource management"},
143   { MESSAGE_TYPE_FACILITY,              "Facility"},
144   { MESSAGE_TYPE_USER_PART_TEST,        "User part test"},
145   { MESSAGE_TYPE_USER_PART_AVAIL,       "User part available"},
146   { MESSAGE_TYPE_IDENT_REQ,             "Identification request"},
147   { MESSAGE_TYPE_IDENT_RSP,             "Identification response"},
148   { MESSAGE_TYPE_SEGMENTATION,          "Segmentation"},
149   { MESSAGE_TYPE_LOOP_PREVENTION,       "Loop prevention"},
150   { MESSAGE_TYPE_APPLICATION_TRANS,     "Application transport"},
151   { MESSAGE_TYPE_PRE_RELEASE_INFO,      "Pre-release information"},     
152   { MESSAGE_TYPE_SUBSEQUENT_DIR_NUM,    "Subsequent Directory Number (national use)"},
153
154   { 0,                                  NULL}};
155
156 /* Same as above but in acronym form (for the Info column) */
157 static const value_string isup_message_type_value_acro[] = {
158   { MESSAGE_TYPE_INITIAL_ADDR,          "IAM"},
159   { MESSAGE_TYPE_SUBSEQ_ADDR,           "SAM"},
160   { MESSAGE_TYPE_INFO_REQ,              "INR"},
161   { MESSAGE_TYPE_INFO,                  "INF"},
162   { MESSAGE_TYPE_CONTINUITY,            "COT"},
163   { MESSAGE_TYPE_ADDR_CMPL,             "ACM"},
164   { MESSAGE_TYPE_CONNECT,               "CON"},
165   { MESSAGE_TYPE_FORW_TRANS,            "FOT"},
166   { MESSAGE_TYPE_ANSWER,                "ANM"},
167   { MESSAGE_TYPE_RELEASE,               "REL"},
168   { MESSAGE_TYPE_SUSPEND,               "SUS"},
169   { MESSAGE_TYPE_RESUME,                "RES"},
170   { MESSAGE_TYPE_REL_CMPL,              "RLC"},
171   { MESSAGE_TYPE_CONT_CHECK_REQ,        "CCR"},
172   { MESSAGE_TYPE_RESET_CIRCUIT,         "RSC"},
173   { MESSAGE_TYPE_BLOCKING,              "BLO"},
174   { MESSAGE_TYPE_UNBLOCKING,            "UBL"},
175   { MESSAGE_TYPE_BLOCK_ACK,             "BLA"},
176   { MESSAGE_TYPE_UNBLOCK_ACK,           "UBLA"},
177   { MESSAGE_TYPE_CIRC_GRP_RST,          "GRS"},
178   { MESSAGE_TYPE_CIRC_GRP_BLCK,         "CGB"},
179   { MESSAGE_TYPE_CIRC_GRP_UNBL,         "CGU"},
180   { MESSAGE_TYPE_CIRC_GRP_BL_ACK,       "CGBA"},
181   { MESSAGE_TYPE_CIRC_GRP_UNBL_ACK,     "CGUA"},
182   { MESSAGE_TYPE_FACILITY_REQ,          "FAR"},
183   { MESSAGE_TYPE_FACILITY_ACC,          "FAA"},
184   { MESSAGE_TYPE_FACILITY_REJ,          "FRJ"},
185   { MESSAGE_TYPE_LOOP_BACK_ACK,         "LPA"},
186   { MESSAGE_TYPE_PASS_ALONG,            "PAM"},
187   { MESSAGE_TYPE_CIRC_GRP_RST_ACK,      "GRA"},
188   { MESSAGE_TYPE_CIRC_GRP_QRY,          "CQM"},
189   { MESSAGE_TYPE_CIRC_GRP_QRY_RSP,      "CQR"},
190   { MESSAGE_TYPE_CALL_PROGRSS,          "CPG"},
191   { MESSAGE_TYPE_USER2USER_INFO,        "UUI"},
192   { MESSAGE_TYPE_UNEQUIPPED_CIC,        "UCIC"},
193   { MESSAGE_TYPE_CONFUSION,             "CFN"},
194   { MESSAGE_TYPE_OVERLOAD,              "OLM"},
195   { MESSAGE_TYPE_CHARGE_INFO,           "CRG"},
196   { MESSAGE_TYPE_NETW_RESRC_MGMT,       "NRM"},
197   { MESSAGE_TYPE_FACILITY,              "FAC"},
198   { MESSAGE_TYPE_USER_PART_TEST,        "UPT"},
199   { MESSAGE_TYPE_USER_PART_AVAIL,       "UPA"},
200   { MESSAGE_TYPE_IDENT_REQ,             "IDR"},
201   { MESSAGE_TYPE_IDENT_RSP,             "IDS"},
202   { MESSAGE_TYPE_SEGMENTATION,          "SGM"},
203   { MESSAGE_TYPE_LOOP_PREVENTION,       "LOP"},
204   { MESSAGE_TYPE_APPLICATION_TRANS,     "APM"},
205   { MESSAGE_TYPE_PRE_RELEASE_INFO,      "PRI"},         
206   { MESSAGE_TYPE_SUBSEQUENT_DIR_NUM,    "SDN"},
207
208   { 0,                                  NULL}};
209
210 /* Definition of Parameter Types */
211 #define PARAM_TYPE_END_OF_OPT_PARAMS      0
212 #define PARAM_TYPE_CALL_REF               1
213 #define PARAM_TYPE_TRANSM_MEDIUM_REQU     2
214 #define PARAM_TYPE_ACC_TRANSP             3
215 #define PARAM_TYPE_CALLED_PARTY_NR        4
216 #define PARAM_TYPE_SUBSQT_NR              5
217 #define PARAM_TYPE_NATURE_OF_CONN_IND     6
218 #define PARAM_TYPE_FORW_CALL_IND          7
219 #define PARAM_TYPE_OPT_FORW_CALL_IND      8
220 #define PARAM_TYPE_CALLING_PRTY_CATEG     9
221 #define PARAM_TYPE_CALLING_PARTY_NR      10
222 #define PARAM_TYPE_REDIRECTING_NR        11
223 #define PARAM_TYPE_REDIRECTION_NR        12
224 #define PARAM_TYPE_CONNECTION_REQ        13
225 #define PARAM_TYPE_INFO_REQ_IND          14
226 #define PARAM_TYPE_INFO_IND              15
227 #define PARAM_TYPE_CONTINUITY_IND        16
228 #define PARAM_TYPE_BACKW_CALL_IND        17
229 #define PARAM_TYPE_CAUSE_INDICATORS      18
230 #define PARAM_TYPE_REDIRECTION_INFO      19
231 #define PARAM_TYPE_CIRC_GRP_SV_MSG_TYPE  21
232 #define PARAM_TYPE_RANGE_AND_STATUS      22
233 #define PARAM_TYPE_FACILITY_IND          24
234 #define PARAM_TYPE_CLSD_USR_GRP_ILOCK_CD 26
235 #define PARAM_TYPE_USER_SERVICE_INFO     29
236 #define PARAM_TYPE_SIGNALLING_POINT_CODE 30
237 #define PARAM_TYPE_USER_TO_USER_INFO     32
238 #define PARAM_TYPE_CONNECTED_NR          33
239 #define PARAM_TYPE_SUSP_RESUME_IND       34
240 #define PARAM_TYPE_TRANSIT_NETW_SELECT   35
241 #define PARAM_TYPE_EVENT_INFO            36
242 #define PARAM_TYPE_CIRC_ASSIGN_MAP       37
243 #define PARAM_TYPE_CIRC_STATE_IND        38
244 #define PARAM_TYPE_AUTO_CONG_LEVEL       39
245 #define PARAM_TYPE_ORIG_CALLED_NR        40
246 #define PARAM_TYPE_OPT_BACKW_CALL_IND    41
247 #define PARAM_TYPE_USER_TO_USER_IND      42
248 #define PARAM_TYPE_ORIG_ISC_POINT_CODE   43
249 #define PARAM_TYPE_GENERIC_NOTIF_IND     44
250 #define PARAM_TYPE_CALL_HIST_INFO        45
251 #define PARAM_TYPE_ACC_DELIV_INFO        46
252 #define PARAM_TYPE_NETW_SPECIFIC_FACLTY  47
253 #define PARAM_TYPE_USER_SERVICE_INFO_PR  48
254 #define PARAM_TYPE_PROPAG_DELAY_COUNTER  49
255 #define PARAM_TYPE_REMOTE_OPERATIONS     50
256 #define PARAM_TYPE_SERVICE_ACTIVATION    51
257 #define PARAM_TYPE_USER_TELESERV_INFO    52
258 #define PARAM_TYPE_TRANSM_MEDIUM_USED    53
259 #define PARAM_TYPE_CALL_DIV_INFO         54
260 #define PARAM_TYPE_ECHO_CTRL_INFO        55
261 #define PARAM_TYPE_MSG_COMPAT_INFO       56
262 #define PARAM_TYPE_PARAM_COMPAT_INFO     57
263 #define PARAM_TYPE_MLPP_PRECEDENCE       58
264 #define PARAM_TYPE_MCID_REQ_IND          59
265 #define PARAM_TYPE_MCID_RSP_IND          60
266 #define PARAM_TYPE_HOP_COUNTER           61
267 #define PARAM_TYPE_TRANSM_MEDIUM_RQUR_PR 62
268 #define PARAM_TYPE_LOCATION_NR           63
269 #define PARAM_TYPE_REDIR_NR_RSTRCT       64
270 #define PARAM_TYPE_CALL_TRANS_REF        67
271 #define PARAM_TYPE_LOOP_PREV_IND         68
272 #define PARAM_TYPE_CALL_TRANS_NR         69
273 #define PARAM_TYPE_CCSS                  75
274 #define PARAM_TYPE_FORW_GVNS             76
275 #define PARAM_TYPE_BACKW_GVNS            77
276 #define PARAM_TYPE_REDIRECT_CAPAB        78
277 #define PARAM_TYPE_NETW_MGMT_CTRL        91
278 #define PARAM_TYPE_CORRELATION_ID       101
279 #define PARAM_TYPE_SCF_ID               102
280 #define PARAM_TYPE_CALL_DIV_TREAT_IND   110
281 #define PARAM_TYPE_CALLED_IN_NR         111
282 #define PARAM_TYPE_CALL_OFF_TREAT_IND   112
283 #define PARAM_TYPE_CHARGED_PARTY_IDENT  113
284 #define PARAM_TYPE_CONF_TREAT_IND       114
285 #define PARAM_TYPE_DISPLAY_INFO         115
286 #define PARAM_TYPE_UID_ACTION_IND       116
287 #define PARAM_TYPE_UID_CAPAB_IND        117
288 #define PARAM_TYPE_REDIRECT_COUNTER     119
289 #define PARAM_TYPE_APPLICATON_TRANS     120
290 #define PARAM_TYPE_COLLECT_CALL_REQ     121
291 #define PARAM_TYPE_GENERIC_NR           192
292 #define PARAM_TYPE_GENERIC_DIGITS       193
293
294 static const value_string isup_parameter_type_value[] = {
295 { PARAM_TYPE_END_OF_OPT_PARAMS,        "End of optional parameters"},
296   { PARAM_TYPE_CALL_REF,               "Call Reference (national use)"},
297   { PARAM_TYPE_TRANSM_MEDIUM_REQU,     "Transmission medium requirement"},
298   { PARAM_TYPE_ACC_TRANSP,             "Access transport"},
299   { PARAM_TYPE_CALLED_PARTY_NR,        "Called party number"},
300   { PARAM_TYPE_SUBSQT_NR,              "Subsequent number"},
301   { PARAM_TYPE_NATURE_OF_CONN_IND,     "Nature of connection indicators"},
302   { PARAM_TYPE_FORW_CALL_IND,          "Forward call indicators"},
303   { PARAM_TYPE_OPT_FORW_CALL_IND,      "Optional forward call indicators"},
304   { PARAM_TYPE_CALLING_PRTY_CATEG,     "Calling party's category"},
305   { PARAM_TYPE_CALLING_PARTY_NR,       "Calling party number"},
306   { PARAM_TYPE_REDIRECTING_NR,         "Redirecting number"},
307   { PARAM_TYPE_REDIRECTION_NR,         "Redirection number"},
308   { PARAM_TYPE_CONNECTION_REQ,         "Connection request"},
309   { PARAM_TYPE_INFO_REQ_IND,           "Information request indicators (national use)"},
310   { PARAM_TYPE_INFO_IND,               "Information indicators (national use)"},
311   { PARAM_TYPE_CONTINUITY_IND,         "Continuity request"},
312   { PARAM_TYPE_BACKW_CALL_IND,         "Backward call indicators"},
313   { PARAM_TYPE_CAUSE_INDICATORS,       "Cause indicators"},
314   { PARAM_TYPE_REDIRECTION_INFO,       "Redirection information"},
315   { PARAM_TYPE_CIRC_GRP_SV_MSG_TYPE,   "Circuit group supervision message type"},
316   { PARAM_TYPE_RANGE_AND_STATUS,       "Range and Status"},
317   { PARAM_TYPE_FACILITY_IND,           "Facility indicator"},
318   { PARAM_TYPE_CLSD_USR_GRP_ILOCK_CD,  "Closed user group interlock code"},
319   { PARAM_TYPE_USER_SERVICE_INFO,      "User service information"},
320   { PARAM_TYPE_SIGNALLING_POINT_CODE,  "Signalling point code (national use)"},
321   { PARAM_TYPE_USER_TO_USER_INFO,      "User-to-user information"},
322   { PARAM_TYPE_CONNECTED_NR,           "Connected number"},
323   { PARAM_TYPE_SUSP_RESUME_IND,        "Suspend/Resume indicators"},
324   { PARAM_TYPE_TRANSIT_NETW_SELECT,    "Transit network selection (national use)"},
325   { PARAM_TYPE_EVENT_INFO,             "Event information"},
326   { PARAM_TYPE_CIRC_ASSIGN_MAP,        "Circuit assignment map"},
327   { PARAM_TYPE_CIRC_STATE_IND,         "Circuit state indicator (national use)"},
328   { PARAM_TYPE_AUTO_CONG_LEVEL,        "Automatic congestion level"},
329   { PARAM_TYPE_ORIG_CALLED_NR,         "Original called number"},
330   { PARAM_TYPE_OPT_BACKW_CALL_IND,     "Backward call indicators"},
331   { PARAM_TYPE_USER_TO_USER_IND,       "User-to-user indicators"},
332   { PARAM_TYPE_ORIG_ISC_POINT_CODE,    "Origination ISC point code"},
333   { PARAM_TYPE_GENERIC_NOTIF_IND,      "Generic notification indicator"},
334   { PARAM_TYPE_CALL_HIST_INFO,         "Call history information"},
335   { PARAM_TYPE_ACC_DELIV_INFO,         "Access delivery information"},
336   { PARAM_TYPE_NETW_SPECIFIC_FACLTY,   "Network specific facility (national use)"},
337   { PARAM_TYPE_USER_SERVICE_INFO_PR,   "User service information prime"},
338   { PARAM_TYPE_PROPAG_DELAY_COUNTER,   "Propagation delay counter"},
339   { PARAM_TYPE_REMOTE_OPERATIONS,      "Remote operations (national use)"},
340   { PARAM_TYPE_SERVICE_ACTIVATION,     "Service activation"},
341   { PARAM_TYPE_USER_TELESERV_INFO,     "User teleservice information"},
342   { PARAM_TYPE_TRANSM_MEDIUM_USED,     "Transmission medium used"},
343   { PARAM_TYPE_CALL_DIV_INFO,          "Call diversion information"},
344   { PARAM_TYPE_ECHO_CTRL_INFO,         "Echo control information"},
345   { PARAM_TYPE_MSG_COMPAT_INFO,        "Message compatibility information"},
346   { PARAM_TYPE_PARAM_COMPAT_INFO,      "Parameter compatibility information"},
347   { PARAM_TYPE_MLPP_PRECEDENCE,        "MLPP precedence"},
348   { PARAM_TYPE_MCID_REQ_IND,           "MCID request indicators"},
349   { PARAM_TYPE_MCID_RSP_IND,           "MCID response indicators"},
350   { PARAM_TYPE_HOP_COUNTER,            "Hop counter"},
351   { PARAM_TYPE_TRANSM_MEDIUM_RQUR_PR,  "Transmission medium requirement prime"},
352   { PARAM_TYPE_LOCATION_NR,            "Location number"},
353   { PARAM_TYPE_REDIR_NR_RSTRCT,        "Redirection number restriction"},
354   { PARAM_TYPE_CALL_TRANS_REF,         "Call transfer reference"},
355   { PARAM_TYPE_LOOP_PREV_IND,          "Loop prevention indicators"},
356   { PARAM_TYPE_CALL_TRANS_NR,          "Call transfer number"},
357   { PARAM_TYPE_CCSS,                   "CCSS"},
358   { PARAM_TYPE_FORW_GVNS,              "Forward GVNS"},
359   { PARAM_TYPE_BACKW_GVNS,             "Backward GVNS"},
360   { PARAM_TYPE_REDIRECT_CAPAB,         "Redirect capability (reserved for national use)"},
361   { PARAM_TYPE_NETW_MGMT_CTRL,         "Network management controls"},
362   { PARAM_TYPE_CORRELATION_ID,         "Correlation id"},
363   { PARAM_TYPE_SCF_ID,                 "SCF id"},
364   { PARAM_TYPE_CALL_DIV_TREAT_IND,     "Call diversion treatment indicators"},
365   { PARAM_TYPE_CALLED_IN_NR,           "Called IN number"},
366   { PARAM_TYPE_CALL_OFF_TREAT_IND,     "Call offering treatment indicators"},
367   { PARAM_TYPE_CHARGED_PARTY_IDENT,    "Charged party identification (national use)"},
368   { PARAM_TYPE_CONF_TREAT_IND,         "Conference treatment indicators"},
369   { PARAM_TYPE_DISPLAY_INFO,           "Display information"},
370   { PARAM_TYPE_UID_ACTION_IND,         "UID action indicators"},
371   { PARAM_TYPE_UID_CAPAB_IND,          "UID capability indicators"},
372   { PARAM_TYPE_REDIRECT_COUNTER,       "Redirect counter (reserved for national use)"},
373   { PARAM_TYPE_COLLECT_CALL_REQ,       "Collect call request"},
374   { PARAM_TYPE_GENERIC_NR,             "Generic number"},
375   { PARAM_TYPE_GENERIC_DIGITS,         "Generic digits (national use)"},
376   { PARAM_TYPE_APPLICATON_TRANS,       "Application transport"},
377   { 0,                                 NULL}};
378
379
380 #define CIC_LENGTH                             2
381 #define BICC_CIC_LENGTH                        4
382 #define MESSAGE_TYPE_LENGTH                    1
383 #define COMMON_HEADER_LENGTH                   (CIC_LENGTH + MESSAGE_TYPE_LENGTH)
384 #define BICC_COMMON_HEADER_LENGTH              (BICC_CIC_LENGTH + MESSAGE_TYPE_LENGTH)
385
386 #define MAXLENGTH                            0xFF /* since length field is 8 Bit long - used in number dissectors;
387                                                      max. number of address digits is 15 digits, but MAXLENGTH used
388                                                      to avoid runtime errors */
389
390 #define PARAMETER_TYPE_LENGTH                  1
391 #define PARAMETER_POINTER_LENGTH               1
392 #define PARAMETER_LENGTH_IND_LENGTH            1
393
394 /* All following parameter length definitions are WITHOUT the parameter type byte and length indicator for optional parameters*/
395 #define PARAMETER_NAME_LENGTH                  1
396 #define PARAMETER_LENGTH_IND_LENGTH            1
397 #define ACCESS_DELIVERY_INFO_LENGTH            1
398 #define AUTO_CONGEST_LEVEL_LENGTH              1
399 #define BACKWARD_CALL_IND_LENGTH               2
400 #define BACKWARD_GVNS_LENGTH                   1
401 #define CALL_DIV_INFO_LENGTH                   1
402 #define CALL_DIV_TREATMENT_IND_LENGTH          1
403 #define CALL_HISTORY_INFO_LENGTH               2
404 #define CALL_OFFERING_TREATMENT_IND_LENGTH     1
405 #define CALL_REFERENCE_LENGTH                  5
406 #define CALL_TRANSFER_REF_LENGTH               1
407 #define CALLING_PRTYS_CATEGORY_LENGTH          1
408 #define CCSS_LENGTH                            1
409 #define CIRCUIT_ASSIGNMENT_MAP_LENGTH          5
410 #define CIRC_GRP_SV_MSG_TYPE_LENGTH            1
411 #define CLOSED_USR_GRP_INTERLOCK_CODE_LENGTH   4
412 #define COLLECT_CALL_REQUEST_LENGTH            1
413 #define CONFERENCE_TREATMENT_IND_LENGTH        1
414 #define CONNECTION_REQUEST_LENGTH              7
415 #define CONTINUITY_IND_LENGTH                  1
416 #define ECHO_CONTROL_INFO_LENGTH               1
417 #define END_OF_OPT_PART_LENGTH                 1
418 #define EVENT_INFO_LENGTH                      1
419 #define FACILITY_IND_LENGTH                    1
420 #define FORWARD_CALL_IND_LENGTH                2
421 #define GENERIC_NOTIFICATION_IND_LENGTH        1
422 #define HOP_COUNTER_LENGTH                     1
423 #define INFO_IND_LENGTH                        2
424 #define INFO_REQUEST_IND_LENGTH                2
425 #define LOOP_PREVENTION_IND_LENGTH             1
426 #define MCID_REQUEST_IND_LENGTH                1
427 #define MCID_RESPONSE_IND_LENGTH               1
428 #define MLPP_PRECEDENCE_LENGTH                 1
429 #define NATURE_OF_CONNECTION_IND_LENGTH        1
430 #define NETWORK_MANAGEMENT_CONTROLS_LENGTH     1
431 #define OPTIONAL_BACKWARD_CALL_IND_LENGTH      1
432 #define OPTIONAL_FORWARD_CALL_IND_LENGTH       1
433 #define ORIGINAL_ISC_POINT_CODE_LENGTH         2
434 #define PROPAGATION_DELAY_COUNT_LENGTH         2
435 #define REDIRECTION_NUMBER_LENGTH              2
436 #define REDIRECTION_INFO_LENGTH                2
437 #define REDIRECTION_NUMBER_RESTRICTION_LENGTH  1
438 #define SIGNALLING_POINT_CODE_LENGTH           2
439 #define SUSPEND_RESUME_IND_LENGTH              1
440 #define TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH 1
441 #define TRANSMISSION_MEDIUM_RQMT_PRIME_LENGTH  1
442 #define TRANSMISSION_MEDIUM_USED_LENGTH        1
443 #define UID_ACTION_IND_LENGTH                  1
444 #define UID_CAPABILITY_IND_LENGTH              1
445 #define USER_TELESERVICE_INFO_LENGTH           3
446 #define USER_TO_USER_IND_LENGTH                1
447 #define RANGE_LENGTH                           1
448
449 #define CALL_ID_LENGTH        3 /* for parameter Call Reference */
450 #define SPC_LENGTH            2 /* for parameter Call Reference, Connection request */
451 #define LOCAL_REF_LENGTH      3 /* for parameter Connection request */
452 #define PROTOCOL_CLASS_LENGTH 1 /* for parameter Connection request */
453 #define CREDIT_LENGTH         1 /* for parameter Connection request */
454
455 #define CIC_OFFSET            0
456 #define BICC_CIC_OFFSET       0
457
458 #define NO_SATELLITE_CIRCUIT_IN_CONNECTION   0
459 #define ONE_SATELLITE_CIRCUIT_IN_CONNECTION  1
460 #define TWO_SATELLITE_CIRCUIT_IN_CONNECTION  2
461 static const value_string isup_satellite_ind_value[] = {
462   { NO_SATELLITE_CIRCUIT_IN_CONNECTION,          "No Satellite circuit in connection"},
463   { ONE_SATELLITE_CIRCUIT_IN_CONNECTION,         "One Satellite circuit in connection"},
464   { TWO_SATELLITE_CIRCUIT_IN_CONNECTION,         "Two Satellite circuits in connection"},
465   { 0,                                 NULL}};
466
467 #define CONTINUITY_CHECK_NOT_REQUIRED           0
468 #define CONTINUITY_CHECK_REQUIRED               1
469 #define CONTINUITY_CHECK_ON_A_PREVIOUS_CIRCUIT  2
470 static const value_string isup_continuity_check_ind_value[] = {
471   { CONTINUITY_CHECK_NOT_REQUIRED,               "Continuity check not required"},
472   { CONTINUITY_CHECK_REQUIRED,                   "Continuity check required on this circuit"},
473   { CONTINUITY_CHECK_ON_A_PREVIOUS_CIRCUIT ,     "Continuity check performed on a previous circuit"},
474   { 0,                                 NULL}};
475
476 static const true_false_string isup_echo_control_device_ind_value = {
477   "Echo control device included",
478   "Echo control device not included"
479 };
480
481 static const true_false_string isup_natnl_inatnl_call_ind_value = {
482   "Call to be treated as international call",
483   "Call to be treated as national call"
484 };
485
486 #define NO_END_TO_END_METHOD_AVAILABLE       0
487 #define PASS_ALONG_METHOD_AVAILABLE          1
488 #define SCCP_METHOD_AVAILABLE                2
489 #define PASS_ALONG_AND_SCCP_METHOD_AVAILABLE 3
490 static const value_string isup_end_to_end_method_ind_value[] = {
491   { NO_END_TO_END_METHOD_AVAILABLE,          "No End-to-end method available (only link-by-link method available)"},
492   { PASS_ALONG_METHOD_AVAILABLE,             "Pass-along method available (national use)"},
493   { SCCP_METHOD_AVAILABLE,                   "SCCP method available"},
494   { PASS_ALONG_AND_SCCP_METHOD_AVAILABLE,    "pass-along and SCCP method available (national use)"},
495   { 0,                                 NULL}};
496
497 static const true_false_string isup_interworking_ind_value = {
498   "interworking encountered",
499   "no interworking encountered (No.7 signalling all the way)"
500 };
501
502 static const true_false_string isup_end_to_end_info_ind_value = {
503   "end-to-end information available",
504   "no end-to-end information available"
505 };
506
507 static const true_false_string isup_ISDN_user_part_ind_value = {
508   "ISDN user part used all the way",
509   "ISDN user part not used all the way"
510 };
511
512 #define ISUP_PREFERED_ALL_THE_WAY               0
513 #define ISUP_NOT_REQUIRED_ALL_THE_WAY           1
514 #define ISUP_REQUIRED_ALL_WAY                   2
515 #define ISUP_ISDN_USER_PART_IND_SPARE           3
516 static const value_string isup_preferences_ind_value[] = {
517   { ISUP_PREFERED_ALL_THE_WAY,                   "ISDN user part prefered all the way"},
518   { ISUP_NOT_REQUIRED_ALL_THE_WAY,               "ISDN user part not required all the way"},
519   { ISUP_REQUIRED_ALL_WAY,                       "ISDN user part required all the way"},
520   { ISUP_ISDN_USER_PART_IND_SPARE,               "spare"},
521   { 0,                                 NULL}};
522
523 static const true_false_string isup_ISDN_originating_access_ind_value = {
524   "originating access ISDN",
525   "originating access non-ISDN"
526 };
527
528 #define NO_INDICATION                                0
529 #define CONNECTIONLESS_METHOD_AVAILABLE              1
530 #define CONNECITON_ORIENTED_METHOD_AVAILABLE         2
531 #define CONNECTIONLESS_AND_ORIENTED_METHOD_AVAILABLE 3
532 static const value_string isup_SCCP_method_ind_value[] = {
533   { NO_INDICATION,                                  "No indication"},
534   { CONNECTIONLESS_METHOD_AVAILABLE,                "Connectionless method available (national use)"},
535   { CONNECITON_ORIENTED_METHOD_AVAILABLE,           "Connection oriented method available"},
536   { CONNECTIONLESS_AND_ORIENTED_METHOD_AVAILABLE,   "Connectionless and -oriented method available (national use)"},
537   { 0,                                 NULL}};
538
539 #define UNKNOWN_AT_THIS_TIME                 0
540 #define OPERATOR_FRENCH                      1
541 #define OPERATOR_ENGLISH                     2
542 #define OPERATOR_GERMAN                      3
543 #define OPERATOR_RUSSIAN                     4
544 #define OPERATOR_SPANISH                     5
545 #define ORDINARY_CALLING_SUBSCRIBER         10
546 #define CALLING_SUBSCRIBER_WITH_PRIORITY    11
547 #define DATA_CALL                           12
548 #define TEST_CALL                           13
549 #define PAYPHONE                            15
550 static const value_string isup_calling_partys_category_value[] = {
551   { UNKNOWN_AT_THIS_TIME,               "Category unknown at this time (national use)"},
552   { OPERATOR_FRENCH,                    "operator, language French"},
553   { OPERATOR_ENGLISH,                   "operator, language English"},
554   { OPERATOR_GERMAN,                    "operator, language German"},
555   { OPERATOR_RUSSIAN,                   "operator, language Russian"},
556   { OPERATOR_SPANISH,                   "operator, language Spanish"},
557   { ORDINARY_CALLING_SUBSCRIBER,        "ordinary calling subscriber"},
558   { CALLING_SUBSCRIBER_WITH_PRIORITY,   "calling subscriber with priority"},
559   { DATA_CALL,                          "data call (voice band data)"},
560   { TEST_CALL,                          "test call"},
561   { PAYPHONE,                           "payphone"},
562   { 0,                                 NULL}};
563
564 #define MEDIUM_SPEECH                        0
565 #define MEDIUM_64KBS                         2
566 #define MEDIUM_3_1_KHZ_AUDIO                 3
567 #define MEDIUM_RESERVED_SERVICE2_1           4
568 #define MEDIUM_RESERVED_SERVICE1_2           5
569 #define MEDIUM_64KBS_PREFERED                6
570 #define MEDIUM_2_64KBS                       7
571 #define MEDIUM_384KBS                        8
572 #define MEDIUM_1536KBS                       9
573 #define MEDIUM_1920KBS                      10
574 #define MEDIUM_3_64KBS                      16
575 #define MEDIUM_4_64KBS                      17
576 #define MEDIUM_5_64KBS                      18
577 #define MEDIUM_7_64KBS                      20
578 #define MEDIUM_8_64KBS                      21
579 #define MEDIUM_9_64KBS                      22
580 #define MEDIUM_10_64KBS                     23
581 #define MEDIUM_11_64KBS                     24
582 #define MEDIUM_12_64KBS                     25
583 #define MEDIUM_13_64KBS                     26
584 #define MEDIUM_14_64KBS                     27
585 #define MEDIUM_15_64KBS                     28
586 #define MEDIUM_16_64KBS                     29
587 #define MEDIUM_17_64KBS                     30
588 #define MEDIUM_18_64KBS                     31
589 #define MEDIUM_19_64KBS                     32
590 #define MEDIUM_20_64KBS                     33
591 #define MEDIUM_21_64KBS                     34
592 #define MEDIUM_22_64KBS                     35
593 #define MEDIUM_23_64KBS                     36
594 #define MEDIUM_25_64KBS                     38
595 #define MEDIUM_26_64KBS                     39
596 #define MEDIUM_27_64KBS                     40
597 #define MEDIUM_28_64KBS                     41
598 #define MEDIUM_29_64KBS                     42
599 static const value_string isup_transmission_medium_requirement_value[] = {
600   { MEDIUM_SPEECH,                       "speech"},
601   { MEDIUM_64KBS,                        "64 kbit/s unrestricted"},
602   { MEDIUM_3_1_KHZ_AUDIO,                "3.1 kHz audio"},
603   { MEDIUM_RESERVED_SERVICE2_1,          "reserved for alternate speech (service 2)/64 kbit/s unrestricted (service 1)"},
604   { MEDIUM_RESERVED_SERVICE1_2,          "reserved for alternate 64 kbit/s unrestricted (service 1)/speech (service 2)"},
605   { MEDIUM_64KBS_PREFERED,               "64 kbit/s prefered"},
606   { MEDIUM_2_64KBS,                      "2x64 kbit/s unrestricted"},
607   { MEDIUM_384KBS,                       "384 kbit/s unrestricted"},
608   { MEDIUM_1536KBS,                      "1536 kbit/s unrestricted"},
609   { MEDIUM_1920KBS,                      "1920 kbit/s unrestricted"},
610   { MEDIUM_3_64KBS,                      "3x64 kbit/s unrestricted"},
611   { MEDIUM_4_64KBS,                      "4x64 kbit/s unrestricted"},
612   { MEDIUM_5_64KBS,                      "5x64 kbit/s unrestricted"},
613   { MEDIUM_7_64KBS,                      "7x64 kbit/s unrestricted"},
614   { MEDIUM_8_64KBS,                      "8x64 kbit/s unrestricted"},
615   { MEDIUM_9_64KBS,                      "9x64 kbit/s unrestricted"},
616   { MEDIUM_10_64KBS,                     "10x64 kbit/s unrestricted"},
617   { MEDIUM_11_64KBS,                     "11x64 kbit/s unrestricted"},
618   { MEDIUM_12_64KBS,                     "12x64 kbit/s unrestricted"},
619   { MEDIUM_13_64KBS,                     "13x64 kbit/s unrestricted"},
620   { MEDIUM_14_64KBS,                     "14x64 kbit/s unrestricted"},
621   { MEDIUM_15_64KBS,                     "15x64 kbit/s unrestricted"},
622   { MEDIUM_16_64KBS,                     "16x64 kbit/s unrestricted"},
623   { MEDIUM_17_64KBS,                     "17x64 kbit/s unrestricted"},
624   { MEDIUM_18_64KBS,                     "18x64 kbit/s unrestricted"},
625   { MEDIUM_19_64KBS,                     "19x64 kbit/s unrestricted"},
626   { MEDIUM_20_64KBS,                     "20x64 kbit/s unrestricted"},
627   { MEDIUM_21_64KBS,                     "21x64 kbit/s unrestricted"},
628   { MEDIUM_22_64KBS,                     "22x64 kbit/s unrestricted"},
629   { MEDIUM_23_64KBS,                     "23x64 kbit/s unrestricted"},
630   { MEDIUM_25_64KBS,                     "25x64 kbit/s unrestricted"},
631   { MEDIUM_26_64KBS,                     "26x64 kbit/s unrestricted"},
632   { MEDIUM_27_64KBS,                     "27x64 kbit/s unrestricted"},
633   { MEDIUM_28_64KBS,                     "28x64 kbit/s unrestricted"},
634   { MEDIUM_29_64KBS,                     "29x64 kbit/s unrestricted"},
635   { 0,                                 NULL}};
636 static const value_string isup_transmission_medium_requirement_prime_value[] = {
637   { MEDIUM_SPEECH,                       "speech"},
638   { MEDIUM_64KBS,                        "reserved for 64 kbit/s unrestricted"},
639   { MEDIUM_3_1_KHZ_AUDIO,                "3.1 kHz audio"},
640   { MEDIUM_RESERVED_SERVICE2_1,          "reserved for alternate speech (service 2)/64 kbit/s unrestricted (service 1)"},
641   { MEDIUM_RESERVED_SERVICE1_2,          "reserved for alternate 64 kbit/s unrestricted (service 1)/speech (service 2)"},
642   { MEDIUM_64KBS_PREFERED,               "reserved for 64 kbit/s prefered"},
643   { MEDIUM_2_64KBS,                      "reserved for 2x64 kbit/s unrestricted"},
644   { MEDIUM_384KBS,                       "reserved for 384 kbit/s unrestricted"},
645   { MEDIUM_1536KBS,                      "reserved for 1536 kbit/s unrestricted"},
646   { MEDIUM_1920KBS,                      "reserved for 1920 kbit/s unrestricted"},
647   { 0,                                 NULL}};
648
649
650 /* Definitions for Called and Calling Party number */
651 #define ISUP_ODD_EVEN_MASK                       0x80
652 #define ISUP_NATURE_OF_ADDRESS_IND_MASK          0x7F
653 #define ISUP_INN_MASK                            0x80
654 #define ISUP_NI_MASK                             0x80
655 #define ISUP_NUMBERING_PLAN_IND_MASK             0x70
656 #define ISUP_ADDRESS_PRESENTATION_RESTR_IND_MASK 0x0C
657 #define ISUP_SCREENING_IND_MASK                  0x03
658 #define ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK       0x0F
659 #define ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK      0xF0
660
661 static const true_false_string isup_odd_even_ind_value = {
662   "odd number of address signals",
663   "even number of address signals"
664 };
665
666 #define ISUP_CALLED_PARTY_NATURE_SUBSCRIBER_NR  1
667 #define ISUP_CALLED_PARTY_NATURE_UNKNOWN        2
668 #define ISUP_CALLED_PARTY_NATURE_NATIONAL_NR    3
669 #define ISUP_CALLED_PARTY_NATURE_INTERNATNL_NR  4
670 #define ISUP_CALLED_PARTY_NATURE_NETW_SPEC_NR   5
671 static const value_string isup_called_party_nature_of_address_ind_value[] = {
672   { ISUP_CALLED_PARTY_NATURE_SUBSCRIBER_NR,     "subscriber number (national use)"},
673   { ISUP_CALLED_PARTY_NATURE_UNKNOWN,           "unknown (national use)"},
674   { ISUP_CALLED_PARTY_NATURE_NATIONAL_NR,       "national (significant) number"},
675   { ISUP_CALLED_PARTY_NATURE_INTERNATNL_NR,     "international number"},
676   { ISUP_CALLED_PARTY_NATURE_NETW_SPEC_NR,      "network-specific number (national use)"},
677   { 0,                                 NULL}};
678
679 static const value_string isup_calling_party_nature_of_address_ind_value[] = {
680   { ISUP_CALLED_PARTY_NATURE_SUBSCRIBER_NR,     "subscriber number (national use)"},
681   { ISUP_CALLED_PARTY_NATURE_UNKNOWN,           "unknown (national use)"},
682   { ISUP_CALLED_PARTY_NATURE_NATIONAL_NR,       "national (significant) number"},
683   { ISUP_CALLED_PARTY_NATURE_INTERNATNL_NR,     "international number"},
684   { 0,                                 NULL}};
685
686 static const true_false_string isup_INN_ind_value = {
687   "routing to internal network number not allowed",
688   "routing to internal network number allowed "
689 };
690 static const true_false_string isup_NI_ind_value = {
691   "incomplete",
692   "complete"
693 };
694
695 #define ISDN_NUMBERING_PLAN                     1
696 #define DATA_NUMBERING_PLAN                     3
697 #define TELEX_NUMBERING_PLAN                    4
698 static const value_string isup_numbering_plan_ind_value[] = {
699   { ISDN_NUMBERING_PLAN,     "ISDN (Telephony) numbering plan"},
700   { DATA_NUMBERING_PLAN,     "Data numbering plan (national use)"},
701   { TELEX_NUMBERING_PLAN,    "Telex numbering plan (national use)"},
702   { 5,                       "Reserved for national use"},
703   { 6,                       "Reserved for national use"},
704   { 0,                                 NULL}};
705
706 #define ADDRESS_PRESETATION_ALLOWED      0
707 #define ADDRESS_PRESETATION_RESTRICTED   1
708 #define ADDRESS_NOT_AVAILABLE            2
709 static const value_string isup_address_presentation_restricted_ind_value[] = {
710   { ADDRESS_PRESETATION_ALLOWED,     "presentation allowed"},
711   { ADDRESS_PRESETATION_RESTRICTED,  "presentation restricted"},
712   { ADDRESS_NOT_AVAILABLE,           "address not availabe (national use)"},
713   { 3,                                 "spare"},
714   { 0,                                 NULL}};
715
716 static const value_string isup_screening_ind_value[] = {
717   { 0,     "reserved"},
718   { 1,     "user provided, verified and passed"},
719   { 2,     "reserved"},
720   { 3,     "network provided"},
721   { 0,     NULL}};
722
723 static const value_string isup_screening_ind_enhanced_value[] = {
724   { 0,     "user provided, not verified"},
725   { 1,     "user provided, verified and passed"},
726   { 2,     "user provided, verified and failed"},
727   { 3,     "network provided"},
728   { 0,     NULL}};
729
730 static const value_string isup_called_party_address_digit_value[] = {
731   { 0,  "0"},
732   { 1,  "1"},
733   { 2,  "2"},
734   { 3,  "3"},
735   { 4,  "4"},
736   { 5,  "5"},
737   { 6,  "6"},
738   { 7,  "7"},
739   { 8,  "8"},
740   { 9,  "9"},
741   { 10, "spare"},
742   { 11, "code 11 "},
743   { 12, "code 12"},
744   { 15, "Stop sending"},
745   { 0,  NULL}};
746
747 static const value_string isup_calling_party_address_digit_value[] = {
748   { 0,  "0"},
749   { 1,  "1"},
750   { 2,  "2"},
751   { 3,  "3"},
752   { 4,  "4"},
753   { 5,  "5"},
754   { 6,  "6"},
755   { 7,  "7"},
756   { 8,  "8"},
757   { 9,  "9"},
758   { 10, "spare"},
759   { 11, "code 11 "},
760   { 12, "code 12"},
761   { 15, "spare"},
762   { 0,  NULL}};
763
764 /*End of Called/Calling party address definitions */
765
766
767 static const true_false_string isup_calling_party_address_request_ind_value = {
768   "calling party address requested",
769   "calling party address not requested"
770 };
771 static const true_false_string isup_holding_ind_value = {
772   "holding requested",
773   "holding not requested"
774 };
775 static const true_false_string isup_calling_partys_category_request_ind_value = {
776   "Calling Party's category requested",
777   "Calling Party's category not requested",
778 };
779 static const true_false_string isup_charge_information_request_ind_value = {
780   "Charge Information requested",
781   "Charge Information not requested"
782 };
783 static const true_false_string isup_malicious_call_identification_request_ind_value = {
784   "Malicious call identification requested",
785   "Malicious call identification not requested"
786 };
787
788 #define CALLING_PARTY_ADDRESS_NOT_INCLUDED             0
789 #define CALLING_PARTY_ADDRESS_NOT_AVAILABLE            1
790 #define CALLING_PARTY_ADDRESS_INCLUDED                 3
791 static const value_string isup_calling_party_address_response_ind_value[] = {
792   { CALLING_PARTY_ADDRESS_NOT_INCLUDED, "Calling party address not included"},
793   { CALLING_PARTY_ADDRESS_NOT_AVAILABLE,"Calling party address not available"},
794   { 4,                                  "spare"},
795   { CALLING_PARTY_ADDRESS_INCLUDED,     "Calling party address included"},
796   { 0,                                 NULL}};
797
798 static const true_false_string isup_hold_provided_ind_value = {
799   "hold provided",
800   "hold not provided"
801 };
802 static const true_false_string isup_calling_partys_category_response_ind_value = {
803   "Calling Party's category included",
804   "Calling Party's category not included",
805 };
806 static const true_false_string isup_charge_information_response_ind_value = {
807   "Charge Information included",
808   "Charge Information not included"
809 };
810 static const true_false_string isup_solicited_information_ind_value = {
811   "unsolicited",
812   "solicited"
813 };
814
815 static const true_false_string isup_continuity_ind_value = {
816   "Continuity check successful",
817   "Continuity ckec failed"
818 };
819
820 #define CHARGE_NO_IND       0
821 #define CHARGE_NO_CHARGE    1
822 #define CHARGE_CHARGE       2
823 static const value_string isup_charge_ind_value[] = {
824   { CHARGE_NO_IND,    "No indication"},
825   { CHARGE_NO_CHARGE, "No charge"},
826   { CHARGE_CHARGE,    "Charge"},
827   { 3,                "spare"},
828   { 0,                NULL}};
829
830 #define CALLED_PARTYS_STATUS_NO_IND            0
831 #define CALLED_PARTYS_STATUS_SUBSCR_FREE       1
832 #define CALLED_PARTYS_STATUS_CONNECT_WHEN_FREE 2
833 static const value_string isup_called_partys_status_ind_value[] = {
834   { CALLED_PARTYS_STATUS_NO_IND,            "No indication"},
835   { CALLED_PARTYS_STATUS_SUBSCR_FREE,       "Subscriber free"},
836   { CALLED_PARTYS_STATUS_CONNECT_WHEN_FREE, "Connect when free (national use)"},
837   { 3,                                      "spare"},
838   { 0,                NULL}};
839
840 #define CALLED_PARTYS_CATEGORY_NO_IND            0
841 #define CALLED_PARTYS_CATEGORY_ORDINARY_SUBSCR   1
842 #define CALLED_PARTYS_CATEGORY_PAYPHONE          2
843 static const value_string isup_called_partys_category_ind_value[] = {
844   { CALLED_PARTYS_CATEGORY_NO_IND,             "No indication"},
845   { CALLED_PARTYS_CATEGORY_ORDINARY_SUBSCR,    "Ordinary subscriber"},
846   { CALLED_PARTYS_CATEGORY_PAYPHONE,           "Payphone"},
847   { 3,                                         "spare"},
848   { 0,                NULL}};
849
850 static const true_false_string isup_ISDN_terminating_access_ind_value = {
851   "terminating access ISDN",
852   "terminating access non-ISDN"
853 };
854
855 static const true_false_string isup_suspend_resume_ind_value = {
856   "network initiated",
857   "ISDN subscriber initiated"
858 };
859 #define MAINTENANCE            0
860 #define HARDWARE_FAILURE       1
861 #define RES_FOR_NATNL_USE      2
862 static const value_string isup_cgs_message_type_value[] = {
863   { MAINTENANCE,            "maintenance oriented"},
864   { HARDWARE_FAILURE,       "hardware failure oriented"},
865   { RES_FOR_NATNL_USE,      "reserved for national use (ISUP'84)"},
866   { 3,                      "spare"},
867   { 0,                NULL}};
868
869 #define USER_TO_USER_SERVICE      2
870 static const value_string isup_facility_ind_value[] = {
871   { USER_TO_USER_SERVICE,     "user-to-user service"},
872   { 0,                NULL}};
873
874 #define MTC_BLCK_STATE_TRANSIENT  0
875 #define MTC_BLCK_STATE_UNEQUIPPED 3
876 static const value_string isup_mtc_blocking_state_DC00_value[] = {
877   {  MTC_BLCK_STATE_TRANSIENT,  "transient"},
878   { 1,                          "spare"},
879   { 2,                          "spare"},
880   {  MTC_BLCK_STATE_UNEQUIPPED, "unequipped"},
881   { 0,                NULL}};
882
883 #define MTC_BLCK_NO_BLOCKING      0
884 #define MTC_LOCALLY_BLOCKED       1
885 #define MTC_REMOTELY_BLOCKED      2
886 #define MTC_LOCAL_REMOTE_BLOCKED  3
887 static const value_string isup_mtc_blocking_state_DCnot00_value[] = {
888   {  MTC_BLCK_NO_BLOCKING,     "no blocking (active)"},
889   {  MTC_LOCALLY_BLOCKED,      "locally blocked"},
890   {  MTC_REMOTELY_BLOCKED,     "remotely blocked"},
891   {  MTC_LOCAL_REMOTE_BLOCKED, "locally and remotely blocked"},
892   {  0,                NULL}};
893
894 #define CALL_PROC_INCOMING_BUSY 1
895 #define CALL_PROC_OUTGOING_BUSY 2
896 #define CALL_PROC_IDLE          3
897 static const value_string isup_call_processing_state_value[] = {
898   {  CALL_PROC_INCOMING_BUSY,     "circuit incoming busy"},
899   {  CALL_PROC_OUTGOING_BUSY,     "circuit outgoing busy"},
900   {  CALL_PROC_IDLE,              "idle"},
901   {  0,                NULL}};
902
903 #define HW_BLCK_NO_BLOCKING          0
904 #define HW_LOCALLY_BLOCKED           1
905 #define HW_REMOTELY_BLOCKED          2
906 #define HW_LOCAL_REMOTE_BLOCKED      3
907 static const value_string isup_HW_blocking_state_value[] = {
908   {  HW_BLCK_NO_BLOCKING,     "no blocking (active)"},
909   {  HW_LOCALLY_BLOCKED,      "locally blocked"},
910   {  HW_REMOTELY_BLOCKED,     "remotely blocked"},
911   {  HW_LOCAL_REMOTE_BLOCKED, "locally and remotely blocked"},
912   {  0,                NULL}};
913
914 #define EVENT_ALERTING      1
915 #define EVENT_PROGRESS      2
916 #define EVENT_INBAND_INFO   3
917 #define EVENT_ON_BUSY       4
918 #define EVENT_ON_NO_REPLY   5
919 #define EVENT_UNCONDITIONAL 6
920 static const value_string isup_event_ind_value[] = {
921   /* according 3.21/Q.763 */
922   {  EVENT_ALERTING,     "ALERTING"},
923   {  EVENT_PROGRESS,     "PROGRESS"},
924   {  EVENT_INBAND_INFO,  "in-band information or an appropriate pattern is now available"},
925   {  EVENT_ON_BUSY,      "call forwarded on busy (national use)"},
926   {  EVENT_ON_NO_REPLY,  "call forwarded on no reply (national use)"},
927   {  EVENT_UNCONDITIONAL,"call forwarded unconditional (national use)"},
928   {  0,                NULL}};
929
930 static const true_false_string isup_event_presentation_restricted_ind_value = {
931   /* according 3.21/Q.763 */
932   "presentation restricted",
933   "no indication"
934 };
935 #define CUG_NON_CUG_CALL                      0
936 #define CUG_CALL_OUTGOING_ACCESS_ALLOWED      2
937 #define CUG_CALL_OUTGOING_ACCESS_NOT_ALLOWED  3
938 static const value_string isup_CUG_call_ind_value[] = {
939   /* according 3.38/Q.763 */
940   {  CUG_NON_CUG_CALL,                     "non-CUG call"},
941   {  1,                                    "spare"},
942   {  CUG_CALL_OUTGOING_ACCESS_ALLOWED,     "closed user group call, outgoing access allowed"},
943   {  CUG_CALL_OUTGOING_ACCESS_NOT_ALLOWED, "closed user group call, outgoing access not allowed"},
944   {  0,                NULL}};
945
946
947 static const true_false_string isup_simple_segmentation_ind_value = {
948   /* according 3.38/Q.763 */
949   "additional information will be sent in a segmentation message",
950   "no additional information will be sent"
951 };
952
953 static const true_false_string isup_connected_line_identity_request_ind_value = {
954   /* according 3.38/Q.763 */
955   "requested",
956   "not requested"
957 };
958
959 static const value_string isup_redirecting_ind_value[] = {
960   /* according 3.45/Q.763 */
961   {  0,        "no redirection (national use)"},
962   {  1,        "call rerouted (national use)"},
963   {  2,        "call rerouted, all redirection information presentation restricted (national use)"},
964   {  3,        "call diverted"},
965   {  4,        "call diverted, all redirection information presentation restricted"},
966   {  5,        "call rerouted, redirection number presentation restricted (national use)"},
967   {  6,        "call diversion, redirection number presentation restricted (national use)"},
968   {  7,        "spare"},
969   {  0,         NULL}};
970
971 static const value_string isup_original_redirection_reason_value[] = {
972   /* according 3.45/Q.763 */
973   {  0,        "unknown/not available"},
974   {  1,        "user busy (national use)"},
975   {  2,        "no reply (national use)"},
976   {  3,        "unconditional (national use)"},
977   {  0,         NULL}};
978
979 static const value_string isup_redirection_reason_value[] = {
980   /* according 3.45/Q.763 */
981   {  0,        "unknown/not available"},
982   {  1,        "user busy (national use)"},
983   {  2,        "no reply (national use)"},
984   {  3,        "unconditional (national use)"},
985   {  4,        "deflection during alerting"},
986   {  5,        "deflection immediate response"},
987   {  6,        "mobile subscriber not reachable"},
988   {  0,         NULL}};
989
990 static const value_string isup_type_of_network_identification_value[] = {
991   /* according 3.53/Q.763 */
992   {  0,        "CCITT/ITU-T-standardized identification"},
993   {  2,        "national network identification"},
994   {  0,         NULL}};
995
996 static const value_string isup_network_identification_plan_value[] = {
997   /* according 3.53/Q.763 */
998   {  0,        "if CCITT/ITU-T id - unknown"},
999   {  3,        "if CCITT/ITU-T id - public data network id code (X.121)"},
1000   {  6,        "if CCITT/ITU-T id - public land Mobile Network id code (E.211)"},
1001   {  0,         NULL}};
1002
1003 static const value_string isup_map_type_value[] = {
1004   /* according 3.69/Q.763 */
1005   {  1,        "1544 kbit/s digital path map format (64 kbit/s base rate"},
1006   {  2,        "2048 kbit/s digital path map format (64 kbit/s base rate"},
1007   {  0,         NULL}};
1008
1009 static const value_string isup_auto_congestion_level_value[] = {
1010   /* according 3.4/Q.763 */
1011   {  1,        "Congestion level 1 exceeded"},
1012   {  2,        "Congestion level 2 exceeded"},
1013   {  0,         NULL}};
1014
1015 static const true_false_string isup_inband_information_ind_value = {
1016   /* according 3.37/Q.763 */
1017   "in-band information or an appropirate pattern is now available",
1018   "no indication"
1019 };
1020 static const true_false_string isup_call_diversion_may_occur_ind_value = {
1021   /* according 3.37/Q.763 */
1022   "call diversion may occur",
1023   "no indication"
1024 };
1025 static const true_false_string isup_MLPP_user_ind_value = {
1026   /* according 3.37/Q.763 */
1027   "MLPP user",
1028   "no indication"
1029 };
1030
1031 static const true_false_string isup_access_delivery_ind_value = {
1032   /* according 3.2/Q.763 */
1033   "No set-up message generated",
1034   "Set-up message generated"
1035 };
1036
1037 static const value_string isup_loop_prevention_response_ind_value[] = {
1038   /* according 3.67/Q.763 */
1039   {  0,        "insufficient information"},
1040   {  1,        "no loop exists"},
1041   {  2,        "simultaneous transfer"},
1042   {  0,         NULL}};
1043
1044 static const true_false_string isup_temporary_alternative_routing_ind_value = {
1045   /* according 3.68/Q.763 */
1046   "TAR controlled call",
1047   "no indication"
1048 };
1049 static const true_false_string isup_extension_ind_value = {
1050   /* according 3.68/Q.763 */
1051   "last octet",
1052   "information continues through the next octet"
1053 };
1054
1055
1056
1057 static const value_string isup_call_to_be_diverted_ind_value[] = {
1058   /* according 3.72/Q.763 */
1059   {  0,        "no indication"},
1060   {  1,        "call diversion allowed"},
1061   {  2,        "call diversion not allowed"},
1062   {  3,        "spare"},
1063   {  0,         NULL}};
1064
1065 static const value_string isup_call_to_be_offered_ind_value[] = {
1066   /* according 3.72/Q.763 */
1067   {  0,        "no indication"},
1068   {  1,        "call offering not allowed"},
1069   {  2,        "call offering allowed"},
1070   {  3,        "spare"},
1071   {  0,         NULL}};
1072
1073 static const value_string isup_conference_acceptance_ind_value[] = {
1074   /* according 3.76/Q.763 */
1075   {  0,        "no indication"},
1076   {  1,        "accept conference request"},
1077   {  2,        "reject conference request"},
1078   {  3,        "spare"},
1079   {  0,         NULL}};
1080
1081 static const value_string isup_application_transport_parameter_value[] = {
1082   /* according 3.82/Q.763 */
1083   {  0,        "Unidentified Context and Error Handling (UCEH) ASE"},
1084   {  1,        "PSS1 ASE (VPN)"},
1085   {  2,        "spare"},
1086   {  3,        "Charging ASE"},
1087   {  4,        "GAT"},
1088   {  5,    "BAT ASE"},
1089   {  6,    "Enhanced Unidentified Context and Error Handling ASE (EUCEH ASE)"},
1090   {  0,         NULL}};
1091
1092 static const true_false_string isup_Release_call_indicator_value = {
1093   "release call",
1094   "do not release call"
1095 };
1096
1097 static const true_false_string isup_Send_notification_ind_value = {
1098   "send notification",
1099   "do not send notification"
1100 };
1101 static const value_string isup_APM_segmentation_ind_value[] = {
1102  
1103   {  0x00,                     "final segment"},
1104   {  0x01,                     "number of following segments"},
1105   {  0x02,                     "number of following segments"},
1106   {  0x03,                     "number of following segments"},
1107   {  0x04,                     "number of following segments"},
1108   {  0x05,                     "number of following segments"},
1109   {  0x06,                     "number of following segments"},
1110   {  0x07,                     "number of following segments"},
1111   {  0x08,                     "number of following segments"},
1112   {  0x09,                     "number of following segments"},
1113   {  0,                NULL}};
1114
1115 static const true_false_string isup_Sequence_ind_value = {
1116   "new sequence",
1117   "subsequent segment to first segment"
1118 };
1119
1120
1121 /* Generalized bit masks for 8 and 16 bits fields */
1122 #define A_8BIT_MASK  0x01
1123 #define B_8BIT_MASK  0x02
1124 #define C_8BIT_MASK  0x04
1125 #define D_8BIT_MASK  0x08
1126 #define E_8BIT_MASK  0x10
1127 #define F_8BIT_MASK  0x20
1128 #define G_8BIT_MASK  0x40
1129 #define H_8BIT_MASK  0x80
1130
1131 #define BA_8BIT_MASK 0x03
1132 #define CB_8BIT_MASK 0x06
1133 #define DC_8BIT_MASK 0x0C
1134 #define FE_8BIT_MASK 0x30
1135 #define GF_8BIT_MASK 0x60
1136 #define GFE_8BIT_MASK 0x70
1137 #define DCBA_8BIT_MASK 0x0F
1138 #define EDCBA_8BIT_MASK 0x1F
1139 #define HGFE_8BIT_MASK 0xF0
1140 #define GFEDCBA_8BIT_MASK 0x7F
1141 #define FEDCBA_8BIT_MASK 0x3F
1142
1143 #define A_16BIT_MASK  0x0100
1144 #define B_16BIT_MASK  0x0200
1145 #define C_16BIT_MASK  0x0400
1146 #define D_16BIT_MASK  0x0800
1147 #define E_16BIT_MASK  0x1000
1148 #define F_16BIT_MASK  0x2000
1149 #define G_16BIT_MASK  0x4000
1150 #define H_16BIT_MASK  0x8000
1151 #define I_16BIT_MASK  0x0001
1152 #define J_16BIT_MASK  0x0002
1153 #define K_16BIT_MASK  0x0004
1154 #define L_16BIT_MASK  0x0008
1155 #define M_16BIT_MASK  0x0010
1156 #define N_16BIT_MASK  0x0020
1157 #define O_16BIT_MASK  0x0040
1158 #define P_16BIT_MASK  0x0080
1159
1160 #define BA_16BIT_MASK 0x0300
1161 #define CB_16BIT_MASK 0x0600
1162 #define DC_16BIT_MASK 0x0C00
1163 #define FE_16BIT_MASK 0x3000
1164 #define HG_16BIT_MASK 0xC000
1165 #define KJ_16BIT_MASK 0x0006
1166 #define PO_16BIT_MASK 0x00C0
1167
1168 #define CBA_16BIT_MASK 0x0700
1169 #define KJI_16BIT_MASK 0x0007
1170 #define HGFE_16BIT_MASK 0xF000
1171 #define PONM_16BIT_MASK 0x00F0
1172
1173 /* Initialize the protocol and registered fields */
1174 static int proto_isup = -1;
1175 static int proto_bicc = -1;
1176 static int hf_isup_cic = -1;
1177 static int hf_bicc_cic = -1;
1178
1179 static int hf_isup_message_type = -1;
1180 static int hf_isup_parameter_type = -1;
1181 static int hf_isup_parameter_length = -1;
1182 static int hf_isup_mandatory_variable_parameter_pointer = -1;
1183 static int hf_isup_pointer_to_start_of_optional_part = -1;
1184
1185 static int hf_isup_satellite_indicator = -1;
1186 static int hf_isup_continuity_check_indicator = -1;
1187 static int hf_isup_echo_control_device_indicator = -1;
1188
1189 static int hf_isup_forw_call_natnl_inatnl_call_indicator = -1;
1190 static int hf_isup_forw_call_end_to_end_method_indicator = -1;
1191 static int hf_isup_forw_call_interworking_indicator = -1;
1192 static int hf_isup_forw_call_end_to_end_info_indicator = -1;
1193 static int hf_isup_forw_call_isdn_user_part_indicator = -1;
1194 static int hf_isup_forw_call_preferences_indicator = -1;
1195 static int hf_isup_forw_call_isdn_access_indicator = -1;
1196 static int hf_isup_forw_call_sccp_method_indicator = -1;
1197
1198 static int hf_isup_calling_partys_category = -1;
1199
1200 static int hf_isup_transmission_medium_requirement = -1;
1201
1202 static int hf_isup_odd_even_indicator = -1;
1203 static int hf_isup_called_party_nature_of_address_indicator = -1;
1204 static int hf_isup_calling_party_nature_of_address_indicator = -1;
1205 static int hf_isup_inn_indicator = -1;
1206 static int hf_isup_ni_indicator = -1;
1207 static int hf_isup_numbering_plan_indicator = -1;
1208 static int hf_isup_address_presentation_restricted_indicator = -1;
1209 static int hf_isup_screening_indicator = -1;
1210 static int hf_isup_screening_indicator_enhanced = -1;
1211 static int hf_isup_called_party_odd_address_signal_digit = -1;
1212 static int hf_isup_calling_party_odd_address_signal_digit = -1;
1213 static int hf_isup_called_party_even_address_signal_digit = -1;
1214 static int hf_isup_calling_party_even_address_signal_digit = -1;
1215
1216 static int hf_isup_calling_party_address_request_indicator = -1;
1217 static int hf_isup_info_req_holding_indicator = -1;
1218 static int hf_isup_calling_partys_category_request_indicator = -1;
1219 static int hf_isup_charge_information_request_indicator = -1;
1220 static int hf_isup_malicious_call_identification_request_indicator = -1;
1221
1222 static int hf_isup_calling_party_address_response_indicator = -1;
1223 static int hf_isup_hold_provided_indicator = -1;
1224 static int hf_isup_calling_partys_category_response_indicator = -1;
1225 static int hf_isup_charge_information_response_indicator = -1;
1226 static int hf_isup_solicited_indicator = -1;
1227
1228 static int hf_isup_continuity_indicator = -1;
1229
1230 static int hf_isup_backw_call_charge_ind = -1 ;
1231 static int hf_isup_backw_call_called_partys_status_ind = -1;
1232 static int hf_isup_backw_call_called_partys_category_ind = -1;
1233 static int hf_isup_backw_call_end_to_end_method_ind = -1;
1234 static int hf_isup_backw_call_interworking_ind = -1;
1235 static int hf_isup_backw_call_end_to_end_info_ind = -1;
1236 static int hf_isup_backw_call_isdn_user_part_ind = -1;
1237 static int hf_isup_backw_call_holding_ind = -1;
1238 static int hf_isup_backw_call_isdn_access_ind = -1;
1239 static int hf_isup_backw_call_echo_control_device_ind = -1;
1240 static int hf_isup_backw_call_sccp_method_ind = -1;
1241
1242 static int hf_isup_cause_indicator = -1;
1243
1244 static int hf_isup_suspend_resume_indicator = -1;
1245
1246 static int hf_isup_range_indicator = -1;
1247 static int hf_isup_cgs_message_type = -1;
1248
1249 static int hf_isup_mtc_blocking_state1 = -1;
1250 static int hf_isup_mtc_blocking_state2 = -1;
1251 static int hf_isup_call_proc_state = -1;
1252 static int hf_isup_hw_blocking_state = -1;
1253
1254 static int hf_isup_event_ind = -1;
1255 static int hf_isup_event_presentation_restricted_ind = -1;
1256
1257 static int hf_isup_cug_call_ind = -1;
1258 static int hf_isup_simple_segmentation_ind = -1;
1259 static int hf_isup_connected_line_identity_request_ind = -1;
1260
1261 static int hf_isup_redirecting_ind = -1;
1262 static int hf_isup_original_redirection_reason = -1;
1263 static int hf_isup_redirection_counter = -1;
1264 static int hf_isup_redirection_reason = -1;
1265
1266 static int hf_isup_type_of_network_identification = -1;
1267 static int hf_isup_network_identification_plan = -1;
1268
1269 static int hf_isup_map_type = -1;
1270
1271 static int hf_isup_automatic_congestion_level = -1;
1272
1273 static int hf_isup_inband_information_ind = -1;
1274 static int hf_isup_call_diversion_may_occur_ind = -1;
1275 static int hf_isup_mlpp_user_ind = -1;
1276
1277 static int hf_isup_access_delivery_ind =- -1;
1278
1279 static int hf_isup_transmission_medium_requirement_prime = -1;
1280
1281 static int hf_isup_loop_prevention_response_ind = -1;
1282
1283 static int hf_isup_temporary_alternative_routing_ind = -1;
1284 static int hf_isup_extension_ind = -1;
1285
1286 static int hf_isup_call_to_be_diverted_ind                      = -1;
1287
1288 static int hf_isup_call_to_be_offered_ind                       = -1;
1289
1290 static int hf_isup_conference_acceptance_ind                    = -1;
1291
1292 static int hf_isup_transit_at_intermediate_exchange_ind         = -1;
1293 static int hf_isup_Release_call_ind                             = -1;
1294 static int hf_isup_Send_notification_ind                        = -1;
1295 static int hf_isup_Discard_message_ind_value                    = -1;
1296 static int hf_isup_Discard_parameter_ind                        = -1;
1297 static int hf_isup_Pass_on_not_possible_indicator               = -1;
1298 static int hf_isup_Broadband_narrowband_interworking_ind        = -1;
1299
1300 static int hf_isup_app_cont_ident                                       = -1;
1301 static int hf_isup_app_Send_notification_ind                            = -1;
1302 static int hf_isup_apm_segmentation_ind                                 = -1;
1303 static int hf_isup_apm_si_ind                                           = -1;
1304 static int hf_isup_app_Release_call_ind                                 = -1;
1305 static int hf_length_indicator                                          = -1;
1306 static int hf_bat_ase_identifier                                        = -1;
1307 static int hf_Action_Indicator                                          = -1;
1308
1309 static int hf_Instruction_ind_for_general_action                        = -1;   
1310
1311 static int hf_Send_notification_ind_for_general_action                  = -1;
1312
1313 static int hf_Instruction_ind_for_pass_on_not_possible                  = -1;
1314
1315 static int hf_Send_notification_ind_for_pass_on_not_possible            = -1;
1316 static int hf_BCTP_Version_Indicator                                    = -1;
1317 static int hf_Tunnelled_Protocol_Indicator                              = -1;
1318 static int hf_TPEI                                                      = -1;
1319 static int hf_BVEI                                                      = -1;
1320 static int hf_bnci                                                      = -1;
1321 static int hf_characteristics                                           = -1;
1322
1323 static int hf_Organization_Identifier                                   = -1;
1324 static int hf_codec_type                                                = -1;
1325 static int hf_bearer_control_tunneling                                  = -1;
1326 static int hf_Local_BCU_ID                                              = -1;
1327 static int hf_late_cut_trough_cap_ind                                   = -1;
1328 static int hf_bat_ase_signal                                            = -1;
1329 static int hf_bat_ase_duration                                          = -1;
1330 static int hf_bat_ase_bearer_redir_ind                                  = -1;
1331
1332 /* Initialize the subtree pointers */
1333 static gint ett_isup                                                    = -1;
1334 static gint ett_isup_parameter                                          = -1;
1335 static gint ett_isup_address_digits                                     = -1;
1336 static gint ett_isup_pass_along_message                                 = -1;
1337 static gint ett_isup_circuit_state_ind                                  = -1;
1338 static gint ett_bat_ase                                                 = -1;   
1339 static gint ett_bicc                                                    = -1;
1340 static gint ett_bat_ase_element                                         = -1;
1341
1342 static dissector_handle_t sdp_handle;
1343
1344 /* ------------------------------------------------------------------
1345   Mapping number to ASCII-character
1346  ------------------------------------------------------------------ */
1347 char number_to_char(int number)
1348 {
1349   if (number < 10)
1350     return ((char) number + ASCII_NUMBER_DELTA);
1351   else
1352     return ((char) number + ASCII_LETTER_DELTA);
1353 }
1354
1355
1356 /* ------------------------------------------------------------------ */
1357 /* Dissectors for all used parameter types                            */
1358 /* ------------------------------------------------------------------ */
1359 /* argument tvbuff_t contains only parameter-specific length          */
1360 /* length indicator is already dissected in dissect_isup_message() or */
1361 /* dissect_isup_optional_parameter()                                  */
1362 /* ------------------------------------------------------------------ */
1363
1364 /* ------------------------------------------------------------------
1365  Dissector Parameter nature of connection flags
1366  */
1367 static void
1368 dissect_isup_nature_of_connection_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1369 {
1370   guint8 nature_of_connection_ind;
1371
1372   nature_of_connection_ind = tvb_get_guint8(parameter_tvb, 0);
1373   proto_tree_add_uint(parameter_tree, hf_isup_satellite_indicator, parameter_tvb, 0,NATURE_OF_CONNECTION_IND_LENGTH, nature_of_connection_ind);
1374   proto_tree_add_uint(parameter_tree, hf_isup_continuity_check_indicator, parameter_tvb, 0,NATURE_OF_CONNECTION_IND_LENGTH, nature_of_connection_ind);
1375   proto_tree_add_boolean(parameter_tree, hf_isup_echo_control_device_indicator, parameter_tvb, 0,  NATURE_OF_CONNECTION_IND_LENGTH, nature_of_connection_ind);
1376
1377   proto_item_set_text(parameter_item, "Nature of Connection Indicators: 0x%x", nature_of_connection_ind);
1378 }
1379
1380 /* ------------------------------------------------------------------
1381  Dissector Parameter Forward Call Indicators
1382  */
1383 static void
1384 dissect_isup_forward_call_indicators_parameter(tvbuff_t *parameter_tvb,proto_tree *parameter_tree, proto_item *parameter_item)
1385 {
1386   guint16 forward_call_ind;
1387
1388   forward_call_ind = tvb_get_ntohs(parameter_tvb, 0);
1389   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_natnl_inatnl_call_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1390   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);
1391   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_interworking_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1392   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);
1393   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_isdn_user_part_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1394   proto_tree_add_uint(parameter_tree, hf_isup_forw_call_preferences_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1395   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_isdn_access_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1396   proto_tree_add_uint(parameter_tree, hf_isup_forw_call_sccp_method_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1397
1398   proto_item_set_text(parameter_item, "Forward Call Indicators: 0x%x", forward_call_ind );
1399 }
1400
1401 /* ------------------------------------------------------------------
1402  Dissector Parameter Calling Party's Category
1403  */
1404 static void
1405 dissect_isup_calling_partys_category_parameter(tvbuff_t *parameter_tvb,proto_tree *parameter_tree, proto_item *parameter_item)
1406 {
1407   guint8 calling_partys_category;
1408
1409   calling_partys_category = tvb_get_guint8(parameter_tvb, 0);
1410   proto_tree_add_uint(parameter_tree, hf_isup_calling_partys_category, parameter_tvb, 0, CALLING_PRTYS_CATEGORY_LENGTH, calling_partys_category);
1411
1412   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"));
1413 }
1414
1415
1416 /* ------------------------------------------------------------------
1417   Dissector Parameter Transmission medium requirement
1418  */
1419 static void
1420 dissect_isup_transmission_medium_requirement_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1421 {
1422   guint8 transmission_medium_requirement;
1423
1424   transmission_medium_requirement = tvb_get_guint8(parameter_tvb, 0);
1425   proto_tree_add_uint(parameter_tree, hf_isup_transmission_medium_requirement, parameter_tvb, 0, TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH,transmission_medium_requirement);
1426
1427   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"));
1428 }
1429 /* ------------------------------------------------------------------
1430   Dissector Parameter Called party number
1431  */
1432 static void
1433 dissect_isup_called_party_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1434 {
1435   proto_item *address_digits_item;
1436   proto_tree *address_digits_tree;
1437   guint8 indicators1, indicators2;
1438   guint8 address_digit_pair=0;
1439   gint offset=0;
1440   gint i=0;
1441   gint length;
1442   char called_number[MAXLENGTH]="";
1443
1444   indicators1 = tvb_get_guint8(parameter_tvb, 0);
1445   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
1446   proto_tree_add_uint(parameter_tree, hf_isup_called_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
1447   indicators2 = tvb_get_guint8(parameter_tvb, 1);
1448   proto_tree_add_boolean(parameter_tree, hf_isup_inn_indicator, parameter_tvb, 1, 1, indicators2);
1449   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
1450   offset = 2;
1451
1452   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
1453                                             offset, -1,
1454                                             "Called Party Number");
1455   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
1456
1457   length = tvb_length_remaining(parameter_tvb, offset);
1458   while(length > 0){
1459     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
1460     proto_tree_add_uint(address_digits_tree, hf_isup_called_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1461     called_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
1462     if ((length - 1) > 0 ){
1463       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1464       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1465     }
1466     offset++;
1467     length = tvb_length_remaining(parameter_tvb, offset);
1468   }
1469
1470   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
1471       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
1472       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1473   }
1474   called_number[i++] = '\0';
1475
1476   proto_item_set_text(address_digits_item, "Called Party Number: %s", called_number);
1477   proto_item_set_text(parameter_item, "Called Party Number: %s", called_number);
1478
1479 }
1480 /* ------------------------------------------------------------------
1481   Dissector Parameter  Subsequent number
1482  */
1483 static void
1484 dissect_isup_subsequent_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1485 {
1486   proto_item *address_digits_item;
1487   proto_tree *address_digits_tree;
1488   guint8 indicators1;
1489   guint8 address_digit_pair=0;
1490   gint offset=0;
1491   gint i=0;
1492   gint length;
1493   char called_number[MAXLENGTH]="";
1494
1495   indicators1 = tvb_get_guint8(parameter_tvb, 0);
1496   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
1497   offset = 1;
1498
1499   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
1500                                             offset, -1,
1501                                             "Subsequent Number");
1502   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
1503
1504   length = tvb_length_remaining(parameter_tvb, offset);
1505   while(length > 0){
1506     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
1507     proto_tree_add_uint(address_digits_tree, hf_isup_called_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1508     called_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
1509     if ((length - 1) > 0 ){
1510       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1511       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1512     }
1513     offset++;
1514     length = tvb_length_remaining(parameter_tvb, offset);
1515   }
1516
1517   if (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
1518       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
1519       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1520   }
1521   called_number[i++] = '\0';
1522
1523   proto_item_set_text(address_digits_item, "Subsequent Number: %s", called_number);
1524   proto_item_set_text(parameter_item, "Subsequent Number: %s", called_number);
1525
1526 }
1527 /* ------------------------------------------------------------------
1528   Dissector Parameter Information Request Indicators
1529  */
1530 static void
1531 dissect_isup_information_request_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1532 {
1533   guint16 information_request_indicators;
1534
1535   information_request_indicators = tvb_get_ntohs(parameter_tvb, 0);
1536   proto_tree_add_boolean(parameter_tree, hf_isup_calling_party_address_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
1537   proto_tree_add_boolean(parameter_tree, hf_isup_info_req_holding_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
1538   proto_tree_add_boolean(parameter_tree, hf_isup_calling_partys_category_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
1539   proto_tree_add_boolean(parameter_tree, hf_isup_charge_information_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
1540   proto_tree_add_boolean(parameter_tree, hf_isup_malicious_call_identification_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
1541
1542
1543   proto_item_set_text(parameter_item, "Information request indicators: 0x%x", information_request_indicators);
1544 }
1545 /* ------------------------------------------------------------------
1546   Dissector Parameter Information Indicators
1547  */
1548 static void
1549 dissect_isup_information_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1550 {
1551   guint16 information_indicators;
1552
1553   information_indicators = tvb_get_ntohs(parameter_tvb, 0);
1554   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_address_response_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
1555   proto_tree_add_boolean(parameter_tree, hf_isup_hold_provided_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
1556   proto_tree_add_boolean(parameter_tree, hf_isup_calling_partys_category_response_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
1557   proto_tree_add_boolean(parameter_tree, hf_isup_charge_information_response_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
1558   proto_tree_add_boolean(parameter_tree, hf_isup_solicited_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
1559
1560
1561   proto_item_set_text(parameter_item, "Information indicators: 0x%x", information_indicators);
1562 }
1563 /* ------------------------------------------------------------------
1564   Dissector Parameter Continuity Indicators
1565  */
1566 static void
1567 dissect_isup_continuity_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1568 {
1569   guint8 continuity_indicators;
1570
1571   continuity_indicators = tvb_get_guint8(parameter_tvb, 0);
1572   proto_tree_add_boolean(parameter_tree, hf_isup_continuity_indicator, parameter_tvb, 0, CONTINUITY_IND_LENGTH,  continuity_indicators);
1573
1574   proto_item_set_text(parameter_item, "Continuity indicators: 0x%x", continuity_indicators);
1575 }
1576 /* ------------------------------------------------------------------
1577  Dissector Parameter Backward Call Indicators
1578  */
1579 static void
1580 dissect_isup_backward_call_indicators_parameter(tvbuff_t *parameter_tvb,proto_tree *parameter_tree, proto_item *parameter_item)
1581 {
1582   guint16 backward_call_ind;
1583
1584   backward_call_ind = tvb_get_ntohs(parameter_tvb, 0);
1585
1586
1587   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_charge_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1588   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_called_partys_status_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1589   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_called_partys_category_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1590   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);
1591   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_interworking_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1592   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);
1593   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_isdn_user_part_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1594   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_holding_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH,  backward_call_ind);
1595   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_isdn_access_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1596   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_echo_control_device_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1597   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_sccp_method_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1598
1599   proto_item_set_text(parameter_item, "Backward Call Indicators: 0x%x", backward_call_ind);
1600 }
1601 /* ------------------------------------------------------------------
1602   Dissector Parameter Cause Indicators - no detailed dissection since defined in Rec. Q.850
1603  */
1604
1605 /*
1606  * Cause codes for Cause.
1607  * The decoding of cause indicators parameter field are defined in ITU-T
1608  * Recommendation Q.850; those are different from the ones in the Q.931
1609  * dissector, as that has some values not specified by the standard but
1610  * that appear to be used for purposes other than the ones in Q.850.
1611  */
1612 static const value_string q850_cause_code_vals[] = {
1613         { 0x00, "Valid cause code not yet received" },
1614         { 0x01, "Unallocated (unassigned) number" },
1615         { 0x02, "No route to specified transit network" },
1616         { 0x03, "No route to destination" },
1617         { 0x04, "Send special information tone" },
1618         { 0x05, "Misdialled trunk prefix" },
1619         { 0x06, "Channel unacceptable" },
1620         { 0x07, "Call awarded and being delivered in an established channel" },
1621         { 0x08, "Preemption" },
1622         { 0x09, "Preemption - circuit reserved for reuse" },
1623         { 0x0E, "QoR: ported number" },
1624         { 0x10, "Normal call clearing" },
1625         { 0x11, "User busy" },
1626         { 0x12, "No user responding" },
1627         { 0x13, "No answer from user (user alerted)" },
1628         { 0x14, "Subscriber absent" },
1629         { 0x15, "Call rejected" },
1630         { 0x16, "Number changed" },
1631         { 0x17, "Redirection to new destination" },
1632         { 0x18, "Call rejected due to feature at the destination" },
1633         { 0x19, "Exchange routing error" },
1634         { 0x1A, "Non-selected user clearing" },
1635         { 0x1B, "Destination out of order" },
1636         { 0x1C, "Invalid number format (address incomplete)" },
1637         { 0x1D, "Facility rejected" },
1638         { 0x1E, "Response to STATUS ENQUIRY" },
1639         { 0x1F, "Normal unspecified" },
1640         { 0x21, "Circuit out of order" },
1641         { 0x22, "No circuit/channel available" },
1642         { 0x26, "Network out of order" },
1643         { 0x27, "Permanent frame mode connection out of service" },
1644         { 0x28, "Permanent frame mode connection operational" },
1645         { 0x29, "Temporary failure" },
1646         { 0x2A, "Switching equipment congestion" },
1647         { 0x2B, "Access information discarded" },
1648         { 0x2C, "Requested circuit/channel not available" },
1649         { 0x2E, "Precedence call blocked" },
1650         { 0x2F, "Resources unavailable, unspecified" },
1651         { 0x31, "Quality of service unavailable" },
1652         { 0x32, "Requested facility not subscribed" },
1653         { 0x35, "Outgoing calls barred within CUG" },
1654         { 0x37, "Incoming calls barred within CUG" },
1655         { 0x38, "Call waiting not subscribed" },
1656         { 0x39, "Bearer capability not authorized" },
1657         { 0x3A, "Bearer capability not presently available" },
1658         { 0x3E, "Inconsistency in designated outgoing access information and subscriber class" },
1659         { 0x3F, "Service or option not available, unspecified" },
1660         { 0x41, "Bearer capability not implemented" },
1661         { 0x42, "Channel type not implemented" },
1662         { 0x45, "Requested facility not implemented" },
1663         { 0x46, "Only restricted digital information bearer capability is available" },
1664         { 0x4F, "Service or option not implemented, unspecified" },
1665         { 0x51, "Invalid call reference value" },
1666         { 0x52, "Identified channel does not exist" },
1667         { 0x53, "Call identity does not exist for suspended call" },
1668         { 0x54, "Call identity in use" },
1669         { 0x55, "No call suspended" },
1670         { 0x56, "Call having the requested call identity has been cleared" },
1671         { 0x57, "Called user not member of CUG" },
1672         { 0x58, "Incompatible destination" },
1673         { 0x5A, "Non-existing CUG" },
1674         { 0x5B, "Invalid transit network selection (national use)" },
1675         { 0x5F, "Invalid message, unspecified" },
1676         { 0x60, "Mandatory information element is missing" },
1677         { 0x61, "Message type non-existent or not implemented" },
1678         { 0x62, "Message not compatible with call state or message type non-existent or not implemented" },
1679         { 0x63, "Information element nonexistant or not implemented" },
1680         { 0x64, "Invalid information element contents" },
1681         { 0x65, "Message not compatible with call state" },
1682         { 0x66, "Recovery on timer expiry" },
1683         { 0x67, "Parameter non-existent or not implemented - passed on" },
1684         { 0x6E, "Message with unrecognized parameter discarded" },
1685         { 0x6F, "Protocol error, unspecified" },
1686         { 0x7F, "Internetworking, unspecified" },
1687         { 0,    NULL }
1688 };
1689
1690
1691
1692
1693 static void
1694 dissect_isup_cause_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1695 { guint length = tvb_length(parameter_tvb);
1696   proto_tree_add_text(parameter_tree, parameter_tvb,0, length, "Cause indicators (-> Q.850)");
1697   dissect_q931_cause_ie(parameter_tvb,0,length,
1698                                             parameter_tree,
1699                                             hf_isup_cause_indicator);
1700   proto_item_set_text(parameter_item, "Cause indicators, see Q.850 (%u byte%s length)", length , plurality(length, "", "s"));
1701 }
1702
1703 /* ------------------------------------------------------------------
1704   Dissector Parameter Suspend/Resume Indicators
1705  */
1706 static void
1707 dissect_isup_suspend_resume_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1708 {
1709   guint8 indicators;
1710
1711   indicators = tvb_get_guint8(parameter_tvb, 0);
1712   proto_tree_add_boolean(parameter_tree, hf_isup_suspend_resume_indicator, parameter_tvb, 0, SUSPEND_RESUME_IND_LENGTH,  indicators);
1713
1714   proto_item_set_text(parameter_item, "Suspend/Resume indicator: 0x%x", indicators);
1715 }
1716 /* ------------------------------------------------------------------
1717   Dissector Parameter Range and Status Indicators
1718  */
1719 static void
1720 dissect_isup_range_and_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1721 {
1722   guint8 range, actual_status_length;
1723
1724   range = tvb_get_guint8(parameter_tvb, 0);
1725   proto_tree_add_uint_format(parameter_tree, hf_isup_range_indicator, parameter_tvb, 0, RANGE_LENGTH, range, "Range: %u", range);
1726   actual_status_length = tvb_length_remaining(parameter_tvb, RANGE_LENGTH);
1727   if (actual_status_length > 0)
1728     proto_tree_add_text(parameter_tree, parameter_tvb , RANGE_LENGTH, actual_status_length, "Status subfield");
1729   else
1730     proto_tree_add_text(parameter_tree, parameter_tvb , 0, 0, "Status subfield is not present with this message type");
1731
1732
1733   proto_item_set_text(parameter_item, "Range (%u) and status", range);
1734 }
1735 /* ------------------------------------------------------------------
1736   Dissector Parameter Circuit group supervision message type
1737  */
1738 static void
1739 dissect_isup_circuit_group_supervision_message_type_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1740 {
1741   guint8 cgs_message_type;
1742
1743   cgs_message_type = tvb_get_guint8(parameter_tvb, 0);
1744   proto_tree_add_uint(parameter_tree, hf_isup_cgs_message_type, parameter_tvb, 0, CIRC_GRP_SV_MSG_TYPE_LENGTH, cgs_message_type);
1745
1746   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);
1747 }
1748 /* ------------------------------------------------------------------
1749   Dissector Parameter Facility indicator parameter
1750  */
1751 static void
1752 dissect_isup_facility_ind_parameter(tvbuff_t *parameter_tvb, proto_item *parameter_item)
1753 {
1754   guint8 indicator;
1755
1756   indicator = tvb_get_guint8(parameter_tvb, 0);
1757
1758   proto_item_set_text(parameter_item, "Facility indicator: %s (%u)"  ,val_to_str(indicator, isup_facility_ind_value,"spare"), indicator);
1759 }
1760 /* ------------------------------------------------------------------
1761   Dissector Parameter Circuit state indicator
1762  */
1763 static void
1764 dissect_isup_circuit_state_ind_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1765 {
1766   proto_item *circuit_state_item;
1767   proto_tree *circuit_state_tree;
1768   guint8 circuit_state;
1769   gint offset=0;
1770   gint i=0;
1771   gint length;
1772
1773   length = tvb_length_remaining(parameter_tvb, offset);
1774   while(length > 0){
1775     circuit_state_item = proto_tree_add_text(parameter_tree, parameter_tvb,
1776                                              offset,
1777                                              tvb_length_remaining(parameter_tvb, offset),
1778                                              "Circuit# CIC+%u state", i);
1779     circuit_state_tree = proto_item_add_subtree(circuit_state_item, ett_isup_circuit_state_ind);
1780     circuit_state = tvb_get_guint8(parameter_tvb, offset);
1781     if ((circuit_state & DC_8BIT_MASK) == 0){
1782       proto_tree_add_uint(circuit_state_tree, hf_isup_mtc_blocking_state1, parameter_tvb, offset, 1, circuit_state);
1783       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"));
1784     }
1785     else {
1786       proto_tree_add_uint(circuit_state_tree, hf_isup_mtc_blocking_state2, parameter_tvb, offset, 1, circuit_state);
1787       proto_tree_add_uint(circuit_state_tree, hf_isup_call_proc_state, parameter_tvb, offset, 1, circuit_state);
1788       proto_tree_add_uint(circuit_state_tree, hf_isup_hw_blocking_state, parameter_tvb, offset, 1, circuit_state);
1789       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"));
1790     }
1791     offset++;
1792     length = tvb_length_remaining(parameter_tvb, offset);
1793   }
1794   proto_item_set_text(parameter_item, "Circuit state indicator (national use)");
1795 }
1796 /* ------------------------------------------------------------------
1797   Dissector Parameter Event information
1798  */
1799 static void
1800 dissect_isup_event_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1801 {
1802   guint8 indicators;
1803
1804   indicators = tvb_get_guint8(parameter_tvb, 0);
1805   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);
1806   proto_tree_add_boolean(parameter_tree, hf_isup_event_presentation_restricted_ind, parameter_tvb, 0, EVENT_INFO_LENGTH, indicators);
1807
1808   proto_item_set_text(parameter_item,"Event information: %s (%u)", val_to_str(indicators & GFEDCBA_8BIT_MASK, isup_event_ind_value, "spare"),indicators );
1809 }
1810 /* ------------------------------------------------------------------
1811   Dissector Parameter User-to-user information- no detailed dissection since defined in Rec. Q.931
1812  */
1813 static void
1814 dissect_isup_user_to_user_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1815 { guint length = tvb_length(parameter_tvb);
1816   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "User-to-user info (-> Q.931)");
1817   dissect_q931_user_user_ie(parameter_tvb, 0, length,
1818     parameter_tree );
1819   proto_item_set_text(parameter_item, "User-to-user information, see Q.931 (%u byte%s length)", length , plurality(length, "", "s"));
1820 }
1821 /* ------------------------------------------------------------------
1822   Dissector Parameter Call Reference
1823  */
1824 static void
1825 dissect_isup_call_reference_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1826 {
1827   guint32 call_id;
1828   guint16 spc;
1829
1830   call_id = tvb_get_ntoh24(parameter_tvb, 0);
1831   spc = tvb_get_letohs(parameter_tvb, CALL_ID_LENGTH) & 0x3FFF; /*since 1st 2 bits spare */
1832   proto_tree_add_text(parameter_tree, parameter_tvb, 0, CALL_ID_LENGTH, "Call identity: %u", call_id);
1833   proto_tree_add_text(parameter_tree, parameter_tvb, CALL_ID_LENGTH, SPC_LENGTH, "Signalling Point Code: %u", spc);
1834
1835   proto_item_set_text(parameter_item, "Call Reference: Call ID = %u, SPC = %u", call_id, spc);
1836 }
1837 /* ------------------------------------------------------------------
1838   Dissector Parameter Access Transport - no detailed dissection since defined in Rec. Q.931
1839  */
1840 static void
1841 dissect_isup_access_transport_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1842 { guint length = tvb_length(parameter_tvb);
1843   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Access transport parameter field (-> Q.931)");
1844   proto_item_set_text(parameter_item, "Access transport, see Q.931 (%u byte%s length)", length , plurality(length, "", "s"));
1845 }
1846
1847 #define  ACTION_INDICATOR                               0x01    
1848 #define  BACKBONE_NETWORK_CONNECTION_IDENTIFIER         0x02    
1849 #define  INTERWORKING_FUNCTION_ADDRESS                  0x03    
1850 #define  CODEC_LIST                                     0x04    
1851 #define  CODEC                                          0x05    
1852 #define  BAT_COMPATIBILITY_REPORT                       0x06    
1853 #define  BEARER_NETWORK_CONNECTION_CHARACTERISTICS      0x07    
1854 #define  BEARER_CONTROL_INFORMATION                     0x08    
1855 #define  BEARER_CONTROL_TUNNELLING                      0x09    
1856 #define  BEARER_CONTROL_UNIT_IDENTIFIER                 0x0A    
1857 #define  SIGNAL                                         0x0B    
1858 #define  BEARER_REDIRECTION_CAPABILITY                  0x0C    
1859 #define  BEARER_REDIRECTION_INDICATORS                  0x0D    
1860 #define  SIGNAL_TYPE                                    0x0E    
1861 #define  DURATION                                       0x0F
1862
1863         
1864
1865
1866 static const value_string bat_ase_list_of_Identifiers_vals[] = {
1867
1868         { 0x00                                          ,       "spare" },
1869         { ACTION_INDICATOR                              ,       "Action Indicator" },
1870         { BACKBONE_NETWORK_CONNECTION_IDENTIFIER        ,       "Backbone Network Connection Identifier" },
1871         { INTERWORKING_FUNCTION_ADDRESS                 ,       "Interworking Function Address" },
1872         { CODEC_LIST                                    ,       "Codec List" },
1873         { CODEC                                         ,       "Codec" },
1874         { BAT_COMPATIBILITY_REPORT                      ,       "BAT Compatibility Report" },
1875         { BEARER_NETWORK_CONNECTION_CHARACTERISTICS     ,       "Bearer Network Connection Characteristics" },
1876         { BEARER_CONTROL_INFORMATION                    ,       "Bearer Control Information"},
1877         { BEARER_CONTROL_TUNNELLING                     ,       "Bearer Control Tunnelling"},
1878         { BEARER_CONTROL_UNIT_IDENTIFIER                ,       "Bearer Control Unit Identifier" },
1879         { SIGNAL                                        ,       "Signal"},
1880         { BEARER_REDIRECTION_CAPABILITY                 ,       "Bearer Redirection Capability"},
1881         { BEARER_REDIRECTION_INDICATORS                 ,       "Bearer Redirection Indicators"},
1882         { SIGNAL_TYPE                                   ,       "Signal Type"},
1883         { DURATION                                      ,       "Duration" },
1884         { 0,    NULL }
1885 };    
1886
1887 /*ITU-T Q.765.5 (06/2000) 13*/
1888 static const value_string Instruction_indicator_for_general_action_vals[] =
1889 {
1890   { 0,     "Pass on information element"},
1891   { 1,     "Discard information element"},
1892   { 2,     "Discard BICC data"},
1893   { 3,     "Release call"},
1894   { 0,     NULL}};
1895
1896 static const value_string Instruction_indicator_for_pass_on_not_possible_vals[] = {
1897   { 0,     "Release call"},
1898   { 1,     "Discard information element"},
1899   { 2,     "Discard BICC data"},
1900   { 3,     "reserved (interpreted as 00)"},
1901   { 0,     NULL}};
1902
1903 static value_string bat_ase_action_indicator_field_vals[] = {
1904       
1905         { 0x00, "no indication"},
1906         { 0x01, "connect backward"},
1907         { 0x02, "connect forward"},
1908         { 0x03, "connect forward, no notification"},
1909         { 0x04, "connect forward, plus notification"},
1910         { 0x05, "connect forward, no notification + selected codec"},
1911         { 0x06, "connect forward, plus notification + selected codec"},
1912         { 0x07, "use idle"},
1913         { 0x08, "connected"},
1914         { 0x09, "switched"},
1915         { 0x0a, "selected codec"},
1916         { 0x0b, "modify codec"},
1917         { 0x0c, "successful codec modification"},
1918         { 0x0d, "codec modification failure"},
1919         { 0x0e, "mid-call codec negotiation"},
1920         { 0x0f, "modify to selected codec information"},
1921         { 0x10, "mid-call codec negotiation failure"},
1922         { 0x11, "start signal, notify"},
1923         { 0x12, "start signal, no notify"},
1924         { 0x13, "stop signal, notify"},
1925         { 0x14, "stop signal, no notify"},
1926         { 0x15, "start signal acknowledge"},
1927         { 0x16, "start signal reject"},
1928         { 0x16, "stop signal acknowledge"},
1929         { 0x18, "bearer redirect"},
1930         { 0,    NULL }
1931 };    
1932
1933 static const true_false_string BCTP_BVEI_value  = {
1934   "Version Error Indication, BCTP version not supported",
1935   "No indication"
1936 };
1937
1938 static value_string BCTP_Tunnelled_Protocol_Indicator_vals[] = {
1939       
1940         { 0x20, "IPBCP (text encoded)"},
1941         { 0x21, "spare (text encoded protocol)"},
1942         { 0x22, "not used"},
1943         { 0,    NULL }
1944 };    
1945
1946 static const true_false_string BCTP_TPEI_value  = {
1947   "Protocol Error Indication, Bearer Control Protocol not supported",
1948   "No indication"
1949 };
1950
1951 #define  ITU_T                                  0x01    
1952
1953 static const value_string bat_ase_organization_identifier_subfield_vals[] = {
1954
1955         { 0x00, "no indication"},
1956         { 0x01, "ITU-T"},
1957         { 0x02, "ETSI (refer to TS 26.103)"},
1958         { 0,    NULL }
1959 };
1960
1961
1962 #define G_711_64_A                                              0x01
1963 #define G_711_64_U                                              0x02
1964 #define G_711_56_A                                              0x03
1965 #define G_711_56_U                                              0x04
1966 #define G_722_SB_ADPCM                                          0x05
1967 #define G_723_1                                                 0x06
1968 #define G_723_1_Annex_A                                         0x07
1969 #define G_726_ADPCM                                             0x08
1970 #define G_727_Embedded_ADPCM                                    0x09
1971 #define G_728                                                   0x0a
1972 #define G_729_CS_ACELP                                          0x0b
1973 #define G_729_Annex_B                                           0x0c
1974
1975 static const value_string ITU_T_codec_type_subfield_vals[] = {
1976
1977         { 0x00,                         "no indication"},
1978         { G_711_64_A,                   "G.711 64 kbit/s A-law"},
1979         { G_711_64_U,                   "G.711 64 kbit/s -law"},
1980         { G_711_56_A,                   "G.711 56 kbit/s A-law"},
1981         { G_711_56_U,                   "G.711 56 kbit/s -law"},
1982         { G_722_SB_ADPCM,               "G.722 (SB-ADPCM)"},
1983         { G_723_1,                      "G.723.1"},
1984         { G_723_1_Annex_A,              "G.723.1 Annex A (silence suppression)"},
1985         { G_726_ADPCM,                  "G.726 (ADPCM)"},
1986         { G_727_Embedded_ADPCM,         "G.727 (Embedded ADPCM)"},
1987         { G_728,                        "G.728"},
1988         { G_729_CS_ACELP,               "G.729 (CS-ACELP)"},
1989         { G_729_Annex_B,                "G.729 Annex B (silence suppression)"},
1990         { 0,    NULL }
1991 };
1992
1993
1994 static const value_string bearer_network_connection_characteristics_vals[] = {
1995
1996         { 0x00, "no indication"},
1997         { 0x01, "AAL type 1"},
1998         { 0x02, "AAL type 2"},
1999         { 0x03, "Structured AAL type 1"},
2000         { 0x04, "IP/RTP"},
2001         { 0,    NULL }
2002 };
2003
2004 static const true_false_string Bearer_Control_Tunnelling_ind_value  = {
2005   "Tunnelling to be used",
2006   "No indication"
2007 };
2008
2009 static const true_false_string late_cut_trough_cap_ind_value  = {
2010   "Late Cut-through supported",
2011   "Late Cut-through not supported"
2012 };
2013 /*  ITU-T Rec. Q.765.5/Amd.1 (07/2001) */
2014 static const value_string Bearer_Redirection_Indicator_vals[] = {
2015         { 0x00, " no indication"},
2016         { 0x01, "late cut-through request"},
2017         { 0x02, "redirect temporary reject"},
2018         { 0x03, "redirect backwards request"},
2019         { 0x04, "redirect forwards request"},
2020         { 0x05, "redirect bearer release request"},
2021         { 0x06, "redirect bearer release proceed"},
2022         { 0x07, " redirect bearer release complete"},
2023         { 0x08, "redirect cut-through request"},
2024         { 0x09, "redirect bearer connected indication"},
2025         { 0x0a, "redirect failure"},
2026         { 0x0b, "new connection identifier"},
2027         { 0,    NULL }
2028 };
2029
2030 /*26/Q.765.5 - Signal Type */
2031 static const value_string BAt_ASE_Signal_Type_vals[] = {
2032         { 0x00, "DTMF 0"},
2033         { 0x01, "DTMF 1"},
2034         { 0x02, "DTMF 2"},
2035         { 0x03, "DTMF 3"},
2036         { 0x04, "DTMF 4"},
2037         { 0x05, "DTMF 5"},
2038         { 0x06, "DTMF 6"},
2039         { 0x07, "DTMF 7"},
2040         { 0x08, "DTMF 8"},
2041         { 0x09, "DTMF 9"},
2042         { 0x0a, "DTMF *"},
2043         { 0x0b, "DTMF #"},
2044         { 0x0c, "DTMF A"},
2045         { 0x0d, "DTMF B"},
2046         { 0x0e, "DTMF C"},
2047         { 0x1f, "DTMF D"},
2048         { 0x40, "dial tone"},
2049         { 0x41, "PABX internal dial tone"},
2050         { 0x42, "special dial tone"},
2051         { 0x43, "second dial tone"},
2052         { 0x44, "ringing tone"},
2053         { 0x45, "special ringing tone"},
2054         { 0x46, "busy tone"},
2055         { 0x47, "congestion tone"},
2056         { 0x48, "special information tone"},
2057         { 0x49, "warning tone"},
2058         { 0x4a, "intrusion tone"},
2059         { 0x4b, "call waiting tone"},
2060         { 0x4c, "pay tone"},
2061         { 0x4d, "payphone recognition tone"},
2062         { 0x4e, "comfort tone"},
2063         { 0x4f, "tone on hold"},
2064         { 0x50, "record tone"},
2065         { 0x51, "Caller waiting tone"},
2066         { 0x52, "positive indication tone"},
2067         { 0x53, "negative indication tone"},
2068         { 0,    NULL }
2069 };
2070
2071
2072 /* Dissect BAT ASE message according to Q.765.5 200006 and Amendment 1 200107   */
2073 /* Layout of message                                                            */
2074 /*      Element name                    Octet                                   */                      
2075 /*      Identifier 1                    1                                       */
2076 /*      Length indicator 1              2                                       */
2077 /*      Compatibility information 1     3                                       */
2078 /*      Contents 1                      4                                       */
2079 /*      Identifier n                    m                                       */
2080 /*      Length indicator n                                                      */
2081 /*      Compatibility information n                                             */
2082 /*      Contents n                      p                                       */
2083
2084 static void
2085 dissect_bat_ase_Encapsulated_Application_Information(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *parameter_tree,  gint offset, gint length)
2086
2087         tvbuff_t        *next_tvb;
2088         proto_tree      *bat_ase_tree, *bat_ase_element_tree;
2089         proto_item      *bat_ase_item, *bat_ase_element_item;
2090         guint8 identifier,compatibility_info,content, BCTP_Indicator_field_1, BCTP_Indicator_field_2;
2091         guint8 length_indicator, sdp_length, tempdata, content_len, element_no, number_of_indicators;
2092         guint duration;
2093         guint32 bnci, Local_BCU_ID;
2094         element_no = 0;
2095
2096         bat_ase_item = proto_tree_add_text(parameter_tree,parameter_tvb,
2097                                            offset,(length-offset),
2098 "Bearer Association Transport (BAT) Application Service Element (ASE) Encapsulated Application Information:");
2099         bat_ase_tree = proto_item_add_subtree(bat_ase_item , ett_bat_ase);
2100
2101         proto_tree_add_text(bat_ase_tree, parameter_tvb, offset, (length-offset), "BAT ASE Encapsulated Application Information, (%u byte%s length)", (length - offset ), plurality(length, "", "s"));
2102         while(length > offset){
2103                 element_no = element_no + 1;
2104                 identifier = tvb_get_guint8(parameter_tvb, offset);
2105                 offset = offset + 1;
2106 /* length indicator may be 11 bits long                         */
2107 /*        temp_length = tvb_get_ntohs(parameter_tvb, offset);*/
2108         
2109                 length_indicator = tvb_get_guint8(parameter_tvb, offset);
2110
2111
2112                 bat_ase_element_item = proto_tree_add_text(bat_ase_tree,parameter_tvb,
2113                                           ( offset - 1),(length_indicator + 1),"BAT ASE Element %u, Identifier: %s",element_no,
2114                                         val_to_str(identifier,bat_ase_list_of_Identifiers_vals,NULL));
2115                 bat_ase_element_tree = proto_item_add_subtree(bat_ase_element_item , ett_bat_ase_element);
2116
2117                 proto_tree_add_uint(bat_ase_element_tree , hf_bat_ase_identifier , parameter_tvb, offset - 1, 1, identifier );
2118                 proto_tree_add_uint(bat_ase_element_tree , hf_length_indicator  , parameter_tvb, offset, 1, length_indicator & 0x7f );
2119
2120                 offset = offset + 1;
2121                 compatibility_info = tvb_get_guint8(parameter_tvb, offset);
2122                 proto_tree_add_uint(bat_ase_element_tree, hf_Instruction_ind_for_general_action , parameter_tvb, offset, 1, compatibility_info );
2123                 proto_tree_add_boolean(bat_ase_element_tree, hf_Send_notification_ind_for_general_action , parameter_tvb, offset, 1, compatibility_info );
2124                 proto_tree_add_uint(bat_ase_element_tree, hf_Instruction_ind_for_pass_on_not_possible , parameter_tvb, offset, 1, compatibility_info );
2125                 proto_tree_add_boolean(bat_ase_element_tree, hf_Send_notification_ind_for_pass_on_not_possible , parameter_tvb, offset, 1, compatibility_info );
2126                 proto_tree_add_boolean(bat_ase_element_tree, hf_isup_extension_ind , parameter_tvb, offset, 1, compatibility_info );
2127                 offset = offset + 1;
2128                 content_len = ( length_indicator & 0x7f ) - 1 ; /* exclude the treated Compatibility information */
2129
2130                 /* content will be different depending on identifier */
2131                 switch ( identifier ){
2132
2133                         case ACTION_INDICATOR :
2134
2135                                 content = tvb_get_guint8(parameter_tvb, offset);
2136                                 proto_tree_add_uint(bat_ase_element_tree, hf_Action_Indicator , parameter_tvb, offset, 1, content );
2137                                 offset = offset + 1;
2138                                 break;                          
2139                         case BACKBONE_NETWORK_CONNECTION_IDENTIFIER :           
2140
2141                                 bnci = tvb_get_letohl(parameter_tvb, offset);
2142                                 switch ( content_len ){
2143                                 case 1:
2144                                                 bnci = bnci & 0x000000ff;
2145                                                 break;  
2146                                 case 2:
2147                                                 bnci = bnci & 0x0000ffff;
2148                                                 break;  
2149                                 case 3:
2150                                                 bnci = bnci & 0x00ffffff;
2151                                                 break;  
2152                                 case 4:;  
2153                                 default:;
2154                                 }
2155                                 proto_tree_add_uint_format(bat_ase_element_tree, hf_bnci, parameter_tvb, offset, content_len, bnci, "BNCI: 0x%08x", bnci);
2156                                 offset = offset + content_len;
2157
2158                         break;
2159                         case INTERWORKING_FUNCTION_ADDRESS :            
2160                                 proto_tree_add_text(bat_ase_element_tree, parameter_tvb, offset, content_len, "BIWF: %s",
2161                                                             tvb_bytes_to_str(parameter_tvb, offset, content_len));
2162                                 offset = offset + content_len;
2163                         break;
2164                         case CODEC_LIST :               
2165                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
2166                                 proto_tree_add_uint(bat_ase_element_tree, hf_Organization_Identifier , parameter_tvb, offset, 1, tempdata );
2167                                 if ( tempdata != ITU_T ){
2168                                         proto_tree_add_text(bat_ase_element_tree, parameter_tvb, offset, content_len , "List of Codecs ( Non ITU-T ) %s",
2169                                                             tvb_bytes_to_str(parameter_tvb, offset, content_len));
2170                                 break;
2171                                 }
2172                                 offset = offset + 1;
2173                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
2174                                 proto_tree_add_uint(bat_ase_element_tree, hf_codec_type , parameter_tvb, offset, 1, tempdata );
2175                                 offset = offset +1;
2176                                 proto_tree_add_text(bat_ase_element_tree, parameter_tvb, offset,content_len , "Not decoded yet, (%u byte%s length)", (content_len), plurality(length, "", "s"));
2177                                 offset = offset + content_len - 2;
2178                         break;
2179                         case CODEC :                                    
2180                                 proto_tree_add_text(bat_ase_element_tree, parameter_tvb, offset,content_len , "Not decoded yet, (%u byte%s length)", (content_len), plurality(length, "", "s"));
2181                                 offset = offset + content_len;
2182                         break;
2183                         case BAT_COMPATIBILITY_REPORT :                 
2184                                 proto_tree_add_text(bat_ase_element_tree, parameter_tvb, offset,content_len , "Not decoded yet, (%u byte%s length)", (content_len), plurality(length, "", "s"));
2185                                 offset = offset + content_len;
2186                         break;
2187                         case BEARER_NETWORK_CONNECTION_CHARACTERISTICS :        
2188                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
2189                                 proto_tree_add_uint(bat_ase_element_tree, hf_characteristics , parameter_tvb, offset, 1, tempdata );
2190                                 offset = offset + content_len;
2191                         break;
2192 /* The Bearer Control Information information element contains the bearer control tunnelling protocol */
2193 /* ITU-T Q.1990 (2001), BICC bearer control tunnelling protocol. */
2194
2195                         case BEARER_CONTROL_INFORMATION :               
2196                                 BCTP_Indicator_field_1 = tvb_get_guint8(parameter_tvb, offset);
2197                                 proto_tree_add_uint(bat_ase_element_tree, hf_BCTP_Version_Indicator, parameter_tvb, offset, 1, BCTP_Indicator_field_1 );
2198                                 proto_tree_add_boolean(bat_ase_element_tree, hf_BVEI, parameter_tvb, offset, 1, BCTP_Indicator_field_1 );
2199                                 offset = offset + 1;
2200
2201                                 BCTP_Indicator_field_2 = tvb_get_guint8(parameter_tvb, offset);
2202                                 proto_tree_add_uint(bat_ase_element_tree, hf_Tunnelled_Protocol_Indicator , parameter_tvb, offset, 1, BCTP_Indicator_field_2 );
2203                                 proto_tree_add_boolean(bat_ase_element_tree, hf_TPEI, parameter_tvb, offset, 1, BCTP_Indicator_field_2 );
2204                                 offset = offset + 1;
2205
2206                                 sdp_length = ( length_indicator & 0x7f) - 3;
2207
2208                                 next_tvb = tvb_new_subset(parameter_tvb, offset, sdp_length, sdp_length);
2209                                 call_dissector(sdp_handle, next_tvb, pinfo, bat_ase_element_tree);
2210                                 offset = offset + sdp_length;
2211
2212
2213                         break;
2214                         case BEARER_CONTROL_TUNNELLING :                
2215
2216                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
2217                                 proto_tree_add_boolean(bat_ase_element_tree, hf_bearer_control_tunneling , parameter_tvb, offset, 1, tempdata );
2218                                 offset = offset + content_len;
2219                         break;
2220                         case BEARER_CONTROL_UNIT_IDENTIFIER :           
2221                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
2222                                 proto_tree_add_text(bat_ase_element_tree, parameter_tvb, offset, 1, "Network ID Length indicator= %u",tempdata);
2223                                 offset = offset +1;
2224                                 if ( tempdata > 0 ) {
2225                                         offset = offset +1;
2226                                 
2227 /* Q.765.5 amd 1
2228         Network ID
2229         The coding of the Network ID field is identical to the coding of the Network ID field in the
2230         Global Call Reference parameter as specified in clause 6/Q.1902.3 (see [3]).
2231         NOTE .When used inside a network domain, the Network ID may be omitted by setting the
2232         Network ID Length indicator to the value "0".
2233         Q.1902.3
2234         The following codes are used in the subfields of the global call reference parameter field:
2235         a) Network ID
2236         The Network ID contains the value field (coded according to ASN.1 BER) of an object
2237         identifier identifying the network. This means that the tag and length fields are omitted.
2238         An example of such an object identifier can be the following:
2239         .{itu-t (0) administration (2) national regulatory authority (x) network (y)}
2240         The value for x is the value of the national regulatory authority (one of the Data Country
2241         Codes associated to the country as specified in ITU-T X.121 shall be used for "national
2242         regulatory authority"), the value for y is under the control of the national regulatory
2243         authority concerned.
2244         b) Node ID
2245         A binary number that uniquely identifies within the network the node which generates the
2246         call reference.
2247         c) Call Reference ID
2248         A binary number used for the call reference of the call. This is generated by the node for
2249         each call.
2250
2251 */
2252                                         proto_tree_add_text(bat_ase_element_tree, parameter_tvb, offset, tempdata , "Network ID: %s",
2253                                                             tvb_bytes_to_str(parameter_tvb, offset, tempdata));
2254                                         offset = offset + tempdata;
2255                 } /* end if */
2256
2257                                 Local_BCU_ID = tvb_get_letohl(parameter_tvb, offset);
2258                                 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 );
2259                                 offset = offset + 4;
2260                         break;
2261                         case SIGNAL :           
2262                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
2263                                 proto_tree_add_uint(bat_ase_element_tree, hf_bat_ase_signal , parameter_tvb, offset, 1, tempdata );
2264                                 offset = offset + 1;
2265                                 if ( content_len > 1){
2266                                 duration = tvb_get_letohs(parameter_tvb, offset);
2267                                 proto_tree_add_uint(bat_ase_element_tree, hf_bat_ase_duration , parameter_tvb, offset, 2, duration );
2268                                 offset = offset + 2;
2269                                 }
2270                         break;
2271                         case BEARER_REDIRECTION_CAPABILITY :                    
2272                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
2273                                 proto_tree_add_boolean(bat_ase_element_tree, hf_late_cut_trough_cap_ind , parameter_tvb, offset, 1, tempdata );
2274                                 offset = offset + content_len;
2275                         break;
2276                         case BEARER_REDIRECTION_INDICATORS :
2277                                 number_of_indicators = 0;
2278                                 while ( number_of_indicators < content_len ) {          
2279                                         tempdata = tvb_get_guint8(parameter_tvb, offset);
2280                                         proto_tree_add_uint(bat_ase_element_tree, hf_bat_ase_bearer_redir_ind , parameter_tvb, offset, 1, tempdata );
2281                                         offset = offset + 1;
2282                                         number_of_indicators = number_of_indicators + 1;
2283                                 }
2284                         break;
2285                         case SIGNAL_TYPE :                                      
2286                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
2287                                 proto_tree_add_uint(bat_ase_element_tree, hf_bat_ase_signal , parameter_tvb, offset, 1, tempdata );
2288                                 offset = offset + content_len;
2289                         break;
2290                         case DURATION :
2291                                 duration = tvb_get_letohs(parameter_tvb, offset);
2292                                 proto_tree_add_uint(bat_ase_element_tree, hf_bat_ase_duration , parameter_tvb, offset, 2, duration );
2293                                 offset = offset + content_len;
2294                         break;
2295                         default :
2296                                 proto_tree_add_text(bat_ase_element_tree, parameter_tvb, offset,content_len , "Default ?, (%u byte%s length)", (content_len), plurality(length, "", "s"));
2297                                 offset = offset + content_len;
2298                         }                                       
2299         } 
2300 }
2301
2302 static void
2303 dissect_isup_application_transport_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *parameter_tree, proto_item *parameter_item)
2304
2305
2306   guint8 application_context_identifier;
2307   guint8 application_transport_instruction_ind;
2308   guint8 si_and_apm_segmentation_indicator;
2309   guint8 apm_Segmentation_local_ref;
2310   guint8 pointer_to_transparent_data;
2311   guint16 application_context_identifier16;
2312   gint offset = 0;
2313   guint length = tvb_length(parameter_tvb);
2314   
2315   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Application transport parameter fields:");
2316   proto_item_set_text(parameter_item, "Application transport, (%u byte%s length)", length , plurality(length, "", "s"));
2317   application_context_identifier = tvb_get_guint8(parameter_tvb, 0);
2318  
2319   if ( (application_context_identifier & H_8BIT_MASK) == 0x80) {
2320       proto_tree_add_uint(parameter_tree, hf_isup_app_cont_ident, parameter_tvb,offset, 1, (application_context_identifier & GFEDCBA_8BIT_MASK));
2321         offset = offset + 1;
2322         if ((application_context_identifier & 0x7f) > 6) return;
2323        }
2324   else
2325         {
2326         application_context_identifier16 = tvb_get_letohs(parameter_tvb,offset); 
2327         proto_tree_add_text(parameter_tree, parameter_tvb, offset, 2, "Application context identifier: 0x%x", application_context_identifier16);
2328         offset = offset + 2;
2329         return; /* no further decoding of this element */
2330         }
2331   proto_tree_add_text(parameter_tree, parameter_tvb, offset, length, "Application transport instruction indictators: ");
2332   application_transport_instruction_ind = tvb_get_guint8(parameter_tvb, offset);        
2333   proto_tree_add_boolean(parameter_tree, hf_isup_app_Release_call_ind, parameter_tvb, offset, 1, application_transport_instruction_ind);
2334   proto_tree_add_boolean(parameter_tree, hf_isup_app_Send_notification_ind, parameter_tvb, offset, 1, application_transport_instruction_ind);
2335   offset = offset + 1; 
2336   if ( (application_transport_instruction_ind & H_8BIT_MASK) == 0x80) {
2337         proto_tree_add_text(parameter_tree, parameter_tvb, offset, length, "APM segmentation indicator:");
2338         si_and_apm_segmentation_indicator  = tvb_get_guint8(parameter_tvb, offset);
2339         proto_tree_add_uint(parameter_tree, hf_isup_apm_segmentation_ind , parameter_tvb, offset, 1, si_and_apm_segmentation_indicator  );
2340         proto_tree_add_boolean(parameter_tree, hf_isup_apm_si_ind , parameter_tvb, offset, 1, si_and_apm_segmentation_indicator  );
2341         offset = offset + 1;
2342
2343           if ( (si_and_apm_segmentation_indicator & H_8BIT_MASK) == 0x80) {
2344                 apm_Segmentation_local_ref  = tvb_get_guint8(parameter_tvb, offset);
2345                 proto_tree_add_text(parameter_tree, parameter_tvb, offset, 1, "Segmentation local reference (SLR): 0x%x", apm_Segmentation_local_ref  );
2346                 offset = offset + 1;
2347           }
2348   }     
2349
2350    proto_tree_add_text(parameter_tree, parameter_tvb, offset, length, "APM-user information field"  );
2351    /* dissect BAT ASE element, without transparent data ( Q.765.5-200006) */ 
2352    if ((application_context_identifier & 0x7f) != 5) {
2353                 proto_tree_add_text(parameter_tree, parameter_tvb, offset, length, "No further dissection of APM-user information field");
2354                 return;
2355         }
2356    pointer_to_transparent_data = tvb_get_guint8(parameter_tvb, offset);
2357    if (pointer_to_transparent_data != 0)
2358                 proto_tree_add_text(parameter_tree, parameter_tvb, offset, 1, "Pointer to transparent data: 0x%x Don't know how to dissect further", pointer_to_transparent_data  );
2359    proto_tree_add_text(parameter_tree, parameter_tvb, offset, 1, "Pointer to transparent data: 0x%x No transparent data", pointer_to_transparent_data  );
2360    offset = offset + 1;
2361  
2362    dissect_bat_ase_Encapsulated_Application_Information(parameter_tvb , pinfo, parameter_tree, offset, length);
2363
2364
2365
2366 }
2367
2368
2369
2370 /* ------------------------------------------------------------------
2371   Dissector Parameter Optional Forward Call indicators
2372  */
2373 static void
2374 dissect_isup_optional_forward_call_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2375 {
2376   guint8 indicators;
2377
2378   indicators = tvb_get_guint8(parameter_tvb, 0);
2379   proto_tree_add_uint(parameter_tree, hf_isup_cug_call_ind, parameter_tvb, 0, OPTIONAL_FORWARD_CALL_IND_LENGTH, indicators);
2380   proto_tree_add_boolean(parameter_tree, hf_isup_simple_segmentation_ind, parameter_tvb, 0, OPTIONAL_FORWARD_CALL_IND_LENGTH, indicators);
2381   proto_tree_add_boolean(parameter_tree, hf_isup_connected_line_identity_request_ind, parameter_tvb, 0, OPTIONAL_FORWARD_CALL_IND_LENGTH, indicators);
2382
2383
2384   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 );
2385 }
2386 /* ------------------------------------------------------------------
2387   Dissector Parameter calling party number
2388  */
2389 static void
2390 dissect_isup_calling_party_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2391 {
2392   proto_item *address_digits_item;
2393   proto_tree *address_digits_tree;
2394   guint8 indicators1, indicators2;
2395   guint8 address_digit_pair=0;
2396   gint offset=0;
2397   gint i=0;
2398   gint length;
2399   char calling_number[MAXLENGTH]="";
2400
2401   indicators1 = tvb_get_guint8(parameter_tvb, 0);
2402   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
2403   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
2404   indicators2 = tvb_get_guint8(parameter_tvb, 1);
2405   proto_tree_add_boolean(parameter_tree, hf_isup_ni_indicator, parameter_tvb, 1, 1, indicators2);
2406   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
2407   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
2408   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator, parameter_tvb, 1, 1, indicators2);
2409   offset = 2;
2410
2411   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
2412                                             offset, -1,
2413                                             "Calling Party Number");
2414   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
2415
2416   length = tvb_length_remaining(parameter_tvb, offset);
2417   while(length > 0){
2418     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
2419     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2420     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
2421     if ((length - 1) > 0 ){
2422       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2423       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2424     }
2425     offset++;
2426     length = tvb_length_remaining(parameter_tvb, offset);
2427   }
2428
2429   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
2430       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
2431       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2432   }
2433   calling_number[i++] = '\0';
2434
2435   proto_item_set_text(address_digits_item, "Calling Party Number: %s", calling_number);
2436   proto_item_set_text(parameter_item, "Calling Party Number: %s", calling_number);
2437
2438 }
2439 /* ------------------------------------------------------------------
2440   Dissector Parameter Original called  number
2441  */
2442 static void
2443 dissect_isup_original_called_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2444 {
2445   proto_item *address_digits_item;
2446   proto_tree *address_digits_tree;
2447   guint8 indicators1, indicators2;
2448   guint8 address_digit_pair=0;
2449   gint offset=0;
2450   gint i=0;
2451   gint length;
2452   char calling_number[MAXLENGTH]="";
2453
2454   indicators1 = tvb_get_guint8(parameter_tvb, 0);
2455   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
2456   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
2457   indicators2 = tvb_get_guint8(parameter_tvb, 1);
2458   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
2459   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
2460   offset = 2;
2461
2462   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
2463                                             offset, -1,
2464                                             "Original Called Number");
2465   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
2466
2467   length = tvb_length_remaining(parameter_tvb, offset);
2468   while(length > 0){
2469     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
2470     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2471     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
2472     if ((length - 1) > 0 ){
2473       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2474       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2475     }
2476     offset++;
2477     length = tvb_length_remaining(parameter_tvb, offset);
2478   }
2479
2480   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
2481       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
2482       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2483   }
2484   calling_number[i++] = '\0';
2485
2486   proto_item_set_text(address_digits_item, "Original Called Number: %s", calling_number);
2487   proto_item_set_text(parameter_item, "Original Called Number: %s", calling_number);
2488
2489 }
2490 /* ------------------------------------------------------------------
2491   Dissector Parameter Redirecting number
2492  */
2493 static void
2494 dissect_isup_redirecting_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2495 {
2496   proto_item *address_digits_item;
2497   proto_tree *address_digits_tree;
2498   guint8 indicators1, indicators2;
2499   guint8 address_digit_pair=0;
2500   gint offset=0;
2501   gint i=0;
2502   gint length;
2503   char calling_number[MAXLENGTH]="";
2504
2505   indicators1 = tvb_get_guint8(parameter_tvb, 0);
2506   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
2507   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
2508   indicators2 = tvb_get_guint8(parameter_tvb, 1);
2509   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
2510   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
2511   offset = 2;
2512
2513   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
2514                                             offset, -1,
2515                                             "Redirecting Number");
2516   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
2517
2518   length = tvb_length_remaining(parameter_tvb, offset);
2519   while(length > 0){
2520     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
2521     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2522     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
2523     if ((length - 1) > 0 ){
2524       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2525       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2526     }
2527     offset++;
2528     length = tvb_length_remaining(parameter_tvb, offset);
2529   }
2530
2531   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
2532       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
2533       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2534   }
2535   calling_number[i++] = '\0';
2536
2537   proto_item_set_text(address_digits_item, "Redirecting Number: %s", calling_number);
2538   proto_item_set_text(parameter_item, "Redirecting Number: %s", calling_number);
2539
2540 }
2541 /* ------------------------------------------------------------------
2542   Dissector Parameter Redirection number
2543  */
2544 static void
2545 dissect_isup_redirection_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2546 {
2547   proto_item *address_digits_item;
2548   proto_tree *address_digits_tree;
2549   guint8 indicators1, indicators2;
2550   guint8 address_digit_pair=0;
2551   gint offset=0;
2552   gint i=0;
2553   gint length;
2554   char called_number[MAXLENGTH]="";
2555
2556   indicators1 = tvb_get_guint8(parameter_tvb, 0);
2557   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
2558   proto_tree_add_uint(parameter_tree, hf_isup_called_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
2559   indicators2 = tvb_get_guint8(parameter_tvb, 1);
2560   proto_tree_add_boolean(parameter_tree, hf_isup_inn_indicator, parameter_tvb, 1, 1, indicators2);
2561   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
2562   offset = 2;
2563
2564   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
2565                                             offset, -1,
2566                                             "Redirection Number");
2567   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
2568
2569   length = tvb_length_remaining(parameter_tvb, offset);
2570   while(length > 0){
2571     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
2572     proto_tree_add_uint(address_digits_tree, hf_isup_called_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2573     called_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
2574     if ((length - 1) > 0 ){
2575       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2576       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2577     }
2578     offset++;
2579     length = tvb_length_remaining(parameter_tvb, offset);
2580   }
2581
2582   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
2583       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
2584       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2585   }
2586   called_number[i++] = '\0';
2587
2588   proto_item_set_text(address_digits_item, "Redirection Number: %s", called_number);
2589   proto_item_set_text(parameter_item, "Redirection Number: %s", called_number);
2590 }
2591 /* ------------------------------------------------------------------
2592   Dissector Parameter Connection request
2593  */
2594 static void
2595 dissect_isup_connection_request_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2596 {
2597   guint32 local_ref;
2598   guint16 spc;
2599   guint8 protocol_class, credit, offset=0;
2600
2601   local_ref = tvb_get_ntoh24(parameter_tvb, 0);
2602   proto_tree_add_text(parameter_tree, parameter_tvb, offset, LOCAL_REF_LENGTH, "Local Reference: %u", local_ref);
2603   offset = LOCAL_REF_LENGTH;
2604   spc = tvb_get_letohs(parameter_tvb,offset) & 0x3FFF; /*since 1st 2 bits spare */
2605   proto_tree_add_text(parameter_tree, parameter_tvb, offset, SPC_LENGTH, "Signalling Point Code: %u", spc);
2606   offset += SPC_LENGTH;
2607   protocol_class = tvb_get_guint8(parameter_tvb, offset);
2608   proto_tree_add_text(parameter_tree, parameter_tvb, offset, PROTOCOL_CLASS_LENGTH, "Protocol Class: %u", protocol_class);
2609   offset += PROTOCOL_CLASS_LENGTH;
2610   credit = tvb_get_guint8(parameter_tvb, offset);
2611   proto_tree_add_text(parameter_tree, parameter_tvb, offset, CREDIT_LENGTH, "Credit: %u", credit);
2612   offset += CREDIT_LENGTH;
2613
2614   proto_item_set_text(parameter_item, "Connection request: Local Reference = %u, SPC = %u, Protocol Class = %u, Credit = %u", local_ref, spc, protocol_class, credit);
2615 }
2616 /* ------------------------------------------------------------------
2617   Dissector Parameter Redirection information
2618  */
2619 static void
2620 dissect_isup_redirection_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2621 {
2622   if (tvb_length(parameter_tvb) == 2){
2623     guint16 indicators;
2624     indicators = tvb_get_ntohs(parameter_tvb, 0);
2625     proto_tree_add_uint(parameter_tree, hf_isup_redirecting_ind, parameter_tvb,0 , REDIRECTION_INFO_LENGTH, indicators);
2626     proto_tree_add_uint(parameter_tree, hf_isup_original_redirection_reason, parameter_tvb,0 , REDIRECTION_INFO_LENGTH, indicators);
2627     proto_tree_add_uint(parameter_tree, hf_isup_redirection_counter, parameter_tvb,0 , REDIRECTION_INFO_LENGTH, indicators);
2628     proto_tree_add_uint(parameter_tree, hf_isup_redirection_reason, parameter_tvb,0 , REDIRECTION_INFO_LENGTH, indicators);
2629     proto_item_set_text(parameter_item, "Redirection Information");
2630   }
2631   else { /* ISUP'88 (blue book) */
2632     guint16 indicators;
2633     indicators = tvb_get_guint8(parameter_tvb, 0) * 0x100; /*since 2nd octet isn't present*/
2634     proto_tree_add_uint(parameter_tree, hf_isup_redirecting_ind, parameter_tvb, 0, 1, indicators);
2635     proto_tree_add_uint(parameter_tree, hf_isup_original_redirection_reason, parameter_tvb,0 , 1, indicators);
2636     proto_item_set_text(parameter_item, "Redirection Information (2nd octet not present since ISUP '88)");
2637   }
2638 }
2639 /* ------------------------------------------------------------------
2640   Dissector Parameter Closed user group interlock code
2641  */
2642 static void
2643 dissect_isup_closed_user_group_interlock_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2644 {
2645   char NI_digits[5]="";
2646   guint8 digit_pair;
2647   guint16 bin_code;
2648
2649   digit_pair = tvb_get_guint8(parameter_tvb, 0);
2650   NI_digits[0] = number_to_char((digit_pair & HGFE_8BIT_MASK) / 0x10);
2651   NI_digits[1] = number_to_char(digit_pair & DCBA_8BIT_MASK);
2652   digit_pair = tvb_get_guint8(parameter_tvb, 1);
2653   NI_digits[2] = number_to_char((digit_pair & HGFE_8BIT_MASK) / 0x10);
2654   NI_digits[3] = number_to_char(digit_pair & DCBA_8BIT_MASK);
2655   NI_digits[4] = '\0';
2656   proto_tree_add_text(parameter_tree, parameter_tvb, 0, 2, "Network Identity: %s", NI_digits);
2657   bin_code = tvb_get_ntohs(parameter_tvb, 2);
2658   proto_tree_add_text(parameter_tree, parameter_tvb, 3, 2, "Binary Code: 0x%x", bin_code);
2659   proto_item_set_text(parameter_item, "Closed user group interlock code: NI = %s, Binary code = 0x%x", NI_digits, bin_code);
2660 }
2661 /* ------------------------------------------------------------------
2662   Dissector Parameter User service information- no detailed dissection since defined in Rec. Q.931
2663  */
2664 static void
2665 dissect_isup_user_service_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2666 { guint length = tvb_length(parameter_tvb);
2667   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "User service information (-> Q.931 Bearer_capability)");
2668   proto_item_set_text(parameter_item, "User service information, see Q.931 (%u byte%s length)", length , plurality(length, "", "s"));
2669   dissect_q931_bearer_capability_ie(parameter_tvb,
2670                                             0, length,
2671                                             parameter_tree);
2672 }
2673 /* ------------------------------------------------------------------
2674   Dissector Parameter Signalling point code
2675  */
2676 static void
2677 dissect_isup_signalling_point_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2678 {
2679   guint16 spc;
2680
2681   spc = tvb_get_letohs(parameter_tvb, 0) & 0x3FFF; /*since 1st 2 bits spare */
2682   proto_tree_add_text(parameter_tree, parameter_tvb, 0, SIGNALLING_POINT_CODE_LENGTH, "Signalling Point Code: %u", spc);
2683
2684   proto_item_set_text(parameter_item, "Signalling point code: %u", spc);
2685 }
2686 /* ------------------------------------------------------------------
2687   Dissector Parameter Connected number
2688  */
2689 static void
2690 dissect_isup_connected_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2691 {
2692   proto_item *address_digits_item;
2693   proto_tree *address_digits_tree;
2694   guint8 indicators1, indicators2;
2695   guint8 address_digit_pair=0;
2696   gint offset=0;
2697   gint i=0;
2698   gint length;
2699   char calling_number[MAXLENGTH]="";
2700
2701   indicators1 = tvb_get_guint8(parameter_tvb, 0);
2702   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
2703   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
2704   indicators2 = tvb_get_guint8(parameter_tvb, 1);
2705   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
2706   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
2707   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator, parameter_tvb, 1, 1, indicators2);
2708   offset = 2;
2709
2710   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
2711                                             offset, -1,
2712                                             "Connected Number");
2713   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
2714
2715   length = tvb_length_remaining(parameter_tvb, offset);
2716   while(length > 0){
2717     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
2718     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2719     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
2720     if ((length - 1) > 0 ){
2721       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2722       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2723     }
2724     offset++;
2725     length = tvb_length_remaining(parameter_tvb, offset);
2726   }
2727
2728   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
2729       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
2730       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2731   }
2732   calling_number[i++] = '\0';
2733
2734   proto_item_set_text(address_digits_item, "Connected Number: %s", calling_number);
2735   proto_item_set_text(parameter_item, "Connected Number: %s", calling_number);
2736
2737 }
2738 /* ------------------------------------------------------------------
2739   Dissector Transit network selection
2740  */
2741 static void
2742 dissect_isup_transit_network_selection_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2743 {
2744   proto_item *address_digits_item;
2745   proto_tree *address_digits_tree;
2746   guint8 indicators;
2747   guint8 address_digit_pair=0;
2748   gint offset=0;
2749   gint i=0;
2750   gint length;
2751   char network_id[MAXLENGTH]="";
2752
2753   indicators = tvb_get_guint8(parameter_tvb, 0);
2754   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators);
2755   proto_tree_add_uint(parameter_tree, hf_isup_type_of_network_identification, parameter_tvb, 0, 1, indicators);
2756   proto_tree_add_uint(parameter_tree, hf_isup_network_identification_plan, parameter_tvb, 0, 1, indicators);
2757   offset = 1;
2758
2759   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
2760                                             offset, -1,
2761                                             "Network identification");
2762   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
2763
2764   length = tvb_length_remaining(parameter_tvb, offset);
2765   while(length > 0){
2766     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
2767     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2768     network_id[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
2769     if ((length - 1) > 0 ){
2770       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2771       network_id[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2772     }
2773     offset++;
2774     length = tvb_length_remaining(parameter_tvb, offset);
2775   }
2776
2777   if  (((indicators & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
2778       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
2779       network_id[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2780   }
2781   network_id[i++] = '\0';
2782
2783   proto_item_set_text(address_digits_item, "Network identification: %s", network_id);
2784   proto_item_set_text(parameter_item, "Transit network selection: %s", network_id);
2785
2786 }
2787 /* ------------------------------------------------------------------
2788   Dissector Parameter Circuit assignment map
2789  */
2790 static void
2791 dissect_isup_circuit_assignment_map_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2792 { guint8 map_type;
2793
2794   map_type = tvb_get_guint8(parameter_tvb, 0);
2795   proto_tree_add_uint(parameter_tree, hf_isup_map_type, parameter_tvb, 0, 1, map_type);
2796   proto_tree_add_text(parameter_tree, parameter_tvb, 1, 5, "Circuit assignment map (bit position indicates usage of corresponding circuit->3.69/Q.763)");
2797   proto_item_set_text(parameter_item, "Circuit assignment map");
2798 }
2799 /* ------------------------------------------------------------------
2800   Dissector Parameter Automatic congestion level
2801  */
2802 static void
2803 dissect_isup_automatic_congestion_level_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2804 { guint8 congestion_level;
2805
2806   congestion_level = tvb_get_guint8(parameter_tvb, 0);
2807   proto_tree_add_uint(parameter_tree, hf_isup_automatic_congestion_level, parameter_tvb, 0, AUTO_CONGEST_LEVEL_LENGTH, congestion_level);
2808   proto_item_set_text(parameter_item, "Automatic congestion level: %s (%u)", val_to_str(congestion_level, isup_auto_congestion_level_value, "spare"), congestion_level);
2809 }
2810 /* ------------------------------------------------------------------
2811   Dissector Parameter Optional backward Call indicators
2812  */
2813 static void
2814 dissect_isup_optional_backward_call_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2815 {
2816   guint8 indicators;
2817
2818   indicators = tvb_get_guint8(parameter_tvb, 0);
2819   proto_tree_add_boolean(parameter_tree, hf_isup_inband_information_ind, parameter_tvb, 0, OPTIONAL_BACKWARD_CALL_IND_LENGTH, indicators);
2820   proto_tree_add_boolean(parameter_tree, hf_isup_call_diversion_may_occur_ind, parameter_tvb, 0, OPTIONAL_BACKWARD_CALL_IND_LENGTH, indicators);
2821   proto_tree_add_boolean(parameter_tree, hf_isup_simple_segmentation_ind, parameter_tvb, 0, OPTIONAL_BACKWARD_CALL_IND_LENGTH, indicators);
2822   proto_tree_add_boolean(parameter_tree, hf_isup_mlpp_user_ind, parameter_tvb, 0, OPTIONAL_BACKWARD_CALL_IND_LENGTH, indicators);
2823
2824
2825   proto_item_set_text(parameter_item,"Optional backward call indicators: 0x%x", indicators );
2826 }
2827 /* ------------------------------------------------------------------
2828   Dissector Parameter User-to-user indicators
2829  */
2830 static void
2831 dissect_isup_user_to_user_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2832 {
2833   guint8 indicators;
2834
2835   indicators = tvb_get_guint8(parameter_tvb, 0);
2836   proto_tree_add_text(parameter_tree, parameter_tvb, 0, USER_TO_USER_IND_LENGTH, "User-to-user indicators: 0x%x (refer to 3.60/Q.763 for detailed decoding)", indicators );
2837   proto_item_set_text(parameter_item,"User-to-user indicators: 0x%x", indicators );
2838 }
2839 /* ------------------------------------------------------------------
2840   Dissector Parameter Original ISC point code
2841  */
2842 static void
2843 dissect_isup_original_isc_point_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2844 {
2845   guint16 spc;
2846
2847   spc = tvb_get_letohs(parameter_tvb, 0) & 0x3FFF; /*since 1st 2 bits spare */
2848   proto_tree_add_text(parameter_tree, parameter_tvb, 0, ORIGINAL_ISC_POINT_CODE_LENGTH, "Origination ISC Point Code: %u", spc);
2849
2850   proto_item_set_text(parameter_item, "Origination ISC point code: %u", spc);
2851 }
2852 /* ------------------------------------------------------------------
2853   Dissector Parameter Generic notification indicator
2854  */
2855 static void
2856 dissect_isup_generic_notification_indicator_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2857 {
2858   guint8 indicators;
2859
2860   indicators = tvb_get_guint8(parameter_tvb, 0);
2861   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 );
2862   proto_item_set_text(parameter_item,"Generic notification indicator: 0x%x", indicators );
2863 }
2864 /* ------------------------------------------------------------------
2865   Dissector Parameter Call history information
2866  */
2867 static void
2868 dissect_isup_call_history_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2869 {
2870   guint16 info;
2871
2872   info = tvb_get_ntohs(parameter_tvb, 0);
2873   proto_tree_add_text(parameter_tree, parameter_tvb, 0, CALL_HISTORY_INFO_LENGTH, "Call history info: propagation delay = %u ms", info);
2874   proto_item_set_text(parameter_item,"Call history info: propagation delay = %u ms", info);
2875 }
2876 /* ------------------------------------------------------------------
2877   Dissector Parameter Access delivery information
2878  */
2879 static void
2880 dissect_isup_access_delivery_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2881 { guint8 indicator;
2882
2883   indicator = tvb_get_guint8(parameter_tvb, 0);
2884   proto_tree_add_boolean(parameter_tree, hf_isup_access_delivery_ind, parameter_tvb, 0, ACCESS_DELIVERY_INFO_LENGTH, indicator);
2885   proto_item_set_text(parameter_item, "Access delivery information: 0x%x", indicator);
2886 }
2887 /* ------------------------------------------------------------------
2888   Dissector Parameter Network specific facility
2889  */
2890 static void
2891 dissect_isup_network_specific_facility_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2892 { guint length = tvb_length(parameter_tvb);
2893   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Network specific facility (refer to 3.36/Q.763 for detailed decoding)");
2894   proto_item_set_text(parameter_item, "Network specific facility (%u byte%s length)", length , plurality(length, "", "s"));
2895 }
2896 /* ------------------------------------------------------------------
2897   Dissector Parameter User service information prime
2898  */
2899 static void
2900 dissect_isup_user_service_information_prime_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2901 { guint length = tvb_length(parameter_tvb);
2902   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "User service information prime (-> Q.931)");
2903   proto_item_set_text(parameter_item, "User service information prime, see Q.931 (%u byte%s length)", length , plurality(length, "", "s"));
2904 }
2905 /* ------------------------------------------------------------------
2906   Dissector Parameter Propagation delay counter
2907  */
2908 static void
2909 dissect_isup_propagation_delay_counter_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2910 {
2911   guint16 info;
2912
2913   info = tvb_get_ntohs(parameter_tvb, 0);
2914   proto_tree_add_text(parameter_tree, parameter_tvb, 0, PROPAGATION_DELAY_COUNT_LENGTH, "Propagation delay counter = %u ms", info);
2915   proto_item_set_text(parameter_item,"Propagation delay counter = %u ms", info);
2916 }
2917 /* ------------------------------------------------------------------
2918   Dissector Parameter Remote operations
2919  */
2920 static void
2921 dissect_isup_remote_operations_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2922 { guint length = tvb_length(parameter_tvb);
2923   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Remote operations");
2924   proto_item_set_text(parameter_item, "Remote operations (%u byte%s length)", length , plurality(length, "", "s"));
2925 }
2926 /* ------------------------------------------------------------------
2927   Dissector Parameter Service activation
2928  */
2929 static void
2930 dissect_isup_service_activation_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2931 {
2932   guint i;
2933   guint8 feature_code;
2934   guint length = tvb_length(parameter_tvb);
2935   for (i=0; i< length; i++){
2936     feature_code = tvb_get_guint8(parameter_tvb, i);
2937     proto_tree_add_text(parameter_tree, parameter_tvb, i, 1, "Feature Code %u: %u", i+1, feature_code);
2938   }
2939   proto_item_set_text(parameter_item, "Service Activation (%u byte%s length)", length , plurality(length, "", "s"));
2940 }
2941 /* ------------------------------------------------------------------
2942   Dissector Parameter User service information prime - no detailed dissection since defined in Rec. Q.931
2943  */
2944 static void
2945 dissect_isup_user_teleservice_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2946 {
2947   proto_tree_add_text(parameter_tree, parameter_tvb, 0, USER_TELESERVICE_INFO_LENGTH, "User teleservice information (-> Q.931)");
2948   proto_item_set_text(parameter_item, "User teleservice information, see Q.931");
2949 }
2950 /* ------------------------------------------------------------------
2951   Dissector Parameter Transmission medium requirement used
2952  */
2953 static void
2954 dissect_isup_transmission_medium_used_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2955 {
2956   guint8 transmission_medium_requirement;
2957
2958   transmission_medium_requirement = tvb_get_guint8(parameter_tvb, 0);
2959   proto_tree_add_uint(parameter_tree, hf_isup_transmission_medium_requirement_prime, parameter_tvb, 0, TRANSMISSION_MEDIUM_RQMT_PRIME_LENGTH,transmission_medium_requirement);
2960
2961   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"));
2962 }
2963 /* ------------------------------------------------------------------
2964   Dissector Parameter Call diversion information
2965  */
2966 static void
2967 dissect_isup_call_diversion_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2968 { guint8 indicator;
2969
2970   indicator = tvb_get_guint8(parameter_tvb, 0);
2971   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);
2972   proto_item_set_text(parameter_item, "Call diversion information: 0x%x", indicator);
2973 }
2974 /* ------------------------------------------------------------------
2975   Dissector Parameter Echo control  information
2976  */
2977 static void
2978 dissect_isup_echo_control_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2979 { guint8 indicator;
2980
2981   indicator = tvb_get_guint8(parameter_tvb, 0);
2982   proto_tree_add_text(parameter_tree, parameter_tvb, 0, ECHO_CONTROL_INFO_LENGTH, "Echo control information: 0x%x (refer to 3.19/Q.763 for detailed decoding)", indicator);
2983   proto_item_set_text(parameter_item, "Echo control information: 0x%x", indicator);
2984 }
2985 /* ------------------------------------------------------------------
2986   Dissector Parameter Message compatibility information
2987  */
2988 static void
2989 dissect_isup_message_compatibility_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2990 { guint length = tvb_length(parameter_tvb);
2991   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Message compatibility information (refer to 3.33/Q.763 for detailed decoding)");
2992   proto_item_set_text(parameter_item, "Message compatibility information (%u byte%s length)", length , plurality(length, "", "s"));
2993 }
2994 /* ------------------------------------------------------------------
2995   Dissector Parameter compatibility information
2996  */
2997 static const true_false_string isup_transit_at_intermediate_exchange_ind_value  = {
2998   "End node interpretation",
2999   "Transit interpretation"
3000 };
3001
3002
3003 static const true_false_string isup_Discard_message_ind_value = {
3004         "Discard message",
3005         "Do not discard message (pass on)",
3006 };
3007
3008 static const true_false_string isup_Discard_parameter_ind_value = {
3009         "Discard parameter",
3010         "Do not discard parameter (pass on)",
3011 };
3012
3013 static const value_string isup_Pass_on_not_possible_indicator_vals[] = {
3014         { 0x00, "Release call" },
3015         { 0x01, "Discard message" },
3016         { 0x02, "Discard parameter" },
3017         { 0x03, "Reserved (interpreted as 00)" },
3018
3019 };
3020 static const value_string ISUP_Broadband_narrowband_interworking_indicator_vals[] = {
3021         { 0x00, "Pass on" },
3022         { 0x01, "Discard message" },
3023         { 0x02, "Release call" },
3024         { 0x03, "Discard parameter" },
3025 }; 
3026
3027 static void
3028 dissect_isup_parameter_compatibility_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3029 {
3030   guint  length = tvb_length(parameter_tvb);
3031   guint  len = length;
3032   guint8 upgraded_parameter, upgraded_parameter_no;
3033   guint8 offset;
3034   guint8 instruction_indicators; 
3035   offset = 0;
3036   upgraded_parameter_no = 0;
3037
3038   proto_item_set_text(parameter_item, "Parameter compatibility information (%u byte%s length)", length , plurality(length, "", "s"));
3039 /* etxrab Decoded as per Q.763 section 3.41 */
3040   while ( len > 0 ) {
3041   if (len == 0)
3042                 return;
3043   upgraded_parameter_no = upgraded_parameter_no + 1;
3044   upgraded_parameter = tvb_get_guint8(parameter_tvb, offset);
3045
3046   proto_tree_add_text(parameter_tree, parameter_tvb, offset, 1,
3047             "Upgraded parameter no: %u = %s", upgraded_parameter_no,
3048             val_to_str(upgraded_parameter, isup_parameter_type_value, NULL));
3049   offset += 1;
3050   len -= 1;
3051   instruction_indicators = tvb_get_guint8(parameter_tvb, offset);
3052
3053   proto_tree_add_text(parameter_tree, parameter_tvb, offset, 1,
3054                     "Instruction indicators: 0x%x ",
3055                     instruction_indicators);
3056
3057  proto_tree_add_boolean(parameter_tree, hf_isup_transit_at_intermediate_exchange_ind, 
3058                 parameter_tvb, offset, 1, instruction_indicators );
3059
3060  proto_tree_add_boolean(parameter_tree, hf_isup_Release_call_ind, parameter_tvb, offset, 1, instruction_indicators );
3061
3062  proto_tree_add_boolean(parameter_tree, hf_isup_Send_notification_ind, parameter_tvb, offset, 1, instruction_indicators );
3063
3064  proto_tree_add_boolean(parameter_tree, hf_isup_Discard_message_ind_value, parameter_tvb, offset, 1, instruction_indicators );
3065
3066  proto_tree_add_boolean(parameter_tree, hf_isup_Discard_parameter_ind, parameter_tvb, offset, 1, instruction_indicators );
3067
3068  proto_tree_add_uint(parameter_tree, hf_isup_Pass_on_not_possible_indicator, parameter_tvb, 0, 1,instruction_indicators);
3069
3070   offset += 1;
3071   len -= 1;
3072   if (!(instruction_indicators & H_8BIT_MASK)) {
3073                 if (len == 0)
3074                         return;
3075                   instruction_indicators = tvb_get_guint8(parameter_tvb, offset);
3076                  proto_tree_add_uint(parameter_tree, hf_isup_Broadband_narrowband_interworking_ind, parameter_tvb, offset, 1,instruction_indicators);
3077                  offset += 1;
3078                   len -= 1;
3079                   }
3080    if (len == 0)
3081    return;
3082   ;
3083  }
3084 /* etxrab */
3085  
3086 }
3087 /* ------------------------------------------------------------------
3088   Dissector Parameter MLPP precedence
3089  */
3090 static void
3091 dissect_isup_mlpp_precedence_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3092 {
3093   char NI_digits[5]="";
3094   guint8 indicators, digit_pair;
3095   guint32 bin_code;
3096
3097   indicators = tvb_get_guint8(parameter_tvb, 0);
3098   proto_tree_add_text(parameter_tree, parameter_tvb, 0, 1, "LFB (Bits 6+7) and precedence level (Bits 1-4): 0x%x",indicators);
3099   digit_pair = tvb_get_guint8(parameter_tvb, 1);
3100   NI_digits[0] = number_to_char((digit_pair & HGFE_8BIT_MASK) / 0x10);
3101   NI_digits[1] = number_to_char(digit_pair & DCBA_8BIT_MASK);
3102   digit_pair = tvb_get_guint8(parameter_tvb, 2);
3103   NI_digits[2] = number_to_char((digit_pair & HGFE_8BIT_MASK) / 0x10);
3104   NI_digits[3] = number_to_char(digit_pair & DCBA_8BIT_MASK);
3105   NI_digits[4] = '\0';
3106   proto_tree_add_text(parameter_tree, parameter_tvb, 1, 2, "Network Identity: %s", NI_digits);
3107   bin_code = tvb_get_ntoh24(parameter_tvb, 3);
3108   proto_tree_add_text(parameter_tree, parameter_tvb, 3, 3, "MLPP service domain: 0x%x", bin_code);
3109   proto_item_set_text(parameter_item, "MLPP precedence: NI = %s, MLPP service domain = 0x%x", NI_digits, bin_code);
3110 }
3111 /* ------------------------------------------------------------------
3112   Dissector Parameter MCID request indicators
3113  */
3114 static void
3115 dissect_isup_mcid_request_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3116 { guint8 indicator;
3117
3118   indicator = tvb_get_guint8(parameter_tvb, 0);
3119   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);
3120   proto_item_set_text(parameter_item, "MCID request indicators: 0x%x", indicator);
3121 }
3122 /* ------------------------------------------------------------------
3123   Dissector Parameter MCID response indicators
3124  */
3125 static void
3126 dissect_isup_mcid_response_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3127 { guint8 indicator;
3128
3129   indicator = tvb_get_guint8(parameter_tvb, 0);
3130   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);
3131   proto_item_set_text(parameter_item, "MCID response indicators: 0x%x", indicator);
3132 }
3133 /* ------------------------------------------------------------------
3134   Dissector Parameter Hop counter
3135  */
3136 static void
3137 dissect_isup_hop_counter_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3138 { guint8 counter;
3139
3140   counter = tvb_get_guint8(parameter_tvb, 0) & EDCBA_8BIT_MASK; /* since bits H,G and F are spare */
3141   proto_tree_add_text(parameter_tree, parameter_tvb, 0, HOP_COUNTER_LENGTH, "Hop counter: %u", counter);
3142   proto_item_set_text(parameter_item,  "Hop counter: %u", counter);
3143 }
3144 /* ------------------------------------------------------------------
3145   Dissector Parameter Transmission medium requirement prime
3146  */
3147 static void
3148 dissect_isup_transmission_medium_requirement_prime_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3149 {
3150   guint8 transmission_medium_requirement;
3151
3152   transmission_medium_requirement = tvb_get_guint8(parameter_tvb, 0);
3153   proto_tree_add_uint(parameter_tree, hf_isup_transmission_medium_requirement_prime, parameter_tvb, 0, TRANSMISSION_MEDIUM_RQMT_PRIME_LENGTH,transmission_medium_requirement);
3154
3155   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"));
3156 }
3157
3158 /* ------------------------------------------------------------------
3159   Dissector Parameter location number
3160  */
3161 static void
3162 dissect_isup_location_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3163 {
3164   proto_item *address_digits_item;
3165   proto_tree *address_digits_tree;
3166   guint8 indicators1, indicators2;
3167   guint8 address_digit_pair=0;
3168   gint offset=0;
3169   gint i=0;
3170   gint length;
3171   char calling_number[MAXLENGTH]="";
3172
3173   indicators1 = tvb_get_guint8(parameter_tvb, 0);
3174   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
3175   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
3176   indicators2 = tvb_get_guint8(parameter_tvb, 1);
3177   proto_tree_add_boolean(parameter_tree, hf_isup_inn_indicator, parameter_tvb, 1, 1, indicators2);
3178   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
3179   if ((indicators2 & GFE_8BIT_MASK) == 0x50)
3180     proto_tree_add_text(parameter_tree, parameter_tvb, 1, 1, "Different meaning for Location Number: Numbering plan indicator = private numbering plan");
3181   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
3182   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator, parameter_tvb, 1, 1, indicators2);
3183   offset = 2;
3184
3185   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
3186                                             offset, -1,
3187                                             "Location number");
3188   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
3189
3190   length = tvb_length_remaining(parameter_tvb, offset);
3191   while(length > 0){
3192     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
3193     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3194     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
3195     if ((length - 1) > 0 ){
3196       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3197       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3198     }
3199     offset++;
3200     length = tvb_length_remaining(parameter_tvb, offset);
3201   }
3202
3203   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
3204       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
3205       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3206   }
3207   calling_number[i++] = '\0';
3208
3209   proto_item_set_text(address_digits_item, "Location number: %s", calling_number);
3210   proto_item_set_text(parameter_item, "Location number: %s", calling_number);
3211
3212 }
3213 /* ------------------------------------------------------------------
3214   Dissector Parameter Redirection number restiriction
3215  */
3216 static void
3217 dissect_isup_redirection_number_restriction_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3218 {
3219   guint8 indicator;
3220
3221   indicator = tvb_get_guint8(parameter_tvb, 0);
3222   switch (indicator & BA_8BIT_MASK) {
3223   case 0:
3224     proto_tree_add_text(parameter_tree, parameter_tvb, 0, REDIRECTION_NUMBER_RESTRICTION_LENGTH, "Presentation indicator: Presentation allowed");
3225     break;
3226   case 1:
3227     proto_tree_add_text(parameter_tree, parameter_tvb, 0, REDIRECTION_NUMBER_RESTRICTION_LENGTH, "Presentation indicator: Presentation restricted");
3228     break;
3229   default:
3230     proto_tree_add_text(parameter_tree, parameter_tvb, 0, REDIRECTION_NUMBER_RESTRICTION_LENGTH, "Presentation indicator: spare");
3231     break;
3232   }
3233   proto_item_set_text(parameter_item, "Redirection number restriction: 0x%x ", indicator);
3234 }
3235 /* ------------------------------------------------------------------
3236   Dissector Parameter Call transfer identity
3237  */
3238 static void
3239 dissect_isup_call_transfer_reference_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3240 { guint8 id;
3241
3242   id = tvb_get_guint8(parameter_tvb, 0);
3243   proto_tree_add_text(parameter_tree, parameter_tvb, 0, CALL_TRANSFER_REF_LENGTH, "Call transfer identity: %u", id);
3244   proto_item_set_text(parameter_item,  "Call transfer reference: %u", id);
3245 }
3246 /* ------------------------------------------------------------------
3247   Dissector Parameter Loop prevention
3248  */
3249 static void
3250 dissect_isup_loop_prevention_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3251 {
3252   guint8 indicator;
3253
3254   indicator = tvb_get_guint8(parameter_tvb, 0);
3255   if ((indicator & A_8BIT_MASK)==0) {
3256     proto_tree_add_text(parameter_tree, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, "Type: Request");
3257     proto_item_set_text(parameter_item, "Loop prevention indicators: Request (%u)", indicator);
3258   }
3259   else {
3260     proto_tree_add_text(parameter_tree, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, "Type: Response");
3261     proto_tree_add_uint(parameter_tree, hf_isup_loop_prevention_response_ind, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, indicator);
3262     proto_item_set_text(parameter_item, "Loop prevention indicators: Response (%u)", indicator);
3263   }
3264 }
3265 /* ------------------------------------------------------------------
3266   Dissector Parameter Call transfer number
3267  */
3268 static void
3269 dissect_isup_call_transfer_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3270 {
3271   proto_item *address_digits_item;
3272   proto_tree *address_digits_tree;
3273   guint8 indicators1, indicators2;
3274   guint8 address_digit_pair=0;
3275   gint offset=0;
3276   gint i=0;
3277   gint length;
3278   char calling_number[MAXLENGTH]="";
3279
3280   indicators1 = tvb_get_guint8(parameter_tvb, 0);
3281   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
3282   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
3283   indicators2 = tvb_get_guint8(parameter_tvb, 1);
3284   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
3285   if ((indicators2 & GFE_8BIT_MASK) == 0x50)
3286     proto_tree_add_text(parameter_tree, parameter_tvb, 1, 1, "Different meaning for Call Transfer Number: Numbering plan indicator = private numbering plan");
3287   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
3288   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator_enhanced, parameter_tvb, 1, 1, indicators2);
3289   offset = 2;
3290
3291   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
3292                                             offset, -1,
3293                                             "Call transfer number");
3294   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
3295
3296   length = tvb_length_remaining(parameter_tvb, offset);
3297   while(length > 0){
3298     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
3299     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3300     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
3301     if ((length - 1) > 0 ){
3302       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3303       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3304     }
3305     offset++;
3306     length = tvb_length_remaining(parameter_tvb, offset);
3307   }
3308
3309   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
3310       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
3311       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3312   }
3313   calling_number[i++] = '\0';
3314
3315   proto_item_set_text(address_digits_item, "Call transfer number: %s", calling_number);
3316   proto_item_set_text(parameter_item, "Call transfer number: %s", calling_number);
3317
3318 }
3319 /* ------------------------------------------------------------------
3320   Dissector Parameter CCSS
3321  */
3322 static void
3323 dissect_isup_ccss_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3324 {
3325   guint8 indicator;
3326
3327   indicator = tvb_get_guint8(parameter_tvb, 0);
3328   if ((indicator & A_8BIT_MASK)==0) {
3329     proto_tree_add_text(parameter_tree, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, "CCSS call indicator: no indication");
3330     proto_item_set_text(parameter_item, "CCSS call indicator: no indication (%u)", indicator);
3331   }
3332   else {
3333     proto_tree_add_text(parameter_tree, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, "CCSS call indicator: CCSS call");
3334     proto_item_set_text(parameter_item, "CCSS call indicator: CCSS call (%u)", indicator);
3335   }
3336 }
3337 /* ------------------------------------------------------------------
3338  Parameter Forward GVNS
3339  */
3340 static void
3341 dissect_isup_forward_gvns_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3342 { guint length = tvb_length(parameter_tvb);
3343   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Forward GVNS (refer to 3.66/Q.763 for detailed decoding)");
3344   proto_item_set_text(parameter_item, "Forward GVNS (%u Byte%s)", length , plurality(length, "", "s"));
3345 }
3346 /* ------------------------------------------------------------------
3347  Parameter Redirect capability
3348  */
3349 static void
3350 dissect_isup_redirect_capability_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3351 { guint length = tvb_length(parameter_tvb);
3352   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Redirect capability (format is a national matter)");
3353   proto_item_set_text(parameter_item, "Redirect Capability (%u Byte%s)", length , plurality(length, "", "s"));
3354 }
3355 /* ------------------------------------------------------------------
3356   Dissector Parameter Backward GVNS
3357  */
3358 static void
3359 dissect_isup_backward_gvns_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3360 { guint8 indicator;
3361
3362   indicator = tvb_get_guint8(parameter_tvb, 0);
3363   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);
3364   proto_item_set_text(parameter_item, "Backward GVNS: 0x%x", indicator);
3365 }
3366 /* ------------------------------------------------------------------
3367   Dissector Parameter Network management controls
3368  */
3369 static void
3370 dissect_isup_network_management_controls_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3371 { guint8 indicator;
3372
3373   indicator = tvb_get_guint8(parameter_tvb, 0);
3374   proto_tree_add_boolean(parameter_tree, hf_isup_temporary_alternative_routing_ind, parameter_tvb, 0,NETWORK_MANAGEMENT_CONTROLS_LENGTH, indicator);
3375   proto_tree_add_boolean(parameter_tree, hf_isup_extension_ind, parameter_tvb, 0,NETWORK_MANAGEMENT_CONTROLS_LENGTH, indicator);
3376   proto_item_set_text(parameter_item, "Network management controls: 0x%x", indicator);
3377 }
3378 /* ------------------------------------------------------------------
3379   Dissector Parameter Correlation id - no detailed dissection since defined in Rec. Q.1281
3380  */
3381 static void
3382 dissect_isup_correlation_id_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3383 { guint length = tvb_length(parameter_tvb);
3384   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Correlation ID (-> Q.1281)");
3385   proto_item_set_text(parameter_item, "Correlation ID, see Q.1281 (%u Byte%s)", length , plurality(length, "", "s"));
3386 }
3387 /* ------------------------------------------------------------------
3388   Dissector Parameter SCF id - no detailed dissection since defined in Rec. Q.1281
3389  */
3390 static void
3391 dissect_isup_scf_id_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3392 { guint length = tvb_length(parameter_tvb);
3393   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "SCF ID (-> Q.1281)");
3394   proto_item_set_text(parameter_item, "SCF ID, see Q.1281 (%u Byte%s)", length , plurality(length, "", "s"));
3395 }
3396 /* ------------------------------------------------------------------
3397   Dissector Parameter Call diversion treatment indicators
3398  */
3399 static void
3400 dissect_isup_call_diversion_treatment_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3401 { guint8 indicator;
3402
3403   indicator = tvb_get_guint8(parameter_tvb, 0);
3404   proto_tree_add_uint(parameter_tree, hf_isup_call_to_be_diverted_ind, parameter_tvb, 0,CALL_DIV_TREATMENT_IND_LENGTH, indicator);
3405   proto_tree_add_boolean(parameter_tree, hf_isup_extension_ind, parameter_tvb, 0, CALL_DIV_TREATMENT_IND_LENGTH, indicator);
3406   proto_item_set_text(parameter_item, "Call diversion treatment indicators: 0x%x", indicator);
3407 }
3408 /* ------------------------------------------------------------------
3409   Dissector Parameter called IN  number
3410  */
3411 static void
3412 dissect_isup_called_in_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3413 {
3414   proto_item *address_digits_item;
3415   proto_tree *address_digits_tree;
3416   guint8 indicators1, indicators2;
3417   guint8 address_digit_pair=0;
3418   gint offset=0;
3419   gint i=0;
3420   gint length;
3421   char calling_number[MAXLENGTH]="";
3422
3423   indicators1 = tvb_get_guint8(parameter_tvb, 0);
3424   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
3425   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
3426   indicators2 = tvb_get_guint8(parameter_tvb, 1);
3427   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
3428   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
3429   offset = 2;
3430
3431   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
3432                                             offset, -1,
3433                                             "Called IN Number");
3434   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
3435
3436   length = tvb_length_remaining(parameter_tvb, offset);
3437   while(length > 0){
3438     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
3439     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3440     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
3441     if ((length - 1) > 0 ){
3442       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3443       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3444     }
3445     offset++;
3446     length = tvb_length_remaining(parameter_tvb, offset);
3447   }
3448
3449   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
3450       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
3451       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3452   }
3453   calling_number[i++] = '\0';
3454
3455   proto_item_set_text(address_digits_item, "Called IN Number: %s", calling_number);
3456   proto_item_set_text(parameter_item, "Called IN Number: %s", calling_number);
3457
3458 }
3459 /* ------------------------------------------------------------------
3460   Dissector Parameter Call offering treatment indicators
3461  */
3462 static void
3463 dissect_isup_call_offering_treatment_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3464 { guint8 indicator;
3465
3466   indicator = tvb_get_guint8(parameter_tvb, 0);
3467   proto_tree_add_uint(parameter_tree, hf_isup_call_to_be_offered_ind, parameter_tvb, 0,CALL_OFFERING_TREATMENT_IND_LENGTH, indicator);
3468   proto_tree_add_boolean(parameter_tree, hf_isup_extension_ind, parameter_tvb, 0, CALL_OFFERING_TREATMENT_IND_LENGTH, indicator);
3469   proto_item_set_text(parameter_item, "Call offering treatment indicators: 0x%x", indicator);
3470 }
3471 /* ------------------------------------------------------------------
3472  Parameter Charged party identification
3473  */
3474 static void
3475 dissect_isup_charged_party_identification_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3476 { guint length = tvb_length(parameter_tvb);
3477   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Charged party identification (format is national network specific)");
3478   proto_item_set_text(parameter_item, "Charged party identification (%u Byte%s)", length , plurality(length, "", "s"));
3479 }
3480 /* ------------------------------------------------------------------
3481   Dissector Parameter Conference treatment indicators
3482  */
3483 static void
3484 dissect_isup_conference_treatment_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3485 { guint8 indicator;
3486
3487   indicator = tvb_get_guint8(parameter_tvb, 0);
3488   proto_tree_add_uint(parameter_tree, hf_isup_conference_acceptance_ind, parameter_tvb, 0,CONFERENCE_TREATMENT_IND_LENGTH, indicator);
3489   proto_tree_add_boolean(parameter_tree, hf_isup_extension_ind, parameter_tvb, 0, CONFERENCE_TREATMENT_IND_LENGTH, indicator);
3490   proto_item_set_text(parameter_item, "Conference treatment indicators: 0x%x", indicator);
3491 }
3492 /* ------------------------------------------------------------------
3493   Dissector Parameter Display information
3494  */
3495 static void
3496 dissect_isup_display_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3497 { guint length = tvb_length(parameter_tvb);
3498   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Display information (-> Q.931)");
3499   proto_item_set_text(parameter_item, "Display information (%u Byte%s)", length , plurality(length, "", "s"));
3500 }
3501 /* ------------------------------------------------------------------
3502  Parameter UID action indicators
3503  */
3504 static void
3505 dissect_isup_uid_action_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3506 { guint8 indicator;
3507
3508   indicator = tvb_get_guint8(parameter_tvb, 0);
3509   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);
3510   proto_item_set_text(parameter_item, "UID action indicators: 0x%x", indicator);
3511 }
3512 /* ------------------------------------------------------------------
3513  Parameter UID capability indicators
3514  */
3515 static void
3516 dissect_isup_uid_capability_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3517 { guint8 indicator;
3518
3519   indicator = tvb_get_guint8(parameter_tvb, 0);
3520   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);
3521   proto_item_set_text(parameter_item, "UID capability indicators: 0x%x", indicator);
3522 }
3523 /* ------------------------------------------------------------------
3524  Parameter Redirect counter
3525  */
3526 static void
3527 dissect_isup_redirect_counter_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3528 { guint length = tvb_length(parameter_tvb);
3529   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Redirect counter (format is a national matter)");
3530   proto_item_set_text(parameter_item, "Redirect counter (%u Byte%s)", length , plurality(length, "", "s"));
3531 }
3532 /* ------------------------------------------------------------------
3533   Dissector Parameter Collect call request
3534  */
3535 static void
3536 dissect_isup_collect_call_request_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3537 { guint8 indicator;
3538
3539   indicator = tvb_get_guint8(parameter_tvb, 0);
3540   if ((indicator & A_8BIT_MASK) == 0) {
3541     proto_tree_add_text(parameter_tree, parameter_tvb, 0, COLLECT_CALL_REQUEST_LENGTH, "Collect call request indicator: no indication");
3542     proto_item_set_text(parameter_item, "Collect call reqeust: no indication (0x%x)", indicator);
3543   }
3544   else {
3545     proto_tree_add_text(parameter_tree, parameter_tvb, 0, COLLECT_CALL_REQUEST_LENGTH, "Collect call request indicator: collect call requested");
3546     proto_item_set_text(parameter_item, "Collect call reqeust: collect call requested (0x%x)", indicator);
3547   }
3548 }
3549 /* ------------------------------------------------------------------
3550   Dissector Parameter Generic number
3551  */
3552 static void
3553 dissect_isup_generic_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3554 {
3555   proto_item *address_digits_item;
3556   proto_tree *address_digits_tree;
3557   guint8 indicators1, indicators2, nr_qualifier_ind;
3558   guint8 address_digit_pair=0;
3559   gint offset=0;
3560   gint i=0;
3561   gint length;
3562   char calling_number[MAXLENGTH]="";
3563
3564   nr_qualifier_ind = tvb_get_guint8(parameter_tvb, 0);
3565   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);
3566   indicators1 = tvb_get_guint8(parameter_tvb, 1);
3567   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 1, 1, indicators1);
3568   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
3569   indicators2 = tvb_get_guint8(parameter_tvb, 2);
3570   proto_tree_add_boolean(parameter_tree, hf_isup_ni_indicator, parameter_tvb, 2, 1, indicators2);
3571   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 2, 1, indicators2);
3572   if ((indicators2 & GFE_8BIT_MASK) == 0x50)
3573     proto_tree_add_text(parameter_tree, parameter_tvb, 2, 1, "Different meaning for Generic Number: Numbering plan indicator = private numbering plan");
3574   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 2, 1, indicators2);
3575   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator_enhanced, parameter_tvb, 2, 1, indicators2);
3576   offset = 3;
3577
3578   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
3579                                             offset, -1,
3580                                             "Generic number");
3581   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
3582
3583   length = tvb_length_remaining(parameter_tvb, offset);
3584   while(length > 0){
3585     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
3586     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3587     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
3588     if ((length - 1) > 0 ){
3589       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3590       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3591     }
3592     offset++;
3593     length = tvb_length_remaining(parameter_tvb, offset);
3594   }
3595
3596   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
3597       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
3598       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3599   }
3600   calling_number[i++] = '\0';
3601
3602   proto_item_set_text(address_digits_item, "Generic number: %s", calling_number);
3603   proto_item_set_text(parameter_item, "Generic number: %s", calling_number);
3604
3605 }
3606 /* ------------------------------------------------------------------
3607  Dissector Parameter Generic digits
3608  */
3609 static void
3610 dissect_isup_generic_digits_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3611 { guint length = tvb_length(parameter_tvb);
3612   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Generic digits (refer to 3.24/Q.673 for detailed decoding)");
3613   proto_item_set_text(parameter_item, "Generic digits (%u Byte%s)", length , plurality(length, "", "s"));
3614 }
3615 /* ------------------------------------------------------------------ */
3616 static void
3617 dissect_isup_unknown_parameter(tvbuff_t *parameter_tvb, proto_item *parameter_item)
3618 { guint length = tvb_length(parameter_tvb);
3619   proto_item_set_text(parameter_item, "Parameter Type unknown/reserved (%u Byte%s)", length , plurality(length, "", "s"));
3620 }
3621 /* ------------------------------------------------------------------ */
3622
3623 /* ------------------------------------------------------------------
3624   Dissector all optional parameters
3625 */
3626 static void
3627 dissect_isup_optional_parameter(tvbuff_t *optional_parameters_tvb,packet_info *pinfo, proto_tree *isup_tree)
3628 { proto_item* parameter_item;
3629   proto_tree* parameter_tree;
3630   gint offset = 0;
3631   guint parameter_type, parameter_length, actual_length;
3632   tvbuff_t *parameter_tvb;
3633
3634   /* Dissect all optional parameters while end of message isn't reached */
3635   parameter_type = 0xFF; /* Start-initializiation since parameter_type is used for while-condition */
3636
3637   while ((tvb_length_remaining(optional_parameters_tvb, offset)  >= 1) && (parameter_type != PARAM_TYPE_END_OF_OPT_PARAMS)){
3638     parameter_type = tvb_get_guint8(optional_parameters_tvb, offset);
3639
3640     if (parameter_type != PARAM_TYPE_END_OF_OPT_PARAMS){
3641       parameter_length = tvb_get_guint8(optional_parameters_tvb, offset + PARAMETER_TYPE_LENGTH);
3642
3643       parameter_item = proto_tree_add_text(isup_tree, optional_parameters_tvb,
3644                                            offset,
3645                                            parameter_length  + PARAMETER_TYPE_LENGTH + PARAMETER_LENGTH_IND_LENGTH,
3646                                            "Parameter: type %u",
3647                                            parameter_type);
3648       parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
3649       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"));
3650       offset += PARAMETER_TYPE_LENGTH;
3651
3652       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);
3653       offset += PARAMETER_LENGTH_IND_LENGTH;
3654
3655       actual_length = tvb_length_remaining(optional_parameters_tvb, offset);
3656       if (actual_length > 0){
3657         parameter_tvb = tvb_new_subset(optional_parameters_tvb, offset, MIN(parameter_length, actual_length), parameter_length);
3658         switch (parameter_type) {
3659         case PARAM_TYPE_CALL_REF:
3660           dissect_isup_call_reference_parameter(parameter_tvb, parameter_tree, parameter_item);
3661           break;
3662         case PARAM_TYPE_TRANSM_MEDIUM_REQU:
3663           dissect_isup_transmission_medium_requirement_parameter(parameter_tvb, parameter_tree, parameter_item);
3664           break;
3665         case PARAM_TYPE_ACC_TRANSP:
3666           dissect_isup_access_transport_parameter(parameter_tvb, parameter_tree, parameter_item);
3667           break;
3668         case PARAM_TYPE_CALLED_PARTY_NR:
3669           dissect_isup_called_party_number_parameter(parameter_tvb, parameter_tree, parameter_item);
3670           break;
3671         case PARAM_TYPE_SUBSQT_NR:
3672           dissect_isup_subsequent_number_parameter(parameter_tvb, parameter_tree, parameter_item);
3673           break;
3674         case PARAM_TYPE_NATURE_OF_CONN_IND:
3675           dissect_isup_nature_of_connection_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3676           break;
3677         case PARAM_TYPE_FORW_CALL_IND:
3678           dissect_isup_forward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3679           break;
3680         case PARAM_TYPE_OPT_FORW_CALL_IND:
3681           dissect_isup_optional_forward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3682           break;
3683         case PARAM_TYPE_CALLING_PRTY_CATEG:
3684           dissect_isup_calling_partys_category_parameter(parameter_tvb, parameter_tree, parameter_item);
3685           break;
3686         case PARAM_TYPE_CALLING_PARTY_NR:
3687           dissect_isup_calling_party_number_parameter(parameter_tvb, parameter_tree, parameter_item);
3688           break;
3689         case PARAM_TYPE_REDIRECTING_NR:
3690           dissect_isup_redirecting_number_parameter(parameter_tvb, parameter_tree, parameter_item);
3691           break;
3692         case PARAM_TYPE_REDIRECTION_NR:
3693           dissect_isup_redirection_number_parameter(parameter_tvb, parameter_tree, parameter_item);
3694           break;
3695         case PARAM_TYPE_CONNECTION_REQ:
3696           dissect_isup_connection_request_parameter(parameter_tvb, parameter_tree, parameter_item);
3697           break;
3698         case PARAM_TYPE_INFO_REQ_IND:
3699           dissect_isup_information_request_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3700           break;
3701         case PARAM_TYPE_INFO_IND:
3702           dissect_isup_information_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3703           break;
3704         case PARAM_TYPE_CONTINUITY_IND:
3705           dissect_isup_continuity_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3706           break;
3707         case PARAM_TYPE_BACKW_CALL_IND:
3708           dissect_isup_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3709           break;
3710         case PARAM_TYPE_CAUSE_INDICATORS:
3711           dissect_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3712           break;
3713         case PARAM_TYPE_REDIRECTION_INFO:
3714           dissect_isup_redirection_information_parameter(parameter_tvb, parameter_tree, parameter_item);
3715           break;
3716         case PARAM_TYPE_CIRC_GRP_SV_MSG_TYPE:
3717           dissect_isup_circuit_group_supervision_message_type_parameter(parameter_tvb, parameter_tree, parameter_item);
3718           break;
3719         case PARAM_TYPE_RANGE_AND_STATUS:
3720           dissect_isup_range_and_status_parameter(parameter_tvb, parameter_tree, parameter_item);
3721           break;
3722         case PARAM_TYPE_FACILITY_IND:
3723           dissect_isup_facility_ind_parameter(parameter_tvb, parameter_item);
3724           break;
3725         case PARAM_TYPE_CLSD_USR_GRP_ILOCK_CD:
3726           dissect_isup_closed_user_group_interlock_code_parameter(parameter_tvb, parameter_tree, parameter_item);
3727           break;
3728         case PARAM_TYPE_USER_SERVICE_INFO:
3729           dissect_isup_user_service_information_parameter(parameter_tvb, parameter_tree, parameter_item);
3730           break;
3731         case PARAM_TYPE_SIGNALLING_POINT_CODE:
3732           dissect_isup_signalling_point_code_parameter(parameter_tvb, parameter_tree, parameter_item);
3733           break;
3734         case PARAM_TYPE_USER_TO_USER_INFO:
3735           dissect_isup_user_to_user_information_parameter(parameter_tvb, parameter_tree, parameter_item);
3736           break;
3737         case PARAM_TYPE_CONNECTED_NR:
3738           dissect_isup_connected_number_parameter(parameter_tvb, parameter_tree, parameter_item);
3739           break;
3740         case PARAM_TYPE_SUSP_RESUME_IND:
3741           dissect_isup_suspend_resume_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3742           break;
3743         case PARAM_TYPE_TRANSIT_NETW_SELECT:
3744           dissect_isup_transit_network_selection_parameter(parameter_tvb, parameter_tree, parameter_item);
3745           break;
3746         case PARAM_TYPE_EVENT_INFO:
3747           dissect_isup_event_information_parameter(parameter_tvb, parameter_tree, parameter_item);
3748           break;
3749         case PARAM_TYPE_CIRC_ASSIGN_MAP:
3750           dissect_isup_circuit_assignment_map_parameter(parameter_tvb, parameter_tree, parameter_item);
3751           break;
3752         case PARAM_TYPE_CIRC_STATE_IND:
3753           dissect_isup_circuit_state_ind_parameter(parameter_tvb, parameter_tree, parameter_item);
3754           break;
3755         case PARAM_TYPE_AUTO_CONG_LEVEL:
3756           dissect_isup_automatic_congestion_level_parameter(parameter_tvb, parameter_tree, parameter_item);
3757           break;
3758         case PARAM_TYPE_ORIG_CALLED_NR:
3759           dissect_isup_original_called_number_parameter(parameter_tvb, parameter_tree, parameter_item);
3760           break;
3761         case PARAM_TYPE_OPT_BACKW_CALL_IND:
3762           dissect_isup_optional_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3763           break;
3764         case PARAM_TYPE_USER_TO_USER_IND:
3765           dissect_isup_user_to_user_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3766           break;
3767         case PARAM_TYPE_ORIG_ISC_POINT_CODE:
3768           dissect_isup_original_isc_point_code_parameter(parameter_tvb, parameter_tree, parameter_item);
3769           break;
3770         case PARAM_TYPE_GENERIC_NOTIF_IND:
3771           dissect_isup_generic_notification_indicator_parameter(parameter_tvb, parameter_tree, parameter_item);
3772           break;
3773         case PARAM_TYPE_CALL_HIST_INFO :
3774           dissect_isup_call_history_information_parameter(parameter_tvb, parameter_tree, parameter_item);
3775           break;
3776         case PARAM_TYPE_ACC_DELIV_INFO:
3777           dissect_isup_access_delivery_information_parameter(parameter_tvb, parameter_tree, parameter_item);
3778           break;
3779         case PARAM_TYPE_NETW_SPECIFIC_FACLTY:
3780           dissect_isup_network_specific_facility_parameter(parameter_tvb, parameter_tree, parameter_item);
3781           break;
3782         case PARAM_TYPE_USER_SERVICE_INFO_PR:
3783           dissect_isup_user_service_information_prime_parameter(parameter_tvb, parameter_tree, parameter_item);
3784           break;
3785         case PARAM_TYPE_PROPAG_DELAY_COUNTER:
3786           dissect_isup_propagation_delay_counter_parameter(parameter_tvb, parameter_tree, parameter_item);
3787           break;
3788         case PARAM_TYPE_REMOTE_OPERATIONS:
3789           dissect_isup_remote_operations_parameter(parameter_tvb, parameter_tree, parameter_item);
3790           break;
3791         case PARAM_TYPE_SERVICE_ACTIVATION:
3792           dissect_isup_service_activation_parameter(parameter_tvb, parameter_tree, parameter_item);
3793           break;
3794         case PARAM_TYPE_USER_TELESERV_INFO:
3795           dissect_isup_user_teleservice_information_parameter(parameter_tvb, parameter_tree, parameter_item);
3796           break;
3797         case PARAM_TYPE_TRANSM_MEDIUM_USED:
3798           dissect_isup_transmission_medium_used_parameter(parameter_tvb, parameter_tree, parameter_item);
3799           break;
3800         case PARAM_TYPE_CALL_DIV_INFO:
3801           dissect_isup_call_diversion_information_parameter(parameter_tvb, parameter_tree, parameter_item);
3802           break;
3803         case PARAM_TYPE_ECHO_CTRL_INFO:
3804           dissect_isup_echo_control_information_parameter(parameter_tvb, parameter_tree, parameter_item);
3805           break;
3806         case PARAM_TYPE_MSG_COMPAT_INFO:
3807           dissect_isup_message_compatibility_information_parameter(parameter_tvb, parameter_tree, parameter_item);
3808           break;
3809         case PARAM_TYPE_PARAM_COMPAT_INFO:
3810           dissect_isup_parameter_compatibility_information_parameter(parameter_tvb, parameter_tree, parameter_item);
3811           break;
3812         case PARAM_TYPE_MLPP_PRECEDENCE:
3813           dissect_isup_mlpp_precedence_parameter(parameter_tvb, parameter_tree, parameter_item);
3814           break;
3815         case PARAM_TYPE_MCID_REQ_IND:
3816           dissect_isup_mcid_request_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3817           break;
3818         case PARAM_TYPE_MCID_RSP_IND:
3819           dissect_isup_mcid_response_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3820           break;
3821         case PARAM_TYPE_HOP_COUNTER:
3822           dissect_isup_hop_counter_parameter(parameter_tvb, parameter_tree, parameter_item);
3823           break;
3824         case PARAM_TYPE_TRANSM_MEDIUM_RQUR_PR:
3825           dissect_isup_transmission_medium_requirement_prime_parameter(parameter_tvb, parameter_tree, parameter_item);
3826           break;
3827         case PARAM_TYPE_LOCATION_NR:
3828           dissect_isup_location_number_parameter(parameter_tvb, parameter_tree, parameter_item);
3829           break;
3830         case PARAM_TYPE_REDIR_NR_RSTRCT:
3831           dissect_isup_redirection_number_restriction_parameter(parameter_tvb, parameter_tree, parameter_item);
3832           break;
3833         case PARAM_TYPE_CALL_TRANS_REF:
3834           dissect_isup_call_transfer_reference_parameter(parameter_tvb, parameter_tree, parameter_item);
3835           break;
3836         case PARAM_TYPE_LOOP_PREV_IND:
3837           dissect_isup_loop_prevention_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3838           break;
3839         case PARAM_TYPE_CALL_TRANS_NR:
3840           dissect_isup_call_transfer_number_parameter(parameter_tvb, parameter_tree, parameter_item);
3841           break;
3842         case PARAM_TYPE_CCSS:
3843           dissect_isup_ccss_parameter(parameter_tvb, parameter_tree, parameter_item);
3844           break;
3845         case PARAM_TYPE_FORW_GVNS:
3846           dissect_isup_forward_gvns_parameter(parameter_tvb, parameter_tree, parameter_item);
3847           break;
3848         case PARAM_TYPE_BACKW_GVNS:
3849           dissect_isup_backward_gvns_parameter(parameter_tvb, parameter_tree, parameter_item);
3850           break;
3851         case PARAM_TYPE_REDIRECT_CAPAB:
3852           dissect_isup_redirect_capability_parameter(parameter_tvb, parameter_tree, parameter_item);
3853           break;
3854         case PARAM_TYPE_NETW_MGMT_CTRL:
3855           dissect_isup_network_management_controls_parameter(parameter_tvb, parameter_tree, parameter_item);
3856           break;
3857         case PARAM_TYPE_CORRELATION_ID:
3858           dissect_isup_correlation_id_parameter(parameter_tvb, parameter_tree, parameter_item);
3859           break;
3860         case PARAM_TYPE_SCF_ID:
3861           dissect_isup_scf_id_parameter(parameter_tvb, parameter_tree, parameter_item);
3862           break;
3863         case PARAM_TYPE_CALL_DIV_TREAT_IND:
3864           dissect_isup_call_diversion_treatment_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3865           break;
3866         case PARAM_TYPE_CALLED_IN_NR:
3867           dissect_isup_called_in_number_parameter(parameter_tvb, parameter_tree, parameter_item);
3868           break;
3869         case PARAM_TYPE_CALL_OFF_TREAT_IND:
3870           dissect_isup_call_offering_treatment_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3871           break;
3872         case PARAM_TYPE_CHARGED_PARTY_IDENT:
3873           dissect_isup_charged_party_identification_parameter(parameter_tvb, parameter_tree, parameter_item);
3874           break;
3875         case PARAM_TYPE_CONF_TREAT_IND:
3876           dissect_isup_conference_treatment_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3877           break;
3878         case PARAM_TYPE_DISPLAY_INFO:
3879           dissect_isup_display_information_parameter(parameter_tvb, parameter_tree, parameter_item);
3880           break;
3881         case PARAM_TYPE_UID_ACTION_IND:
3882           dissect_isup_uid_action_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3883           break;
3884         case PARAM_TYPE_UID_CAPAB_IND:
3885           dissect_isup_uid_capability_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3886           break;
3887         case PARAM_TYPE_REDIRECT_COUNTER:
3888           dissect_isup_redirect_counter_parameter(parameter_tvb, parameter_tree, parameter_item);
3889           break;
3890         case PARAM_TYPE_COLLECT_CALL_REQ:
3891           dissect_isup_collect_call_request_parameter(parameter_tvb, parameter_tree, parameter_item);
3892           break;
3893         case PARAM_TYPE_GENERIC_NR:
3894           dissect_isup_generic_number_parameter(parameter_tvb, parameter_tree, parameter_item);
3895           break;
3896         case PARAM_TYPE_GENERIC_DIGITS:
3897           dissect_isup_generic_digits_parameter(parameter_tvb, parameter_tree, parameter_item);
3898           break;
3899         case PARAM_TYPE_APPLICATON_TRANS:
3900           dissect_isup_application_transport_parameter(parameter_tvb, pinfo, parameter_tree, parameter_item);
3901           break;
3902           
3903         default:
3904           dissect_isup_unknown_parameter(parameter_tvb, parameter_item);
3905           break;
3906         }
3907         offset += MIN(parameter_length, actual_length);
3908       }
3909
3910     }
3911     else {
3912         /* End of optional parameters is reached */
3913         proto_tree_add_uint_format(isup_tree, hf_isup_message_type, optional_parameters_tvb , offset, PARAMETER_TYPE_LENGTH, parameter_type, "End of optional parameters (%u)", parameter_type);
3914     }
3915   }
3916 }
3917
3918 /* ------------------------------------------------------------------ */
3919 /* Dissectors for all used message types                              */
3920 /* Called by dissect_isup_message(),                                  */
3921 /* call parameter dissectors in order of mandatory parameters         */
3922 /* (since not labeled)                                                */
3923 /* ------------------------------------------------------------------
3924   Dissector Message Type Initial address message
3925  */
3926 gint
3927 dissect_isup_initial_address_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
3928 { proto_item* parameter_item;
3929   proto_tree* parameter_tree;
3930   tvbuff_t *parameter_tvb;
3931   gint offset = 0;
3932   gint parameter_type, parameter_pointer, parameter_length, actual_length;
3933
3934   /* Do stuff for first mandatory fixed parameter: Nature of Connection Indicators */
3935   parameter_type = PARAM_TYPE_NATURE_OF_CONN_IND;
3936   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
3937                                        NATURE_OF_CONNECTION_IND_LENGTH,
3938                                        "Nature of Connection Indicators");
3939   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
3940   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"));
3941   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
3942   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(NATURE_OF_CONNECTION_IND_LENGTH, actual_length), NATURE_OF_CONNECTION_IND_LENGTH);
3943   dissect_isup_nature_of_connection_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3944   offset += NATURE_OF_CONNECTION_IND_LENGTH;
3945
3946   /* Do stuff for 2nd mandatory fixed parameter: Forward Call Indicators */
3947   parameter_type =  PARAM_TYPE_FORW_CALL_IND;
3948   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
3949                                        FORWARD_CALL_IND_LENGTH,
3950                                        "Forward Call Indicators");
3951   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
3952   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"));
3953   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
3954   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(FORWARD_CALL_IND_LENGTH, actual_length), FORWARD_CALL_IND_LENGTH );
3955   dissect_isup_forward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3956   offset +=  FORWARD_CALL_IND_LENGTH;
3957
3958   /* Do stuff for 3nd mandatory fixed parameter: Calling party's category */
3959   parameter_type = PARAM_TYPE_CALLING_PRTY_CATEG;
3960   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
3961                                        CALLING_PRTYS_CATEGORY_LENGTH,
3962                                        "Calling Party's category");
3963   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
3964   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"));
3965   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
3966   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CALLING_PRTYS_CATEGORY_LENGTH, actual_length),CALLING_PRTYS_CATEGORY_LENGTH );
3967   dissect_isup_calling_partys_category_parameter(parameter_tvb, parameter_tree, parameter_item);
3968   offset += CALLING_PRTYS_CATEGORY_LENGTH;
3969
3970   /* Do stuff for 4th mandatory fixed parameter: Transmission medium requirement */
3971   parameter_type = PARAM_TYPE_TRANSM_MEDIUM_REQU;
3972   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
3973                                        TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH,
3974                                        "Transmission medium requirement");
3975   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
3976   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"));
3977   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
3978   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH, actual_length), TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH);
3979   dissect_isup_transmission_medium_requirement_parameter(parameter_tvb, parameter_tree, parameter_item);
3980   offset += TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH;
3981
3982
3983   /* Do stuff for mandatory variable parameter Called party number */
3984   parameter_type = PARAM_TYPE_CALLED_PARTY_NR;
3985   parameter_pointer = tvb_get_guint8(message_tvb, offset);
3986   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
3987
3988   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
3989                                        offset +  parameter_pointer,
3990                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
3991                                        "Called Party Number");
3992   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
3993   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"));
3994   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);
3995   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);
3996   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
3997   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
3998   dissect_isup_called_party_number_parameter(parameter_tvb, parameter_tree, parameter_item);
3999   offset += PARAMETER_POINTER_LENGTH;
4000
4001   return offset;
4002 }
4003 /* ------------------------------------------------------------------
4004   Dissector Message Type subsequent address message
4005  */
4006 gint dissect_isup_subsequent_address_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
4007 { proto_item* parameter_item;
4008   proto_tree* parameter_tree;
4009   tvbuff_t *parameter_tvb;
4010   gint offset = 0;
4011   gint parameter_type, parameter_pointer, parameter_length, actual_length;
4012
4013   /* Do stuff for mandatory variable parameter Subsequent number */
4014   parameter_type = PARAM_TYPE_SUBSQT_NR;
4015
4016   parameter_pointer = tvb_get_guint8(message_tvb, offset);
4017   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
4018
4019   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
4020                                        offset +  parameter_pointer,
4021                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
4022                                        "Subsequent Number");
4023   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4024   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"));
4025   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);
4026   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);
4027   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4028   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
4029   dissect_isup_subsequent_number_parameter(parameter_tvb, parameter_tree, parameter_item);
4030   offset += PARAMETER_POINTER_LENGTH;
4031
4032   return offset;
4033 }
4034
4035 /* ------------------------------------------------------------------
4036   Dissector Message Type Information request message
4037  */
4038 gint
4039 dissect_isup_information_request_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
4040 { proto_item* parameter_item;
4041   proto_tree* parameter_tree;
4042   tvbuff_t *parameter_tvb;
4043   gint offset = 0;
4044   gint parameter_type, actual_length;
4045
4046   /* Do stuff for first mandatory fixed parameter: Information request indicators*/
4047   parameter_type = PARAM_TYPE_INFO_REQ_IND;
4048   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
4049                                        INFO_REQUEST_IND_LENGTH,
4050                                        "Information request indicators");
4051   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4052   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"));
4053   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4054   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(INFO_REQUEST_IND_LENGTH, actual_length), INFO_REQUEST_IND_LENGTH);
4055   dissect_isup_information_request_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
4056   offset += INFO_REQUEST_IND_LENGTH;
4057   return offset;
4058 }
4059 /* ------------------------------------------------------------------
4060   Dissector Message Type Information
4061  */
4062 gint
4063 dissect_isup_information_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
4064 { proto_item* parameter_item;
4065   proto_tree* parameter_tree;
4066   tvbuff_t *parameter_tvb;
4067   gint offset = 0;
4068   gint parameter_type, actual_length;
4069
4070   /* Do stuff for first mandatory fixed parameter: Information  indicators*/
4071   parameter_type = PARAM_TYPE_INFO_IND;
4072   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
4073                                        INFO_IND_LENGTH,
4074                                        "Information indicators");
4075   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4076   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"));
4077   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4078   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(INFO_IND_LENGTH, actual_length), INFO_IND_LENGTH);
4079   dissect_isup_information_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
4080   offset += INFO_IND_LENGTH;
4081   return offset;
4082 }
4083 /* ------------------------------------------------------------------
4084   Dissector Message Type Continuity
4085  */
4086 gint
4087 dissect_isup_continuity_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
4088 { proto_item* parameter_item;
4089   proto_tree* parameter_tree;
4090   tvbuff_t *parameter_tvb;
4091   gint offset = 0;
4092   gint parameter_type, actual_length;
4093
4094   /* Do stuff for first mandatory fixed parameter: Continuity indicators*/
4095   parameter_type = PARAM_TYPE_CONTINUITY_IND;
4096   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
4097                                        CONTINUITY_IND_LENGTH,
4098                                        "Continuity indicators");
4099   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4100   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"));
4101   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4102   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CONTINUITY_IND_LENGTH, actual_length), CONTINUITY_IND_LENGTH);
4103   dissect_isup_continuity_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
4104   offset += CONTINUITY_IND_LENGTH;
4105   return offset;
4106 }
4107 /* ------------------------------------------------------------------
4108   Dissector Message Type Address complete
4109  */
4110 gint
4111 dissect_isup_address_complete_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
4112 { proto_item* parameter_item;
4113   proto_tree* parameter_tree;
4114   tvbuff_t *parameter_tvb;
4115   gint offset = 0;
4116   gint parameter_type, actual_length;
4117
4118   /* Do stuff for first mandatory fixed parameter: backward call indicators*/
4119   parameter_type = PARAM_TYPE_BACKW_CALL_IND;
4120   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
4121                                        BACKWARD_CALL_IND_LENGTH,
4122                                        "Backward Call Indicators");
4123   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4124   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"));
4125   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4126   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(BACKWARD_CALL_IND_LENGTH, actual_length), BACKWARD_CALL_IND_LENGTH);
4127   dissect_isup_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
4128   offset += BACKWARD_CALL_IND_LENGTH;
4129   return offset;
4130 }
4131 /* ------------------------------------------------------------------
4132   Dissector Message Type Connect
4133  */
4134 gint
4135 dissect_isup_connect_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
4136 { proto_item* parameter_item;
4137   proto_tree* parameter_tree;
4138   tvbuff_t *parameter_tvb;
4139   gint offset = 0;
4140   gint parameter_type, actual_length;
4141
4142   /* Do stuff for first mandatory fixed parameter: backward call indicators*/
4143   parameter_type = PARAM_TYPE_BACKW_CALL_IND;
4144   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
4145                                        BACKWARD_CALL_IND_LENGTH,
4146                                        "Backward Call Indicators");
4147   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4148   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"));
4149   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4150   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(BACKWARD_CALL_IND_LENGTH, actual_length), BACKWARD_CALL_IND_LENGTH);
4151   dissect_isup_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
4152   offset += BACKWARD_CALL_IND_LENGTH;
4153   return offset;
4154 }
4155 /* ------------------------------------------------------------------
4156   Dissector Message Type release message
4157  */
4158 gint
4159 dissect_isup_release_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
4160 { proto_item* parameter_item;
4161   proto_tree* parameter_tree;
4162   tvbuff_t *parameter_tvb;
4163   gint offset = 0;
4164   gint parameter_type, parameter_pointer, parameter_length, actual_length;
4165
4166   /* Do stuff for mandatory variable parameter Cause indicators */
4167   parameter_type =  PARAM_TYPE_CAUSE_INDICATORS;
4168
4169   parameter_pointer = tvb_get_guint8(message_tvb, offset);
4170   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
4171
4172   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
4173                                        offset +  parameter_pointer,
4174                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
4175                                        "Cause indicators, see Q.850");
4176   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4177   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"));
4178   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);
4179   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);
4180   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4181   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
4182   dissect_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
4183   offset += PARAMETER_POINTER_LENGTH;
4184
4185   return offset;
4186 }
4187 /* ------------------------------------------------------------------
4188   Dissector Message Type Resume/Suspend
4189  */
4190 gint
4191 dissect_isup_suspend_resume_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
4192 { proto_item* parameter_item;
4193   proto_tree* parameter_tree;
4194   tvbuff_t *parameter_tvb;
4195   gint offset = 0;
4196   gint parameter_type, actual_length;
4197
4198   /* Do stuff for first mandatory fixed parameter: backward call indicators*/
4199   parameter_type = PARAM_TYPE_SUSP_RESUME_IND;
4200   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
4201                                        SUSPEND_RESUME_IND_LENGTH,
4202                                        "Suspend/Resume indicator");
4203   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4204   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"));
4205   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4206   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(SUSPEND_RESUME_IND_LENGTH, actual_length), SUSPEND_RESUME_IND_LENGTH);
4207   dissect_isup_suspend_resume_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
4208   offset += SUSPEND_RESUME_IND_LENGTH;
4209   return offset;
4210 }
4211 /* ------------------------------------------------------------------
4212   Dissector Message Type Circuit group reset/query message
4213  */
4214 gint
4215 dissect_isup_circuit_group_reset_query_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
4216 { proto_item* parameter_item;
4217   proto_tree* parameter_tree;
4218   tvbuff_t *parameter_tvb;
4219   gint offset = 0;
4220   gint parameter_type, parameter_pointer, parameter_length, actual_length;
4221
4222   /* Do stuff for mandatory variable parameter range and status*/
4223   parameter_type =  PARAM_TYPE_RANGE_AND_STATUS;
4224
4225   parameter_pointer = tvb_get_guint8(message_tvb, offset);
4226   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
4227
4228   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
4229                                        offset +  parameter_pointer,
4230                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
4231                                        "Range and status");
4232   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4233   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"));
4234   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);
4235   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);
4236   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4237   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
4238   dissect_isup_range_and_status_parameter(parameter_tvb, parameter_tree, parameter_item);
4239   offset += PARAMETER_POINTER_LENGTH;
4240
4241   return offset;
4242 }
4243 /* ------------------------------------------------------------------
4244   Dissector Message Type Circuit group blocking/blocking ack/unblocking/unblocking ack messages
4245  */
4246 gint
4247 dissect_isup_circuit_group_blocking_messages(tvbuff_t *message_tvb, proto_tree *isup_tree)
4248 { proto_item* parameter_item;
4249   proto_tree* parameter_tree;
4250   tvbuff_t *parameter_tvb;
4251   gint offset = 0;
4252   gint parameter_type, parameter_pointer, parameter_length, actual_length;
4253
4254    /* Do stuff for first mandatory fixed parameter: circuit group supervision message type*/
4255   parameter_type = PARAM_TYPE_CIRC_GRP_SV_MSG_TYPE;
4256   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
4257                                        CIRC_GRP_SV_MSG_TYPE_LENGTH,
4258                                        "Circuit group supervision message type");
4259   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4260   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"));
4261   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4262   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CIRC_GRP_SV_MSG_TYPE_LENGTH, actual_length), CIRC_GRP_SV_MSG_TYPE_LENGTH);
4263   dissect_isup_circuit_group_supervision_message_type_parameter(parameter_tvb, parameter_tree, parameter_item);
4264   offset += CIRC_GRP_SV_MSG_TYPE_LENGTH;
4265
4266   /* Do stuff for mandatory variable parameter range and status*/
4267   parameter_type =  PARAM_TYPE_RANGE_AND_STATUS;
4268
4269   parameter_pointer = tvb_get_guint8(message_tvb, offset);
4270   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
4271
4272   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
4273                                        offset +  parameter_pointer,
4274                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
4275                                        "Facility indicator");
4276   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4277   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"));
4278   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);
4279   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);
4280   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4281   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
4282   dissect_isup_facility_ind_parameter(parameter_tvb, parameter_item);
4283   offset += PARAMETER_POINTER_LENGTH;
4284
4285   return offset;
4286 }
4287
4288 /* ------------------------------------------------------------------
4289   Dissector Message Type Facility request/accepted
4290  */
4291 gint
4292 dissect_isup_facility_request_accepted_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
4293 { proto_item* parameter_item;
4294   proto_tree* parameter_tree;
4295   tvbuff_t *parameter_tvb;
4296   gint offset = 0;
4297   gint parameter_type, actual_length;
4298
4299   /* Do stuff for first mandatory fixed parameter: facility indicators*/
4300   parameter_type = PARAM_TYPE_FACILITY_IND;
4301   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
4302                                        FACILITY_IND_LENGTH,
4303                                        "Facility indicator");
4304   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4305   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"));
4306   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4307   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(FACILITY_IND_LENGTH, actual_length), FACILITY_IND_LENGTH);
4308   dissect_isup_facility_ind_parameter(parameter_tvb, parameter_item);
4309   offset += FACILITY_IND_LENGTH;
4310   return offset;
4311 }
4312 /* ------------------------------------------------------------------
4313   Dissector Message Type Facility reject
4314  */
4315 gint
4316 dissect_isup_facility_reject_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
4317 { proto_item* parameter_item;
4318   proto_tree* parameter_tree;
4319   tvbuff_t *parameter_tvb;
4320   gint offset = 0;
4321   gint parameter_type, parameter_pointer, parameter_length, actual_length;
4322
4323   /* Do stuff for first mandatory fixed parameter: facility indicators*/
4324   parameter_type = PARAM_TYPE_FACILITY_IND;
4325   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
4326                                        FACILITY_IND_LENGTH,
4327                                        "Facility indicator");
4328   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4329   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"));
4330   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4331   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(FACILITY_IND_LENGTH, actual_length), FACILITY_IND_LENGTH);
4332   dissect_isup_facility_ind_parameter(parameter_tvb, parameter_item);
4333   offset += FACILITY_IND_LENGTH;
4334
4335   /* Do stuff for mandatory variable parameter Cause indicators */
4336   parameter_type =  PARAM_TYPE_CAUSE_INDICATORS;
4337
4338   parameter_pointer = tvb_get_guint8(message_tvb, offset);
4339   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
4340
4341   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
4342                                        offset +  parameter_pointer,
4343                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
4344                                        "Cause indicators, see Q.850");
4345   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4346   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"));
4347   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);
4348   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);
4349   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4350   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
4351   dissect_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
4352   offset += PARAMETER_POINTER_LENGTH;
4353
4354   return offset;
4355 }
4356 /* ------------------------------------------------------------------
4357   Dissector Message Type Circuit group reset acknowledgement message
4358  */
4359 gint
4360 dissect_isup_circuit_group_reset_acknowledgement_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
4361 { proto_item* parameter_item;
4362   proto_tree* parameter_tree;
4363   tvbuff_t *parameter_tvb;
4364   gint offset = 0;
4365   gint parameter_type, parameter_pointer, parameter_length, actual_length;
4366
4367   /* Do stuff for mandatory variable parameter range and status*/
4368   parameter_type =  PARAM_TYPE_RANGE_AND_STATUS;
4369
4370   parameter_pointer = tvb_get_guint8(message_tvb, offset);
4371   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
4372
4373   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
4374                                        offset +  parameter_pointer,
4375                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
4376                                        "Range and status");
4377   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4378   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"));
4379   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);
4380   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);
4381   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4382   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
4383   dissect_isup_range_and_status_parameter(parameter_tvb, parameter_tree, parameter_item);
4384   offset += PARAMETER_POINTER_LENGTH;
4385
4386   return offset;
4387 }
4388 /* ------------------------------------------------------------------
4389   Dissector Message Type Circuit group query response message
4390  */
4391 gint
4392 dissect_isup_circuit_group_query_response_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
4393 { proto_item* parameter_item;
4394   proto_tree* parameter_tree;
4395   tvbuff_t *parameter_tvb;
4396   gint offset = 0;
4397   gint parameter_type, parameter_pointer, parameter_length, actual_length;
4398
4399   /* Do stuff for 1. mandatory variable parameter range and status*/
4400   parameter_type =  PARAM_TYPE_RANGE_AND_STATUS;
4401
4402   parameter_pointer = tvb_get_guint8(message_tvb, offset);
4403   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
4404
4405   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
4406                                        offset +  parameter_pointer,
4407                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
4408                                        "Range and status");
4409   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4410   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"));
4411   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);
4412   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);
4413   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4414   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
4415   dissect_isup_range_and_status_parameter(parameter_tvb, parameter_tree, parameter_item);
4416   offset += PARAMETER_POINTER_LENGTH;
4417
4418   /* Do stuff for 2. mandatory variable parameter Circuit state indicator*/
4419   parameter_type = PARAM_TYPE_CIRC_STATE_IND;
4420
4421   parameter_pointer = tvb_get_guint8(message_tvb, offset);
4422   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
4423
4424   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
4425                                        offset +  parameter_pointer,
4426                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
4427                                        "Circuit state indicator (national use)");
4428   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4429   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"));
4430   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);
4431   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);
4432   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4433   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
4434   dissect_isup_circuit_state_ind_parameter(parameter_tvb, parameter_tree, parameter_item);
4435   offset += PARAMETER_POINTER_LENGTH;
4436
4437   return offset;
4438 }
4439 /* ------------------------------------------------------------------
4440   Dissector Message Type Call Progress
4441 */
4442 gint
4443 dissect_isup_call_progress_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
4444 { proto_item* parameter_item;
4445   proto_tree* parameter_tree;
4446   tvbuff_t *parameter_tvb;
4447   gint offset = 0;
4448   gint parameter_type, actual_length;
4449
4450   /* Do stuff for first mandatory fixed parameter: Event information*/
4451   parameter_type = PARAM_TYPE_EVENT_INFO;
4452   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
4453                                        EVENT_INFO_LENGTH,
4454                                        "Event information");
4455   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4456   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"));
4457   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4458   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(EVENT_INFO_LENGTH, actual_length), EVENT_INFO_LENGTH);
4459   dissect_isup_event_information_parameter(parameter_tvb, parameter_tree, parameter_item);
4460   offset += EVENT_INFO_LENGTH;
4461   return offset;
4462 }
4463 /* ------------------------------------------------------------------
4464   Dissector Message Type User-to-User information
4465  */
4466 gint
4467 dissect_isup_user_to_user_information_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
4468 { proto_item* parameter_item;
4469   proto_tree* parameter_tree;
4470   tvbuff_t *parameter_tvb;
4471   gint offset = 0;
4472   gint parameter_type, parameter_pointer, parameter_length, actual_length;
4473
4474   /* Do stuff for mandatory variable parameter User-to-user information*/
4475   parameter_type =  PARAM_TYPE_USER_TO_USER_INFO;
4476
4477   parameter_pointer = tvb_get_guint8(message_tvb, offset);
4478   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
4479
4480   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
4481                                        offset +  parameter_pointer,
4482                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
4483                                        "User-to-user information, see Q.931");
4484   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4485   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"));
4486   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);
4487   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);
4488   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4489   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
4490   dissect_isup_user_to_user_information_parameter(parameter_tvb, parameter_tree, parameter_item);
4491   offset += PARAMETER_POINTER_LENGTH;
4492
4493   return offset;
4494 }
4495 /* ------------------------------------------------------------------
4496   Dissector Message Type Confusion
4497  */
4498 gint
4499 dissect_isup_confusion_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
4500 { proto_item* parameter_item;
4501   proto_tree* parameter_tree;
4502   tvbuff_t *parameter_tvb;
4503   gint offset = 0;
4504   gint parameter_type, parameter_pointer, parameter_length, actual_length;
4505
4506   /* Do stuff for mandatory variable parameter Cause indicators */
4507   parameter_type =  PARAM_TYPE_CAUSE_INDICATORS;
4508
4509   parameter_pointer = tvb_get_guint8(message_tvb, offset);
4510   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
4511
4512   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
4513                                        offset +  parameter_pointer,
4514                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
4515                                        "Cause indicators, see Q.850");
4516   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
4517   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"));
4518   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);
4519   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);
4520   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
4521   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
4522   dissect_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
4523   offset += PARAMETER_POINTER_LENGTH;
4524
4525   return offset;
4526 }
4527 /* ------------------------------------------------------------------ */
4528 static void
4529 dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup_tree)
4530 {
4531   tvbuff_t *parameter_tvb;
4532   tvbuff_t *optional_parameter_tvb;
4533   proto_item* pass_along_item;
4534   proto_tree* pass_along_tree;
4535   gint offset, bufferlength;
4536   guint8 message_type, opt_parameter_pointer;
4537   gint opt_part_possible = FALSE; /* default setting - for message types allowing optional
4538                                      params explicitely set to TRUE in case statement */
4539   offset = 0;
4540
4541   /* Extract message type field */
4542   message_type = tvb_get_guint8(message_tvb,0);
4543
4544    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);
4545    offset +=  MESSAGE_TYPE_LENGTH;
4546
4547    bufferlength = tvb_ensure_length_remaining(message_tvb, offset);
4548    parameter_tvb = tvb_new_subset(message_tvb, offset, bufferlength, bufferlength);
4549
4550    /* distinguish between message types:*/
4551    switch (message_type) {
4552      case MESSAGE_TYPE_INITIAL_ADDR:
4553        offset += dissect_isup_initial_address_message(parameter_tvb, isup_tree);
4554        opt_part_possible = TRUE;
4555       break;
4556     case MESSAGE_TYPE_SUBSEQ_ADDR:
4557        offset += dissect_isup_subsequent_address_message(parameter_tvb, isup_tree);
4558        opt_part_possible = TRUE;
4559       break;
4560     case MESSAGE_TYPE_INFO_REQ:
4561        offset += dissect_isup_information_request_message(parameter_tvb, isup_tree);
4562        opt_part_possible = TRUE;
4563       break;
4564     case MESSAGE_TYPE_INFO:
4565        offset += dissect_isup_information_message(parameter_tvb, isup_tree);
4566        opt_part_possible = TRUE;
4567       break;
4568     case MESSAGE_TYPE_CONTINUITY:
4569        offset += dissect_isup_continuity_message(parameter_tvb, isup_tree);
4570       break;
4571     case MESSAGE_TYPE_ADDR_CMPL:
4572        offset += dissect_isup_address_complete_message(parameter_tvb, isup_tree);
4573        opt_part_possible = TRUE;
4574       break;
4575     case MESSAGE_TYPE_CONNECT:
4576        offset += dissect_isup_connect_message(parameter_tvb, isup_tree);
4577        opt_part_possible = TRUE;
4578       break;
4579     case MESSAGE_TYPE_FORW_TRANS:
4580       /* no dissector necessary since no mandatory parameters included */
4581        opt_part_possible = TRUE;
4582       break;
4583     case MESSAGE_TYPE_ANSWER:
4584       /* no dissector necessary since no mandatory parameters included */
4585        opt_part_possible = TRUE;
4586       break;
4587     case MESSAGE_TYPE_RELEASE:
4588        offset += dissect_isup_release_message(parameter_tvb, isup_tree);
4589        opt_part_possible = TRUE;
4590       break;
4591     case MESSAGE_TYPE_SUSPEND:
4592        offset += dissect_isup_suspend_resume_message(parameter_tvb, isup_tree);
4593        opt_part_possible = TRUE;
4594       break;
4595     case MESSAGE_TYPE_RESUME:
4596        offset += dissect_isup_suspend_resume_message(parameter_tvb, isup_tree);
4597        opt_part_possible = TRUE;
4598       break;
4599     case MESSAGE_TYPE_REL_CMPL:
4600       /* no dissector necessary since no mandatory parameters included */
4601        opt_part_possible = TRUE;
4602       break;
4603     case MESSAGE_TYPE_CONT_CHECK_REQ:
4604       /* no dissector necessary since no mandatory parameters included */
4605       break;
4606     case MESSAGE_TYPE_RESET_CIRCUIT:
4607       /* no dissector necessary since no mandatory parameters included */
4608       break;
4609     case MESSAGE_TYPE_BLOCKING:
4610       /* no dissector necessary since no mandatory parameters included */
4611       break;
4612     case MESSAGE_TYPE_UNBLOCKING:
4613       /* no dissector necessary since no mandatory parameters included */
4614       break;
4615     case MESSAGE_TYPE_BLOCK_ACK:
4616       /* no dissector necessary since no mandatory parameters included */
4617       break;
4618     case MESSAGE_TYPE_UNBLOCK_ACK:
4619       /* no dissector necessary since no mandatory parameters included */
4620       break;
4621     case MESSAGE_TYPE_CIRC_GRP_RST:
4622        offset += dissect_isup_circuit_group_reset_query_message(parameter_tvb, isup_tree);
4623       break;
4624     case MESSAGE_TYPE_CIRC_GRP_BLCK:
4625        offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
4626       break;
4627     case MESSAGE_TYPE_CIRC_GRP_UNBL:
4628        offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
4629       break;
4630     case MESSAGE_TYPE_CIRC_GRP_BL_ACK:
4631        offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
4632       break;
4633     case MESSAGE_TYPE_CIRC_GRP_UNBL_ACK:
4634        offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
4635       break;
4636     case MESSAGE_TYPE_FACILITY_REQ:
4637        offset += dissect_isup_facility_request_accepted_message(parameter_tvb, isup_tree);
4638        opt_part_possible = TRUE;
4639       break;
4640     case MESSAGE_TYPE_FACILITY_ACC:
4641        offset += dissect_isup_facility_request_accepted_message(parameter_tvb, isup_tree);
4642        opt_part_possible = TRUE;
4643       break;
4644     case MESSAGE_TYPE_FACILITY_REJ:
4645        offset += dissect_isup_facility_reject_message(parameter_tvb, isup_tree);
4646        opt_part_possible = TRUE;
4647       break;
4648     case MESSAGE_TYPE_LOOP_BACK_ACK:
4649       /* no dissector necessary since no mandatory parameters included */
4650       break;
4651     case MESSAGE_TYPE_PASS_ALONG:
4652       /* call dissect_isup_message recursively */
4653       { guint8 pa_message_type;
4654         pa_message_type = tvb_get_guint8(parameter_tvb, 0);
4655         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);
4656         pass_along_tree = proto_item_add_subtree(pass_along_item, ett_isup_pass_along_message);
4657         dissect_isup_message(parameter_tvb, pinfo, pass_along_tree);
4658         break;
4659       }
4660     case MESSAGE_TYPE_CIRC_GRP_RST_ACK:
4661        offset += dissect_isup_circuit_group_reset_acknowledgement_message(parameter_tvb, isup_tree);
4662       break;
4663     case MESSAGE_TYPE_CIRC_GRP_QRY:
4664        offset += dissect_isup_circuit_group_reset_query_message(parameter_tvb, isup_tree);
4665       break;
4666     case MESSAGE_TYPE_CIRC_GRP_QRY_RSP:
4667        offset += dissect_isup_circuit_group_query_response_message(parameter_tvb, isup_tree);
4668       break;
4669     case MESSAGE_TYPE_CALL_PROGRSS:
4670        offset += dissect_isup_call_progress_message(parameter_tvb, isup_tree);
4671        opt_part_possible = TRUE;
4672       break;
4673     case MESSAGE_TYPE_USER2USER_INFO:
4674       offset += dissect_isup_user_to_user_information_message(parameter_tvb, isup_tree);
4675       opt_part_possible = TRUE;
4676       break;
4677     case MESSAGE_TYPE_UNEQUIPPED_CIC:
4678       /* no dissector necessary since no mandatory parameters included */
4679       break;
4680     case MESSAGE_TYPE_CONFUSION:
4681       offset += dissect_isup_confusion_message(parameter_tvb, isup_tree);
4682        opt_part_possible = TRUE;
4683       break;
4684     case MESSAGE_TYPE_OVERLOAD:
4685       /* no dissector necessary since no mandatory parameters included */
4686       break;
4687     case MESSAGE_TYPE_CHARGE_INFO:
4688       /* do nothing since format is a national matter */
4689       proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Format is a national matter");
4690       break;
4691     case MESSAGE_TYPE_NETW_RESRC_MGMT:
4692       /* no dissector necessary since no mandatory parameters included */
4693        opt_part_possible = TRUE;
4694       break;
4695     case MESSAGE_TYPE_FACILITY:
4696       /* no dissector necessary since no mandatory parameters included */
4697        opt_part_possible = TRUE;
4698       break;
4699     case MESSAGE_TYPE_USER_PART_TEST:
4700       /* no dissector necessary since no mandatory parameters included */
4701        opt_part_possible = TRUE;
4702       break;
4703     case MESSAGE_TYPE_USER_PART_AVAIL:
4704       /* no dissector necessary since no mandatory parameters included */
4705        opt_part_possible = TRUE;
4706       break;
4707     case MESSAGE_TYPE_IDENT_REQ:
4708       /* no dissector necessary since no mandatory parameters included */
4709        opt_part_possible = TRUE;
4710       break;
4711     case MESSAGE_TYPE_IDENT_RSP:
4712       /* no dissector necessary since no mandatory parameters included */
4713        opt_part_possible = TRUE;
4714       break;
4715     case MESSAGE_TYPE_SEGMENTATION:
4716       /* no dissector necessary since no mandatory parameters included */
4717        opt_part_possible = TRUE;
4718       break;
4719     case MESSAGE_TYPE_LOOP_PREVENTION:
4720       /* no dissector necessary since no mandatory parameters included */
4721        opt_part_possible = TRUE;
4722       break;
4723     case MESSAGE_TYPE_APPLICATION_TRANS:
4724       /* no dissector necessary since no mandatory parameters included */
4725        opt_part_possible = TRUE;
4726       break;
4727     case MESSAGE_TYPE_PRE_RELEASE_INFO:
4728       /* no dissector necessary since no mandatory parameters included */
4729        opt_part_possible = TRUE;
4730       break;
4731     case MESSAGE_TYPE_SUBSEQUENT_DIR_NUM:
4732       /* do nothing since format is a national matter */
4733       proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Format is a national matter");
4734       break;
4735
4736     default:
4737       proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Unknown Message type (possibly reserved/used in former ISUP version)");
4738       break;
4739   }
4740
4741    /* extract pointer to start of optional part (if any) */
4742    if (opt_part_possible == TRUE){
4743      opt_parameter_pointer = tvb_get_guint8(message_tvb, offset);
4744      if (opt_parameter_pointer > 0){
4745        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);
4746        offset += opt_parameter_pointer;
4747        optional_parameter_tvb = tvb_new_subset(message_tvb, offset, -1, -1 );
4748        dissect_isup_optional_parameter(optional_parameter_tvb, pinfo, isup_tree);
4749      }
4750      else
4751        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);
4752    }
4753    else if (message_type !=MESSAGE_TYPE_CHARGE_INFO)
4754      proto_tree_add_text(isup_tree, message_tvb, 0, 0, "No optional parameters are possible with this message type");
4755
4756 }
4757
4758 /* ------------------------------------------------------------------ */
4759 static void
4760 dissect_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
4761 {
4762
4763 /* Set up structures needed to add the protocol subtree and manage it */
4764         proto_item *ti;
4765         proto_tree *isup_tree;
4766         tvbuff_t *message_tvb;
4767         guint16 cic;
4768         guint8 message_type;
4769
4770 /* Make entries in Protocol column and Info column on summary display */
4771         if (check_col(pinfo->cinfo, COL_PROTOCOL))
4772                 col_set_str(pinfo->cinfo, COL_PROTOCOL, "ISUP");
4773
4774 /* Extract message type field */
4775         message_type = tvb_get_guint8(tvb, CIC_OFFSET + CIC_LENGTH);
4776
4777         if (check_col(pinfo->cinfo, COL_INFO))
4778                 col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_type, isup_message_type_value_acro, "reserved"));
4779
4780 /* In the interest of speed, if "tree" is NULL, don't do any work not
4781    necessary to generate protocol tree items. */
4782         if (tree) {
4783                 ti = proto_tree_add_item(tree, proto_isup, tvb, 0, -1, FALSE);
4784                 isup_tree = proto_item_add_subtree(ti, ett_isup);
4785
4786                 /* dissect CIC in main dissector since pass-along message type carrying complete IUSP message w/o CIC needs
4787                    recursive message dissector call */
4788                 cic =          tvb_get_letohs(tvb, CIC_OFFSET) & 0x0FFF; /*since upper 4 bits spare */
4789
4790                 proto_tree_add_uint_format(isup_tree, hf_isup_cic, tvb, CIC_OFFSET, CIC_LENGTH, cic, "CIC: %u", cic);
4791
4792                 message_tvb = tvb_new_subset(tvb, CIC_LENGTH, -1, -1);
4793                 dissect_isup_message(message_tvb, pinfo, isup_tree);
4794         }
4795 }
4796
4797 /* ------------------------------------------------------------------ */
4798 static void
4799 dissect_bicc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
4800 {
4801
4802 /* Set up structures needed to add the protocol subtree and manage it */
4803         proto_item *ti;
4804         proto_tree *bicc_tree;
4805         tvbuff_t *message_tvb;
4806         guint32 bicc_cic;
4807         guint8 message_type;
4808
4809 /* Make entries in Protocol column and Info column on summary display */
4810         if (check_col(pinfo->cinfo, COL_PROTOCOL))
4811                 col_set_str(pinfo->cinfo, COL_PROTOCOL, "BICC");
4812
4813 /* Extract message type field */
4814         message_type = tvb_get_guint8(tvb, BICC_CIC_OFFSET + BICC_CIC_LENGTH);
4815
4816         if (check_col(pinfo->cinfo, COL_INFO))
4817                 col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_type, isup_message_type_value_acro, "reserved"));
4818
4819 /* In the interest of speed, if "tree" is NULL, don't do any work not
4820    necessary to generate protocol tree items. */
4821         if (tree) {
4822                 ti = proto_tree_add_item(tree, proto_bicc, tvb, 0, -1, FALSE);
4823                 bicc_tree = proto_item_add_subtree(ti, ett_bicc);
4824
4825                 /* dissect CIC in main dissector since pass-along message type carrying complete BICC/ISUP message w/o CIC needs
4826                    recursive message dissector call */
4827                 bicc_cic = tvb_get_letohl(tvb, BICC_CIC_OFFSET);
4828
4829                 proto_tree_add_uint_format(bicc_tree, hf_bicc_cic, tvb, BICC_CIC_OFFSET, BICC_CIC_LENGTH, bicc_cic, "CIC: %u", bicc_cic);
4830         
4831                 message_tvb = tvb_new_subset(tvb, BICC_CIC_LENGTH, -1, -1);
4832                 dissect_isup_message(message_tvb, pinfo, bicc_tree);
4833         }
4834 }
4835 /*---------------------------------------------------------------------*/
4836 /* Register the protocol with Ethereal */
4837 void
4838 proto_register_isup(void)
4839 {
4840 /* Setup list of header fields  See Section 1.6.1 for details*/
4841         static hf_register_info hf[] = {
4842                 { &hf_isup_cic,
4843                         { "CIC",           "isup.cic",
4844                         FT_UINT16, BASE_HEX, NULL, 0x0,
4845                           "", HFILL }},
4846
4847                 { &hf_isup_message_type,
4848                         { "Message Type",  "isup.message_type",
4849                         FT_UINT8, BASE_DEC, NULL, 0x0,
4850                         "", HFILL }},
4851
4852                 { &hf_isup_parameter_type,
4853                         { "Parameter Type",  "isup.parameter_type",
4854                         FT_UINT8, BASE_DEC, NULL, 0x0,
4855                         "", HFILL }},
4856
4857                 { &hf_isup_parameter_length,
4858                         { "Parameter Length",  "isup.parameter_length",
4859                         FT_UINT8, BASE_DEC, NULL, 0x0,
4860                         "", HFILL }},
4861
4862                 { &hf_isup_mandatory_variable_parameter_pointer,
4863                         { "Pointer to Parameter",  "isup.mandatory_variable_parameter_pointer",
4864                         FT_UINT8, BASE_DEC, NULL, 0x0,
4865                         "", HFILL }},
4866
4867                 { &hf_isup_pointer_to_start_of_optional_part,
4868                         { "Pointer to optional parameter part",  "isup.optional_parameter_part_pointer",
4869                         FT_UINT8, BASE_DEC, NULL, 0x0,
4870                         "", HFILL }},
4871
4872                 { &hf_isup_satellite_indicator,
4873                         { "Satellite Indicator",  "isup.satellite_indicator",
4874                         FT_UINT8, BASE_HEX, VALS(isup_satellite_ind_value), BA_8BIT_MASK,
4875                         "", HFILL }},
4876
4877                 { &hf_isup_continuity_check_indicator,
4878                         { "Continuity Check Indicator",  "isup.continuity_check_indicator",
4879                         FT_UINT8, BASE_HEX, VALS(isup_continuity_check_ind_value), DC_8BIT_MASK,
4880                         "", HFILL }},
4881
4882                 { &hf_isup_echo_control_device_indicator,
4883                         { "Echo Control Device Indicator",  "isup.echo_control_device_indicator",
4884                         FT_BOOLEAN, 8, TFS(&isup_echo_control_device_ind_value),E_8BIT_MASK,
4885                         "", HFILL }},
4886
4887                 { &hf_isup_forw_call_natnl_inatnl_call_indicator,
4888                         { "National/international call indicator",  "isup.forw_call_natnl_inatnl_call_indicator",
4889                         FT_BOOLEAN, 16, TFS(&isup_natnl_inatnl_call_ind_value),A_16BIT_MASK,
4890                         "", HFILL }},
4891
4892                 { &hf_isup_forw_call_end_to_end_method_indicator,
4893                         { "End-to-end method indicator",  "isup.forw_call_end_to_end_method_indicator",
4894                         FT_UINT16, BASE_HEX, VALS(isup_end_to_end_method_ind_value), CB_16BIT_MASK,
4895                         "", HFILL }},
4896
4897                 { &hf_isup_forw_call_interworking_indicator,
4898                         { "Interworking indicator",  "isup.forw_call_interworking_indicator",
4899                         FT_BOOLEAN, 16, TFS(&isup_interworking_ind_value), D_16BIT_MASK,
4900                         "", HFILL }},
4901
4902                 { &hf_isup_forw_call_end_to_end_info_indicator,
4903                         { "End-to-end information indicator",  "isup.forw_call_end_to_end_information_indicator",
4904                         FT_BOOLEAN, 16, TFS(&isup_end_to_end_info_ind_value), E_16BIT_MASK,
4905                         "", HFILL }},
4906
4907                 { &hf_isup_forw_call_isdn_user_part_indicator,
4908                         { "ISDN user part indicator",  "isup.forw_call_isdn_user_part_indicator",
4909                         FT_BOOLEAN, 16, TFS(&isup_ISDN_user_part_ind_value), F_16BIT_MASK,
4910                         "", HFILL }},
4911
4912                 { &hf_isup_forw_call_preferences_indicator,
4913                         { "ISDN user part preference indicator",  "isup.forw_call_preferences_indicator",
4914                         FT_UINT16, BASE_HEX, VALS(isup_preferences_ind_value), HG_16BIT_MASK,
4915                         "", HFILL }},
4916
4917                 { &hf_isup_forw_call_isdn_access_indicator,
4918                         { "ISDN access indicator",  "isup.forw_call_isdn_access_indicator",
4919                         FT_BOOLEAN, 16, TFS(&isup_ISDN_originating_access_ind_value), I_16BIT_MASK,
4920                         "", HFILL }},
4921
4922                 { &hf_isup_forw_call_sccp_method_indicator,
4923                         { "SCCP method indicator",  "isup.forw_call_sccp_method_indicator",
4924                         FT_UINT16, BASE_HEX, VALS(isup_SCCP_method_ind_value), KJ_16BIT_MASK,
4925                         "", HFILL }},
4926
4927                 { &hf_isup_calling_partys_category,
4928                         { "Calling Party's category",  "isup.calling_partys_category",
4929                         FT_UINT8, BASE_HEX, VALS(isup_calling_partys_category_value), 0x0,
4930                         "", HFILL }},
4931
4932                 { &hf_isup_transmission_medium_requirement,
4933                         { "Transmission medium requirement",  "isup.transmission_medium_requirement",
4934                         FT_UINT8, BASE_DEC, VALS(isup_transmission_medium_requirement_value), 0x0,
4935                         "", HFILL }},
4936
4937                 { &hf_isup_odd_even_indicator,
4938                         { "Odd/even indicator",  "isup.isdn_odd_even_indicator",
4939                         FT_BOOLEAN, 8, TFS(&isup_odd_even_ind_value), ISUP_ODD_EVEN_MASK,
4940                         "", HFILL }},
4941
4942                 { &hf_isup_called_party_nature_of_address_indicator,
4943                         { "Nature of address indicator",  "isup.called_party_nature_of_address_indicator",
4944                         FT_UINT8, BASE_DEC, VALS(isup_called_party_nature_of_address_ind_value), ISUP_NATURE_OF_ADDRESS_IND_MASK,
4945                         "", HFILL }},
4946
4947                 { &hf_isup_calling_party_nature_of_address_indicator,
4948                         { "Nature of address indicator",  "isup.calling_party_nature_of_address_indicator",
4949                         FT_UINT8, BASE_DEC, VALS(isup_calling_party_nature_of_address_ind_value), ISUP_NATURE_OF_ADDRESS_IND_MASK,
4950                         "", HFILL }},
4951
4952                 { &hf_isup_inn_indicator,
4953                         { "INN indicator",  "isup.inn_indicator",
4954                         FT_BOOLEAN, 8, TFS(&isup_INN_ind_value), ISUP_INN_MASK,
4955                         "", HFILL }},
4956
4957                 { &hf_isup_ni_indicator,
4958                         { "NI indicator",  "isup.ni_indicator",
4959                         FT_BOOLEAN, 8, TFS(&isup_NI_ind_value), ISUP_NI_MASK,
4960                         "", HFILL }},
4961
4962                 { &hf_isup_numbering_plan_indicator,
4963                         { "Numbering plan indicator",  "isup.numbering_plan_indicator",
4964                         FT_UINT8, BASE_DEC, VALS(isup_numbering_plan_ind_value), ISUP_NUMBERING_PLAN_IND_MASK,
4965                         "", HFILL }},
4966
4967                 { &hf_isup_address_presentation_restricted_indicator,
4968                         { "Address presentation restricted indicator",  "isup.address_presentation_restricted_indicator",
4969                         FT_UINT8, BASE_DEC, VALS(isup_address_presentation_restricted_ind_value), ISUP_ADDRESS_PRESENTATION_RESTR_IND_MASK,
4970                         "", HFILL }},
4971
4972                 { &hf_isup_screening_indicator,
4973                         { "Screening indicator",  "isup.screening_indicator",
4974                         FT_UINT8, BASE_DEC, VALS(isup_screening_ind_value), ISUP_SCREENING_IND_MASK,
4975                         "", HFILL }},
4976
4977                 { &hf_isup_screening_indicator_enhanced,
4978                         { "Screening indicator",  "isup.screening_indicator_enhanced",
4979                         FT_UINT8, BASE_DEC, VALS(isup_screening_ind_enhanced_value), ISUP_SCREENING_IND_MASK,
4980                         "", HFILL }},
4981
4982                 { &hf_isup_called_party_odd_address_signal_digit,
4983                         { "Address signal digit",  "isup.called_party_odd_address_signal_digit",
4984                         FT_UINT8, BASE_DEC, VALS(isup_called_party_address_digit_value), ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK,
4985                         "", HFILL }},
4986
4987                 { &hf_isup_calling_party_odd_address_signal_digit,
4988                         { "Address signal digit",  "isup.calling_party_odd_address_signal_digit",
4989                         FT_UINT8, BASE_DEC, VALS(isup_calling_party_address_digit_value), ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK,
4990                         "", HFILL }},
4991
4992                 { &hf_isup_called_party_even_address_signal_digit,
4993                         { "Address signal digit",  "isup.called_party_even_address_signal_digit",
4994                         FT_UINT8, BASE_DEC, VALS(isup_called_party_address_digit_value), ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK,
4995                         "", HFILL }},
4996
4997                 { &hf_isup_calling_party_even_address_signal_digit,
4998                         { "Address signal digit",  "isup.calling_party_even_address_signal_digit",
4999                         FT_UINT8, BASE_DEC, VALS(isup_calling_party_address_digit_value), ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK,
5000                         "", HFILL }},
5001
5002                 { &hf_isup_calling_party_address_request_indicator,
5003                         { "Calling party address request indicator",  "isup.calling_party_address_request_indicator",
5004                         FT_BOOLEAN, 16, TFS(&isup_calling_party_address_request_ind_value), A_16BIT_MASK,
5005                         "", HFILL }},
5006
5007                 { &hf_isup_info_req_holding_indicator,
5008                         { "Holding indicator",  "isup.info_req_holding_indicator",
5009                         FT_BOOLEAN, 16, TFS(&isup_holding_ind_value), B_16BIT_MASK,
5010                         "", HFILL }},
5011
5012                 { &hf_isup_calling_partys_category_request_indicator,
5013                         { "Calling party's category request indicator",  "isup.calling_partys_category_request_indicator",
5014                         FT_BOOLEAN, 16, TFS(&isup_calling_partys_category_request_ind_value), D_16BIT_MASK,
5015                         "", HFILL }},
5016
5017                 { &hf_isup_charge_information_request_indicator,
5018                         { "Charge information request indicator",  "isup.charge_information_request_indicator",
5019                         FT_BOOLEAN, 16, TFS(&isup_charge_information_request_ind_value), E_16BIT_MASK,
5020                         "", HFILL }},
5021
5022                 { &hf_isup_malicious_call_identification_request_indicator,
5023                         { "Malicious call identification request indicator (ISUP'88)",  "isup.malicious_call_ident_request_indicator",
5024                         FT_BOOLEAN, 16, TFS(&isup_malicious_call_identification_request_ind_value), H_16BIT_MASK,
5025                         "", HFILL }},
5026
5027                 { &hf_isup_calling_party_address_response_indicator,
5028                         { "Calling party address response indicator",  "isup.calling_party_address_response_indicator",
5029                         FT_UINT16, BASE_HEX, VALS(isup_calling_party_address_response_ind_value), BA_16BIT_MASK,
5030                         "", HFILL }},
5031
5032                 { &hf_isup_hold_provided_indicator,
5033                         { "Hold provided indicator",  "isup.hold_provided_indicator",
5034                         FT_BOOLEAN, 16, TFS(&isup_hold_provided_ind_value), C_16BIT_MASK,
5035                         "", HFILL }},
5036
5037                 { &hf_isup_calling_partys_category_response_indicator,
5038                         { "Calling party's category response indicator",  "isup.calling_partys_category_response_indicator",
5039                         FT_BOOLEAN, 16, TFS(&isup_calling_partys_category_response_ind_value), F_16BIT_MASK,
5040                         "", HFILL }},
5041
5042                 { &hf_isup_charge_information_response_indicator,
5043                         { "Charge information response indicator",  "isup.charge_information_response_indicator",
5044                         FT_BOOLEAN, 16, TFS(&isup_charge_information_response_ind_value), G_16BIT_MASK,
5045                         "", HFILL }},
5046
5047                 { &hf_isup_solicited_indicator,
5048                         { "Solicited indicator",  "isup.solicided_indicator",
5049                         FT_BOOLEAN, 16, TFS(&isup_solicited_information_ind_value), H_16BIT_MASK,
5050                         "", HFILL }},
5051
5052                 { &hf_isup_continuity_indicator,
5053                         { "Continuity indicator",  "isup.continuity_indicator",
5054                         FT_BOOLEAN, 8, TFS(&isup_continuity_ind_value), A_8BIT_MASK,
5055                         "", HFILL }},
5056
5057                 { &hf_isup_backw_call_charge_ind,
5058                         { "Charge indicator",  "isup.charge_indicator",
5059                         FT_UINT16, BASE_HEX, VALS(isup_charge_ind_value), BA_16BIT_MASK,
5060                         "", HFILL }},
5061
5062                 { &hf_isup_backw_call_called_partys_status_ind,
5063                         { "Called party's status indicator",  "isup.called_partys_status_indicator",
5064                         FT_UINT16, BASE_HEX, VALS(isup_called_partys_status_ind_value), DC_16BIT_MASK,
5065                         "", HFILL }},
5066
5067                 { &hf_isup_backw_call_called_partys_category_ind,
5068                         { "Called party's category indicator",  "isup.called_partys_category_indicator",
5069                         FT_UINT16, BASE_HEX, VALS(isup_called_partys_category_ind_value), FE_16BIT_MASK,
5070                         "", HFILL }},
5071
5072                 { &hf_isup_backw_call_end_to_end_method_ind,
5073                         { "End-to-end method indicator",  "isup.backw_call_end_to_end_method_indicator",
5074                         FT_UINT16, BASE_HEX, VALS(isup_end_to_end_method_ind_value), HG_16BIT_MASK,
5075                         "", HFILL }},
5076
5077                 { &hf_isup_backw_call_interworking_ind,
5078                         { "Interworking indicator",  "isup.backw_call_interworking_indicator",
5079                         FT_BOOLEAN, 16, TFS(&isup_interworking_ind_value), I_16BIT_MASK,
5080                         "", HFILL }},
5081
5082                 { &hf_isup_backw_call_end_to_end_info_ind,
5083                         { "End-to-end information indicator",  "isup.backw_call_end_to_end_information_indicator",
5084                         FT_BOOLEAN, 16, TFS(&isup_end_to_end_info_ind_value), J_16BIT_MASK,
5085                         "", HFILL }},
5086
5087                 { &hf_isup_backw_call_isdn_user_part_ind,
5088                         { "ISDN user part indicator",  "isup.backw_call_isdn_user_part_indicator",
5089                         FT_BOOLEAN, 16, TFS(&isup_ISDN_user_part_ind_value), K_16BIT_MASK,
5090                         "", HFILL }},
5091
5092                 { &hf_isup_backw_call_holding_ind,
5093                         { "Holding indicator",  "isup.backw_call_holding_indicator",
5094                         FT_BOOLEAN, 16, TFS(&isup_holding_ind_value), L_16BIT_MASK,
5095                         "", HFILL }},
5096
5097                 { &hf_isup_backw_call_isdn_access_ind,
5098                         { "ISDN access indicator",  "isup.backw_call_isdn_access_indicator",
5099                         FT_BOOLEAN, 16, TFS(&isup_ISDN_terminating_access_ind_value), M_16BIT_MASK,
5100                         "", HFILL }},
5101
5102                 { &hf_isup_backw_call_echo_control_device_ind,
5103                         { "Echo Control Device Indicator",  "isup.backw_call_echo_control_device_indicator",
5104                         FT_BOOLEAN, 16, TFS(&isup_echo_control_device_ind_value), N_16BIT_MASK,
5105                         "", HFILL }},
5106
5107                 { &hf_isup_backw_call_sccp_method_ind,
5108                         { "SCCP method indicator",  "isup.backw_call_sccp_method_indicator",
5109                         FT_UINT16, BASE_HEX, VALS(isup_SCCP_method_ind_value), PO_16BIT_MASK,
5110                         "", HFILL }},
5111
5112                 { &hf_isup_cause_indicator,
5113                         { "Cause indicator",  "isup.cause_indicator",
5114                         FT_UINT8, BASE_DEC, VALS(q850_cause_code_vals), 0x0,
5115                         "", HFILL }},
5116
5117                 { &hf_isup_suspend_resume_indicator,
5118                         { "Suspend/Resume indicator",  "isup.suspend_resume_indicator",
5119                         FT_BOOLEAN, 8, TFS(&isup_suspend_resume_ind_value), A_8BIT_MASK,
5120                         "", HFILL }},
5121
5122                 { &hf_isup_transmission_medium_requirement,
5123                         { "Transmission medium requirement",  "isup.transmission_medium_requirement",
5124                         FT_UINT8, BASE_DEC, VALS(isup_transmission_medium_requirement_value), 0x0,
5125                         "", HFILL }},
5126
5127                 { &hf_isup_range_indicator,
5128                         { "Range indicator",  "isup.range_indicator",
5129                           FT_UINT8, BASE_DEC, NULL , 0x0,
5130                           "", HFILL }},
5131
5132                 { &hf_isup_cgs_message_type,
5133                         { "Circuit group supervision message type",  "isup.cgs_message_type",
5134                         FT_UINT8, BASE_DEC, VALS(isup_cgs_message_type_value), BA_8BIT_MASK,
5135                         "", HFILL }},
5136
5137                 { &hf_isup_mtc_blocking_state1,
5138                         { "Maintenance blocking state",  "isup.mtc_blocking_state",
5139                         FT_UINT8, BASE_DEC, VALS(isup_mtc_blocking_state_DC00_value), BA_8BIT_MASK,
5140                         "", HFILL }},
5141
5142                 { &hf_isup_mtc_blocking_state2,
5143                         { "Maintenance blocking state",  "isup.mtc_blocking_state",
5144                         FT_UINT8, BASE_DEC, VALS(isup_mtc_blocking_state_DCnot00_value), BA_8BIT_MASK,
5145                         "", HFILL }},
5146
5147                 { &hf_isup_call_proc_state,
5148                         { "Call processing state",  "isup.call_processing_state",
5149                         FT_UINT8, BASE_DEC, VALS(isup_call_processing_state_value), DC_8BIT_MASK,
5150                         "", HFILL }},
5151
5152                 { &hf_isup_hw_blocking_state,
5153                         { "HW blocking state",  "isup.hw_blocking_state",
5154                         FT_UINT8, BASE_DEC, VALS(isup_HW_blocking_state_value), FE_8BIT_MASK,
5155                         "", HFILL }},
5156
5157                 { &hf_isup_event_ind,
5158                         { "Event indicator",  "isup.event_ind",
5159                           FT_UINT8, 8, NULL, 0x0,
5160                         "", HFILL }},
5161
5162                 { &hf_isup_event_presentation_restricted_ind,
5163                         { "Event presentation restricted indicator",  "isup.event_presentatiation_restr_ind",
5164                         FT_BOOLEAN, 8, TFS(&isup_event_presentation_restricted_ind_value), H_8BIT_MASK,
5165                         "", HFILL }},
5166
5167                 { &hf_isup_cug_call_ind,
5168                         { "Closed user group call indicator",  "isup.clg_call_ind",
5169                         FT_UINT8, BASE_DEC, VALS(isup_CUG_call_ind_value), BA_8BIT_MASK,
5170                         "", HFILL }},
5171
5172                 { &hf_isup_simple_segmentation_ind,
5173                         { "Simple segmentation indicator",  "isup.simple_segmentation_ind",
5174                         FT_BOOLEAN, 8, TFS(&isup_simple_segmentation_ind_value), C_8BIT_MASK,
5175                         "", HFILL }},
5176
5177                 { &hf_isup_connected_line_identity_request_ind,
5178                         { "Connected line identity request indicator",  "isup.connected_line_identity_request_ind",
5179                         FT_BOOLEAN, 8, TFS(&isup_connected_line_identity_request_ind_value), H_8BIT_MASK,
5180                         "", HFILL }},
5181
5182                 { &hf_isup_redirecting_ind,
5183                         { "Redirection indicator",  "isup.redirecting_ind",
5184                         FT_UINT16, BASE_DEC, VALS(isup_redirecting_ind_value), CBA_16BIT_MASK,
5185                         "", HFILL }},
5186
5187                 { &hf_isup_original_redirection_reason,
5188                         { "Original redirection reason",  "isup.original_redirection_reason",
5189                         FT_UINT16, BASE_DEC, VALS(isup_original_redirection_reason_value), HGFE_16BIT_MASK,
5190                         "", HFILL }},
5191
5192                 { &hf_isup_redirection_counter,
5193                         { "Redirection counter",  "isup.redirection_counter",
5194                         FT_UINT16, BASE_DEC, NULL, KJI_16BIT_MASK,
5195                         "", HFILL }},
5196
5197                 { &hf_isup_redirection_reason,
5198                         { "Redirection reason",  "isup.redirection_reason",
5199                         FT_UINT16, BASE_DEC, VALS(isup_redirection_reason_value), PONM_16BIT_MASK,
5200                         "", HFILL }},
5201
5202                 { &hf_isup_type_of_network_identification,
5203                         { "Type of network identification",  "isup.type_of_network_identification",
5204                         FT_UINT8, BASE_DEC, VALS(isup_type_of_network_identification_value), GFE_8BIT_MASK,
5205                         "", HFILL }},
5206
5207                 { &hf_isup_network_identification_plan,
5208                         { "Network identification plan",  "isup.network_identification_plan",
5209                         FT_UINT8, BASE_DEC, VALS(isup_network_identification_plan_value), DCBA_8BIT_MASK,
5210                         "", HFILL }},
5211
5212                 { &hf_isup_map_type,
5213                         { "Map Type",  "isup.map_type",
5214                         FT_UINT8, BASE_DEC, VALS(isup_map_type_value), FEDCBA_8BIT_MASK,
5215                         "", HFILL }},
5216
5217                 { &hf_isup_automatic_congestion_level,
5218                         { "Automatic congestion level",  "isup.automatic_congestion_level",
5219                         FT_UINT8, BASE_DEC, VALS(isup_auto_congestion_level_value), 0x0,
5220                         "", HFILL }},
5221
5222                 { &hf_isup_inband_information_ind,
5223                         { "In-band information indicator",  "isup.inband_information_ind",
5224                         FT_BOOLEAN, 8, TFS(&isup_inband_information_ind_value), A_8BIT_MASK,
5225                         "", HFILL }},
5226
5227                 { &hf_isup_call_diversion_may_occur_ind,
5228                         { "Call diversion may occur indicator",  "isup.call_diversion_may_occur_ind",
5229                         FT_BOOLEAN, 8, TFS(&isup_call_diversion_may_occur_ind_value), B_8BIT_MASK,
5230                         "", HFILL }},
5231
5232                 { &hf_isup_mlpp_user_ind,
5233                         { "MLPP user indicator",  "isup.mlpp_user",
5234                         FT_BOOLEAN, 8, TFS(&isup_MLPP_user_ind_value), D_8BIT_MASK,
5235                         "", HFILL }},
5236
5237                 { &hf_isup_access_delivery_ind,
5238                         { "Access delivery indicator",  "isup.access_delivery_ind",
5239                         FT_BOOLEAN, 8, TFS(&isup_access_delivery_ind_value), A_8BIT_MASK,
5240                         "", HFILL }},
5241
5242                 { &hf_isup_transmission_medium_requirement_prime,
5243                         { "Transmission medium requirement prime",  "isup.transmission_medium_requirement_prime",
5244                         FT_UINT8, BASE_DEC, VALS(isup_transmission_medium_requirement_prime_value), 0x0,
5245                         "", HFILL }},
5246
5247                 { &hf_isup_loop_prevention_response_ind,
5248                         { "Response indicator",  "isup.loop_prevention_response_ind",
5249                         FT_UINT8, BASE_DEC, VALS(isup_loop_prevention_response_ind_value), CB_8BIT_MASK,
5250                         "", HFILL }},
5251
5252                 { &hf_isup_temporary_alternative_routing_ind,
5253                         { "Temporary alternative routing indicator",  "isup.temporary_alternative_routing_ind",
5254                         FT_BOOLEAN, 8, TFS(&isup_temporary_alternative_routing_ind_value), A_8BIT_MASK,
5255                         "", HFILL }},
5256
5257                 { &hf_isup_extension_ind,
5258                         { "Extension indicator",  "isup.extension_ind",
5259                         FT_BOOLEAN, 8, TFS(&isup_extension_ind_value), H_8BIT_MASK,
5260                         "", HFILL }},
5261
5262                 { &hf_isup_call_to_be_diverted_ind,
5263                         { "Call to be diverted indicator",  "isup.call_to_be_diverted_ind",
5264                         FT_UINT8, BASE_DEC, VALS(isup_call_to_be_diverted_ind_value), BA_8BIT_MASK,
5265                         "", HFILL }},
5266
5267                 { &hf_isup_call_to_be_offered_ind,
5268                         { "Call to be offered indicator",  "isup.call_to_be_offered_ind",
5269                         FT_UINT8, BASE_DEC, VALS(isup_call_to_be_offered_ind_value), BA_8BIT_MASK,
5270                         "", HFILL }},
5271
5272                 { &hf_isup_conference_acceptance_ind,
5273                         { "Conference acceptance indicator",  "isup.conference_acceptance_ind",
5274                         FT_UINT8, BASE_DEC, VALS(isup_conference_acceptance_ind_value), BA_8BIT_MASK,
5275                         "", HFILL }},
5276
5277                 { &hf_isup_transit_at_intermediate_exchange_ind,
5278                         { "Transit at intermediate exchange indicator", "isup.transit_at_intermediate_exchange_ind",
5279                         FT_BOOLEAN, 16, TFS(&isup_transit_at_intermediate_exchange_ind_value), A_8BIT_MASK,
5280                         "", HFILL }},
5281
5282                 { &hf_isup_Release_call_ind,
5283                         { "Release call indicator", "isup.Release_call_ind",
5284                         FT_BOOLEAN, 16, TFS(&isup_Release_call_indicator_value), B_8BIT_MASK,
5285                         "", HFILL }},
5286
5287                 { &hf_isup_Send_notification_ind,
5288                         { "Send notification indicator", "isup.Send_notification_ind",
5289                         FT_BOOLEAN, 16, TFS(&isup_Send_notification_ind_value),C_8BIT_MASK,
5290                         "", HFILL }},
5291
5292                 { &hf_isup_Discard_message_ind_value,
5293                         { "Discard message indicator","isup.Discard_message_ind_value",
5294                         FT_BOOLEAN, 16, TFS(&isup_Discard_message_ind_value), D_8BIT_MASK,
5295                         "", HFILL }},
5296
5297                 { &hf_isup_Discard_parameter_ind,               
5298                         { "Discard parameter indicator","isup.Discard_parameter_ind",
5299                         FT_BOOLEAN, 16, TFS(&isup_Discard_parameter_ind_value), E_8BIT_MASK,
5300                         "", HFILL }},
5301
5302                 { &hf_isup_Pass_on_not_possible_indicator,
5303                         { "Pass on not possible indicator",  "isup_Pass_on_not_possible_ind",
5304                         FT_UINT8, BASE_HEX, VALS(isup_Pass_on_not_possible_indicator_vals),GF_8BIT_MASK,
5305                         "", HFILL }},
5306
5307                 { &hf_isup_Broadband_narrowband_interworking_ind,
5308                         { "Broadband narrowband interworking indicator Bits JF",  "isup_Pass_on_not_possible_ind",
5309                         FT_UINT8, BASE_HEX, VALS(ISUP_Broadband_narrowband_interworking_indicator_vals),BA_8BIT_MASK,
5310                         "", HFILL }},
5311
5312                 { &hf_isup_app_cont_ident,
5313                         { "Application context identifier",  "isup.app_context_identifier",
5314                         FT_UINT8, BASE_DEC, VALS(isup_application_transport_parameter_value),0x0,
5315                         "", HFILL }},
5316
5317                 { &hf_isup_app_Release_call_ind, 
5318                         { "Release call indicator (RCI)",  "isup.app_Release_call_ indicator",
5319                         FT_BOOLEAN, 8, TFS(&isup_Release_call_indicator_value), A_8BIT_MASK,
5320                         "", HFILL }},
5321
5322                 { &hf_isup_app_Send_notification_ind, 
5323                         { "Send notification indicator (SNI)",  "isup.app_Send_notification_ind",
5324                         FT_BOOLEAN, 8, TFS(&isup_Send_notification_ind_value), B_8BIT_MASK,
5325                         "", HFILL }},
5326
5327                 { &hf_isup_apm_segmentation_ind,
5328                         { "APM segmentation indicator",  "isup.apm_segmentation_ind",
5329                         FT_UINT8, BASE_DEC, VALS(isup_APM_segmentation_ind_value), FEDCBA_8BIT_MASK,
5330                         "", HFILL }},
5331
5332                 { &hf_isup_apm_si_ind, 
5333                         { "Sequence indicator (SI)",  "isup.APM_Sequence_ind",
5334                         FT_BOOLEAN, 8, TFS(&isup_Sequence_ind_value), G_8BIT_MASK,
5335                         "", HFILL }},
5336                 { &hf_bat_ase_identifier,
5337                         { "BAT ASE Identifiers",  "bicc.bat_ase_identifier",
5338                         FT_UINT8, BASE_HEX, VALS(bat_ase_list_of_Identifiers_vals),0x0, 
5339                         "", HFILL }},
5340   
5341                 { &hf_length_indicator,
5342                         { "BAT ASE Element length indicator",  "bicc.bat_ase_length_indicator",
5343                         FT_UINT8, BASE_DEC, NULL,0x0,
5344                         "", HFILL }},
5345
5346                 { &hf_Action_Indicator,
5347                         { "BAT ASE action indicator field",  "bicc.bat_ase_bat_ase_action_indicator_field",
5348                         FT_UINT8, BASE_HEX, VALS(bat_ase_action_indicator_field_vals),0x00,     
5349                         "", HFILL }},
5350
5351                 { &hf_Instruction_ind_for_general_action,
5352                         { "BAT ASE Instruction indicator for general action",  "bicc.bat_ase_Instruction_ind_for_general_action",
5353                         FT_UINT8, BASE_HEX, VALS(Instruction_indicator_for_general_action_vals),0x03,   
5354                         "", HFILL }},
5355
5356                 { &hf_Send_notification_ind_for_general_action, 
5357                         { "Send notification indicator for general action",  "bicc.bat_ase_Send_notification_ind_for_general_action",
5358                         FT_BOOLEAN, 8, TFS(&isup_Send_notification_ind_value), 0x04,
5359                         "", HFILL }},
5360
5361                 { &hf_Instruction_ind_for_pass_on_not_possible, 
5362                         { "Instruction ind for pass-on not possible",  "bicc.bat_ase_Instruction_ind_for_pass_on_not_possible",
5363                         FT_UINT8, BASE_HEX, VALS(Instruction_indicator_for_pass_on_not_possible_vals),0x30,     
5364                         "", HFILL }},
5365
5366                 { &hf_Send_notification_ind_for_pass_on_not_possible, 
5367                         { "Send notification indication for pass-on not possible",  "bicc.bat_ase_Send_notification_ind_for_pass_on_not_possible",
5368                         FT_BOOLEAN, 8, TFS(&isup_Send_notification_ind_value), 0x40,
5369                         "", HFILL }},
5370
5371                 { &hf_BCTP_Version_Indicator,
5372                         { "BCTP Version Indicator",  "bicc.bat_ase_BCTP_Version_Indicator",
5373                         FT_UINT8, BASE_DEC, NULL,0x1f,
5374                         "", HFILL }},
5375         
5376                 { &hf_BVEI,
5377                         { "BCTP Version Error Indicator",  "bicc.bat_ase_BCTP_BVEI",
5378                         FT_BOOLEAN, 8, TFS(&BCTP_BVEI_value), 0x40,
5379                         "", HFILL }},
5380
5381                 { &hf_Tunnelled_Protocol_Indicator,
5382                         { "Tunnelled Protocol Indicator",  "bicc.bat_ase_BCTP_Tunnelled_Protocol_Indicator",
5383                         FT_UINT8, BASE_DEC, VALS(BCTP_Tunnelled_Protocol_Indicator_vals),0x3f,  
5384                         "", HFILL }},
5385
5386                 { &hf_TPEI,
5387                         { "Tunnelled Protocol Error Indicator value",  "bicc.bat_ase_BCTP_tpei",
5388                         FT_BOOLEAN, 8, TFS(&BCTP_TPEI_value), 0x40,
5389                         "", HFILL }},
5390
5391                 { &hf_bnci,
5392                         { "Backbone Network Connection Identifier (BNCI)", "bat_ase.bnci",
5393                         FT_UINT32, BASE_HEX, NULL, 0x0,
5394                           "", HFILL }},
5395
5396                 { &hf_characteristics,
5397                         { "Backbone network connection characteristics", "bat_ase.char",
5398                         FT_UINT8, BASE_HEX, VALS(bearer_network_connection_characteristics_vals),0x0,   
5399                           "", HFILL }},
5400
5401                 { &hf_isup_app_cont_ident,
5402                         { "Application context identifier",  "isup.app_context_identifier",
5403                         FT_UINT8, BASE_DEC, VALS(isup_application_transport_parameter_value),0x0,
5404                         "", HFILL }},
5405
5406                 { &hf_Organization_Identifier,
5407                         { "Organization identifier subfield ",  "bat_ase.organization_identifier_subfield",
5408                         FT_UINT8, BASE_DEC, VALS(bat_ase_organization_identifier_subfield_vals),0x0,
5409                         "", HFILL }},
5410
5411                 { &hf_codec_type,
5412                         { "ITU-T codec type subfield",  "bat_ase.ITU_T_codec_type_subfield",
5413                         FT_UINT8, BASE_HEX, VALS(ITU_T_codec_type_subfield_vals),0x0,
5414                         "", HFILL }},
5415
5416                 { &hf_bearer_control_tunneling,
5417                         { "Bearer control tunneling",  "bat_ase.bearer_control_tunneling",
5418                         FT_BOOLEAN, 8, TFS(&Bearer_Control_Tunnelling_ind_value),0x01,
5419                         "", HFILL }},
5420
5421                 { &hf_Local_BCU_ID,
5422                         { "Local BCU ID",  "bat_ase.Local_BCU_ID",
5423                         FT_UINT32, BASE_HEX, NULL, 0x0,
5424                           "", HFILL }},
5425
5426                 { &hf_late_cut_trough_cap_ind,
5427                         { "Late Cut-through capability indicator",  "bat_ase.late_cut_trough_cap_ind",
5428                         FT_BOOLEAN, 8, TFS(&late_cut_trough_cap_ind_value),0x01,
5429                         "", HFILL }},
5430
5431                 { &hf_bat_ase_signal,
5432                         { "Q.765.5 - Signal Type",  "bat_ase.signal_type",
5433                         FT_UINT8, BASE_HEX, VALS(BAt_ASE_Signal_Type_vals),0x0,
5434                         "", HFILL }},
5435
5436                 { &hf_bat_ase_duration,
5437                         { "Duration in ms",  "bat_ase.signal_type",
5438                         FT_UINT16, BASE_DEC, NULL,0x0,
5439                         "", HFILL }},
5440                 { &hf_bat_ase_bearer_redir_ind,
5441                         { "Redirection Indicator",  "bat_ase_bearer_redir_ind",
5442                         FT_UINT8, BASE_HEX, VALS(Bearer_Redirection_Indicator_vals),0x0,
5443                         "", HFILL }},
5444
5445
5446         };
5447
5448 /* Setup protocol subtree array */
5449         static gint *ett[] = {
5450                 &ett_isup,
5451                 &ett_isup_parameter,
5452                 &ett_isup_address_digits,
5453                 &ett_isup_pass_along_message,
5454                 &ett_isup_circuit_state_ind,
5455                 &ett_bat_ase,
5456                 &ett_bat_ase_element
5457         };
5458
5459 /* Register the protocol name and description */
5460         proto_isup = proto_register_protocol("ISDN User Part",
5461             "ISUP", "isup");
5462
5463 /* Required function calls to register the header fields and subtrees used */
5464         proto_register_field_array(proto_isup, hf, array_length(hf));
5465         proto_register_subtree_array(ett, array_length(ett));
5466 }
5467
5468
5469 /* ------------------------------------------------------------------ */
5470 /* Register isup with the sub-laying MTP L3 dissector */
5471 void
5472 proto_reg_handoff_isup(void)
5473 {
5474   dissector_handle_t isup_handle;
5475  
5476   isup_handle = create_dissector_handle(dissect_isup, proto_isup);
5477   dissector_add("mtp3.service_indicator", MTP3_ISUP_SERVICE_INDICATOR, isup_handle);
5478   dissector_add("m3ua.protocol_data_si", MTP3_ISUP_SERVICE_INDICATOR, isup_handle);
5479
5480 }
5481
5482 void
5483 proto_register_bicc(void)
5484 {
5485 /* Setup list of header fields  See Section 1.6.1 for details*/
5486         static hf_register_info hf[] = {
5487                 { &hf_bicc_cic,
5488                         { "Call identification Code (CIC)",           "bicc.cic",
5489                         FT_UINT32, BASE_HEX, NULL, 0x0,
5490                           "", HFILL }},
5491         };
5492
5493 /* Setup protocol subtree array */
5494         static gint *ett[] = {
5495                 &ett_bicc
5496         };
5497         proto_bicc = proto_register_protocol("Bearer Independent Call Control ",
5498             "BICC", "bicc"); 
5499 /* Required function calls to register the header fields and subtrees used */
5500         proto_register_field_array(proto_bicc, hf, array_length(hf));
5501         proto_register_subtree_array(ett, array_length(ett));
5502 }
5503
5504 /* Register isup with the sub-laying MTP L3 dissector */
5505 void
5506 proto_reg_handoff_bicc(void)
5507 {
5508   dissector_handle_t bicc_handle;
5509   sdp_handle = find_dissector("sdp");
5510
5511   bicc_handle = create_dissector_handle(dissect_bicc, proto_bicc);
5512   dissector_add("mtp3.service_indicator", MTP3_BICC_SERVICE_INDICATOR, bicc_handle);
5513   dissector_add("m3ua.protocol_data_si", MTP3_BICC_SERVICE_INDICATOR, bicc_handle);
5514 }