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