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