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