Include files from the "epan" directory and subdirectories thereof with
[obnox/wireshark/wip.git] / packet-isup.c
1 /* packet-ISUP.c
2  * Routines for ISUP dissection
3  * Copyright 2001, Martina Obermeier <martina.obermeier@icn.siemens.de>
4  *
5  * $Id: packet-isup.c,v 1.8 2002/01/21 07:36:36 guy Exp $
6  *
7  * Ethereal - Network traffic analyzer
8  * By Gerald Combs <gerald@ethereal.com>
9  * Copyright 1998 Gerald Combs
10  *
11  * Copied from README.developer
12  * 
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  * 
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  * 
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26  */
27
28 #ifdef HAVE_CONFIG_H
29 # include "config.h"
30 #endif
31
32 #include <stdio.h>
33 #include <stdlib.h>
34 #include <string.h>
35
36 #ifdef HAVE_SYS_TYPES_H
37 # include <sys/types.h>
38 #endif
39
40 #ifdef HAVE_NETINET_IN_H
41 # include <netinet/in.h>
42 #endif
43
44 #include <glib.h>
45
46 #ifdef NEED_SNPRINTF_H
47 # include "snprintf.h"
48 #endif
49
50 #include <epan/packet.h>
51 #include "packet-ip.h"
52
53 #define MTP3_ISUP_SERVICE_INDICATOR     5
54 #define ASCII_NUMBER_DELTA              0x30
55 #define ASCII_LETTER_DELTA              0x37
56
57 /* Definition of protocol field values und lengths */
58
59 /* Definition of Message Types */
60 #define MESSAGE_TYPE_INITIAL_ADDR       1
61 #define MESSAGE_TYPE_SUBSEQ_ADDR        2
62 #define MESSAGE_TYPE_INFO_REQ           3
63 #define MESSAGE_TYPE_INFO               4
64 #define MESSAGE_TYPE_CONTINUITY         5
65 #define MESSAGE_TYPE_ADDR_CMPL          6
66 #define MESSAGE_TYPE_CONNECT            7
67 #define MESSAGE_TYPE_FORW_TRANS         8
68 #define MESSAGE_TYPE_ANSWER             9
69 #define MESSAGE_TYPE_RELEASE           12 
70 #define MESSAGE_TYPE_SUSPEND           13
71 #define MESSAGE_TYPE_RESUME            14 
72 #define MESSAGE_TYPE_REL_CMPL          16
73 #define MESSAGE_TYPE_CONT_CHECK_REQ    17
74 #define MESSAGE_TYPE_RESET_CIRCUIT     18
75 #define MESSAGE_TYPE_BLOCKING          19
76 #define MESSAGE_TYPE_UNBLOCKING        20
77 #define MESSAGE_TYPE_BLOCK_ACK         21
78 #define MESSAGE_TYPE_UNBLOCK_ACK       22
79 #define MESSAGE_TYPE_CIRC_GRP_RST      23
80 #define MESSAGE_TYPE_CIRC_GRP_BLCK     24
81 #define MESSAGE_TYPE_CIRC_GRP_UNBL     25
82 #define MESSAGE_TYPE_CIRC_GRP_BL_ACK   26
83 #define MESSAGE_TYPE_CIRC_GRP_UNBL_ACK 27 
84 #define MESSAGE_TYPE_FACILITY_REQ      31
85 #define MESSAGE_TYPE_FACILITY_ACC      32
86 #define MESSAGE_TYPE_FACILITY_REJ      33
87 #define MESSAGE_TYPE_LOOP_BACK_ACK     36
88 #define MESSAGE_TYPE_PASS_ALONG        40
89 #define MESSAGE_TYPE_CIRC_GRP_RST_ACK  41
90 #define MESSAGE_TYPE_CIRC_GRP_QRY      42
91 #define MESSAGE_TYPE_CIRC_GRP_QRY_RSP  43
92 #define MESSAGE_TYPE_CALL_PROGRSS      44
93 #define MESSAGE_TYPE_USER2USER_INFO    45
94 #define MESSAGE_TYPE_UNEQUIPPED_CIC    46
95 #define MESSAGE_TYPE_CONFUSION         47
96 #define MESSAGE_TYPE_OVERLOAD          48
97 #define MESSAGE_TYPE_CHARGE_INFO       49
98 #define MESSAGE_TYPE_NETW_RESRC_MGMT   50
99 #define MESSAGE_TYPE_FACILITY          51
100 #define MESSAGE_TYPE_USER_PART_TEST    52
101 #define MESSAGE_TYPE_USER_PART_AVAIL   53
102 #define MESSAGE_TYPE_IDENT_REQ         54
103 #define MESSAGE_TYPE_IDENT_RSP         55 
104 #define MESSAGE_TYPE_SEGMENTATION      56
105 #define MESSAGE_TYPE_LOOP_PREVENTION   64
106
107 static const value_string isup_message_type_value[] = {
108   { MESSAGE_TYPE_INITIAL_ADDR,          "Initial address"},
109   { MESSAGE_TYPE_SUBSEQ_ADDR,           "Subsequent address"},
110   { MESSAGE_TYPE_INFO_REQ,              "Information request (national use)"},
111   { MESSAGE_TYPE_INFO,                  "Information (national use)"},
112   { MESSAGE_TYPE_CONTINUITY,            "Continuity"},
113   { MESSAGE_TYPE_ADDR_CMPL,             "Address complete"},
114   { MESSAGE_TYPE_CONNECT,               "Connect"},
115   { MESSAGE_TYPE_FORW_TRANS,            "Forward transfer"},
116   { MESSAGE_TYPE_ANSWER,                "Answer"},
117   { MESSAGE_TYPE_RELEASE,               "Release"},
118   { MESSAGE_TYPE_SUSPEND,               "Suspend"},
119   { MESSAGE_TYPE_RESUME,                "Resume"},
120   { MESSAGE_TYPE_REL_CMPL,              "Release complete"},
121   { MESSAGE_TYPE_CONT_CHECK_REQ,        "Continuity check request"},
122   { MESSAGE_TYPE_RESET_CIRCUIT,         "Reset Circuit"},
123   { MESSAGE_TYPE_BLOCKING,              "Blocking"},
124   { MESSAGE_TYPE_UNBLOCKING,            "Unblocking"},
125   { MESSAGE_TYPE_BLOCK_ACK,             "Blocking acknowledgement"},
126   { MESSAGE_TYPE_UNBLOCK_ACK,           "Unblocking acknowledgment"},
127   { MESSAGE_TYPE_CIRC_GRP_RST,          "Circuit group reset"},
128   { MESSAGE_TYPE_CIRC_GRP_BLCK,         "Circuit group blocking"},
129   { MESSAGE_TYPE_CIRC_GRP_UNBL,         "Circuit group unblocking"},
130   { MESSAGE_TYPE_CIRC_GRP_BL_ACK,       "Circuit group blocking acknowledgement"},
131   { MESSAGE_TYPE_CIRC_GRP_UNBL_ACK,     "Circuit group unblocking acknowledgement"},
132   { MESSAGE_TYPE_FACILITY_REQ,          "Facility request"},
133   { MESSAGE_TYPE_FACILITY_ACC,          "Facility accepted"},
134   { MESSAGE_TYPE_FACILITY_REJ,          "Facility reject"},
135   { MESSAGE_TYPE_LOOP_BACK_ACK,         "Loop back acknowledgement (national use)"},
136   { MESSAGE_TYPE_PASS_ALONG,            "Pass-along (national use)"},
137   { MESSAGE_TYPE_CIRC_GRP_RST_ACK,      "Circuit group reset acknowledgement"},
138   { MESSAGE_TYPE_CIRC_GRP_QRY,          "Circuit group query (national use)"},
139   { MESSAGE_TYPE_CIRC_GRP_QRY_RSP,      "Circuit group query response (national use)"},
140   { MESSAGE_TYPE_CALL_PROGRSS,          "Call progress"},
141   { MESSAGE_TYPE_USER2USER_INFO,        "User-to-user information"},
142   { MESSAGE_TYPE_UNEQUIPPED_CIC,        "Unequipped CIC (national use)"},
143   { MESSAGE_TYPE_CONFUSION,             "Confusion"},
144   { MESSAGE_TYPE_OVERLOAD,              "Overload (national use)"},
145   { MESSAGE_TYPE_CHARGE_INFO,           "Charge information (national use)"},
146   { MESSAGE_TYPE_NETW_RESRC_MGMT,       "Network resource management"},
147   { MESSAGE_TYPE_FACILITY,              "Facility"},
148   { MESSAGE_TYPE_USER_PART_TEST,        "User part test"},
149   { MESSAGE_TYPE_USER_PART_AVAIL,       "User part available"},
150   { MESSAGE_TYPE_IDENT_REQ,             "Identification request"},
151   { MESSAGE_TYPE_IDENT_RSP,             "Identification response"},
152   { MESSAGE_TYPE_SEGMENTATION,          "Segmentation"},
153   { MESSAGE_TYPE_LOOP_PREVENTION,       "Loop prevention"},
154   { 0,                                  NULL}};
155
156 /* Definition of Parameter Types */
157 #define PARAM_TYPE_END_OF_OPT_PARAMS      0
158 #define PARAM_TYPE_CALL_REF               1
159 #define PARAM_TYPE_TRANSM_MEDIUM_REQU     2
160 #define PARAM_TYPE_ACC_TRANSP             3
161 #define PARAM_TYPE_CALLED_PARTY_NR        4
162 #define PARAM_TYPE_SUBSQT_NR              5
163 #define PARAM_TYPE_NATURE_OF_CONN_IND     6
164 #define PARAM_TYPE_FORW_CALL_IND          7
165 #define PARAM_TYPE_OPT_FORW_CALL_IND      8
166 #define PARAM_TYPE_CALLING_PRTY_CATEG     9
167 #define PARAM_TYPE_CALLING_PARTY_NR      10
168 #define PARAM_TYPE_REDIRECTING_NR        11
169 #define PARAM_TYPE_REDIRECTION_NR        12
170 #define PARAM_TYPE_CONNECTION_REQ        13
171 #define PARAM_TYPE_INFO_REQ_IND          14
172 #define PARAM_TYPE_INFO_IND              15
173 #define PARAM_TYPE_CONTINUITY_IND        16
174 #define PARAM_TYPE_BACKW_CALL_IND        17
175 #define PARAM_TYPE_CAUSE_INDICATORS      18
176 #define PARAM_TYPE_REDIRECTION_INFO      19
177 #define PARAM_TYPE_CIRC_GRP_SV_MSG_TYPE  21
178 #define PARAM_TYPE_RANGE_AND_STATUS      22
179 #define PARAM_TYPE_FACILITY_IND          24
180 #define PARAM_TYPE_CLSD_USR_GRP_ILOCK_CD 26
181 #define PARAM_TYPE_USER_SERVICE_INFO     29
182 #define PARAM_TYPE_SIGNALLING_POINT_CODE 30
183 #define PARAM_TYPE_USER_TO_USER_INFO     32
184 #define PARAM_TYPE_CONNECTED_NR          33
185 #define PARAM_TYPE_SUSP_RESUME_IND       34
186 #define PARAM_TYPE_TRANSIT_NETW_SELECT   35
187 #define PARAM_TYPE_EVENT_INFO            36
188 #define PARAM_TYPE_CIRC_ASSIGN_MAP       37
189 #define PARAM_TYPE_CIRC_STATE_IND        38
190 #define PARAM_TYPE_AUTO_CONG_LEVEL       39
191 #define PARAM_TYPE_ORIG_CALLED_NR        40
192 #define PARAM_TYPE_OPT_BACKW_CALL_IND    41
193 #define PARAM_TYPE_USER_TO_USER_IND      42
194 #define PARAM_TYPE_ORIG_ISC_POINT_CODE   43
195 #define PARAM_TYPE_GENERIC_NOTIF_IND     44
196 #define PARAM_TYPE_CALL_HIST_INFO        45 
197 #define PARAM_TYPE_ACC_DELIV_INFO        46
198 #define PARAM_TYPE_NETW_SPECIFIC_FACLTY  47
199 #define PARAM_TYPE_USER_SERVICE_INFO_PR  48
200 #define PARAM_TYPE_PROPAG_DELAY_COUNTER  49
201 #define PARAM_TYPE_REMOTE_OPERATIONS     50
202 #define PARAM_TYPE_SERVICE_ACTIVATION    51
203 #define PARAM_TYPE_USER_TELESERV_INFO    52
204 #define PARAM_TYPE_TRANSM_MEDIUM_USED    53
205 #define PARAM_TYPE_CALL_DIV_INFO         54
206 #define PARAM_TYPE_ECHO_CTRL_INFO        55
207 #define PARAM_TYPE_MSG_COMPAT_INFO       56
208 #define PARAM_TYPE_PARAM_COMPAT_INFO     57
209 #define PARAM_TYPE_MLPP_PRECEDENCE       58  
210 #define PARAM_TYPE_MCID_REQ_IND          59
211 #define PARAM_TYPE_MCID_RSP_IND          60
212 #define PARAM_TYPE_HOP_COUNTER           61
213 #define PARAM_TYPE_TRANSM_MEDIUM_RQUR_PR 62
214 #define PARAM_TYPE_LOCATION_NR           63
215 #define PARAM_TYPE_REDIR_NR_RSTRCT       64
216 #define PARAM_TYPE_CALL_TRANS_REF        67
217 #define PARAM_TYPE_LOOP_PREV_IND         68
218 #define PARAM_TYPE_CALL_TRANS_NR         69
219 #define PARAM_TYPE_CCSS                  75
220 #define PARAM_TYPE_FORW_GVNS             76
221 #define PARAM_TYPE_BACKW_GVNS            77
222 #define PARAM_TYPE_REDIRECT_CAPAB        78
223 #define PARAM_TYPE_NETW_MGMT_CTRL        91
224 #define PARAM_TYPE_CORRELATION_ID       101
225 #define PARAM_TYPE_SCF_ID               102
226 #define PARAM_TYPE_CALL_DIV_TREAT_IND   110
227 #define PARAM_TYPE_CALLED_IN_NR         111
228 #define PARAM_TYPE_CALL_OFF_TREAT_IND   112
229 #define PARAM_TYPE_CHARGED_PARTY_IDENT  113
230 #define PARAM_TYPE_CONF_TREAT_IND       114
231 #define PARAM_TYPE_DISPLAY_INFO         115
232 #define PARAM_TYPE_UID_ACTION_IND       116
233 #define PARAM_TYPE_UID_CAPAB_IND        117
234 #define PARAM_TYPE_REDIRECT_COUNTER     119
235 #define PARAM_TYPE_COLLECT_CALL_REQ     121
236 #define PARAM_TYPE_GENERIC_NR           192
237 #define PARAM_TYPE_GENERIC_DIGITS       193
238
239 static const value_string isup_parameter_type_value[] = {
240 { PARAM_TYPE_END_OF_OPT_PARAMS,        "End of optional parameters"},
241   { PARAM_TYPE_CALL_REF,               "Call Reference (national use)"},
242   { PARAM_TYPE_TRANSM_MEDIUM_REQU,     "Transmission medium requirement"},
243   { PARAM_TYPE_ACC_TRANSP,             "Access transport"},
244   { PARAM_TYPE_CALLED_PARTY_NR,        "Called party number"},
245   { PARAM_TYPE_SUBSQT_NR,              "Subsequent number"},
246   { PARAM_TYPE_NATURE_OF_CONN_IND,     "Nature of connection indicators"},
247   { PARAM_TYPE_FORW_CALL_IND,          "Forward call indicators"},
248   { PARAM_TYPE_OPT_FORW_CALL_IND,      "Optional forward call indicators"},
249   { PARAM_TYPE_CALLING_PRTY_CATEG,     "Calling party's category"},
250   { PARAM_TYPE_CALLING_PARTY_NR,       "Calling party number"},
251   { PARAM_TYPE_REDIRECTING_NR,         "Redirecting number"},
252   { PARAM_TYPE_REDIRECTION_NR,         "Redirection number"},
253   { PARAM_TYPE_CONNECTION_REQ,         "Connection request"},
254   { PARAM_TYPE_INFO_REQ_IND,           "Information request indicators (national use)"},
255   { PARAM_TYPE_INFO_IND,               "Information indicators (national use)"},
256   { PARAM_TYPE_CONTINUITY_IND,         "Continuity request"},
257   { PARAM_TYPE_BACKW_CALL_IND,         "Backward call indicators"},
258   { PARAM_TYPE_CAUSE_INDICATORS,       "Cause indicators"},
259   { PARAM_TYPE_REDIRECTION_INFO,       "Redirection information"},
260   { PARAM_TYPE_CIRC_GRP_SV_MSG_TYPE,   "Circuit group supervision message type"},
261   { PARAM_TYPE_RANGE_AND_STATUS,       "Range and Status"},
262   { PARAM_TYPE_FACILITY_IND,           "Facility indicator"},
263   { PARAM_TYPE_CLSD_USR_GRP_ILOCK_CD,  "Closed user group interlock code"},
264   { PARAM_TYPE_USER_SERVICE_INFO,      "User service information"},
265   { PARAM_TYPE_SIGNALLING_POINT_CODE,  "Signalling point code (national use)"},
266   { PARAM_TYPE_USER_TO_USER_INFO,      "User-to-user information"},
267   { PARAM_TYPE_CONNECTED_NR,           "Connected number"},
268   { PARAM_TYPE_SUSP_RESUME_IND,        "Suspend/Resume indicators"},
269   { PARAM_TYPE_TRANSIT_NETW_SELECT,    "Transit network selection (national use)"},
270   { PARAM_TYPE_EVENT_INFO,             "Event information"},
271   { PARAM_TYPE_CIRC_ASSIGN_MAP,        "Circuit assignment map"},
272   { PARAM_TYPE_CIRC_STATE_IND,         "Circuit state indicator (national use)"},
273   { PARAM_TYPE_AUTO_CONG_LEVEL,        "Automatic congestion level"},
274   { PARAM_TYPE_ORIG_CALLED_NR,         "Original called number"},
275   { PARAM_TYPE_OPT_BACKW_CALL_IND,     "Backward call indicators"},
276   { PARAM_TYPE_USER_TO_USER_IND,       "User-to-user indicators"},
277   { PARAM_TYPE_ORIG_ISC_POINT_CODE,    "Origination ISC point code"},
278   { PARAM_TYPE_GENERIC_NOTIF_IND,      "Generic notification indicator"},
279   { PARAM_TYPE_CALL_HIST_INFO,         "Call history information"},
280   { PARAM_TYPE_ACC_DELIV_INFO,         "Access delivery information"},
281   { PARAM_TYPE_NETW_SPECIFIC_FACLTY,   "Network specific facility (national use)"},
282   { PARAM_TYPE_USER_SERVICE_INFO_PR,   "User service information prime"},
283   { PARAM_TYPE_PROPAG_DELAY_COUNTER,   "Propagation delay counter"},
284   { PARAM_TYPE_REMOTE_OPERATIONS,      "Remote operations (national use)"},
285   { PARAM_TYPE_SERVICE_ACTIVATION,     "Service activation"},
286   { PARAM_TYPE_USER_TELESERV_INFO,     "User teleservice information"},
287   { PARAM_TYPE_TRANSM_MEDIUM_USED,     "Transmission medium used"},
288   { PARAM_TYPE_CALL_DIV_INFO,          "Call diversion information"},
289   { PARAM_TYPE_ECHO_CTRL_INFO,         "Echo control information"},
290   { PARAM_TYPE_MSG_COMPAT_INFO,        "Message compatibility information"},
291   { PARAM_TYPE_PARAM_COMPAT_INFO,      "Parameter compatibility information"},
292   { PARAM_TYPE_MLPP_PRECEDENCE,        "MLPP precedence"},
293   { PARAM_TYPE_MCID_REQ_IND,           "MCID request indicators"},
294   { PARAM_TYPE_MCID_RSP_IND,           "MCID response indicators"},
295   { PARAM_TYPE_HOP_COUNTER,            "Hop counter"},
296   { PARAM_TYPE_TRANSM_MEDIUM_RQUR_PR,  "Transmission medium requirement prime"},
297   { PARAM_TYPE_LOCATION_NR,            "Location number"},
298   { PARAM_TYPE_REDIR_NR_RSTRCT,        "Redirection number restriction"},
299   { PARAM_TYPE_CALL_TRANS_REF,         "Call transfer reference"},
300   { PARAM_TYPE_LOOP_PREV_IND,          "Loop prevention indicators"},
301   { PARAM_TYPE_CALL_TRANS_NR,          "Call transfer number"},
302   { PARAM_TYPE_CCSS,                   "CCSS"},
303   { PARAM_TYPE_FORW_GVNS,              "Forward GVNS"},
304   { PARAM_TYPE_BACKW_GVNS,             "Backward GVNS"},
305   { PARAM_TYPE_REDIRECT_CAPAB,         "Redirect capability (reserved for national use)"},
306   { PARAM_TYPE_NETW_MGMT_CTRL,         "Network management controls"},
307   { PARAM_TYPE_CORRELATION_ID,         "Correlation id"},
308   { PARAM_TYPE_SCF_ID,                 "SCF id"},
309   { PARAM_TYPE_CALL_DIV_TREAT_IND,     "Call diversion treatment indicators"},
310   { PARAM_TYPE_CALLED_IN_NR,           "Called IN number"},
311   { PARAM_TYPE_CALL_OFF_TREAT_IND,     "Call offering treatment indicators"},
312   { PARAM_TYPE_CHARGED_PARTY_IDENT,    "Charged party identification (national use)"},
313   { PARAM_TYPE_CONF_TREAT_IND,         "Conference treatment indicators"},
314   { PARAM_TYPE_DISPLAY_INFO,           "Display information"},
315   { PARAM_TYPE_UID_ACTION_IND,         "UID action indicators"},
316   { PARAM_TYPE_UID_CAPAB_IND,          "UID capability indicators"},
317   { PARAM_TYPE_REDIRECT_COUNTER,       "Redirect counter (reserved for national use)"},
318   { PARAM_TYPE_COLLECT_CALL_REQ,       "Collect call request"},
319   { PARAM_TYPE_GENERIC_NR,             "Generic number"},
320   { PARAM_TYPE_GENERIC_DIGITS,         "Generic digits (national use)"},
321   { 0,                                 NULL}};
322
323
324 #define CIC_LENGTH                             2
325 #define MESSAGE_TYPE_LENGTH                    1
326 #define COMMON_HEADER_LENGTH                   (CIC_LENGTH + MESSAGE_TYPE_LENGTH)
327
328 #define MAXLENGTH                            0xFF /* since length field is 8 Bit long - used in number dissectors;
329                                                      max. number of address digits is 15 digits, but MAXLENGTH used 
330                                                      to avoid runtime errors */
331
332 #define PARAMETER_TYPE_LENGTH                  1
333 #define PARAMETER_POINTER_LENGTH               1
334 #define PARAMETER_LENGTH_IND_LENGTH            1
335
336 /* All following parameter length definitions are WITHOUT the parameter type byte and length indicator for optional parameters*/ 
337 #define PARAMETER_NAME_LENGTH                  1
338 #define PARAMETER_LENGTH_IND_LENGTH            1
339 #define ACCESS_DELIVERY_INFO_LENGTH            1
340 #define AUTO_CONGEST_LEVEL_LENGTH              1
341 #define BACKWARD_CALL_IND_LENGTH               2
342 #define BACKWARD_GVNS_LENGTH                   1
343 #define CALL_DIV_INFO_LENGTH                   1
344 #define CALL_DIV_TREATMENT_IND_LENGTH          1
345 #define CALL_HISTORY_INFO_LENGTH               2
346 #define CALL_OFFERING_TREATMENT_IND_LENGTH     1
347 #define CALL_REFERENCE_LENGTH                  5
348 #define CALL_TRANSFER_REF_LENGTH               1
349 #define CALLING_PRTYS_CATEGORY_LENGTH          1
350 #define CCSS_LENGTH                            1
351 #define CIRCUIT_ASSIGNMENT_MAP_LENGTH          5
352 #define CIRC_GRP_SV_MSG_TYPE_LENGTH            1
353 #define CLOSED_USR_GRP_INTERLOCK_CODE_LENGTH   4
354 #define COLLECT_CALL_REQUEST_LENGTH            1
355 #define CONFERENCE_TREATMENT_IND_LENGTH        1
356 #define CONNECTION_REQUEST_LENGTH              7
357 #define CONTINUITY_IND_LENGTH                  1
358 #define ECHO_CONTROL_INFO_LENGTH               1
359 #define END_OF_OPT_PART_LENGTH                 1
360 #define EVENT_INFO_LENGTH                      1
361 #define FACILITY_IND_LENGTH                    1
362 #define FORWARD_CALL_IND_LENGTH                2
363 #define GENERIC_NOTIFICATION_IND_LENGTH        1
364 #define HOP_COUNTER_LENGTH                     1
365 #define INFO_IND_LENGTH                        2
366 #define INFO_REQUEST_IND_LENGTH                2
367 #define LOOP_PREVENTION_IND_LENGTH             1
368 #define MCID_REQUEST_IND_LENGTH                1
369 #define MCID_RESPONSE_IND_LENGTH               1
370 #define MLPP_PRECEDENCE_LENGTH                 1
371 #define NATURE_OF_CONNECTION_IND_LENGTH        1
372 #define NETWORK_MANAGEMENT_CONTROLS_LENGTH     1
373 #define OPTIONAL_BACKWARD_CALL_IND_LENGTH      1
374 #define OPTIONAL_FORWARD_CALL_IND_LENGTH       1
375 #define ORIGINAL_ISC_POINT_CODE_LENGTH         2
376 #define PROPAGATION_DELAY_COUNT_LENGTH         2
377 #define REDIRECTION_NUMBER_LENGTH              2
378 #define REDIRECTION_INFO_LENGTH                2
379 #define REDIRECTION_NUMBER_RESTRICTION_LENGTH  1
380 #define SIGNALLING_POINT_CODE_LENGTH           2
381 #define SUSPEND_RESUME_IND_LENGTH              1
382 #define TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH 1
383 #define TRANSMISSION_MEDIUM_RQMT_PRIME_LENGTH  1
384 #define TRANSMISSION_MEDIUM_USED_LENGTH        1
385 #define UID_ACTION_IND_LENGTH                  1
386 #define UID_CAPABILITY_IND_LENGTH              1
387 #define USER_TELESERVICE_INFO_LENGTH           3
388 #define USER_TO_USER_IND_LENGTH                1
389 #define RANGE_LENGTH                           1
390
391 #define CALL_ID_LENGTH        3 /* for parameter Call Reference */
392 #define SPC_LENGTH            2 /* for parameter Call Reference, Connection request */
393 #define LOCAL_REF_LENGTH      3 /* for parameter Connection request */
394 #define PROTOCOL_CLASS_LENGTH 1 /* for parameter Connection request */
395 #define CREDIT_LENGTH         1 /* for parameter Connection request */
396
397 #define CIC_OFFSET            0
398
399 #define NO_SATELLITE_CIRCUIT_IN_CONNECTION   0
400 #define ONE_SATELLITE_CIRCUIT_IN_CONNECTION  1
401 #define TWO_SATELLITE_CIRCUIT_IN_CONNECTION  2
402 static const value_string isup_satellite_ind_value[] = {
403   { NO_SATELLITE_CIRCUIT_IN_CONNECTION,          "No Satellite circuit in connection"},
404   { ONE_SATELLITE_CIRCUIT_IN_CONNECTION,         "One Satellite circuit in connection"},  
405   { TWO_SATELLITE_CIRCUIT_IN_CONNECTION,         "Two Satellite circuits in connection"},
406   { 0,                                 NULL}};
407
408 #define CONTINUITY_CHECK_NOT_REQUIRED           0
409 #define CONTINUITY_CHECK_REQUIRED               1
410 #define CONTINUITY_CHECK_ON_A_PREVIOUS_CIRCUIT  2
411 static const value_string isup_continuity_check_ind_value[] = {
412   { CONTINUITY_CHECK_NOT_REQUIRED,               "Continuity check not required"},
413   { CONTINUITY_CHECK_REQUIRED,                   "Continuity check required on this circuit"},  
414   { CONTINUITY_CHECK_ON_A_PREVIOUS_CIRCUIT ,     "Continuity check performed on a previous circuit"},
415   { 0,                                 NULL}};
416
417 static const true_false_string isup_echo_control_device_ind_value = {
418   "Echo control device included",
419   "Echo control device not included"
420 };
421
422 static const true_false_string isup_natnl_inatnl_call_ind_value = {
423   "Call to be treated as international call",
424   "Call to be treated as national call"
425 };
426
427 #define NO_END_TO_END_METHOD_AVAILABLE       0
428 #define PASS_ALONG_METHOD_AVAILABLE          1
429 #define SCCP_METHOD_AVAILABLE                2
430 #define PASS_ALONG_AND_SCCP_METHOD_AVAILABLE 3
431 static const value_string isup_end_to_end_method_ind_value[] = {
432   { NO_END_TO_END_METHOD_AVAILABLE,          "No End-to-end method available (only link-by-link method available)"},
433   { PASS_ALONG_METHOD_AVAILABLE,             "Pass-along method available (national use)"},  
434   { SCCP_METHOD_AVAILABLE,                   "SCCP method available"},
435   { PASS_ALONG_AND_SCCP_METHOD_AVAILABLE,    "pass-along and SCCP method available (national use)"},
436   { 0,                                 NULL}};
437
438 static const true_false_string isup_interworking_ind_value = {
439   "interworking encountered",
440   "no interworking encountered (No.7 signalling all the way)"
441 };
442
443 static const true_false_string isup_end_to_end_info_ind_value = {
444   "end-to-end information available",
445   "no end-to-end information available"
446 };
447
448 static const true_false_string isup_ISDN_user_part_ind_value = {
449   "ISDN user part used all the way",
450   "ISDN user part not used all the way"
451 };
452
453 #define ISUP_PREFERED_ALL_THE_WAY               0
454 #define ISUP_NOT_REQUIRED_ALL_THE_WAY           1
455 #define ISUP_REQUIRED_ALL_WAY                   2
456 #define ISUP_ISDN_USER_PART_IND_SPARE           3
457 static const value_string isup_preferences_ind_value[] = {
458   { ISUP_PREFERED_ALL_THE_WAY,                   "ISDN user part prefered all the way"},
459   { ISUP_NOT_REQUIRED_ALL_THE_WAY,               "ISDN user part not required all the way"},  
460   { ISUP_REQUIRED_ALL_WAY,                       "ISDN user part required all the way"},
461   { ISUP_ISDN_USER_PART_IND_SPARE,               "spare"},
462   { 0,                                 NULL}};
463
464 static const true_false_string isup_ISDN_originating_access_ind_value = {
465   "originating access ISDN",
466   "originating access non-ISDN"
467 };
468
469 #define NO_INDICATION                                0
470 #define CONNECTIONLESS_METHOD_AVAILABLE              1
471 #define CONNECITON_ORIENTED_METHOD_AVAILABLE         2
472 #define CONNECTIONLESS_AND_ORIENTED_METHOD_AVAILABLE 3
473 static const value_string isup_SCCP_method_ind_value[] = {
474   { NO_INDICATION,                                  "No indication"},
475   { CONNECTIONLESS_METHOD_AVAILABLE,                "Connectionless method available (national use)"},  
476   { CONNECITON_ORIENTED_METHOD_AVAILABLE,           "Connection oriented method available"},
477   { CONNECTIONLESS_AND_ORIENTED_METHOD_AVAILABLE,   "Connectionless and -oriented method available (national use)"},
478   { 0,                                 NULL}};
479
480 #define UNKNOWN_AT_THIS_TIME                 0
481 #define OPERATOR_FRENCH                      1
482 #define OPERATOR_ENGLISH                     2
483 #define OPERATOR_GERMAN                      3
484 #define OPERATOR_RUSSIAN                     4
485 #define OPERATOR_SPANISH                     5
486 #define ORDINARY_CALLING_SUBSCRIBER         10
487 #define CALLING_SUBSCRIBER_WITH_PRIORITY    11
488 #define DATA_CALL                           12
489 #define TEST_CALL                           13
490 #define PAYPHONE                            15
491 static const value_string isup_calling_partys_category_value[] = {
492   { UNKNOWN_AT_THIS_TIME,               "Category unknown at this time (national use)"},
493   { OPERATOR_FRENCH,                    "operator, language French"},  
494   { OPERATOR_ENGLISH,                   "operator, language English"},  
495   { OPERATOR_GERMAN,                    "operator, language German"},  
496   { OPERATOR_RUSSIAN,                   "operator, language Russian"},  
497   { OPERATOR_SPANISH,                   "operator, language Spanish"},  
498   { ORDINARY_CALLING_SUBSCRIBER,        "ordinary calling subscriber"},
499   { CALLING_SUBSCRIBER_WITH_PRIORITY,   "calling subscriber with priority"},
500   { DATA_CALL,                          "data call (voice band data)"},
501   { TEST_CALL,                          "test call"},
502   { PAYPHONE,                           "payphone"},
503   { 0,                                 NULL}};
504
505 #define MEDIUM_SPEECH                        0
506 #define MEDIUM_64KBS                         2
507 #define MEDIUM_3_1_KHZ_AUDIO                 3
508 #define MEDIUM_RESERVED_SERVICE2_1           4
509 #define MEDIUM_RESERVED_SERVICE1_2           5
510 #define MEDIUM_64KBS_PREFERED                6
511 #define MEDIUM_2_64KBS                       7
512 #define MEDIUM_384KBS                        8
513 #define MEDIUM_1536KBS                       9
514 #define MEDIUM_1920KBS                      10
515 #define MEDIUM_3_64KBS                      16
516 #define MEDIUM_4_64KBS                      17
517 #define MEDIUM_5_64KBS                      18
518 #define MEDIUM_7_64KBS                      20
519 #define MEDIUM_8_64KBS                      21
520 #define MEDIUM_9_64KBS                      22
521 #define MEDIUM_10_64KBS                     23
522 #define MEDIUM_11_64KBS                     24
523 #define MEDIUM_12_64KBS                     25
524 #define MEDIUM_13_64KBS                     26
525 #define MEDIUM_14_64KBS                     27
526 #define MEDIUM_15_64KBS                     28
527 #define MEDIUM_16_64KBS                     29
528 #define MEDIUM_17_64KBS                     30
529 #define MEDIUM_18_64KBS                     31
530 #define MEDIUM_19_64KBS                     32
531 #define MEDIUM_20_64KBS                     33
532 #define MEDIUM_21_64KBS                     34
533 #define MEDIUM_22_64KBS                     35
534 #define MEDIUM_23_64KBS                     36
535 #define MEDIUM_25_64KBS                     38
536 #define MEDIUM_26_64KBS                     39
537 #define MEDIUM_27_64KBS                     40
538 #define MEDIUM_28_64KBS                     41
539 #define MEDIUM_29_64KBS                     42
540 static const value_string isup_transmission_medium_requirement_value[] = {
541   { MEDIUM_SPEECH,                       "speech"},
542   { MEDIUM_64KBS,                        "64 kbit/s unrestricted"},
543   { MEDIUM_3_1_KHZ_AUDIO,                "3.1 kHz audio"},
544   { MEDIUM_RESERVED_SERVICE2_1,          "reserved for alternate speech (service 2)/64 kbit/s unrestricted (service 1)"},
545   { MEDIUM_RESERVED_SERVICE1_2,          "reserved for alternate 64 kbit/s unrestricted (service 1)/speech (service 2)"},
546   { MEDIUM_64KBS_PREFERED,               "64 kbit/s prefered"},
547   { MEDIUM_2_64KBS,                      "2x64 kbit/s unrestricted"},
548   { MEDIUM_384KBS,                       "384 kbit/s unrestricted"},
549   { MEDIUM_1536KBS,                      "1536 kbit/s unrestricted"},
550   { MEDIUM_1920KBS,                      "1920 kbit/s unrestricted"},
551   { MEDIUM_3_64KBS,                      "3x64 kbit/s unrestricted"},
552   { MEDIUM_4_64KBS,                      "4x64 kbit/s unrestricted"},
553   { MEDIUM_5_64KBS,                      "5x64 kbit/s unrestricted"},
554   { MEDIUM_7_64KBS,                      "7x64 kbit/s unrestricted"},
555   { MEDIUM_8_64KBS,                      "8x64 kbit/s unrestricted"},
556   { MEDIUM_9_64KBS,                      "9x64 kbit/s unrestricted"},
557   { MEDIUM_10_64KBS,                     "10x64 kbit/s unrestricted"},
558   { MEDIUM_11_64KBS,                     "11x64 kbit/s unrestricted"},
559   { MEDIUM_12_64KBS,                     "12x64 kbit/s unrestricted"},
560   { MEDIUM_13_64KBS,                     "13x64 kbit/s unrestricted"},
561   { MEDIUM_14_64KBS,                     "14x64 kbit/s unrestricted"},
562   { MEDIUM_15_64KBS,                     "15x64 kbit/s unrestricted"},
563   { MEDIUM_16_64KBS,                     "16x64 kbit/s unrestricted"},
564   { MEDIUM_17_64KBS,                     "17x64 kbit/s unrestricted"},
565   { MEDIUM_18_64KBS,                     "18x64 kbit/s unrestricted"},
566   { MEDIUM_19_64KBS,                     "19x64 kbit/s unrestricted"},
567   { MEDIUM_20_64KBS,                     "20x64 kbit/s unrestricted"},
568   { MEDIUM_21_64KBS,                     "21x64 kbit/s unrestricted"},
569   { MEDIUM_22_64KBS,                     "22x64 kbit/s unrestricted"},
570   { MEDIUM_23_64KBS,                     "23x64 kbit/s unrestricted"},
571   { MEDIUM_25_64KBS,                     "25x64 kbit/s unrestricted"},
572   { MEDIUM_26_64KBS,                     "26x64 kbit/s unrestricted"},
573   { MEDIUM_27_64KBS,                     "27x64 kbit/s unrestricted"},
574   { MEDIUM_28_64KBS,                     "28x64 kbit/s unrestricted"},
575   { MEDIUM_29_64KBS,                     "29x64 kbit/s unrestricted"},
576   { 0,                                 NULL}};
577 static const value_string isup_transmission_medium_requirement_prime_value[] = {
578   { MEDIUM_SPEECH,                       "speech"},
579   { MEDIUM_64KBS,                        "reserved for 64 kbit/s unrestricted"},
580   { MEDIUM_3_1_KHZ_AUDIO,                "3.1 kHz audio"},
581   { MEDIUM_RESERVED_SERVICE2_1,          "reserved for alternate speech (service 2)/64 kbit/s unrestricted (service 1)"},
582   { MEDIUM_RESERVED_SERVICE1_2,          "reserved for alternate 64 kbit/s unrestricted (service 1)/speech (service 2)"},
583   { MEDIUM_64KBS_PREFERED,               "reserved for 64 kbit/s prefered"},
584   { MEDIUM_2_64KBS,                      "reserved for 2x64 kbit/s unrestricted"},
585   { MEDIUM_384KBS,                       "reserved for 384 kbit/s unrestricted"},
586   { MEDIUM_1536KBS,                      "reserved for 1536 kbit/s unrestricted"},
587   { MEDIUM_1920KBS,                      "reserved for 1920 kbit/s unrestricted"},
588   { 0,                                 NULL}};
589
590
591 /* Definitions for Called and Calling Party number */
592 #define ISUP_ODD_EVEN_MASK                       0x80
593 #define ISUP_NATURE_OF_ADDRESS_IND_MASK          0x7F
594 #define ISUP_INN_MASK                            0x80
595 #define ISUP_NI_MASK                             0x80
596 #define ISUP_NUMBERING_PLAN_IND_MASK             0x70
597 #define ISUP_ADDRESS_PRESENTATION_RESTR_IND_MASK 0x0C
598 #define ISUP_SCREENING_IND_MASK                  0x03
599 #define ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK       0x0F
600 #define ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK      0xF0
601
602 static const true_false_string isup_odd_even_ind_value = {
603   "odd number of address signals",
604   "even number of address signals"
605 };
606
607 #define ISUP_CALLED_PARTY_NATURE_SUBSCRIBER_NR  1
608 #define ISUP_CALLED_PARTY_NATURE_UNKNOWN        2
609 #define ISUP_CALLED_PARTY_NATURE_NATIONAL_NR    3
610 #define ISUP_CALLED_PARTY_NATURE_INTERNATNL_NR  4
611 #define ISUP_CALLED_PARTY_NATURE_NETW_SPEC_NR   5
612 static const value_string isup_called_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   { ISUP_CALLED_PARTY_NATURE_NETW_SPEC_NR,      "network-specific number (national use)"},
618   { 0,                                 NULL}};
619
620 static const value_string isup_calling_party_nature_of_address_ind_value[] = {
621   { ISUP_CALLED_PARTY_NATURE_SUBSCRIBER_NR,     "subscriber number (national use)"},
622   { ISUP_CALLED_PARTY_NATURE_UNKNOWN,           "unknown (national use)"},  
623   { ISUP_CALLED_PARTY_NATURE_NATIONAL_NR,       "national (significant) number"},
624   { ISUP_CALLED_PARTY_NATURE_INTERNATNL_NR,     "international number"},
625   { 0,                                 NULL}};
626
627 static const true_false_string isup_INN_ind_value = {
628   "routing to internal network number not allowed",
629   "routing to internal network number allowed "
630 };
631 static const true_false_string isup_NI_ind_value = {
632   "incomplete",
633   "complete"
634 };
635
636 #define ISDN_NUMBERING_PLAN                     1
637 #define DATA_NUMBERING_PLAN                     3
638 #define TELEX_NUMBERING_PLAN                    4
639 static const value_string isup_numbering_plan_ind_value[] = {
640   { ISDN_NUMBERING_PLAN,     "ISDN (Telephony) numbering plan"},
641   { DATA_NUMBERING_PLAN,     "Data numbering plan (national use)"},
642   { TELEX_NUMBERING_PLAN,    "Telex numbering plan (national use)"},
643   { 5,                       "Reserved for national use"},
644   { 6,                       "Reserved for national use"},
645   { 0,                                 NULL}};
646
647 #define ADDRESS_PRESETATION_ALLOWED      0
648 #define ADDRESS_PRESETATION_RESTRICTED   1
649 #define ADDRESS_NOT_AVAILABLE            2
650 static const value_string isup_address_presentation_restricted_ind_value[] = {
651   { ADDRESS_PRESETATION_ALLOWED,     "presentation allowed"},
652   { ADDRESS_PRESETATION_RESTRICTED,  "presentation restricted"},
653   { ADDRESS_NOT_AVAILABLE,           "address not availabe (national use)"},
654   { 3,                                 "spare"},
655   { 0,                                 NULL}};
656
657 static const value_string isup_screening_ind_value[] = {
658   { 0,     "reserved"},
659   { 1,     "user provided, verified and passed"},
660   { 2,     "reserved"},
661   { 3,     "network provided"},
662   { 0,     NULL}};
663
664 static const value_string isup_screening_ind_enhanced_value[] = {
665   { 0,     "user provided, not verified"},
666   { 1,     "user provided, verified and passed"},
667   { 2,     "user provided, verified and failed"},
668   { 3,     "network provided"},
669   { 0,     NULL}};
670
671 static const value_string isup_called_party_address_digit_value[] = {
672   { 0,  "0"},
673   { 1,  "1"},
674   { 2,  "2"},
675   { 3,  "3"},
676   { 4,  "4"},
677   { 5,  "5"},
678   { 6,  "6"},
679   { 7,  "7"},
680   { 8,  "8"},
681   { 9,  "9"},
682   { 10, "spare"},
683   { 11, "code 11 "},
684   { 12, "code 12"},
685   { 15, "Stop sending"},
686   { 0,  NULL}};
687
688 static const value_string isup_calling_party_address_digit_value[] = {
689   { 0,  "0"},
690   { 1,  "1"},
691   { 2,  "2"},
692   { 3,  "3"},
693   { 4,  "4"},
694   { 5,  "5"},
695   { 6,  "6"},
696   { 7,  "7"},
697   { 8,  "8"},
698   { 9,  "9"},
699   { 10, "spare"},
700   { 11, "code 11 "},
701   { 12, "code 12"},
702   { 15, "spare"},
703   { 0,  NULL}};
704
705 /*End of Called/Calling party address definitions */
706
707
708 static const true_false_string isup_calling_party_address_request_ind_value = {
709   "calling party address requested",
710   "calling party address not requested"
711 };
712 static const true_false_string isup_holding_ind_value = {
713   "holding requested",
714   "holding not requested"
715 };
716 static const true_false_string isup_calling_partys_category_request_ind_value = {
717   "Calling Party's category requested",
718   "Calling Party's category not requested",
719 };
720 static const true_false_string isup_charge_information_request_ind_value = {
721   "Charge Information requested",
722   "Charge Information not requested"
723 };
724 static const true_false_string isup_malicious_call_identification_request_ind_value = {
725   "Malicious call identification requested",
726   "Malicious call identification not requested"
727 };
728
729 #define CALLING_PARTY_ADDRESS_NOT_INCLUDED             0
730 #define CALLING_PARTY_ADDRESS_NOT_AVAILABLE            1
731 #define CALLING_PARTY_ADDRESS_INCLUDED                 3
732 static const value_string isup_calling_party_address_response_ind_value[] = {
733   { CALLING_PARTY_ADDRESS_NOT_INCLUDED, "Calling party address not included"},
734   { CALLING_PARTY_ADDRESS_NOT_AVAILABLE,"Calling party address not available"},
735   { 4,                                  "spare"},
736   { CALLING_PARTY_ADDRESS_INCLUDED,     "Calling party address included"},
737   { 0,                                 NULL}};
738
739 static const true_false_string isup_hold_provided_ind_value = {
740   "hold provided",
741   "hold not provided"
742 };
743 static const true_false_string isup_calling_partys_category_response_ind_value = {
744   "Calling Party's category included",
745   "Calling Party's category not included",
746 };
747 static const true_false_string isup_charge_information_response_ind_value = {
748   "Charge Information included",
749   "Charge Information not included"
750 };
751 static const true_false_string isup_solicited_information_ind_value = {
752   "unsolicited",
753   "solicited"
754 };
755
756 static const true_false_string isup_continuity_ind_value = {
757   "Continuity check successful",
758   "Continuity ckec failed"
759 };
760
761 #define CHARGE_NO_IND       0
762 #define CHARGE_NO_CHARGE    1
763 #define CHARGE_CHARGE       2
764 static const value_string isup_charge_ind_value[] = {
765   { CHARGE_NO_IND,    "No indication"},
766   { CHARGE_NO_CHARGE, "No charge"},
767   { CHARGE_CHARGE,    "Charge"},
768   { 3,                "spare"},
769   { 0,                NULL}};
770
771 #define CALLED_PARTYS_STATUS_NO_IND            0
772 #define CALLED_PARTYS_STATUS_SUBSCR_FREE       1
773 #define CALLED_PARTYS_STATUS_CONNECT_WHEN_FREE 2      
774 static const value_string isup_called_partys_status_ind_value[] = {
775   { CALLED_PARTYS_STATUS_NO_IND,            "No indication"},
776   { CALLED_PARTYS_STATUS_SUBSCR_FREE,       "Subscriber free"},
777   { CALLED_PARTYS_STATUS_CONNECT_WHEN_FREE, "Connect when free (national use)"},
778   { 3,                                      "spare"},
779   { 0,                NULL}};
780
781 #define CALLED_PARTYS_CATEGORY_NO_IND            0
782 #define CALLED_PARTYS_CATEGORY_ORDINARY_SUBSCR   1
783 #define CALLED_PARTYS_CATEGORY_PAYPHONE          2      
784 static const value_string isup_called_partys_category_ind_value[] = {
785   { CALLED_PARTYS_CATEGORY_NO_IND,             "No indication"},
786   { CALLED_PARTYS_CATEGORY_ORDINARY_SUBSCR,    "Ordinary subscriber"},
787   { CALLED_PARTYS_CATEGORY_PAYPHONE,           "Payphone"},
788   { 3,                                         "spare"},
789   { 0,                NULL}};
790
791 static const true_false_string isup_ISDN_terminating_access_ind_value = {
792   "terminating access ISDN",
793   "terminating access non-ISDN"
794 };
795
796 static const true_false_string isup_suspend_resume_ind_value = {
797   "network initiated",
798   "ISDN subscriber initiated"
799 };
800 #define MAINTENANCE            0
801 #define HARDWARE_FAILURE       1
802 #define RES_FOR_NATNL_USE      2      
803 static const value_string isup_cgs_message_type_value[] = {
804   { MAINTENANCE,            "maintenance oriented"},
805   { HARDWARE_FAILURE,       "hardware failure oriented"},
806   { RES_FOR_NATNL_USE,      "reserved for national use (ISUP'84)"},
807   { 3,                      "spare"},
808   { 0,                NULL}};
809
810 #define USER_TO_USER_SERVICE      2      
811 static const value_string isup_facility_ind_value[] = {
812   { USER_TO_USER_SERVICE,     "user-to-user service"},
813   { 0,                NULL}};
814
815 #define MTC_BLCK_STATE_TRANSIENT  0
816 #define MTC_BLCK_STATE_UNEQUIPPED 3
817 static const value_string isup_mtc_blocking_state_DC00_value[] = {
818   {  MTC_BLCK_STATE_TRANSIENT,  "transient"},
819   { 1,                          "spare"},
820   { 2,                          "spare"},
821   {  MTC_BLCK_STATE_UNEQUIPPED, "unequipped"},
822   { 0,                NULL}};
823
824 #define MTC_BLCK_NO_BLOCKING      0
825 #define MTC_LOCALLY_BLOCKED       1
826 #define MTC_REMOTELY_BLOCKED      2
827 #define MTC_LOCAL_REMOTE_BLOCKED  3
828 static const value_string isup_mtc_blocking_state_DCnot00_value[] = {
829   {  MTC_BLCK_NO_BLOCKING,     "no blocking (active)"},
830   {  MTC_LOCALLY_BLOCKED,      "locally blocked"},
831   {  MTC_REMOTELY_BLOCKED,     "remotely blocked"},
832   {  MTC_LOCAL_REMOTE_BLOCKED, "locally and remotely blocked"},
833   {  0,                NULL}};
834
835 #define CALL_PROC_INCOMING_BUSY 1
836 #define CALL_PROC_OUTGOING_BUSY 2
837 #define CALL_PROC_IDLE          3
838 static const value_string isup_call_processing_state_value[] = {
839   {  CALL_PROC_INCOMING_BUSY,     "circuit incoming busy"},
840   {  CALL_PROC_OUTGOING_BUSY,     "circuit outgoing busy"},
841   {  CALL_PROC_IDLE,              "idle"},
842   {  0,                NULL}};
843
844 #define HW_BLCK_NO_BLOCKING          0
845 #define HW_LOCALLY_BLOCKED           1
846 #define HW_REMOTELY_BLOCKED          2
847 #define HW_LOCAL_REMOTE_BLOCKED      3
848 static const value_string isup_HW_blocking_state_value[] = {
849   {  HW_BLCK_NO_BLOCKING,     "no blocking (active)"},
850   {  HW_LOCALLY_BLOCKED,      "locally blocked"},
851   {  HW_REMOTELY_BLOCKED,     "remotely blocked"},
852   {  HW_LOCAL_REMOTE_BLOCKED, "locally and remotely blocked"},
853   {  0,                NULL}};
854
855 #define EVENT_ALERTING      1
856 #define EVENT_PROGRESS      2
857 #define EVENT_INBAND_INFO   3
858 #define EVENT_ON_BUSY       4
859 #define EVENT_ON_NO_REPLY   5
860 #define EVENT_UNCONDITIONAL 6
861 static const value_string isup_event_ind_value[] = {
862   /* according 3.21/Q.763 */
863   {  EVENT_ALERTING,     "ALERTING"},
864   {  EVENT_PROGRESS,     "PROGRESS"},
865   {  EVENT_INBAND_INFO,  "in-band information or an appropriate pattern is now available"},
866   {  EVENT_ON_BUSY,      "call forwarded on busy (national use)"},
867   {  EVENT_ON_NO_REPLY,  "call forwarded on no reply (national use)"},
868   {  EVENT_UNCONDITIONAL,"call forwarded unconditional (national use)"},
869   {  0,                NULL}};
870
871 static const true_false_string isup_event_presentation_restricted_ind_value = {
872   /* according 3.21/Q.763 */
873   "presentation restricted",
874   "no indication"
875 };
876 #define CUG_NON_CUG_CALL                      0
877 #define CUG_CALL_OUTGOING_ACCESS_ALLOWED      2
878 #define CUG_CALL_OUTGOING_ACCESS_NOT_ALLOWED  3
879 static const value_string isup_CUG_call_ind_value[] = {
880   /* according 3.38/Q.763 */
881   {  CUG_NON_CUG_CALL,                     "non-CUG call"},
882   {  1,                                    "spare"},
883   {  CUG_CALL_OUTGOING_ACCESS_ALLOWED,     "closed user group call, outgoing access allowed"},
884   {  CUG_CALL_OUTGOING_ACCESS_NOT_ALLOWED, "closed user group call, outgoing access not allowed"},
885   {  0,                NULL}};
886
887
888 static const true_false_string isup_simple_segmentation_ind_value = {
889   /* according 3.38/Q.763 */
890   "additional information will be sent in a segmentation message",
891   "no additional information will be sent"
892 };
893
894 static const true_false_string isup_connected_line_identity_request_ind_value = {
895   /* according 3.38/Q.763 */
896   "requested",
897   "not requested"
898 };
899
900 static const value_string isup_redirecting_ind_value[] = {
901   /* according 3.45/Q.763 */
902   {  0,        "no redirection (national use)"},
903   {  1,        "call rerouted (national use)"},
904   {  2,        "call rerouted, all redirection information presentation restricted (national use)"},
905   {  3,        "call diverted"},
906   {  4,        "call diverted, all redirection information presentation restricted"},
907   {  5,        "call rerouted, redirection number presentation restricted (national use)"},
908   {  6,        "call diversion, redirection number presentation restricted (national use)"},
909   {  7,        "spare"},
910   {  0,         NULL}};
911
912 static const value_string isup_original_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   {  0,         NULL}};
919
920 static const value_string isup_redirection_reason_value[] = {
921   /* according 3.45/Q.763 */
922   {  0,        "unknown/not available"},
923   {  1,        "user busy (national use)"},
924   {  2,        "no reply (national use)"},
925   {  3,        "unconditional (national use)"},
926   {  4,        "deflection during alerting"},
927   {  5,        "deflection immediate response"},
928   {  6,        "mobile subscriber not reachable"},
929   {  0,         NULL}};
930
931 static const value_string isup_type_of_network_identification_value[] = {
932   /* according 3.53/Q.763 */
933   {  0,        "CCITT/ITU-T-standardized identification"},
934   {  2,        "national network identification"},
935   {  0,         NULL}};
936
937 static const value_string isup_network_identification_plan_value[] = {
938   /* according 3.53/Q.763 */
939   {  0,        "if CCITT/ITU-T id - unknown"},
940   {  3,        "if CCITT/ITU-T id - public data network id code (X.121)"},
941   {  6,        "if CCITT/ITU-T id - public land Mobile Network id code (E.211)"},
942   {  0,         NULL}};
943
944 static const value_string isup_map_type_value[] = {
945   /* according 3.69/Q.763 */
946   {  1,        "1544 kbit/s digital path map format (64 kbit/s base rate"},
947   {  2,        "2048 kbit/s digital path map format (64 kbit/s base rate"},
948   {  0,         NULL}};
949
950 static const value_string isup_auto_congestion_level_value[] = {
951   /* according 3.4/Q.763 */
952   {  1,        "Congestion level 1 exceeded"},
953   {  2,        "Congestion level 2 exceeded"},
954   {  0,         NULL}};
955
956 static const true_false_string isup_inband_information_ind_value = {
957   /* according 3.37/Q.763 */
958   "in-band information or an appropirate pattern is now available",
959   "no indication"
960 };
961 static const true_false_string isup_call_diversion_may_occur_ind_value = {
962   /* according 3.37/Q.763 */
963   "call diversion may occur",
964   "no indication"
965 };
966 static const true_false_string isup_MLPP_user_ind_value = {
967   /* according 3.37/Q.763 */
968   "MLPP user",
969   "no indication"
970 };
971
972 static const true_false_string isup_access_delivery_ind_value = {
973   /* according 3.2/Q.763 */
974   "No set-up message generated",
975   "Set-up message generated"
976 };
977
978 static const value_string isup_loop_prevention_response_ind_value[] = {
979   /* according 3.67/Q.763 */
980   {  0,        "insufficient information"},
981   {  1,        "no loop exists"},
982   {  2,        "simultaneous transfer"},
983   {  0,         NULL}};
984
985 static const true_false_string isup_temporary_alternative_routing_ind_value = {
986   /* according 3.68/Q.763 */
987   "TAR controlled call",
988   "no indication"
989 };
990 static const true_false_string isup_extension_ind_value = {
991   /* according 3.68/Q.763 */
992   "last octet",
993   "information continues through the next octet"
994 };
995
996 static const value_string isup_call_to_be_diverted_ind_value[] = {
997   /* according 3.72/Q.763 */
998   {  0,        "no indication"},
999   {  1,        "call diversion allowed"},
1000   {  2,        "call diversion not allowed"},
1001   {  3,        "spare"},
1002   {  0,         NULL}};
1003
1004 static const value_string isup_call_to_be_offered_ind_value[] = {
1005   /* according 3.72/Q.763 */
1006   {  0,        "no indication"},
1007   {  1,        "call offering not allowed"},
1008   {  2,        "call offering allowed"},
1009   {  3,        "spare"},
1010   {  0,         NULL}};
1011
1012 static const value_string isup_conference_acceptance_ind_value[] = {
1013   /* according 3.76/Q.763 */
1014   {  0,        "no indication"},
1015   {  1,        "accept conference request"},
1016   {  2,        "reject conference request"},
1017   {  3,        "spare"},
1018   {  0,         NULL}};
1019
1020
1021 /* Generalized bit masks for 8 and 16 bits fields */
1022 #define A_8BIT_MASK  0x01
1023 #define B_8BIT_MASK  0x02
1024 #define C_8BIT_MASK  0x04
1025 #define D_8BIT_MASK  0x08
1026 #define E_8BIT_MASK  0x10
1027 #define F_8BIT_MASK  0x20
1028 #define G_8BIT_MASK  0x40
1029 #define H_8BIT_MASK  0x80
1030
1031 #define BA_8BIT_MASK 0x03
1032 #define CB_8BIT_MASK 0x06
1033 #define DC_8BIT_MASK 0x0C
1034 #define FE_8BIT_MASK 0x30
1035 #define GFE_8BIT_MASK 0x70
1036 #define DCBA_8BIT_MASK 0x0F
1037 #define EDCBA_8BIT_MASK 0x1F
1038 #define HGFE_8BIT_MASK 0xF0
1039 #define GFEDCBA_8BIT_MASK 0x7F
1040 #define FEDCBA_8BIT_MASK 0x3F
1041
1042 #define A_16BIT_MASK  0x0100
1043 #define B_16BIT_MASK  0x0200
1044 #define C_16BIT_MASK  0x0400
1045 #define D_16BIT_MASK  0x0800
1046 #define E_16BIT_MASK  0x1000
1047 #define F_16BIT_MASK  0x2000
1048 #define G_16BIT_MASK  0x4000
1049 #define H_16BIT_MASK  0x8000
1050 #define I_16BIT_MASK  0x0001
1051 #define J_16BIT_MASK  0x0002
1052 #define K_16BIT_MASK  0x0004
1053 #define L_16BIT_MASK  0x0008
1054 #define M_16BIT_MASK  0x0010
1055 #define N_16BIT_MASK  0x0020
1056 #define O_16BIT_MASK  0x0040
1057 #define P_16BIT_MASK  0x0080
1058
1059 #define BA_16BIT_MASK 0x0300 
1060 #define CB_16BIT_MASK 0x0600
1061 #define DC_16BIT_MASK 0x0C00
1062 #define FE_16BIT_MASK 0x3000
1063 #define HG_16BIT_MASK 0xC000
1064 #define KJ_16BIT_MASK 0x0006
1065 #define PO_16BIT_MASK 0x00C0
1066
1067 #define CBA_16BIT_MASK 0x0700
1068 #define KJI_16BIT_MASK 0x0007
1069 #define HGFE_16BIT_MASK 0xF000
1070 #define PONM_16BIT_MASK 0x00F0
1071
1072 /* Initialize the protocol and registered fields */
1073 static int proto_isup = -1;
1074 static int hf_isup_cic = -1;
1075 static int hf_isup_message_type = -1;
1076 static int hf_isup_parameter_type = -1;
1077 static int hf_isup_parameter_length = -1;
1078 static int hf_isup_mandatory_variable_parameter_pointer = -1;
1079 static int hf_isup_pointer_to_start_of_optional_part = -1;
1080
1081 static int hf_isup_satellite_indicator = -1;
1082 static int hf_isup_continuity_check_indicator = -1;
1083 static int hf_isup_echo_control_device_indicator = -1;
1084
1085 static int hf_isup_forw_call_natnl_inatnl_call_indicator = -1;
1086 static int hf_isup_forw_call_end_to_end_method_indicator = -1;
1087 static int hf_isup_forw_call_interworking_indicator = -1;
1088 static int hf_isup_forw_call_end_to_end_info_indicator = -1;
1089 static int hf_isup_forw_call_isdn_user_part_indicator = -1;
1090 static int hf_isup_forw_call_preferences_indicator = -1;
1091 static int hf_isup_forw_call_isdn_access_indicator = -1;
1092 static int hf_isup_forw_call_sccp_method_indicator = -1;
1093
1094 static int hf_isup_calling_partys_category = -1;
1095
1096 static int hf_isup_transmission_medium_requirement = -1;
1097
1098 static int hf_isup_odd_even_indicator = -1;
1099 static int hf_isup_called_party_nature_of_address_indicator = -1;
1100 static int hf_isup_calling_party_nature_of_address_indicator = -1;
1101 static int hf_isup_inn_indicator = -1;
1102 static int hf_isup_ni_indicator = -1;
1103 static int hf_isup_numbering_plan_indicator = -1;
1104 static int hf_isup_address_presentation_restricted_indicator = -1;
1105 static int hf_isup_screening_indicator = -1;
1106 static int hf_isup_screening_indicator_enhanced = -1;
1107 static int hf_isup_called_party_odd_address_signal_digit = -1;
1108 static int hf_isup_calling_party_odd_address_signal_digit = -1;
1109 static int hf_isup_called_party_even_address_signal_digit = -1;
1110 static int hf_isup_calling_party_even_address_signal_digit = -1;
1111
1112 static int hf_isup_calling_party_address_request_indicator = -1;
1113 static int hf_isup_info_req_holding_indicator = -1;
1114 static int hf_isup_calling_partys_category_request_indicator = -1;
1115 static int hf_isup_charge_information_request_indicator = -1;
1116 static int hf_isup_malicious_call_identification_request_indicator = -1;
1117
1118 static int hf_isup_calling_party_address_response_indicator = -1;
1119 static int hf_isup_hold_provided_indicator = -1;
1120 static int hf_isup_calling_partys_category_response_indicator = -1;
1121 static int hf_isup_charge_information_response_indicator = -1;
1122 static int hf_isup_solicited_indicator = -1;
1123
1124 static int hf_isup_continuity_indicator = -1;
1125
1126 static int hf_isup_backw_call_charge_ind = -1 ; 
1127 static int hf_isup_backw_call_called_partys_status_ind = -1;
1128 static int hf_isup_backw_call_called_partys_category_ind = -1;
1129 static int hf_isup_backw_call_end_to_end_method_ind = -1;
1130 static int hf_isup_backw_call_interworking_ind = -1;
1131 static int hf_isup_backw_call_end_to_end_info_ind = -1;
1132 static int hf_isup_backw_call_isdn_user_part_ind = -1;
1133 static int hf_isup_backw_call_holding_ind = -1;
1134 static int hf_isup_backw_call_isdn_access_ind = -1;
1135 static int hf_isup_backw_call_echo_control_device_ind = -1;
1136 static int hf_isup_backw_call_sccp_method_ind = -1;
1137  
1138 static int hf_isup_suspend_resume_indicator = -1;
1139
1140 static int hf_isup_range_indicator = -1;
1141 static int hf_isup_cgs_message_type = -1;
1142
1143 static int hf_isup_mtc_blocking_state1 = -1;
1144 static int hf_isup_mtc_blocking_state2 = -1;
1145 static int hf_isup_call_proc_state = -1;
1146 static int hf_isup_hw_blocking_state = -1;
1147
1148 static int hf_isup_event_ind = -1;
1149 static int hf_isup_event_presentation_restricted_ind = -1;
1150
1151 static int hf_isup_cug_call_ind = -1;
1152 static int hf_isup_simple_segmentation_ind = -1;
1153 static int hf_isup_connected_line_identity_request_ind = -1;
1154
1155 static int hf_isup_redirecting_ind = -1;
1156 static int hf_isup_original_redirection_reason = -1;
1157 static int hf_isup_redirection_counter = -1;
1158 static int hf_isup_redirection_reason = -1;
1159
1160 static int hf_isup_type_of_network_identification = -1;
1161 static int hf_isup_network_identification_plan = -1;
1162
1163 static int hf_isup_map_type = -1;
1164
1165 static int hf_isup_automatic_congestion_level = -1;
1166
1167 static int hf_isup_inband_information_ind = -1;
1168 static int hf_isup_call_diversion_may_occur_ind = -1;
1169 static int hf_isup_mlpp_user_ind = -1;
1170
1171 static int hf_isup_access_delivery_ind =- -1;
1172
1173 static int hf_isup_transmission_medium_requirement_prime = -1;
1174
1175 static int hf_isup_loop_prevention_response_ind = -1;
1176
1177 static int hf_isup_temporary_alternative_routing_ind = -1;
1178 static int hf_isup_extension_ind = -1;
1179
1180 static int hf_isup_call_to_be_diverted_ind = -1;
1181
1182 static int hf_isup_call_to_be_offered_ind = -1;
1183
1184 static int hf_isup_conference_acceptance_ind = -1;
1185
1186 /* Initialize the subtree pointers */
1187 static gint ett_isup = -1;
1188 static gint ett_isup_parameter = -1;
1189 static gint ett_isup_address_digits = -1;
1190 static gint ett_isup_pass_along_message = -1;
1191 static gint ett_isup_circuit_state_ind = -1;
1192
1193
1194 /* ------------------------------------------------------------------ 
1195   Mapping number to ASCII-character   
1196  ------------------------------------------------------------------ */
1197 char number_to_char(int number)
1198 {
1199   if (number < 10)
1200     return ((char) number + ASCII_NUMBER_DELTA);
1201   else
1202     return ((char) number + ASCII_LETTER_DELTA);
1203 }
1204
1205
1206 /* ------------------------------------------------------------------ */
1207 /* Dissectors for all used parameter types                            */ 
1208 /* ------------------------------------------------------------------ */
1209 /* argument tvbuff_t contains only parameter-specific length          */
1210 /* length indicator is already dissected in dissect_isup_message() or */
1211 /* dissect_isup_optional_parameter()                                  */
1212 /* ------------------------------------------------------------------ */
1213
1214 /* ------------------------------------------------------------------ 
1215  Dissector Parameter nature of connection flags 
1216  */
1217 void 
1218 dissect_isup_nature_of_connection_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1219 {
1220   guint8 nature_of_connection_ind;
1221
1222   nature_of_connection_ind = tvb_get_guint8(parameter_tvb, 0);
1223   proto_tree_add_uint(parameter_tree, hf_isup_satellite_indicator, parameter_tvb, 0,NATURE_OF_CONNECTION_IND_LENGTH, nature_of_connection_ind);
1224   proto_tree_add_uint(parameter_tree, hf_isup_continuity_check_indicator, parameter_tvb, 0,NATURE_OF_CONNECTION_IND_LENGTH, nature_of_connection_ind);
1225   proto_tree_add_boolean(parameter_tree, hf_isup_echo_control_device_indicator, parameter_tvb, 0,  NATURE_OF_CONNECTION_IND_LENGTH, nature_of_connection_ind);
1226
1227   proto_item_set_text(parameter_item, "Nature of Connection Indicators: 0x%x", nature_of_connection_ind);
1228 }
1229
1230 /* ------------------------------------------------------------------ 
1231  Dissector Parameter Forward Call Indicators
1232  */
1233 void 
1234 dissect_isup_forward_call_indicators_parameter(tvbuff_t *parameter_tvb,proto_tree *parameter_tree, proto_item *parameter_item)
1235 {
1236   guint16 forward_call_ind;
1237
1238   forward_call_ind = tvb_get_ntohs(parameter_tvb, 0);
1239   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_natnl_inatnl_call_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1240   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);
1241   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_interworking_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1242   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);
1243   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_isdn_user_part_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1244   proto_tree_add_uint(parameter_tree, hf_isup_forw_call_preferences_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1245   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_isdn_access_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1246   proto_tree_add_uint(parameter_tree, hf_isup_forw_call_sccp_method_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1247  
1248   proto_item_set_text(parameter_item, "Forward Call Indicators: 0x%x", forward_call_ind );  
1249 }
1250
1251 /* ------------------------------------------------------------------ 
1252  Dissector Parameter Calling Party's Category 
1253  */
1254 void 
1255 dissect_isup_calling_partys_category_parameter(tvbuff_t *parameter_tvb,proto_tree *parameter_tree, proto_item *parameter_item)
1256 {
1257   guint8 calling_partys_category;
1258   
1259   calling_partys_category = tvb_get_guint8(parameter_tvb, 0);
1260   proto_tree_add_uint(parameter_tree, hf_isup_calling_partys_category, parameter_tvb, 0, CALLING_PRTYS_CATEGORY_LENGTH, calling_partys_category);
1261
1262   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"));
1263 }
1264
1265
1266 /* ------------------------------------------------------------------
1267   Dissector Parameter Transmission medium requirement 
1268  */
1269 void 
1270 dissect_isup_transmission_medium_requirement_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1271
1272   guint8 transmission_medium_requirement;
1273   
1274   transmission_medium_requirement = tvb_get_guint8(parameter_tvb, 0);
1275   proto_tree_add_uint(parameter_tree, hf_isup_transmission_medium_requirement, parameter_tvb, 0, TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH,transmission_medium_requirement);
1276
1277   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"));
1278 }
1279 /* ------------------------------------------------------------------
1280   Dissector Parameter Called party number
1281  */
1282 void dissect_isup_called_party_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1283 {
1284   proto_item *address_digits_item;
1285   proto_tree *address_digits_tree;
1286   guint8 indicators1, indicators2;
1287   guint8 address_digit_pair=0;
1288   gint offset=0; 
1289   gint i=0;
1290   gint length;
1291   char called_number[MAXLENGTH]="";
1292
1293   indicators1 = tvb_get_guint8(parameter_tvb, 0);
1294   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
1295   proto_tree_add_uint(parameter_tree, hf_isup_called_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
1296   indicators2 = tvb_get_guint8(parameter_tvb, 1);
1297   proto_tree_add_boolean(parameter_tree, hf_isup_inn_indicator, parameter_tvb, 1, 1, indicators2);
1298   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
1299   offset = 2;
1300
1301   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
1302                                             offset,
1303                                             tvb_length_remaining(parameter_tvb, offset),
1304                                             "Called Party Number");
1305   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
1306
1307   length = tvb_length_remaining(parameter_tvb, offset);
1308   while(length > 0){
1309     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
1310     proto_tree_add_uint(address_digits_tree, hf_isup_called_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1311     called_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
1312     if ((length - 1) > 0 ){ 
1313       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1314       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1315     } 
1316     offset++;
1317     length = tvb_length_remaining(parameter_tvb, offset);   
1318   }
1319
1320   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
1321       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
1322       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1323   }
1324   called_number[i++] = '\0';
1325
1326   proto_item_set_text(address_digits_item, "Called Party Number: %s", called_number);  
1327   proto_item_set_text(parameter_item, "Called Party Number: %s", called_number);
1328   
1329 }
1330 /* ------------------------------------------------------------------
1331   Dissector Parameter  Subsequent number
1332  */
1333 void dissect_isup_subsequent_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1334 {
1335   proto_item *address_digits_item;
1336   proto_tree *address_digits_tree;
1337   guint8 indicators1;
1338   guint8 address_digit_pair=0;
1339   gint offset=0; 
1340   gint i=0;
1341   gint length;
1342   char called_number[MAXLENGTH]="";
1343
1344   indicators1 = tvb_get_guint8(parameter_tvb, 0);
1345   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
1346   offset = 1;
1347
1348   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
1349                                             offset,
1350                                             tvb_length_remaining(parameter_tvb, offset),
1351                                             "Subsequent Number");
1352   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
1353
1354   length = tvb_length_remaining(parameter_tvb, offset);
1355   while(length > 0){
1356     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
1357     proto_tree_add_uint(address_digits_tree, hf_isup_called_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1358     called_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
1359     if ((length - 1) > 0 ){ 
1360       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1361       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1362     } 
1363     offset++;
1364     length = tvb_length_remaining(parameter_tvb, offset);   
1365   }
1366
1367   if (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
1368       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
1369       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1370   }
1371   called_number[i++] = '\0';
1372
1373   proto_item_set_text(address_digits_item, "Subsequent Number: %s", called_number);  
1374   proto_item_set_text(parameter_item, "Subsequent Number: %s", called_number);
1375   
1376 }
1377 /* ------------------------------------------------------------------
1378   Dissector Parameter Information Request Indicators
1379  */
1380 void 
1381 dissect_isup_information_request_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1382
1383   guint16 information_request_indicators;
1384   
1385   information_request_indicators = tvb_get_ntohs(parameter_tvb, 0);
1386   proto_tree_add_boolean(parameter_tree, hf_isup_calling_party_address_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
1387   proto_tree_add_boolean(parameter_tree, hf_isup_info_req_holding_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
1388   proto_tree_add_boolean(parameter_tree, hf_isup_calling_partys_category_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
1389   proto_tree_add_boolean(parameter_tree, hf_isup_charge_information_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
1390   proto_tree_add_boolean(parameter_tree, hf_isup_malicious_call_identification_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
1391   
1392
1393   proto_item_set_text(parameter_item, "Information request indicators: 0x%x", information_request_indicators);
1394 }
1395 /* ------------------------------------------------------------------
1396   Dissector Parameter Information Indicators
1397  */
1398 void 
1399 dissect_isup_information_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1400
1401   guint16 information_indicators;
1402   
1403   information_indicators = tvb_get_ntohs(parameter_tvb, 0);
1404   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_address_response_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
1405   proto_tree_add_boolean(parameter_tree, hf_isup_hold_provided_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
1406   proto_tree_add_boolean(parameter_tree, hf_isup_calling_partys_category_response_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
1407   proto_tree_add_boolean(parameter_tree, hf_isup_charge_information_response_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
1408   proto_tree_add_boolean(parameter_tree, hf_isup_solicited_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
1409   
1410
1411   proto_item_set_text(parameter_item, "Information indicators: 0x%x", information_indicators);
1412 }
1413 /* ------------------------------------------------------------------
1414   Dissector Parameter Continuity Indicators 
1415  */
1416 void 
1417 dissect_isup_continuity_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1418
1419   guint8 continuity_indicators;
1420   
1421   continuity_indicators = tvb_get_guint8(parameter_tvb, 0);
1422   proto_tree_add_boolean(parameter_tree, hf_isup_continuity_indicator, parameter_tvb, 0, CONTINUITY_IND_LENGTH,  continuity_indicators);
1423
1424   proto_item_set_text(parameter_item, "Continuity indicators: 0x%x", continuity_indicators);
1425 }
1426 /* ------------------------------------------------------------------ 
1427  Dissector Parameter Backward Call Indicators 
1428  */
1429 void 
1430 dissect_isup_backward_call_indicators_parameter(tvbuff_t *parameter_tvb,proto_tree *parameter_tree, proto_item *parameter_item)
1431 {
1432   guint16 backward_call_ind;
1433
1434   backward_call_ind = tvb_get_ntohs(parameter_tvb, 0);
1435   
1436
1437   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_charge_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1438   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_called_partys_status_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1439   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_called_partys_category_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1440   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);
1441   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_interworking_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1442   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);
1443   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_isdn_user_part_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1444   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_holding_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH,  backward_call_ind);
1445   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_isdn_access_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1446   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_echo_control_device_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1447   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_sccp_method_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
1448  
1449   proto_item_set_text(parameter_item, "Backward Call Indicators: 0x%x", backward_call_ind);  
1450 }
1451 /* ------------------------------------------------------------------
1452   Dissector Parameter Cause Indicators - no detailed dissection since defined in Rec. Q.850
1453  */
1454 void 
1455 dissect_isup_cause_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1456 { guint length = tvb_length(parameter_tvb);
1457   proto_tree_add_text(parameter_item, parameter_tvb,0, length, "Cause indicators (-> Q.850)"); 
1458   proto_item_set_text(parameter_item, "Cause indicators, see Q.850 (%u byte%s length)", length , plurality(length, "", "s"));
1459 }
1460
1461 /* ------------------------------------------------------------------
1462   Dissector Parameter Suspend/Resume Indicators 
1463  */
1464 void 
1465 dissect_isup_suspend_resume_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1466
1467   guint8 indicators;
1468   
1469   indicators = tvb_get_guint8(parameter_tvb, 0);
1470   proto_tree_add_boolean(parameter_tree, hf_isup_suspend_resume_indicator, parameter_tvb, 0, SUSPEND_RESUME_IND_LENGTH,  indicators);
1471
1472   proto_item_set_text(parameter_item, "Suspend/Resume indicator: 0x%x", indicators);
1473 }
1474 /* ------------------------------------------------------------------
1475   Dissector Parameter Range and Status Indicators 
1476  */
1477 void 
1478 dissect_isup_range_and_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1479
1480   guint8 range, actual_status_length;
1481
1482   range = tvb_get_guint8(parameter_tvb, 0);
1483   proto_tree_add_uint_format(parameter_tree, hf_isup_range_indicator, parameter_tvb, 0, RANGE_LENGTH, range, "Range: %u", range);
1484   actual_status_length = tvb_length_remaining(parameter_tvb, RANGE_LENGTH);
1485   if (actual_status_length > 0)
1486     proto_tree_add_text(parameter_tree, parameter_tvb , RANGE_LENGTH, actual_status_length, "Status subfield");
1487   else
1488     proto_tree_add_text(parameter_tree, parameter_tvb , 0, 0, "Status subfield is not present with this message type");
1489
1490
1491   proto_item_set_text(parameter_item, "Range (%u) and status", range);
1492 }
1493 /* ------------------------------------------------------------------
1494   Dissector Parameter Circuit group supervision message type
1495  */
1496 void 
1497 dissect_isup_circuit_group_supervision_message_type_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1498
1499   guint8 cgs_message_type;
1500   
1501   cgs_message_type = tvb_get_guint8(parameter_tvb, 0);
1502   proto_tree_add_uint(parameter_tree, hf_isup_cgs_message_type, parameter_tvb, 0, CIRC_GRP_SV_MSG_TYPE_LENGTH, cgs_message_type);
1503
1504   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);
1505 }
1506 /* ------------------------------------------------------------------
1507   Dissector Parameter Facility indicator parameter 
1508  */
1509 void 
1510 dissect_isup_facility_ind_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1511
1512   guint8 indicator;
1513   
1514   indicator = tvb_get_guint8(parameter_tvb, 0);
1515
1516   proto_item_set_text(parameter_item, "Facility indicator: %s (%u)"  ,val_to_str(indicator, isup_facility_ind_value,"spare"), indicator);
1517 }
1518 /* ------------------------------------------------------------------
1519   Dissector Parameter Circuit state indicator 
1520  */
1521 void 
1522 dissect_isup_circuit_state_ind_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1523 {
1524   proto_item *circuit_state_item;
1525   proto_tree *circuit_state_tree;
1526   guint8 circuit_state;
1527   gint offset=0; 
1528   gint i=0;
1529   gint length;
1530
1531   length = tvb_length_remaining(parameter_tvb, offset);
1532   while(length > 0){
1533     circuit_state_item = proto_tree_add_text(parameter_tree, parameter_tvb,
1534                                              offset,
1535                                              tvb_length_remaining(parameter_tvb, offset),
1536                                              "Circuit# CIC+%u state", i);
1537     circuit_state_tree = proto_item_add_subtree(circuit_state_item, ett_isup_circuit_state_ind);
1538     circuit_state = tvb_get_guint8(parameter_tvb, offset);
1539     if ((circuit_state & DC_8BIT_MASK) == 0){ 
1540       proto_tree_add_uint(circuit_state_tree, hf_isup_mtc_blocking_state1, parameter_tvb, offset, 1, circuit_state);
1541       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"));  
1542     } 
1543     else { 
1544       proto_tree_add_uint(circuit_state_tree, hf_isup_mtc_blocking_state2, parameter_tvb, offset, 1, circuit_state);
1545       proto_tree_add_uint(circuit_state_tree, hf_isup_call_proc_state, parameter_tvb, offset, 1, circuit_state);
1546       proto_tree_add_uint(circuit_state_tree, hf_isup_hw_blocking_state, parameter_tvb, offset, 1, circuit_state);
1547       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"));     
1548     } 
1549     offset++;
1550     length = tvb_length_remaining(parameter_tvb, offset);
1551   }
1552   proto_item_set_text(parameter_item, "Circuit state indicator (national use)");
1553 }
1554 /* ------------------------------------------------------------------
1555   Dissector Parameter Event information 
1556  */
1557 void 
1558 dissect_isup_event_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1559
1560   guint8 indicators;
1561   
1562   indicators = tvb_get_guint8(parameter_tvb, 0);
1563   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);
1564   proto_tree_add_boolean(parameter_tree, hf_isup_event_presentation_restricted_ind, parameter_tvb, 0, EVENT_INFO_LENGTH, indicators);
1565
1566   proto_item_set_text(parameter_item,"Event information: %s (%u)", val_to_str(indicators & GFEDCBA_8BIT_MASK, isup_event_ind_value, "spare"),indicators );
1567 }
1568 /* ------------------------------------------------------------------
1569   Dissector Parameter User-to-user information- no detailed dissection since defined in Rec. Q.931
1570  */
1571 void 
1572 dissect_isup_user_to_user_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1573 { guint length = tvb_length(parameter_tvb);
1574   proto_tree_add_text(parameter_item, parameter_tvb, 0, length, "User-to-user info (-> Q.931)"); 
1575   proto_item_set_text(parameter_item, "User-to-user information, see Q.931 (%u byte%s length)", length , plurality(length, "", "s"));
1576 }
1577 /* ------------------------------------------------------------------
1578   Dissector Parameter Call Reference 
1579  */
1580 void 
1581 dissect_isup_call_reference_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1582
1583   guint32 call_id;
1584   guint16 spc;
1585   
1586   call_id = tvb_get_ntoh24(parameter_tvb, 0);
1587   spc = tvb_get_letohs(parameter_tvb, CALL_ID_LENGTH) & 0x3FFF; /*since 1st 2 bits spare */
1588   proto_tree_add_text(parameter_item, parameter_tvb, 0, CALL_ID_LENGTH, "Call identity: %u", call_id); 
1589   proto_tree_add_text(parameter_item, parameter_tvb, CALL_ID_LENGTH, SPC_LENGTH, "Signalling Point Code: %u", spc); 
1590
1591   proto_item_set_text(parameter_item, "Call Reference: Call ID = %u, SPC = %u", call_id, spc);
1592 }
1593 /* ------------------------------------------------------------------
1594   Dissector Parameter Access Transport - no detailed dissection since defined in Rec. Q.931
1595  */
1596 void 
1597 dissect_isup_access_transport_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1598 { guint length = tvb_length(parameter_tvb);
1599   proto_tree_add_text(parameter_item, parameter_tvb, 0, length, "Access transport parameter field (-> Q.931)"); 
1600   proto_item_set_text(parameter_item, "Access transport, see Q.931 (%u byte%s length)", length , plurality(length, "", "s"));
1601 }
1602 /* ------------------------------------------------------------------
1603   Dissector Parameter Optional Forward Call indicators
1604  */
1605 void 
1606 dissect_isup_optional_forward_call_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1607
1608   guint8 indicators;
1609   
1610   indicators = tvb_get_guint8(parameter_tvb, 0);
1611   proto_tree_add_uint(parameter_tree, hf_isup_cug_call_ind, parameter_tvb, 0, OPTIONAL_FORWARD_CALL_IND_LENGTH, indicators);
1612   proto_tree_add_boolean(parameter_tree, hf_isup_simple_segmentation_ind, parameter_tvb, 0, OPTIONAL_FORWARD_CALL_IND_LENGTH, indicators);
1613   proto_tree_add_boolean(parameter_tree, hf_isup_connected_line_identity_request_ind, parameter_tvb, 0, OPTIONAL_FORWARD_CALL_IND_LENGTH, indicators);
1614
1615
1616   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 );
1617 }
1618 /* ------------------------------------------------------------------
1619   Dissector Parameter calling party number
1620  */
1621 void 
1622 dissect_isup_calling_party_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1623 {
1624   proto_item *address_digits_item;
1625   proto_tree *address_digits_tree;
1626   guint8 indicators1, indicators2;
1627   guint8 address_digit_pair=0;
1628   gint offset=0; 
1629   gint i=0;
1630   gint length;
1631   char calling_number[MAXLENGTH]="";
1632
1633   indicators1 = tvb_get_guint8(parameter_tvb, 0);
1634   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
1635   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
1636   indicators2 = tvb_get_guint8(parameter_tvb, 1);
1637   proto_tree_add_boolean(parameter_tree, hf_isup_ni_indicator, parameter_tvb, 1, 1, indicators2);
1638   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
1639   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
1640   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator, parameter_tvb, 1, 1, indicators2);
1641   offset = 2;
1642
1643   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
1644                                             offset,
1645                                             tvb_length_remaining(parameter_tvb, offset),
1646                                             "Calling Party Number");
1647   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
1648
1649   length = tvb_length_remaining(parameter_tvb, offset);
1650   while(length > 0){
1651     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
1652     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1653     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
1654     if ((length - 1) > 0 ){ 
1655       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1656       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1657     } 
1658     offset++;
1659     length = tvb_length_remaining(parameter_tvb, offset);   
1660   }
1661
1662   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
1663       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
1664       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1665   }
1666   calling_number[i++] = '\0';
1667
1668   proto_item_set_text(address_digits_item, "Calling Party Number: %s", calling_number);  
1669   proto_item_set_text(parameter_item, "Calling Party Number: %s", calling_number);
1670   
1671 }
1672 /* ------------------------------------------------------------------
1673   Dissector Parameter Original called  number
1674  */
1675 void 
1676 dissect_isup_original_called_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1677 {
1678   proto_item *address_digits_item;
1679   proto_tree *address_digits_tree;
1680   guint8 indicators1, indicators2;
1681   guint8 address_digit_pair=0;
1682   gint offset=0; 
1683   gint i=0;
1684   gint length;
1685   char calling_number[MAXLENGTH]="";
1686
1687   indicators1 = tvb_get_guint8(parameter_tvb, 0);
1688   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
1689   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
1690   indicators2 = tvb_get_guint8(parameter_tvb, 1);
1691   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
1692   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
1693   offset = 2;
1694
1695   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
1696                                             offset,
1697                                             tvb_length_remaining(parameter_tvb, offset),
1698                                             "Original Called Number");
1699   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
1700
1701   length = tvb_length_remaining(parameter_tvb, offset);
1702   while(length > 0){
1703     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
1704     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1705     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
1706     if ((length - 1) > 0 ){ 
1707       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1708       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1709     } 
1710     offset++;
1711     length = tvb_length_remaining(parameter_tvb, offset);   
1712   }
1713
1714   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
1715       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
1716       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1717   }
1718   calling_number[i++] = '\0';
1719
1720   proto_item_set_text(address_digits_item, "Original Called Number: %s", calling_number);  
1721   proto_item_set_text(parameter_item, "Original Called Number: %s", calling_number);
1722   
1723 }
1724 /* ------------------------------------------------------------------
1725   Dissector Parameter Redirecting number
1726  */
1727 void 
1728 dissect_isup_redirecting_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1729 {
1730   proto_item *address_digits_item;
1731   proto_tree *address_digits_tree;
1732   guint8 indicators1, indicators2;
1733   guint8 address_digit_pair=0;
1734   gint offset=0; 
1735   gint i=0;
1736   gint length;
1737   char calling_number[MAXLENGTH]="";
1738
1739   indicators1 = tvb_get_guint8(parameter_tvb, 0);
1740   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
1741   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
1742   indicators2 = tvb_get_guint8(parameter_tvb, 1);
1743   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
1744   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
1745   offset = 2;
1746
1747   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
1748                                             offset,
1749                                             tvb_length_remaining(parameter_tvb, offset),
1750                                             "Redirecting Number");
1751   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
1752
1753   length = tvb_length_remaining(parameter_tvb, offset);
1754   while(length > 0){
1755     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
1756     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1757     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
1758     if ((length - 1) > 0 ){ 
1759       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1760       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1761     } 
1762     offset++;
1763     length = tvb_length_remaining(parameter_tvb, offset);   
1764   }
1765
1766   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
1767       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
1768       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1769   }
1770   calling_number[i++] = '\0';
1771
1772   proto_item_set_text(address_digits_item, "Redirecting Number: %s", calling_number);  
1773   proto_item_set_text(parameter_item, "Redirecting Number: %s", calling_number);
1774   
1775 }
1776 /* ------------------------------------------------------------------
1777   Dissector Parameter Redirection number 
1778  */
1779 void dissect_isup_redirection_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1780 {
1781   proto_item *address_digits_item;
1782   proto_tree *address_digits_tree;
1783   guint8 indicators1, indicators2;
1784   guint8 address_digit_pair=0;
1785   gint offset=0; 
1786   gint i=0;
1787   gint length;
1788   char called_number[MAXLENGTH]="";
1789
1790   indicators1 = tvb_get_guint8(parameter_tvb, 0);
1791   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
1792   proto_tree_add_uint(parameter_tree, hf_isup_called_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
1793   indicators2 = tvb_get_guint8(parameter_tvb, 1);
1794   proto_tree_add_boolean(parameter_tree, hf_isup_inn_indicator, parameter_tvb, 1, 1, indicators2);
1795   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
1796   offset = 2;
1797
1798   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
1799                                             offset,
1800                                             tvb_length_remaining(parameter_tvb, offset),
1801                                             "Redirection Number");
1802   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
1803
1804   length = tvb_length_remaining(parameter_tvb, offset);
1805   while(length > 0){
1806     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
1807     proto_tree_add_uint(address_digits_tree, hf_isup_called_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1808     called_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
1809     if ((length - 1) > 0 ){ 
1810       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1811       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1812     } 
1813     offset++;
1814     length = tvb_length_remaining(parameter_tvb, offset);   
1815   }
1816
1817   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
1818       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
1819       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1820   }
1821   called_number[i++] = '\0';
1822
1823   proto_item_set_text(address_digits_item, "Redirection Number: %s", called_number);  
1824   proto_item_set_text(parameter_item, "Redirection Number: %s", called_number); 
1825 }
1826 /* ------------------------------------------------------------------
1827   Dissector Parameter Connection request 
1828  */
1829 void 
1830 dissect_isup_connection_request_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1831
1832   guint32 local_ref;
1833   guint16 spc;
1834   guint8 protocol_class, credit, offset=0; 
1835   
1836   local_ref = tvb_get_ntoh24(parameter_tvb, 0);
1837   proto_tree_add_text(parameter_item, parameter_tvb, offset, LOCAL_REF_LENGTH, "Local Reference: %u", local_ref); 
1838   offset = LOCAL_REF_LENGTH;
1839   spc = tvb_get_letohs(parameter_tvb,offset) & 0x3FFF; /*since 1st 2 bits spare */
1840   proto_tree_add_text(parameter_item, parameter_tvb, offset, SPC_LENGTH, "Signalling Point Code: %u", spc); 
1841   offset += SPC_LENGTH;
1842   protocol_class = tvb_get_guint8(parameter_tvb, offset);
1843   proto_tree_add_text(parameter_item, parameter_tvb, offset, PROTOCOL_CLASS_LENGTH, "Protocol Class: %u", protocol_class); 
1844   offset += PROTOCOL_CLASS_LENGTH;
1845   credit = tvb_get_guint8(parameter_tvb, offset);
1846   proto_tree_add_text(parameter_item, parameter_tvb, offset, CREDIT_LENGTH, "Credit: %u", credit); 
1847   offset += CREDIT_LENGTH;
1848
1849   proto_item_set_text(parameter_item, "Connection request: Local Reference = %u, SPC = %u, Protocol Class = %u, Credit = %u", local_ref, spc, protocol_class, credit);
1850 }
1851 /* ------------------------------------------------------------------
1852   Dissector Parameter Redirection information
1853  */
1854 void 
1855 dissect_isup_redirection_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1856
1857   if (tvb_length(parameter_tvb) == 2){ 
1858     guint16 indicators;
1859     indicators = tvb_get_ntohs(parameter_tvb, 0);
1860     proto_tree_add_uint(parameter_tree, hf_isup_redirecting_ind, parameter_tvb,0 , REDIRECTION_INFO_LENGTH, indicators);
1861     proto_tree_add_uint(parameter_tree, hf_isup_original_redirection_reason, parameter_tvb,0 , REDIRECTION_INFO_LENGTH, indicators);
1862     proto_tree_add_uint(parameter_tree, hf_isup_redirection_counter, parameter_tvb,0 , REDIRECTION_INFO_LENGTH, indicators);
1863     proto_tree_add_uint(parameter_tree, hf_isup_redirection_reason, parameter_tvb,0 , REDIRECTION_INFO_LENGTH, indicators);
1864     proto_item_set_text(parameter_item, "Redirection Information");
1865   }
1866   else { /* ISUP'88 (blue book) */
1867     guint16 indicators;
1868     indicators = tvb_get_guint8(parameter_tvb, 0) * 0x100; /*since 2nd octet isn't present*/ 
1869     proto_tree_add_uint(parameter_tree, hf_isup_redirecting_ind, parameter_tvb, 0, 1, indicators);
1870     proto_tree_add_uint(parameter_tree, hf_isup_original_redirection_reason, parameter_tvb,0 , 1, indicators);
1871     proto_item_set_text(parameter_item, "Redirection Information (2nd octet not present since ISUP '88)");
1872   }
1873 }
1874 /* ------------------------------------------------------------------
1875   Dissector Parameter Closed user group interlock code
1876  */
1877 void dissect_isup_closed_user_group_interlock_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1878 {
1879   char NI_digits[5]="";
1880   guint8 digit_pair;
1881   guint16 bin_code;
1882
1883   digit_pair = tvb_get_guint8(parameter_tvb, 0);
1884   NI_digits[0] = number_to_char((digit_pair & HGFE_8BIT_MASK) / 0x10);
1885   NI_digits[1] = number_to_char(digit_pair & DCBA_8BIT_MASK);
1886   digit_pair = tvb_get_guint8(parameter_tvb, 1);
1887   NI_digits[2] = number_to_char((digit_pair & HGFE_8BIT_MASK) / 0x10);
1888   NI_digits[3] = number_to_char(digit_pair & DCBA_8BIT_MASK);
1889   NI_digits[4] = '\0';
1890   proto_tree_add_text(parameter_item, parameter_tvb, 0, 2, "Network Identity: %s", NI_digits); 
1891   bin_code = tvb_get_ntohs(parameter_tvb, 2);  
1892   proto_tree_add_text(parameter_item, parameter_tvb, 3, 2, "Binary Code: 0x%x", bin_code); 
1893   proto_item_set_text(parameter_item, "Closed user group interlock code: NI = %s, Binary code = 0x%x", NI_digits, bin_code); 
1894 }
1895 /* ------------------------------------------------------------------
1896   Dissector Parameter User service information- no detailed dissection since defined in Rec. Q.931
1897  */
1898 void 
1899 dissect_isup_user_service_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1900 { guint length = tvb_length(parameter_tvb);
1901   proto_tree_add_text(parameter_item, parameter_tvb, 0, length, "User service information (-> Q.931)"); 
1902   proto_item_set_text(parameter_item, "User service information, see Q.931 (%u byte%s length)", length , plurality(length, "", "s"));
1903 }
1904 /* ------------------------------------------------------------------
1905   Dissector Parameter Signalling point code 
1906  */
1907 void 
1908 dissect_isup_signalling_point_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1909
1910   guint16 spc;
1911   
1912   spc = tvb_get_letohs(parameter_tvb, 0) & 0x3FFF; /*since 1st 2 bits spare */
1913   proto_tree_add_text(parameter_item, parameter_tvb, 0, SIGNALLING_POINT_CODE_LENGTH, "Signalling Point Code: %u", spc); 
1914
1915   proto_item_set_text(parameter_item, "Signalling point code: %u", spc);
1916 }
1917 /* ------------------------------------------------------------------
1918   Dissector Parameter Connected number
1919  */
1920 void 
1921 dissect_isup_connected_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1922 {
1923   proto_item *address_digits_item;
1924   proto_tree *address_digits_tree;
1925   guint8 indicators1, indicators2;
1926   guint8 address_digit_pair=0;
1927   gint offset=0; 
1928   gint i=0;
1929   gint length;
1930   char calling_number[MAXLENGTH]="";
1931
1932   indicators1 = tvb_get_guint8(parameter_tvb, 0);
1933   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
1934   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
1935   indicators2 = tvb_get_guint8(parameter_tvb, 1);
1936   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
1937   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
1938   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator, parameter_tvb, 1, 1, indicators2);
1939   offset = 2;
1940
1941   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
1942                                             offset,
1943                                             tvb_length_remaining(parameter_tvb, offset),
1944                                             "Connected Number");
1945   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
1946
1947   length = tvb_length_remaining(parameter_tvb, offset);
1948   while(length > 0){
1949     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
1950     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1951     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
1952     if ((length - 1) > 0 ){ 
1953       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1954       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1955     } 
1956     offset++;
1957     length = tvb_length_remaining(parameter_tvb, offset);   
1958   }
1959
1960   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
1961       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
1962       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1963   }
1964   calling_number[i++] = '\0';
1965
1966   proto_item_set_text(address_digits_item, "Connected Number: %s", calling_number);  
1967   proto_item_set_text(parameter_item, "Connected Number: %s", calling_number);
1968   
1969 }
1970 /* ------------------------------------------------------------------
1971   Dissector Transit network selection
1972  */
1973 void 
1974 dissect_isup_transit_network_selection_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1975 {
1976   proto_item *address_digits_item;
1977   proto_tree *address_digits_tree;
1978   guint8 indicators;
1979   guint8 address_digit_pair=0;
1980   gint offset=0; 
1981   gint i=0;
1982   gint length;
1983   char network_id[MAXLENGTH]="";
1984
1985   indicators = tvb_get_guint8(parameter_tvb, 0);
1986   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators);
1987   proto_tree_add_uint(parameter_tree, hf_isup_type_of_network_identification, parameter_tvb, 0, 1, indicators);
1988   proto_tree_add_uint(parameter_tree, hf_isup_network_identification_plan, parameter_tvb, 0, 1, indicators);
1989   offset = 1;
1990
1991   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
1992                                             offset,
1993                                             tvb_length_remaining(parameter_tvb, offset),
1994                                             "Network identification");
1995   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
1996
1997   length = tvb_length_remaining(parameter_tvb, offset);
1998   while(length > 0){
1999     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
2000     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2001     network_id[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
2002     if ((length - 1) > 0 ){ 
2003       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2004       network_id[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2005     } 
2006     offset++;
2007     length = tvb_length_remaining(parameter_tvb, offset);   
2008   }
2009
2010   if  (((indicators & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
2011       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
2012       network_id[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2013   }
2014   network_id[i++] = '\0';
2015
2016   proto_item_set_text(address_digits_item, "Network identification: %s", network_id);  
2017   proto_item_set_text(parameter_item, "Transit network selection: %s", network_id);
2018   
2019 }
2020 /* ------------------------------------------------------------------
2021   Dissector Parameter Circuit assignment map
2022  */
2023 void 
2024 dissect_isup_circuit_assignment_map_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2025 { guint8 map_type;
2026
2027   map_type = tvb_get_guint8(parameter_tvb, 0);
2028   proto_tree_add_uint(parameter_tree, hf_isup_map_type, parameter_tvb, 0, 1, map_type); 
2029   proto_tree_add_text(parameter_item, parameter_tvb, 1, 5, "Circuit assignment map (bit position indicates usage of corresponding circuit->3.69/Q.763)"); 
2030   proto_item_set_text(parameter_item, "Circuit assignment map");
2031 }
2032 /* ------------------------------------------------------------------
2033   Dissector Parameter Automatic congestion level
2034  */
2035 void 
2036 dissect_isup_automatic_congestion_level_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2037 { guint8 congestion_level;
2038
2039   congestion_level = tvb_get_guint8(parameter_tvb, 0);
2040   proto_tree_add_uint(parameter_tree, hf_isup_automatic_congestion_level, parameter_tvb, 0, AUTO_CONGEST_LEVEL_LENGTH, congestion_level); 
2041   proto_item_set_text(parameter_item, "Automatic congestion level: %s (%u)", val_to_str(congestion_level, isup_auto_congestion_level_value, "spare"), congestion_level);
2042 }
2043 /* ------------------------------------------------------------------
2044   Dissector Parameter Optional backward Call indicators
2045  */
2046 void 
2047 dissect_isup_optional_backward_call_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2048
2049   guint8 indicators;
2050   
2051   indicators = tvb_get_guint8(parameter_tvb, 0);
2052   proto_tree_add_boolean(parameter_tree, hf_isup_inband_information_ind, parameter_tvb, 0, OPTIONAL_BACKWARD_CALL_IND_LENGTH, indicators);
2053   proto_tree_add_boolean(parameter_tree, hf_isup_call_diversion_may_occur_ind, parameter_tvb, 0, OPTIONAL_BACKWARD_CALL_IND_LENGTH, indicators);
2054   proto_tree_add_boolean(parameter_tree, hf_isup_simple_segmentation_ind, parameter_tvb, 0, OPTIONAL_BACKWARD_CALL_IND_LENGTH, indicators);
2055   proto_tree_add_boolean(parameter_tree, hf_isup_mlpp_user_ind, parameter_tvb, 0, OPTIONAL_BACKWARD_CALL_IND_LENGTH, indicators);
2056
2057
2058   proto_item_set_text(parameter_item,"Optional backward call indicators: 0x%x", indicators );
2059 }
2060 /* ------------------------------------------------------------------
2061   Dissector Parameter User-to-user indicators
2062  */
2063 void 
2064 dissect_isup_user_to_user_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2065
2066   guint8 indicators;
2067   
2068   indicators = tvb_get_guint8(parameter_tvb, 0);
2069   proto_tree_add_text(parameter_item, parameter_tvb, 0, USER_TO_USER_IND_LENGTH, "User-to-user indicators: 0x%x (refer to 3.60/Q.763 for detailed decoding)", indicators );
2070   proto_item_set_text(parameter_item,"User-to-user indicators: 0x%x", indicators );
2071 }
2072 /* ------------------------------------------------------------------
2073   Dissector Parameter Original ISC point code 
2074  */
2075 void 
2076 dissect_isup_original_isc_point_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2077
2078   guint16 spc;
2079   
2080   spc = tvb_get_letohs(parameter_tvb, 0) & 0x3FFF; /*since 1st 2 bits spare */
2081   proto_tree_add_text(parameter_item, parameter_tvb, 0, ORIGINAL_ISC_POINT_CODE_LENGTH, "Origination ISC Point Code: %u", spc); 
2082
2083   proto_item_set_text(parameter_item, "Origination ISC point code: %u", spc);
2084 }
2085 /* ------------------------------------------------------------------
2086   Dissector Parameter Generic notification indicator
2087  */
2088 void 
2089 dissect_isup_generic_notification_indicator_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2090
2091   guint8 indicators;
2092   
2093   indicators = tvb_get_guint8(parameter_tvb, 0);
2094   proto_tree_add_text(parameter_item, parameter_tvb, 0, GENERIC_NOTIFICATION_IND_LENGTH, "Generic notification indicator: 0x%x (refer to 3.25/Q.763 for detailed decoding)", indicators );
2095   proto_item_set_text(parameter_item,"Generic notification indicator: 0x%x", indicators );
2096 }
2097 /* ------------------------------------------------------------------
2098   Dissector Parameter Call history information
2099  */
2100 void 
2101 dissect_isup_call_history_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2102
2103   guint16 info;
2104   
2105   info = tvb_get_ntohs(parameter_tvb, 0);
2106   proto_tree_add_text(parameter_item, parameter_tvb, 0, CALL_HISTORY_INFO_LENGTH, "Call history info: propagation delay = %u ms", info);
2107   proto_item_set_text(parameter_item,"Call history info: propagation delay = %u ms", info);
2108 }
2109 /* ------------------------------------------------------------------
2110   Dissector Parameter Access delivery information
2111  */
2112 void 
2113 dissect_isup_access_delivery_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2114 { guint8 indicator;
2115
2116   indicator = tvb_get_guint8(parameter_tvb, 0);
2117   proto_tree_add_boolean(parameter_tree, hf_isup_access_delivery_ind, parameter_tvb, 0, ACCESS_DELIVERY_INFO_LENGTH, indicator); 
2118   proto_item_set_text(parameter_item, "Access delivery information: 0x%x", indicator);
2119 }
2120 /* ------------------------------------------------------------------
2121   Dissector Parameter Network specific facility
2122  */
2123 void 
2124 dissect_isup_network_specific_facility_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2125 { guint length = tvb_length(parameter_tvb);
2126   proto_tree_add_text(parameter_item, parameter_tvb, 0, length, "Network specific facility (refer to 3.36/Q.763 for detailed decoding)"); 
2127   proto_item_set_text(parameter_item, "Network specific facility (%u byte%s length)", length , plurality(length, "", "s"));
2128 }
2129 /* ------------------------------------------------------------------
2130   Dissector Parameter User service information prime 
2131  */
2132 void 
2133 dissect_isup_user_service_information_prime_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2134 { guint length = tvb_length(parameter_tvb);
2135   proto_tree_add_text(parameter_item, parameter_tvb, 0, length, "User service information prime (-> Q.931)"); 
2136   proto_item_set_text(parameter_item, "User service information prime, see Q.931 (%u byte%s length)", length , plurality(length, "", "s"));
2137 }
2138 /* ------------------------------------------------------------------
2139   Dissector Parameter Propagation delay counter
2140  */
2141 void 
2142 dissect_isup_propagation_delay_counter_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2143
2144   guint16 info;
2145   
2146   info = tvb_get_ntohs(parameter_tvb, 0);
2147   proto_tree_add_text(parameter_item, parameter_tvb, 0, PROPAGATION_DELAY_COUNT_LENGTH, "Propagation delay counter = %u ms", info);
2148   proto_item_set_text(parameter_item,"Propagation delay counter = %u ms", info);
2149 }
2150 /* ------------------------------------------------------------------
2151   Dissector Parameter Remote operations
2152  */
2153 void 
2154 dissect_isup_remote_operations_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2155 { guint length = tvb_length(parameter_tvb);
2156   proto_tree_add_text(parameter_item, parameter_tvb, 0, length, "Remote operations"); 
2157   proto_item_set_text(parameter_item, "Remote operations (%u byte%s length)", length , plurality(length, "", "s"));
2158 }
2159 /* ------------------------------------------------------------------
2160   Dissector Parameter Service activation
2161  */
2162 void 
2163 dissect_isup_service_activation_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2164
2165   guint i;
2166   guint8 feature_code;
2167   guint length = tvb_length(parameter_tvb);
2168   for (i=0; i< length; i++){
2169     feature_code = tvb_get_guint8(parameter_tvb, i);
2170     proto_tree_add_text(parameter_item, parameter_tvb, i, 1, "Feature Code %u: %u", i+1, feature_code); 
2171   }
2172   proto_item_set_text(parameter_item, "Service Activation (%u byte%s length)", length , plurality(length, "", "s"));
2173 }
2174 /* ------------------------------------------------------------------
2175   Dissector Parameter User service information prime - no detailed dissection since defined in Rec. Q.931
2176  */
2177 void 
2178 dissect_isup_user_teleservice_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2179
2180   proto_tree_add_text(parameter_item, parameter_tvb, 0, USER_TELESERVICE_INFO_LENGTH, "User teleservice information (-> Q.931)"); 
2181   proto_item_set_text(parameter_item, "User teleservice information, see Q.931");
2182 }
2183 /* ------------------------------------------------------------------
2184   Dissector Parameter Transmission medium requirement used
2185  */
2186 void 
2187 dissect_isup_transmission_medium_used_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2188
2189   guint8 transmission_medium_requirement;
2190   
2191   transmission_medium_requirement = tvb_get_guint8(parameter_tvb, 0);
2192   proto_tree_add_uint(parameter_tree, hf_isup_transmission_medium_requirement_prime, parameter_tvb, 0, TRANSMISSION_MEDIUM_RQMT_PRIME_LENGTH,transmission_medium_requirement);
2193
2194   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"));
2195 }
2196 /* ------------------------------------------------------------------
2197   Dissector Parameter Call diversion information
2198  */
2199 void 
2200 dissect_isup_call_diversion_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2201 { guint8 indicator;
2202
2203   indicator = tvb_get_guint8(parameter_tvb, 0); 
2204   proto_tree_add_text(parameter_item, parameter_tvb, 0, CALL_DIV_INFO_LENGTH, "Call diversion information: 0x%x (refer to 3.6/Q.763 for detailed decoding)", indicator);
2205   proto_item_set_text(parameter_item, "Call diversion information: 0x%x", indicator);
2206 }
2207 /* ------------------------------------------------------------------
2208   Dissector Parameter Echo control  information
2209  */
2210 void 
2211 dissect_isup_echo_control_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2212 { guint8 indicator;
2213
2214   indicator = tvb_get_guint8(parameter_tvb, 0); 
2215   proto_tree_add_text(parameter_item, parameter_tvb, 0, ECHO_CONTROL_INFO_LENGTH, "Echo control information: 0x%x (refer to 3.19/Q.763 for detailed decoding)", indicator);
2216   proto_item_set_text(parameter_item, "Echo control information: 0x%x", indicator);
2217 }
2218 /* ------------------------------------------------------------------
2219   Dissector Parameter Message compatibility information
2220  */
2221 void 
2222 dissect_isup_message_compatibility_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2223 { guint length = tvb_length(parameter_tvb);
2224   proto_tree_add_text(parameter_item, parameter_tvb, 0, length, "Message compatibility information (refer to 3.33/Q.763 for detailed decoding)"); 
2225   proto_item_set_text(parameter_item, "Message compatibility information (%u byte%s length)", length , plurality(length, "", "s"));
2226 }
2227 /* ------------------------------------------------------------------
2228   Dissector Parameter compatibility information
2229  */
2230 void 
2231 dissect_isup_parameter_compatibility_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2232
2233   guint length = tvb_length(parameter_tvb);
2234   proto_tree_add_text(parameter_item, parameter_tvb, 0, length, "Parameter compatibility information (refer to 3.41/Q.763 for detailed decoding)"); 
2235   proto_item_set_text(parameter_item, "Parameter compatibility information (%u byte%s length)", length , plurality(length, "", "s"));
2236 }
2237 /* ------------------------------------------------------------------
2238   Dissector Parameter MLPP precedence
2239  */
2240 void dissect_isup_mlpp_precedence_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2241 {
2242   char NI_digits[5]="";
2243   guint8 indicators, digit_pair;
2244   guint32 bin_code;
2245
2246   indicators = tvb_get_guint8(parameter_tvb, 0);
2247   proto_tree_add_text(parameter_item, parameter_tvb, 0, 1, "LFB (Bits 6+7) and precedence level (Bits 1-4): 0x%x",indicators); 
2248   digit_pair = tvb_get_guint8(parameter_tvb, 1);
2249   NI_digits[0] = number_to_char((digit_pair & HGFE_8BIT_MASK) / 0x10);
2250   NI_digits[1] = number_to_char(digit_pair & DCBA_8BIT_MASK);
2251   digit_pair = tvb_get_guint8(parameter_tvb, 2);
2252   NI_digits[2] = number_to_char((digit_pair & HGFE_8BIT_MASK) / 0x10);
2253   NI_digits[3] = number_to_char(digit_pair & DCBA_8BIT_MASK);
2254   NI_digits[4] = '\0';
2255   proto_tree_add_text(parameter_item, parameter_tvb, 1, 2, "Network Identity: %s", NI_digits); 
2256   bin_code = tvb_get_ntoh24(parameter_tvb, 3);  
2257   proto_tree_add_text(parameter_item, parameter_tvb, 3, 3, "MLPP service domain: 0x%x", bin_code); 
2258   proto_item_set_text(parameter_item, "MLPP precedence: NI = %s, MLPP service domain = 0x%x", NI_digits, bin_code); 
2259 }
2260 /* ------------------------------------------------------------------
2261   Dissector Parameter MCID request indicators
2262  */
2263 void 
2264 dissect_isup_mcid_request_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2265 { guint8 indicator;
2266
2267   indicator = tvb_get_guint8(parameter_tvb, 0); 
2268   proto_tree_add_text(parameter_item, 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);
2269   proto_item_set_text(parameter_item, "MCID request indicators: 0x%x", indicator);
2270 }
2271 /* ------------------------------------------------------------------
2272   Dissector Parameter MCID response indicators
2273  */
2274 void 
2275 dissect_isup_mcid_response_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2276 { guint8 indicator;
2277
2278   indicator = tvb_get_guint8(parameter_tvb, 0); 
2279   proto_tree_add_text(parameter_item, 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);
2280   proto_item_set_text(parameter_item, "MCID response indicators: 0x%x", indicator);
2281 }
2282 /* ------------------------------------------------------------------
2283   Dissector Parameter Hop counter
2284  */
2285 void 
2286 dissect_isup_hop_counter_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2287 { guint8 counter;
2288
2289   counter = tvb_get_guint8(parameter_tvb, 0) & EDCBA_8BIT_MASK; /* since bits H,G and F are spare */ 
2290   proto_tree_add_text(parameter_item, parameter_tvb, 0, HOP_COUNTER_LENGTH, "Hop counter: %u", counter);
2291   proto_item_set_text(parameter_item,  "Hop counter: %u", counter);
2292 }
2293 /* ------------------------------------------------------------------
2294   Dissector Parameter Transmission medium requirement prime
2295  */
2296 void 
2297 dissect_isup_transmission_medium_requirement_prime_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2298
2299   guint8 transmission_medium_requirement;
2300   
2301   transmission_medium_requirement = tvb_get_guint8(parameter_tvb, 0);
2302   proto_tree_add_uint(parameter_tree, hf_isup_transmission_medium_requirement_prime, parameter_tvb, 0, TRANSMISSION_MEDIUM_RQMT_PRIME_LENGTH,transmission_medium_requirement);
2303
2304   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"));
2305 }
2306
2307 /* ------------------------------------------------------------------
2308   Dissector Parameter location number
2309  */
2310 void 
2311 dissect_isup_location_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2312 {
2313   proto_item *address_digits_item;
2314   proto_tree *address_digits_tree;
2315   guint8 indicators1, indicators2;
2316   guint8 address_digit_pair=0;
2317   gint offset=0; 
2318   gint i=0;
2319   gint length;
2320   char calling_number[MAXLENGTH]="";
2321
2322   indicators1 = tvb_get_guint8(parameter_tvb, 0);
2323   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
2324   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
2325   indicators2 = tvb_get_guint8(parameter_tvb, 1);
2326   proto_tree_add_boolean(parameter_tree, hf_isup_inn_indicator, parameter_tvb, 1, 1, indicators2);
2327   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
2328   if ((indicators2 & GFE_8BIT_MASK) == 0x50)
2329     proto_tree_add_text(parameter_item, parameter_tvb, 1, 1, "Different meaning for Location Number: Numbering plan indicator = private numbering plan");
2330   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
2331   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator, parameter_tvb, 1, 1, indicators2);
2332   offset = 2;
2333
2334   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
2335                                             offset,
2336                                             tvb_length_remaining(parameter_tvb, offset),
2337                                             "Location number");
2338   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
2339
2340   length = tvb_length_remaining(parameter_tvb, offset);
2341   while(length > 0){
2342     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
2343     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2344     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
2345     if ((length - 1) > 0 ){ 
2346       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2347       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2348     } 
2349     offset++;
2350     length = tvb_length_remaining(parameter_tvb, offset);   
2351   }
2352
2353   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
2354       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
2355       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2356   }
2357   calling_number[i++] = '\0';
2358
2359   proto_item_set_text(address_digits_item, "Location number: %s", calling_number);  
2360   proto_item_set_text(parameter_item, "Location number: %s", calling_number);
2361   
2362 }
2363 /* ------------------------------------------------------------------
2364   Dissector Parameter Redirection number restiriction
2365  */
2366 void 
2367 dissect_isup_redirection_number_restriction_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2368
2369   guint8 indicator;
2370   
2371   indicator = tvb_get_guint8(parameter_tvb, 0);
2372   switch (indicator & BA_8BIT_MASK) {
2373   case 0:
2374     proto_tree_add_text(parameter_item, parameter_tvb, 0, REDIRECTION_NUMBER_RESTRICTION_LENGTH, "Presentation indicator: Presentation allowed");
2375     break;
2376   case 1:
2377     proto_tree_add_text(parameter_item, parameter_tvb, 0, REDIRECTION_NUMBER_RESTRICTION_LENGTH, "Presentation indicator: Presentation restricted");
2378     break;
2379   default:
2380     proto_tree_add_text(parameter_item, parameter_tvb, 0, REDIRECTION_NUMBER_RESTRICTION_LENGTH, "Presentation indicator: spare");
2381     break;
2382   }
2383   proto_item_set_text(parameter_item, "Redirection number restriction: 0x%x ", indicator); 
2384 }
2385 /* ------------------------------------------------------------------
2386   Dissector Parameter Call transfer identity
2387  */
2388 void 
2389 dissect_isup_call_transfer_reference_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2390 { guint8 id;
2391
2392   id = tvb_get_guint8(parameter_tvb, 0);
2393   proto_tree_add_text(parameter_item, parameter_tvb, 0, CALL_TRANSFER_REF_LENGTH, "Call transfer identity: %u", id);
2394   proto_item_set_text(parameter_item,  "Call transfer reference: %u", id);
2395 }
2396 /* ------------------------------------------------------------------
2397   Dissector Parameter Loop prevention
2398  */
2399 void 
2400 dissect_isup_loop_prevention_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2401
2402   guint8 indicator;
2403   
2404   indicator = tvb_get_guint8(parameter_tvb, 0);
2405   if ((indicator & A_8BIT_MASK)==0) {
2406     proto_tree_add_text(parameter_item, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, "Type: Request");
2407     proto_item_set_text(parameter_item, "Loop prevention indicators: Request (%u)", indicator); 
2408   }
2409   else {
2410     proto_tree_add_text(parameter_item, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, "Type: Response");
2411     proto_tree_add_uint(parameter_item, hf_isup_loop_prevention_response_ind, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, indicator);
2412     proto_item_set_text(parameter_item, "Loop prevention indicators: Response (%u)", indicator); 
2413   }
2414 }
2415 /* ------------------------------------------------------------------
2416   Dissector Parameter Call transfer number
2417  */
2418 void 
2419 dissect_isup_call_transfer_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2420 {
2421   proto_item *address_digits_item;
2422   proto_tree *address_digits_tree;
2423   guint8 indicators1, indicators2;
2424   guint8 address_digit_pair=0;
2425   gint offset=0; 
2426   gint i=0;
2427   gint length;
2428   char calling_number[MAXLENGTH]="";
2429
2430   indicators1 = tvb_get_guint8(parameter_tvb, 0);
2431   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
2432   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
2433   indicators2 = tvb_get_guint8(parameter_tvb, 1);
2434   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
2435   if ((indicators2 & GFE_8BIT_MASK) == 0x50)
2436     proto_tree_add_text(parameter_item, parameter_tvb, 1, 1, "Different meaning for Call Transfer Number: Numbering plan indicator = private numbering plan");
2437   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
2438   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator_enhanced, parameter_tvb, 1, 1, indicators2);
2439   offset = 2;
2440
2441   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
2442                                             offset,
2443                                             tvb_length_remaining(parameter_tvb, offset),
2444                                             "Call transfer number");
2445   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
2446
2447   length = tvb_length_remaining(parameter_tvb, offset);
2448   while(length > 0){
2449     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
2450     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2451     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
2452     if ((length - 1) > 0 ){ 
2453       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2454       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2455     } 
2456     offset++;
2457     length = tvb_length_remaining(parameter_tvb, offset);   
2458   }
2459
2460   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
2461       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
2462       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2463   }
2464   calling_number[i++] = '\0';
2465
2466   proto_item_set_text(address_digits_item, "Call transfer number: %s", calling_number);  
2467   proto_item_set_text(parameter_item, "Call transfer number: %s", calling_number);
2468   
2469 }
2470 /* ------------------------------------------------------------------
2471   Dissector Parameter CCSS
2472  */
2473 void 
2474 dissect_isup_ccss_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2475
2476   guint8 indicator;
2477   
2478   indicator = tvb_get_guint8(parameter_tvb, 0);
2479   if ((indicator & A_8BIT_MASK)==0) {
2480     proto_tree_add_text(parameter_item, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, "CCSS call indicator: no indication");
2481     proto_item_set_text(parameter_item, "CCSS call indicator: no indication (%u)", indicator); 
2482   }
2483   else {
2484     proto_tree_add_text(parameter_item, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, "CCSS call indicator: CCSS call");
2485     proto_item_set_text(parameter_item, "CCSS call indicator: CCSS call (%u)", indicator); 
2486   }
2487 }
2488 /* ------------------------------------------------------------------ 
2489  Parameter Forward GVNS 
2490  */
2491 void
2492 dissect_isup_forward_gvns_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2493 { guint length = tvb_length(parameter_tvb);
2494   proto_tree_add_text(parameter_item, parameter_tvb, 0, length, "Forward GVNS (refer to 3.66/Q.763 for detailed decoding)");
2495   proto_item_set_text(parameter_item, "Forward GVNS (%u Byte%s)", length , plurality(length, "", "s"));
2496 }
2497 /* ------------------------------------------------------------------ 
2498  Parameter Redirect capability
2499  */
2500 void
2501 dissect_isup_redirect_capability_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2502 { guint length = tvb_length(parameter_tvb);
2503   proto_tree_add_text(parameter_item, parameter_tvb, 0, length, "Redirect capability (format is a national matter)");
2504   proto_item_set_text(parameter_item, "Redirect Capability (%u Byte%s)", length , plurality(length, "", "s"));
2505 }
2506 /* ------------------------------------------------------------------
2507   Dissector Parameter Backward GVNS
2508  */
2509 void 
2510 dissect_isup_backward_gvns_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2511 { guint8 indicator;
2512
2513   indicator = tvb_get_guint8(parameter_tvb, 0); 
2514   proto_tree_add_text(parameter_item, parameter_tvb, 0, BACKWARD_GVNS_LENGTH, "Backward GVNS: 0x%x (refer to 3.62/Q.763 for detailed decoding)", indicator);
2515   proto_item_set_text(parameter_item, "Backward GVNS: 0x%x", indicator);
2516 }
2517 /* ------------------------------------------------------------------
2518   Dissector Parameter Network management controls
2519  */
2520 void 
2521 dissect_isup_network_management_controls_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2522 { guint8 indicator;
2523
2524   indicator = tvb_get_guint8(parameter_tvb, 0); 
2525   proto_tree_add_boolean(parameter_item, hf_isup_temporary_alternative_routing_ind, parameter_tvb, 0,NETWORK_MANAGEMENT_CONTROLS_LENGTH, indicator);
2526   proto_tree_add_boolean(parameter_item, hf_isup_extension_ind, parameter_tvb, 0,NETWORK_MANAGEMENT_CONTROLS_LENGTH, indicator);
2527   proto_item_set_text(parameter_item, "Network management controls: 0x%x", indicator);
2528 }
2529 /* ------------------------------------------------------------------
2530   Dissector Parameter Correlation id - no detailed dissection since defined in Rec. Q.1281
2531  */
2532 void 
2533 dissect_isup_correlation_id_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2534 { guint length = tvb_length(parameter_tvb);
2535   proto_tree_add_text(parameter_item, parameter_tvb, 0, length, "Correlation ID (-> Q.1281)"); 
2536   proto_item_set_text(parameter_item, "Correlation ID, see Q.1281 (%u Byte%s)", length , plurality(length, "", "s"));
2537 }
2538 /* ------------------------------------------------------------------
2539   Dissector Parameter SCF id - no detailed dissection since defined in Rec. Q.1281
2540  */
2541 void 
2542 dissect_isup_scf_id_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2543 { guint length = tvb_length(parameter_tvb);
2544   proto_tree_add_text(parameter_item, parameter_tvb, 0, length, "SCF ID (-> Q.1281)"); 
2545   proto_item_set_text(parameter_item, "SCF ID, see Q.1281 (%u Byte%s)", length , plurality(length, "", "s"));
2546 }
2547 /* ------------------------------------------------------------------
2548   Dissector Parameter Call diversion treatment indicators
2549  */
2550 void 
2551 dissect_isup_call_diversion_treatment_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2552 { guint8 indicator;
2553
2554   indicator = tvb_get_guint8(parameter_tvb, 0); 
2555   proto_tree_add_uint(parameter_item, hf_isup_call_to_be_diverted_ind, parameter_tvb, 0,CALL_DIV_TREATMENT_IND_LENGTH, indicator);
2556   proto_tree_add_boolean(parameter_item, hf_isup_extension_ind, parameter_tvb, 0, CALL_DIV_TREATMENT_IND_LENGTH, indicator);
2557   proto_item_set_text(parameter_item, "Call diversion treatment indicators: 0x%x", indicator);
2558 }
2559 /* ------------------------------------------------------------------
2560   Dissector Parameter called IN  number
2561  */
2562 void 
2563 dissect_isup_called_in_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2564 {
2565   proto_item *address_digits_item;
2566   proto_tree *address_digits_tree;
2567   guint8 indicators1, indicators2;
2568   guint8 address_digit_pair=0;
2569   gint offset=0; 
2570   gint i=0;
2571   gint length;
2572   char calling_number[MAXLENGTH]="";
2573
2574   indicators1 = tvb_get_guint8(parameter_tvb, 0);
2575   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
2576   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
2577   indicators2 = tvb_get_guint8(parameter_tvb, 1);
2578   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
2579   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
2580   offset = 2;
2581
2582   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
2583                                             offset,
2584                                             tvb_length_remaining(parameter_tvb, offset),
2585                                             "Called IN Number");
2586   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
2587
2588   length = tvb_length_remaining(parameter_tvb, offset);
2589   while(length > 0){
2590     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
2591     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2592     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
2593     if ((length - 1) > 0 ){ 
2594       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2595       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2596     } 
2597     offset++;
2598     length = tvb_length_remaining(parameter_tvb, offset);   
2599   }
2600
2601   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
2602       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
2603       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2604   }
2605   calling_number[i++] = '\0';
2606
2607   proto_item_set_text(address_digits_item, "Called IN Number: %s", calling_number);  
2608   proto_item_set_text(parameter_item, "Called IN Number: %s", calling_number);
2609   
2610 }
2611 /* ------------------------------------------------------------------
2612   Dissector Parameter Call offering treatment indicators
2613  */
2614 void 
2615 dissect_isup_call_offering_treatment_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2616 { guint8 indicator;
2617
2618   indicator = tvb_get_guint8(parameter_tvb, 0); 
2619   proto_tree_add_uint(parameter_item, hf_isup_call_to_be_offered_ind, parameter_tvb, 0,CALL_OFFERING_TREATMENT_IND_LENGTH, indicator);
2620   proto_tree_add_boolean(parameter_item, hf_isup_extension_ind, parameter_tvb, 0, CALL_OFFERING_TREATMENT_IND_LENGTH, indicator);
2621   proto_item_set_text(parameter_item, "Call offering treatment indicators: 0x%x", indicator);
2622 }
2623 /* ------------------------------------------------------------------ 
2624  Parameter Charged party identification
2625  */
2626 void
2627 dissect_isup_charged_party_identification_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2628 { guint length = tvb_length(parameter_tvb);
2629   proto_tree_add_text(parameter_item, parameter_tvb, 0, length, "Charged party identification (format is national network specific)");
2630   proto_item_set_text(parameter_item, "Charged party identification (%u Byte%s)", length , plurality(length, "", "s"));
2631 }
2632 /* ------------------------------------------------------------------
2633   Dissector Parameter Conference treatment indicators
2634  */
2635 void 
2636 dissect_isup_conference_treatment_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2637 { guint8 indicator;
2638
2639   indicator = tvb_get_guint8(parameter_tvb, 0); 
2640   proto_tree_add_uint(parameter_item, hf_isup_conference_acceptance_ind, parameter_tvb, 0,CONFERENCE_TREATMENT_IND_LENGTH, indicator);
2641   proto_tree_add_boolean(parameter_item, hf_isup_extension_ind, parameter_tvb, 0, CONFERENCE_TREATMENT_IND_LENGTH, indicator);
2642   proto_item_set_text(parameter_item, "Conference treatment indicators: 0x%x", indicator);
2643 }
2644 /* ------------------------------------------------------------------
2645   Dissector Parameter Display information
2646  */
2647 void 
2648 dissect_isup_display_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2649 { guint length = tvb_length(parameter_tvb);
2650   proto_tree_add_text(parameter_item, parameter_tvb, 0, length, "Display information (-> Q.931)");
2651   proto_item_set_text(parameter_item, "Display information (%u Byte%s)", length , plurality(length, "", "s"));
2652 }
2653 /* ------------------------------------------------------------------ 
2654  Parameter UID action indicators
2655  */
2656 void
2657 dissect_isup_uid_action_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2658 { guint8 indicator;
2659
2660   indicator = tvb_get_guint8(parameter_tvb, 0); 
2661   proto_tree_add_text(parameter_item, parameter_tvb, 0,UID_ACTION_IND_LENGTH, "UID action indicators: 0x%x (refer to 3.78/Q.763 for detailed decoding)", indicator);
2662   proto_item_set_text(parameter_item, "UID action indicators: 0x%x", indicator);
2663 }
2664 /* ------------------------------------------------------------------ 
2665  Parameter UID capability indicators
2666  */
2667 void
2668 dissect_isup_uid_capability_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2669 { guint8 indicator;
2670
2671   indicator = tvb_get_guint8(parameter_tvb, 0); 
2672   proto_tree_add_text(parameter_item, parameter_tvb, 0,UID_CAPABILITY_IND_LENGTH, "UID capability indicators: 0x%x (refer to 3.79/Q.763 for detailed decoding)", indicator);
2673   proto_item_set_text(parameter_item, "UID capability indicators: 0x%x", indicator);
2674 }
2675 /* ------------------------------------------------------------------ 
2676  Parameter Redirect counter
2677  */
2678 void
2679 dissect_isup_redirect_counter_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2680 { guint length = tvb_length(parameter_tvb);
2681   proto_tree_add_text(parameter_item, parameter_tvb, 0, length, "Redirect counter (format is a national matter)");
2682   proto_item_set_text(parameter_item, "Redirect counter (%u Byte%s)", length , plurality(length, "", "s"));
2683 }
2684 /* ------------------------------------------------------------------
2685   Dissector Parameter Collect call request
2686  */
2687 void 
2688 dissect_isup_collect_call_request_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2689 { guint8 indicator;
2690
2691   indicator = tvb_get_guint8(parameter_tvb, 0); 
2692   if ((indicator & A_8BIT_MASK) == 0) {
2693     proto_tree_add_text(parameter_item, parameter_tvb, 0, COLLECT_CALL_REQUEST_LENGTH, "Collect call request indicator: no indication");
2694     proto_item_set_text(parameter_item, "Collect call reqeust: no indication (0x%x)", indicator);
2695   }
2696   else {
2697     proto_tree_add_text(parameter_item, parameter_tvb, 0, COLLECT_CALL_REQUEST_LENGTH, "Collect call request indicator: collect call requested");
2698     proto_item_set_text(parameter_item, "Collect call reqeust: collect call requested (0x%x)", indicator);
2699   }
2700 }
2701 /* ------------------------------------------------------------------
2702   Dissector Parameter Generic number
2703  */
2704 void 
2705 dissect_isup_generic_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2706 {
2707   proto_item *address_digits_item;
2708   proto_tree *address_digits_tree;
2709   guint8 indicators1, indicators2, nr_qualifier_ind;
2710   guint8 address_digit_pair=0;
2711   gint offset=0; 
2712   gint i=0;
2713   gint length;
2714   char calling_number[MAXLENGTH]="";
2715
2716   nr_qualifier_ind = tvb_get_guint8(parameter_tvb, 0);
2717   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);
2718   indicators1 = tvb_get_guint8(parameter_tvb, 1);
2719   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 1, 1, indicators1);
2720   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
2721   indicators2 = tvb_get_guint8(parameter_tvb, 2);
2722   proto_tree_add_boolean(parameter_tree, hf_isup_ni_indicator, parameter_tvb, 2, 1, indicators2);
2723   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 2, 1, indicators2);
2724   if ((indicators2 & GFE_8BIT_MASK) == 0x50)
2725     proto_tree_add_text(parameter_item, parameter_tvb, 2, 1, "Different meaning for Generic Number: Numbering plan indicator = private numbering plan");
2726   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 2, 1, indicators2);
2727   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator_enhanced, parameter_tvb, 2, 1, indicators2);
2728   offset = 3;
2729
2730   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
2731                                             offset,
2732                                             tvb_length_remaining(parameter_tvb, offset),
2733                                             "Generic number");
2734   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
2735
2736   length = tvb_length_remaining(parameter_tvb, offset);
2737   while(length > 0){
2738     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
2739     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2740     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
2741     if ((length - 1) > 0 ){ 
2742       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
2743       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2744     } 
2745     offset++;
2746     length = tvb_length_remaining(parameter_tvb, offset);   
2747   }
2748
2749   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
2750       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
2751       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
2752   }
2753   calling_number[i++] = '\0';
2754
2755   proto_item_set_text(address_digits_item, "Generic number: %s", calling_number);  
2756   proto_item_set_text(parameter_item, "Generic number: %s", calling_number);
2757   
2758 }
2759 /* ------------------------------------------------------------------ 
2760  Dissector Parameter Generic digits
2761  */
2762 void
2763 dissect_isup_generic_digits_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2764 { guint length = tvb_length(parameter_tvb);
2765   proto_tree_add_text(parameter_item, parameter_tvb, 0, length, "Generic digits (refer to 3.24/Q.673 for detailed decoding)");
2766   proto_item_set_text(parameter_item, "Generic digits (%u Byte%s)", length , plurality(length, "", "s"));
2767 }
2768 /* ------------------------------------------------------------------ */
2769 void
2770 dissect_isup_unknown_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2771 { guint length = tvb_length(parameter_tvb);
2772   proto_item_set_text(parameter_item, "Parameter Type unknown/reserved (%u Byte%s)", length , plurality(length, "", "s"));
2773 }
2774 /* ------------------------------------------------------------------ */
2775
2776 /* ------------------------------------------------------------------
2777   Dissector all optional parameters
2778 */
2779 void
2780 dissect_isup_optional_parameter(tvbuff_t *optional_parameters_tvb, proto_tree *isup_tree)
2781 { proto_item* parameter_item;
2782   proto_tree* parameter_tree;
2783   gint offset = 0;
2784   guint parameter_type, parameter_length, actual_length;
2785   tvbuff_t *parameter_tvb;
2786
2787   /* Dissect all optional parameters while end of message isn't reached */
2788   parameter_type = 0xFF; /* Start-initializiation since parameter_type is used for while-condition */
2789   
2790   while ((tvb_length_remaining(optional_parameters_tvb, offset)  >= 1) && (parameter_type != PARAM_TYPE_END_OF_OPT_PARAMS)){
2791     parameter_type = tvb_get_guint8(optional_parameters_tvb, offset);
2792     
2793     if (parameter_type != PARAM_TYPE_END_OF_OPT_PARAMS){
2794       parameter_length = tvb_get_guint8(optional_parameters_tvb, offset + PARAMETER_TYPE_LENGTH);
2795       
2796       parameter_item = proto_tree_add_text(isup_tree, optional_parameters_tvb,
2797                                            offset,
2798                                            parameter_length  + PARAMETER_TYPE_LENGTH + PARAMETER_LENGTH_IND_LENGTH,
2799                                            "Parameter: type %u",
2800                                            parameter_type);
2801       parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
2802       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"));       
2803       offset += PARAMETER_TYPE_LENGTH;
2804       
2805       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);
2806       offset += PARAMETER_LENGTH_IND_LENGTH;
2807       
2808       actual_length = tvb_length_remaining(optional_parameters_tvb, offset);
2809       if (actual_length > 0){
2810         parameter_tvb = tvb_new_subset(optional_parameters_tvb, offset, MIN(parameter_length, actual_length), parameter_length);
2811         switch (parameter_type) {
2812         case PARAM_TYPE_CALL_REF:
2813           dissect_isup_call_reference_parameter(parameter_tvb, parameter_tree, parameter_item);
2814           break;
2815         case PARAM_TYPE_TRANSM_MEDIUM_REQU:
2816           dissect_isup_transmission_medium_requirement_parameter(parameter_tvb, parameter_tree, parameter_item);
2817           break;
2818         case PARAM_TYPE_ACC_TRANSP:
2819           dissect_isup_access_transport_parameter(parameter_tvb, parameter_tree, parameter_item);
2820           break;
2821         case PARAM_TYPE_CALLED_PARTY_NR:
2822           dissect_isup_called_party_number_parameter(parameter_tvb, parameter_tree, parameter_item);
2823           break;
2824         case PARAM_TYPE_SUBSQT_NR:
2825           dissect_isup_subsequent_number_parameter(parameter_tvb, parameter_tree, parameter_item);
2826           break;
2827         case PARAM_TYPE_NATURE_OF_CONN_IND:
2828           dissect_isup_nature_of_connection_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
2829           break;
2830         case PARAM_TYPE_FORW_CALL_IND:
2831           dissect_isup_forward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
2832           break;
2833         case PARAM_TYPE_OPT_FORW_CALL_IND:
2834           dissect_isup_optional_forward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
2835           break;
2836         case PARAM_TYPE_CALLING_PRTY_CATEG:
2837           dissect_isup_calling_partys_category_parameter(parameter_tvb, parameter_tree, parameter_item);
2838           break;
2839         case PARAM_TYPE_CALLING_PARTY_NR:
2840           dissect_isup_calling_party_number_parameter(parameter_tvb, parameter_tree, parameter_item);
2841           break;
2842         case PARAM_TYPE_REDIRECTING_NR:
2843           dissect_isup_redirecting_number_parameter(parameter_tvb, parameter_tree, parameter_item);
2844           break;
2845         case PARAM_TYPE_REDIRECTION_NR:
2846           dissect_isup_redirection_number_parameter(parameter_tvb, parameter_tree, parameter_item);
2847           break;
2848         case PARAM_TYPE_CONNECTION_REQ:
2849           dissect_isup_connection_request_parameter(parameter_tvb, parameter_tree, parameter_item);
2850           break;
2851         case PARAM_TYPE_INFO_REQ_IND:
2852           dissect_isup_information_request_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
2853           break;
2854         case PARAM_TYPE_INFO_IND:
2855           dissect_isup_information_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
2856           break;
2857         case PARAM_TYPE_CONTINUITY_IND:
2858           dissect_isup_continuity_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
2859           break;
2860         case PARAM_TYPE_BACKW_CALL_IND:
2861           dissect_isup_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
2862           break;
2863         case PARAM_TYPE_CAUSE_INDICATORS:
2864           dissect_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
2865           break;
2866         case PARAM_TYPE_REDIRECTION_INFO:
2867           dissect_isup_redirection_information_parameter(parameter_tvb, parameter_tree, parameter_item);
2868           break;
2869         case PARAM_TYPE_CIRC_GRP_SV_MSG_TYPE:
2870           dissect_isup_circuit_group_supervision_message_type_parameter(parameter_tvb, parameter_tree, parameter_item);
2871           break;
2872         case PARAM_TYPE_RANGE_AND_STATUS:
2873           dissect_isup_range_and_status_parameter(parameter_tvb, parameter_tree, parameter_item);
2874           break;
2875         case PARAM_TYPE_FACILITY_IND:
2876           dissect_isup_facility_ind_parameter(parameter_tvb, parameter_tree, parameter_item);
2877           break;
2878         case PARAM_TYPE_CLSD_USR_GRP_ILOCK_CD:
2879           dissect_isup_closed_user_group_interlock_code_parameter(parameter_tvb, parameter_tree, parameter_item);
2880           break;
2881         case PARAM_TYPE_USER_SERVICE_INFO:
2882           dissect_isup_user_service_information_parameter(parameter_tvb, parameter_tree, parameter_item);
2883           break;
2884         case PARAM_TYPE_SIGNALLING_POINT_CODE:
2885           dissect_isup_signalling_point_code_parameter(parameter_tvb, parameter_tree, parameter_item);    
2886           break;
2887         case PARAM_TYPE_USER_TO_USER_INFO:
2888           dissect_isup_user_to_user_information_parameter(parameter_tvb, parameter_tree, parameter_item);
2889           break;
2890         case PARAM_TYPE_CONNECTED_NR:
2891           dissect_isup_connected_number_parameter(parameter_tvb, parameter_tree, parameter_item);
2892           break;
2893         case PARAM_TYPE_SUSP_RESUME_IND:
2894           dissect_isup_suspend_resume_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
2895           break;
2896         case PARAM_TYPE_TRANSIT_NETW_SELECT:
2897           dissect_isup_transit_network_selection_parameter(parameter_tvb, parameter_tree, parameter_item);
2898           break;
2899         case PARAM_TYPE_EVENT_INFO:
2900           dissect_isup_event_information_parameter(parameter_tvb, parameter_tree, parameter_item);
2901           break;
2902         case PARAM_TYPE_CIRC_ASSIGN_MAP:
2903           dissect_isup_circuit_assignment_map_parameter(parameter_tvb, parameter_tree, parameter_item);
2904           break;
2905         case PARAM_TYPE_CIRC_STATE_IND:
2906           dissect_isup_circuit_state_ind_parameter(parameter_tvb, parameter_tree, parameter_item);
2907           break;
2908         case PARAM_TYPE_AUTO_CONG_LEVEL:
2909           dissect_isup_automatic_congestion_level_parameter(parameter_tvb, parameter_tree, parameter_item);
2910           break;
2911         case PARAM_TYPE_ORIG_CALLED_NR:
2912           dissect_isup_original_called_number_parameter(parameter_tvb, parameter_tree, parameter_item);
2913           break;
2914         case PARAM_TYPE_OPT_BACKW_CALL_IND:
2915           dissect_isup_optional_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
2916           break;
2917         case PARAM_TYPE_USER_TO_USER_IND:
2918           dissect_isup_user_to_user_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
2919           break;
2920         case PARAM_TYPE_ORIG_ISC_POINT_CODE:
2921           dissect_isup_original_isc_point_code_parameter(parameter_tvb, parameter_tree, parameter_item);          
2922           break;
2923         case PARAM_TYPE_GENERIC_NOTIF_IND:
2924           dissect_isup_generic_notification_indicator_parameter(parameter_tvb, parameter_tree, parameter_item);   
2925           break;
2926         case PARAM_TYPE_CALL_HIST_INFO :
2927           dissect_isup_call_history_information_parameter(parameter_tvb, parameter_tree, parameter_item);         
2928           break;
2929         case PARAM_TYPE_ACC_DELIV_INFO:
2930           dissect_isup_access_delivery_information_parameter(parameter_tvb, parameter_tree, parameter_item);      
2931           break;
2932         case PARAM_TYPE_NETW_SPECIFIC_FACLTY:
2933           dissect_isup_network_specific_facility_parameter(parameter_tvb, parameter_tree, parameter_item);        
2934           break;
2935         case PARAM_TYPE_USER_SERVICE_INFO_PR:
2936           dissect_isup_user_service_information_prime_parameter(parameter_tvb, parameter_tree, parameter_item);   
2937           break;
2938         case PARAM_TYPE_PROPAG_DELAY_COUNTER:
2939           dissect_isup_propagation_delay_counter_parameter(parameter_tvb, parameter_tree, parameter_item);        
2940           break;
2941         case PARAM_TYPE_REMOTE_OPERATIONS:
2942           dissect_isup_remote_operations_parameter(parameter_tvb, parameter_tree, parameter_item);        
2943           break;
2944         case PARAM_TYPE_SERVICE_ACTIVATION:
2945           dissect_isup_service_activation_parameter(parameter_tvb, parameter_tree, parameter_item);       
2946           break;
2947         case PARAM_TYPE_USER_TELESERV_INFO:
2948           dissect_isup_user_teleservice_information_parameter(parameter_tvb, parameter_tree, parameter_item);     
2949           break;
2950         case PARAM_TYPE_TRANSM_MEDIUM_USED:
2951           dissect_isup_transmission_medium_used_parameter(parameter_tvb, parameter_tree, parameter_item);         
2952           break;
2953         case PARAM_TYPE_CALL_DIV_INFO:
2954           dissect_isup_call_diversion_information_parameter(parameter_tvb, parameter_tree, parameter_item);       
2955           break;
2956         case PARAM_TYPE_ECHO_CTRL_INFO:
2957           dissect_isup_echo_control_information_parameter(parameter_tvb, parameter_tree, parameter_item);         
2958           break;
2959         case PARAM_TYPE_MSG_COMPAT_INFO:
2960           dissect_isup_message_compatibility_information_parameter(parameter_tvb, parameter_tree, parameter_item);        
2961           break;
2962         case PARAM_TYPE_PARAM_COMPAT_INFO:
2963           dissect_isup_parameter_compatibility_information_parameter(parameter_tvb, parameter_tree, parameter_item);      
2964           break;
2965         case PARAM_TYPE_MLPP_PRECEDENCE:
2966           dissect_isup_mlpp_precedence_parameter(parameter_tvb, parameter_tree, parameter_item);          
2967           break;
2968         case PARAM_TYPE_MCID_REQ_IND:
2969           dissect_isup_mcid_request_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);          
2970           break;
2971         case PARAM_TYPE_MCID_RSP_IND:
2972           dissect_isup_mcid_response_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);         
2973           break;
2974         case PARAM_TYPE_HOP_COUNTER:
2975           dissect_isup_hop_counter_parameter(parameter_tvb, parameter_tree, parameter_item);      
2976           break;
2977         case PARAM_TYPE_TRANSM_MEDIUM_RQUR_PR:
2978           dissect_isup_transmission_medium_requirement_prime_parameter(parameter_tvb, parameter_tree, parameter_item);    
2979           break;
2980         case PARAM_TYPE_LOCATION_NR:
2981           dissect_isup_location_number_parameter(parameter_tvb, parameter_tree, parameter_item);          
2982           break;
2983         case PARAM_TYPE_REDIR_NR_RSTRCT:
2984           dissect_isup_redirection_number_restriction_parameter(parameter_tvb, parameter_tree, parameter_item);   
2985           break;
2986         case PARAM_TYPE_CALL_TRANS_REF:
2987           dissect_isup_call_transfer_reference_parameter(parameter_tvb, parameter_tree, parameter_item);          
2988           break;
2989         case PARAM_TYPE_LOOP_PREV_IND:
2990           dissect_isup_loop_prevention_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);       
2991           break;
2992         case PARAM_TYPE_CALL_TRANS_NR:
2993           dissect_isup_call_transfer_number_parameter(parameter_tvb, parameter_tree, parameter_item);     
2994           break;
2995         case PARAM_TYPE_CCSS:
2996           dissect_isup_ccss_parameter(parameter_tvb, parameter_tree, parameter_item);     
2997           break;
2998         case PARAM_TYPE_FORW_GVNS:
2999           dissect_isup_forward_gvns_parameter(parameter_tvb, parameter_tree, parameter_item);     
3000           break;
3001         case PARAM_TYPE_BACKW_GVNS:
3002           dissect_isup_backward_gvns_parameter(parameter_tvb, parameter_tree, parameter_item);    
3003           break;
3004         case PARAM_TYPE_REDIRECT_CAPAB:
3005           dissect_isup_redirect_capability_parameter(parameter_tvb, parameter_tree, parameter_item);      
3006           break;
3007         case PARAM_TYPE_NETW_MGMT_CTRL:
3008           dissect_isup_network_management_controls_parameter(parameter_tvb, parameter_tree, parameter_item);      
3009           break;
3010         case PARAM_TYPE_CORRELATION_ID:
3011           dissect_isup_correlation_id_parameter(parameter_tvb, parameter_tree, parameter_item);   
3012           break;
3013         case PARAM_TYPE_SCF_ID:
3014           dissect_isup_scf_id_parameter(parameter_tvb, parameter_tree, parameter_item);   
3015           break;
3016         case PARAM_TYPE_CALL_DIV_TREAT_IND:
3017           dissect_isup_call_diversion_treatment_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);      
3018           break;
3019         case PARAM_TYPE_CALLED_IN_NR:
3020           dissect_isup_called_in_number_parameter(parameter_tvb, parameter_tree, parameter_item);         
3021           break;
3022         case PARAM_TYPE_CALL_OFF_TREAT_IND:
3023           dissect_isup_call_offering_treatment_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);       
3024           break;
3025         case PARAM_TYPE_CHARGED_PARTY_IDENT:
3026           dissect_isup_charged_party_identification_parameter(parameter_tvb, parameter_tree, parameter_item);     
3027           break;
3028         case PARAM_TYPE_CONF_TREAT_IND:
3029           dissect_isup_conference_treatment_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);          
3030           break;
3031         case PARAM_TYPE_DISPLAY_INFO:
3032           dissect_isup_display_information_parameter(parameter_tvb, parameter_tree, parameter_item);      
3033           break;
3034         case PARAM_TYPE_UID_ACTION_IND:
3035           dissect_isup_uid_action_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);    
3036           break;
3037         case PARAM_TYPE_UID_CAPAB_IND:
3038           dissect_isup_uid_capability_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);        
3039           break;
3040         case PARAM_TYPE_REDIRECT_COUNTER:
3041           dissect_isup_redirect_counter_parameter(parameter_tvb, parameter_tree, parameter_item);         
3042           break;
3043         case PARAM_TYPE_COLLECT_CALL_REQ:
3044           dissect_isup_collect_call_request_parameter(parameter_tvb, parameter_tree, parameter_item);     
3045           break;
3046         case PARAM_TYPE_GENERIC_NR:
3047           dissect_isup_generic_number_parameter(parameter_tvb, parameter_tree, parameter_item);   
3048           break;
3049         case PARAM_TYPE_GENERIC_DIGITS:
3050           dissect_isup_generic_digits_parameter(parameter_tvb, parameter_tree, parameter_item);   
3051           break;          
3052         default:
3053           dissect_isup_unknown_parameter(parameter_tvb, parameter_tree, parameter_item);
3054           break;
3055         }
3056         offset += MIN(parameter_length, actual_length);
3057       }
3058       
3059     }
3060     else {
3061         /* End of optional parameters is reached */
3062         proto_tree_add_uint_format(isup_tree, hf_isup_message_type, optional_parameters_tvb , offset, PARAMETER_TYPE_LENGTH, parameter_type, "End of optional parameters (%u)", parameter_type);
3063     }
3064   }
3065 }
3066
3067 /* ------------------------------------------------------------------ */
3068 /* Dissectors for all used message types                              */
3069 /* Called by dissect_isup_message(),                                  */ 
3070 /* call parameter dissectors in order of mandatory parameters         */
3071 /* (since not labeled)                                                */
3072 /* ------------------------------------------------------------------
3073   Dissector Message Type Initial address message 
3074  */
3075 gint
3076 dissect_isup_initial_address_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
3077 { proto_item* parameter_item;
3078   proto_tree* parameter_tree;
3079   tvbuff_t *parameter_tvb;
3080   gint offset = 0;
3081   gint parameter_type, parameter_pointer, parameter_length, actual_length;
3082   
3083   /* Do stuff for first mandatory fixed parameter: Nature of Connection Indicators */
3084   parameter_type = PARAM_TYPE_NATURE_OF_CONN_IND;
3085   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
3086                                        NATURE_OF_CONNECTION_IND_LENGTH,
3087                                        "Nature of Connection Indicators");
3088   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
3089   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"));               
3090   actual_length = tvb_length_remaining(message_tvb, offset);
3091   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(NATURE_OF_CONNECTION_IND_LENGTH, actual_length), NATURE_OF_CONNECTION_IND_LENGTH);
3092   dissect_isup_nature_of_connection_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3093   offset += NATURE_OF_CONNECTION_IND_LENGTH;
3094
3095   /* Do stuff for 2nd mandatory fixed parameter: Forward Call Indicators */
3096   parameter_type =  PARAM_TYPE_FORW_CALL_IND;
3097   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
3098                                        FORWARD_CALL_IND_LENGTH,
3099                                        "Forward Call Indicators");
3100   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
3101   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"));               
3102   actual_length = tvb_length_remaining(message_tvb, offset); 
3103   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(FORWARD_CALL_IND_LENGTH, actual_length), FORWARD_CALL_IND_LENGTH );
3104   dissect_isup_forward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3105   offset +=  FORWARD_CALL_IND_LENGTH;
3106
3107   /* Do stuff for 3nd mandatory fixed parameter: Calling party's category */
3108   parameter_type = PARAM_TYPE_CALLING_PRTY_CATEG;
3109   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
3110                                        CALLING_PRTYS_CATEGORY_LENGTH,
3111                                        "Calling Party's category");
3112   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
3113   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"));               
3114   actual_length = tvb_length_remaining(message_tvb, offset); 
3115   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CALLING_PRTYS_CATEGORY_LENGTH, actual_length),CALLING_PRTYS_CATEGORY_LENGTH );
3116   dissect_isup_calling_partys_category_parameter(parameter_tvb, parameter_tree, parameter_item);
3117   offset += CALLING_PRTYS_CATEGORY_LENGTH;
3118
3119   /* Do stuff for 4th mandatory fixed parameter: Transmission medium requirement */
3120   parameter_type = PARAM_TYPE_TRANSM_MEDIUM_REQU;
3121   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
3122                                        TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH,
3123                                        "Transmission medium requirement");
3124   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
3125   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"));                      
3126   actual_length = tvb_length_remaining(message_tvb, offset); 
3127   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH, actual_length), TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH);
3128   dissect_isup_transmission_medium_requirement_parameter(parameter_tvb, parameter_tree, parameter_item);
3129   offset += TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH;
3130
3131
3132   /* Do stuff for mandatory variable parameter Called party number */
3133   parameter_type = PARAM_TYPE_CALLED_PARTY_NR;
3134   parameter_pointer = tvb_get_guint8(message_tvb, offset);
3135   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
3136
3137   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
3138                                        offset +  parameter_pointer,
3139                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
3140                                        "Called Party Number");
3141   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
3142   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"));       
3143   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);  
3144   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);
3145   actual_length = tvb_length_remaining(message_tvb, offset);           
3146   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
3147   dissect_isup_called_party_number_parameter(parameter_tvb, parameter_tree, parameter_item);
3148   offset += PARAMETER_POINTER_LENGTH;
3149
3150   return offset;
3151 }
3152 /* ------------------------------------------------------------------
3153   Dissector Message Type subsequent address message 
3154  */
3155 gint dissect_isup_subsequent_address_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
3156 { proto_item* parameter_item;
3157   proto_tree* parameter_tree;
3158   tvbuff_t *parameter_tvb;
3159   gint offset = 0;
3160   gint parameter_type, parameter_pointer, parameter_length, actual_length;
3161   
3162   /* Do stuff for mandatory variable parameter Subsequent number */
3163   parameter_type = PARAM_TYPE_SUBSQT_NR;
3164
3165   parameter_pointer = tvb_get_guint8(message_tvb, offset);
3166   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
3167
3168   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
3169                                        offset +  parameter_pointer,
3170                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
3171                                        "Subsequent Number");
3172   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
3173   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"));       
3174   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);  
3175   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);
3176   actual_length = tvb_length_remaining(message_tvb, offset);           
3177   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
3178   dissect_isup_subsequent_number_parameter(parameter_tvb, parameter_tree, parameter_item);
3179   offset += PARAMETER_POINTER_LENGTH;
3180
3181   return offset;
3182 }
3183
3184 /* ------------------------------------------------------------------
3185   Dissector Message Type Information request message 
3186  */
3187 gint
3188 dissect_isup_information_request_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
3189 { proto_item* parameter_item;
3190   proto_tree* parameter_tree;
3191   tvbuff_t *parameter_tvb;
3192   gint offset = 0;
3193   gint parameter_type, actual_length;
3194  
3195   /* Do stuff for first mandatory fixed parameter: Information request indicators*/ 
3196   parameter_type = PARAM_TYPE_INFO_REQ_IND;
3197   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
3198                                        INFO_REQUEST_IND_LENGTH,
3199                                        "Information request indicators");
3200   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
3201   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"));               
3202   actual_length = tvb_length_remaining(message_tvb, offset);
3203   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(INFO_REQUEST_IND_LENGTH, actual_length), INFO_REQUEST_IND_LENGTH);
3204   dissect_isup_information_request_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3205   offset += INFO_REQUEST_IND_LENGTH;
3206   return offset;
3207 }
3208 /* ------------------------------------------------------------------
3209   Dissector Message Type Information  
3210  */
3211 gint
3212 dissect_isup_information_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
3213 { proto_item* parameter_item;
3214   proto_tree* parameter_tree;
3215   tvbuff_t *parameter_tvb;
3216   gint offset = 0;
3217   gint parameter_type, actual_length;
3218  
3219   /* Do stuff for first mandatory fixed parameter: Information  indicators*/ 
3220   parameter_type = PARAM_TYPE_INFO_IND;
3221   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
3222                                        INFO_IND_LENGTH,
3223                                        "Information indicators");
3224   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
3225   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"));               
3226   actual_length = tvb_length_remaining(message_tvb, offset);
3227   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(INFO_IND_LENGTH, actual_length), INFO_IND_LENGTH);
3228   dissect_isup_information_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3229   offset += INFO_IND_LENGTH;
3230   return offset;
3231 }
3232 /* ------------------------------------------------------------------
3233   Dissector Message Type Continuity 
3234  */
3235 gint
3236 dissect_isup_continuity_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
3237 { proto_item* parameter_item;
3238   proto_tree* parameter_tree;
3239   tvbuff_t *parameter_tvb;
3240   gint offset = 0;
3241   gint parameter_type, actual_length;
3242  
3243   /* Do stuff for first mandatory fixed parameter: Continuity indicators*/ 
3244   parameter_type = PARAM_TYPE_CONTINUITY_IND;
3245   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
3246                                        CONTINUITY_IND_LENGTH,
3247                                        "Continuity indicators");
3248   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
3249   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"));               
3250   actual_length = tvb_length_remaining(message_tvb, offset);
3251   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CONTINUITY_IND_LENGTH, actual_length), CONTINUITY_IND_LENGTH);
3252   dissect_isup_continuity_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3253   offset += CONTINUITY_IND_LENGTH;
3254   return offset;
3255 }
3256 /* ------------------------------------------------------------------
3257   Dissector Message Type Address complete
3258  */
3259 gint
3260 dissect_isup_address_complete_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
3261 { proto_item* parameter_item;
3262   proto_tree* parameter_tree;
3263   tvbuff_t *parameter_tvb;
3264   gint offset = 0;
3265   gint parameter_type, actual_length;
3266  
3267   /* Do stuff for first mandatory fixed parameter: backward call indicators*/ 
3268   parameter_type = PARAM_TYPE_BACKW_CALL_IND;
3269   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
3270                                        BACKWARD_CALL_IND_LENGTH,
3271                                        "Backward Call Indicators");
3272   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
3273   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"));               
3274   actual_length = tvb_length_remaining(message_tvb, offset);
3275   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(BACKWARD_CALL_IND_LENGTH, actual_length), BACKWARD_CALL_IND_LENGTH);
3276   dissect_isup_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3277   offset += BACKWARD_CALL_IND_LENGTH;
3278   return offset;
3279 }
3280 /* ------------------------------------------------------------------
3281   Dissector Message Type Connect
3282  */
3283 gint
3284 dissect_isup_connect_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
3285 { proto_item* parameter_item;
3286   proto_tree* parameter_tree;
3287   tvbuff_t *parameter_tvb;
3288   gint offset = 0;
3289   gint parameter_type, actual_length;
3290  
3291   /* Do stuff for first mandatory fixed parameter: backward call indicators*/ 
3292   parameter_type = PARAM_TYPE_BACKW_CALL_IND;
3293   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
3294                                        BACKWARD_CALL_IND_LENGTH,
3295                                        "Backward Call Indicators");
3296   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
3297   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"));               
3298   actual_length = tvb_length_remaining(message_tvb, offset);
3299   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(BACKWARD_CALL_IND_LENGTH, actual_length), BACKWARD_CALL_IND_LENGTH);
3300   dissect_isup_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
3301   offset += BACKWARD_CALL_IND_LENGTH;
3302   return offset;
3303 }
3304 /* ------------------------------------------------------------------
3305   Dissector Message Type release message 
3306  */
3307 gint 
3308 dissect_isup_release_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
3309 { proto_item* parameter_item;
3310   proto_tree* parameter_tree;