Add a inflateEnd() call to free up the stream in the re-init block.
[obnox/wireshark/wip.git] / epan / dissectors / packet-isup.c
1 /* packet-isup.c
2  * Routines for ISUP dissection
3  * Copyright 2001, Martina Obermeier <martina.obermeier@icn.siemens.de>
4  *
5  * Copyright 2004-2005, Anders Broman <anders.broman@ericsson.com>
6  * Modified 2003-09-10 by Anders Broman
7  *              <anders.broman@ericsson.com>
8  * Inserted routines for BICC dissection according to Q.765.5 Q.1902 Q.1970 Q.1990,
9  * calling SDP dissector for RFC2327 decoding.
10  * Modified 2004-01-10 by Anders Broman to add abillity to dissect
11  * Content type application/ISUP RFC 3204 used in SIP-T
12  *
13  * $Id$
14  *
15  * Wireshark - Network traffic analyzer
16  * By Gerald Combs <gerald@wireshark.org>
17  * Copyright 1998 Gerald Combs
18  *
19  * Copied from README.developer
20  *
21  * This program is free software; you can redistribute it and/or
22  * modify it under the terms of the GNU General Public License
23  * as published by the Free Software Foundation; either version 2
24  * of the License, or (at your option) any later version.
25  *
26  * This program is distributed in the hope that it will be useful,
27  * but WITHOUT ANY WARRANTY; without even the implied warranty of
28  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
29  * GNU General Public License for more details.
30  *
31  * You should have received a copy of the GNU General Public License
32  * along with this program; if not, write to the Free Software
33  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34  * References:
35  * ISUP:
36  * http://www.itu.int/rec/recommendation.asp?type=products&lang=e&parent=T-REC-Q
37  * Q.763-199912, Q.763-200212Amd2
38  * ITU-T Q.763/Amd.1 (03/2001)
39  */
40
41 #ifdef HAVE_CONFIG_H
42 # include "config.h"
43 #endif
44
45 #include <stdio.h>
46 #include <stdlib.h>
47 #include <string.h>
48
49 #include <glib.h>
50
51 #include <epan/packet.h>
52 #include <epan/stats_tree.h>
53 #include <prefs.h>
54 #include "packet-q931.h"
55 #include "packet-isup.h"
56 #include "packet-e164.h"
57 #include <epan/sctpppids.h>
58 #include <epan/emem.h>
59 #include <epan/circuit.h>
60 #include <epan/reassemble.h>
61 #include <packet-mtp3.h>
62
63 static gint isup_standard = ITU_STANDARD;
64
65 #define MTP3_ISUP_SERVICE_INDICATOR     5
66 #define MTP3_BICC_SERVICE_INDICATOR     13
67 #define ASCII_NUMBER_DELTA              0x30
68 #define ASCII_LETTER_DELTA              0x37
69
70 /* Definition of protocol field values und lengths */
71
72 /* Definition of Message Types */
73 #define MESSAGE_TYPE_INITIAL_ADDR       1
74 #define MESSAGE_TYPE_SUBSEQ_ADDR        2
75 #define MESSAGE_TYPE_INFO_REQ           3
76 #define MESSAGE_TYPE_INFO               4
77 #define MESSAGE_TYPE_CONTINUITY         5
78 #define MESSAGE_TYPE_ADDR_CMPL          6
79 #define MESSAGE_TYPE_CONNECT            7
80 #define MESSAGE_TYPE_FORW_TRANS         8
81 #define MESSAGE_TYPE_ANSWER             9
82 #define MESSAGE_TYPE_RELEASE           12
83 #define MESSAGE_TYPE_SUSPEND           13
84 #define MESSAGE_TYPE_RESUME            14
85 #define MESSAGE_TYPE_REL_CMPL          16
86 #define MESSAGE_TYPE_CONT_CHECK_REQ    17
87 #define MESSAGE_TYPE_RESET_CIRCUIT     18
88 #define MESSAGE_TYPE_BLOCKING          19
89 #define MESSAGE_TYPE_UNBLOCKING        20
90 #define MESSAGE_TYPE_BLOCK_ACK         21
91 #define MESSAGE_TYPE_UNBLOCK_ACK       22
92 #define MESSAGE_TYPE_CIRC_GRP_RST      23
93 #define MESSAGE_TYPE_CIRC_GRP_BLCK     24
94 #define MESSAGE_TYPE_CIRC_GRP_UNBL     25
95 #define MESSAGE_TYPE_CIRC_GRP_BL_ACK   26
96 #define MESSAGE_TYPE_CIRC_GRP_UNBL_ACK 27
97 #define MESSAGE_TYPE_FACILITY_REQ      31
98 #define MESSAGE_TYPE_FACILITY_ACC      32
99 #define MESSAGE_TYPE_FACILITY_REJ      33
100 #define MESSAGE_TYPE_LOOP_BACK_ACK     36
101 #define MESSAGE_TYPE_PASS_ALONG        40
102 #define MESSAGE_TYPE_CIRC_GRP_RST_ACK  41
103 #define MESSAGE_TYPE_CIRC_GRP_QRY      42
104 #define MESSAGE_TYPE_CIRC_GRP_QRY_RSP  43
105 #define MESSAGE_TYPE_CALL_PROGRSS      44
106 #define MESSAGE_TYPE_USER2USER_INFO    45
107 #define MESSAGE_TYPE_UNEQUIPPED_CIC    46
108 #define MESSAGE_TYPE_CONFUSION         47
109 #define MESSAGE_TYPE_OVERLOAD          48
110 #define MESSAGE_TYPE_CHARGE_INFO       49
111 #define MESSAGE_TYPE_NETW_RESRC_MGMT   50
112 #define MESSAGE_TYPE_FACILITY          51
113 #define MESSAGE_TYPE_USER_PART_TEST    52
114 #define MESSAGE_TYPE_USER_PART_AVAIL   53
115 #define MESSAGE_TYPE_IDENT_REQ         54
116 #define MESSAGE_TYPE_IDENT_RSP         55
117 #define MESSAGE_TYPE_SEGMENTATION      56
118 #define MESSAGE_TYPE_LOOP_PREVENTION   64
119 #define MESSAGE_TYPE_APPLICATION_TRANS 65
120 #define MESSAGE_TYPE_PRE_RELEASE_INFO  66
121 #define MESSAGE_TYPE_SUBSEQUENT_DIR_NUM 67
122
123 #define ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES_ACK                          0xE9
124 #define ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES                                      0xEA
125 #define ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST_RSP                         0xEB
126 #define ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST                                     0xEC
127 #define ANSI_ISUP_MESSAGE_TYPE_EXIT                                                     0xED
128
129 const value_string isup_message_type_value[] = {
130   { MESSAGE_TYPE_INITIAL_ADDR,          "Initial address"},
131   { MESSAGE_TYPE_SUBSEQ_ADDR,           "Subsequent address"},
132   { MESSAGE_TYPE_INFO_REQ,              "Information request (national use)"},
133   { MESSAGE_TYPE_INFO,                  "Information (national use)"},
134   { MESSAGE_TYPE_CONTINUITY,            "Continuity"},
135   { MESSAGE_TYPE_ADDR_CMPL,             "Address complete"},
136   { MESSAGE_TYPE_CONNECT,               "Connect"},
137   { MESSAGE_TYPE_FORW_TRANS,            "Forward transfer"},
138   { MESSAGE_TYPE_ANSWER,                "Answer"},
139   { MESSAGE_TYPE_RELEASE,               "Release"},
140   { MESSAGE_TYPE_SUSPEND,               "Suspend"},
141   { MESSAGE_TYPE_RESUME,                "Resume"},
142   { MESSAGE_TYPE_REL_CMPL,              "Release complete"},
143   { MESSAGE_TYPE_CONT_CHECK_REQ,        "Continuity check request"},
144   { MESSAGE_TYPE_RESET_CIRCUIT,         "Reset Circuit"},
145   { MESSAGE_TYPE_BLOCKING,              "Blocking"},
146   { MESSAGE_TYPE_UNBLOCKING,            "Unblocking"},
147   { MESSAGE_TYPE_BLOCK_ACK,             "Blocking acknowledgement"},
148   { MESSAGE_TYPE_UNBLOCK_ACK,           "Unblocking acknowledgment"},
149   { MESSAGE_TYPE_CIRC_GRP_RST,          "Circuit group reset"},
150   { MESSAGE_TYPE_CIRC_GRP_BLCK,         "Circuit group blocking"},
151   { MESSAGE_TYPE_CIRC_GRP_UNBL,         "Circuit group unblocking"},
152   { MESSAGE_TYPE_CIRC_GRP_BL_ACK,       "Circuit group blocking acknowledgement"},
153   { MESSAGE_TYPE_CIRC_GRP_UNBL_ACK,     "Circuit group unblocking acknowledgement"},
154   { MESSAGE_TYPE_FACILITY_REQ,          "Facility request"},
155   { MESSAGE_TYPE_FACILITY_ACC,          "Facility accepted"},
156   { MESSAGE_TYPE_FACILITY_REJ,          "Facility reject"},
157   { MESSAGE_TYPE_LOOP_BACK_ACK,         "Loop back acknowledgement (national use)"},
158   { MESSAGE_TYPE_PASS_ALONG,            "Pass-along (national use)"},
159   { MESSAGE_TYPE_CIRC_GRP_RST_ACK,      "Circuit group reset acknowledgement"},
160   { MESSAGE_TYPE_CIRC_GRP_QRY,          "Circuit group query (national use)"},
161   { MESSAGE_TYPE_CIRC_GRP_QRY_RSP,      "Circuit group query response (national use)"},
162   { MESSAGE_TYPE_CALL_PROGRSS,          "Call progress"},
163   { MESSAGE_TYPE_USER2USER_INFO,        "User-to-user information"},
164   { MESSAGE_TYPE_UNEQUIPPED_CIC,        "Unequipped CIC (national use)"},
165   { MESSAGE_TYPE_CONFUSION,             "Confusion"},
166   { MESSAGE_TYPE_OVERLOAD,              "Overload (national use)"},
167   { MESSAGE_TYPE_CHARGE_INFO,           "Charge information (national use)"},
168   { MESSAGE_TYPE_NETW_RESRC_MGMT,       "Network resource management"},
169   { MESSAGE_TYPE_FACILITY,              "Facility"},
170   { MESSAGE_TYPE_USER_PART_TEST,        "User part test"},
171   { MESSAGE_TYPE_USER_PART_AVAIL,       "User part available"},
172   { MESSAGE_TYPE_IDENT_REQ,             "Identification request"},
173   { MESSAGE_TYPE_IDENT_RSP,             "Identification response"},
174   { MESSAGE_TYPE_SEGMENTATION,          "Segmentation"},
175   { MESSAGE_TYPE_LOOP_PREVENTION,       "Loop prevention"},
176   { MESSAGE_TYPE_APPLICATION_TRANS,             "Application transport"},
177   { MESSAGE_TYPE_PRE_RELEASE_INFO,              "Pre-release information"},
178   { MESSAGE_TYPE_SUBSEQUENT_DIR_NUM,    "Subsequent Directory Number (national use)"},
179   { 0,                                  NULL}};
180
181  static const value_string ansi_isup_message_type_value[] = {
182   { MESSAGE_TYPE_INITIAL_ADDR,          "Initial address"},
183   { MESSAGE_TYPE_SUBSEQ_ADDR,           "Subsequent address"},
184   { MESSAGE_TYPE_INFO_REQ,              "Information request (national use)"},
185   { MESSAGE_TYPE_INFO,                  "Information (national use)"},
186   { MESSAGE_TYPE_CONTINUITY,            "Continuity"},
187   { MESSAGE_TYPE_ADDR_CMPL,             "Address complete"},
188   { MESSAGE_TYPE_CONNECT,               "Connect"},
189   { MESSAGE_TYPE_FORW_TRANS,            "Forward transfer"},
190   { MESSAGE_TYPE_ANSWER,                "Answer"},
191   { MESSAGE_TYPE_RELEASE,               "Release"},
192   { MESSAGE_TYPE_SUSPEND,               "Suspend"},
193   { MESSAGE_TYPE_RESUME,                "Resume"},
194   { MESSAGE_TYPE_REL_CMPL,              "Release complete"},
195   { MESSAGE_TYPE_CONT_CHECK_REQ,        "Continuity check request"},
196   { MESSAGE_TYPE_RESET_CIRCUIT,         "Reset Circuit"},
197   { MESSAGE_TYPE_BLOCKING,              "Blocking"},
198   { MESSAGE_TYPE_UNBLOCKING,            "Unblocking"},
199   { MESSAGE_TYPE_BLOCK_ACK,             "Blocking acknowledgement"},
200   { MESSAGE_TYPE_UNBLOCK_ACK,           "Unblocking acknowledgment"},
201   { MESSAGE_TYPE_CIRC_GRP_RST,          "Circuit group reset"},
202   { MESSAGE_TYPE_CIRC_GRP_BLCK,         "Circuit group blocking"},
203   { MESSAGE_TYPE_CIRC_GRP_UNBL,         "Circuit group unblocking"},
204   { MESSAGE_TYPE_CIRC_GRP_BL_ACK,       "Circuit group blocking acknowledgement"},
205   { MESSAGE_TYPE_CIRC_GRP_UNBL_ACK,     "Circuit group unblocking acknowledgement"},
206   { MESSAGE_TYPE_FACILITY_REQ,          "Facility request"},
207   { MESSAGE_TYPE_FACILITY_ACC,          "Facility accepted"},
208   { MESSAGE_TYPE_FACILITY_REJ,          "Facility reject"},
209   { MESSAGE_TYPE_LOOP_BACK_ACK,         "Loop back acknowledgement (national use)"},
210   { MESSAGE_TYPE_PASS_ALONG,            "Pass-along (national use)"},
211   { MESSAGE_TYPE_CIRC_GRP_RST_ACK,      "Circuit group reset acknowledgement"},
212   { MESSAGE_TYPE_CIRC_GRP_QRY,          "Circuit group query (national use)"},
213   { MESSAGE_TYPE_CIRC_GRP_QRY_RSP,      "Circuit group query response (national use)"},
214   { MESSAGE_TYPE_CALL_PROGRSS,          "Call progress"},
215   { MESSAGE_TYPE_USER2USER_INFO,        "User-to-user information"},
216   { MESSAGE_TYPE_UNEQUIPPED_CIC,        "Unequipped CIC (national use)"},
217   { MESSAGE_TYPE_CONFUSION,             "Confusion"},
218   { MESSAGE_TYPE_OVERLOAD,              "Overload (national use)"},
219   { MESSAGE_TYPE_CHARGE_INFO,           "Charge information (national use)"},
220   { MESSAGE_TYPE_NETW_RESRC_MGMT,       "Network resource management"},
221   { MESSAGE_TYPE_FACILITY,              "Facility"},
222   { MESSAGE_TYPE_USER_PART_TEST,        "User part test"},
223   { MESSAGE_TYPE_USER_PART_AVAIL,       "User part available"},
224   { MESSAGE_TYPE_IDENT_REQ,             "Identification request"},
225   { MESSAGE_TYPE_IDENT_RSP,             "Identification response"},
226   { MESSAGE_TYPE_SEGMENTATION,          "Segmentation"},
227   { MESSAGE_TYPE_LOOP_PREVENTION,       "Loop prevention"},
228   { MESSAGE_TYPE_APPLICATION_TRANS,             "Application transport"},
229   { MESSAGE_TYPE_PRE_RELEASE_INFO,              "Pre-release information"},
230   { MESSAGE_TYPE_SUBSEQUENT_DIR_NUM,    "Subsequent Directory Number (national use)"},
231   { ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES_ACK,             "Circuit Reservation Acknowledge"},
232   { ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES,                 "Circuit Reservation"},
233   { ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST_RSP,    "Circuit Validation Test Response"},
234   { ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST,                "Circuit Validation Test"},
235   { ANSI_ISUP_MESSAGE_TYPE_EXIT,                                "Exit"},
236   { 0,                                  NULL}};
237 /* Same as above but in acronym form (for the Info column) */
238 const value_string isup_message_type_value_acro[] = {
239   { MESSAGE_TYPE_INITIAL_ADDR,          "IAM"},
240   { MESSAGE_TYPE_SUBSEQ_ADDR,           "SAM"},
241   { MESSAGE_TYPE_INFO_REQ,              "INR"},
242   { MESSAGE_TYPE_INFO,                  "INF"},
243   { MESSAGE_TYPE_CONTINUITY,            "COT"},
244   { MESSAGE_TYPE_ADDR_CMPL,             "ACM"},
245   { MESSAGE_TYPE_CONNECT,               "CON"},
246   { MESSAGE_TYPE_FORW_TRANS,            "FOT"},
247   { MESSAGE_TYPE_ANSWER,                "ANM"},
248   { MESSAGE_TYPE_RELEASE,               "REL"},
249   { MESSAGE_TYPE_SUSPEND,               "SUS"},
250   { MESSAGE_TYPE_RESUME,                "RES"},
251   { MESSAGE_TYPE_REL_CMPL,              "RLC"},
252   { MESSAGE_TYPE_CONT_CHECK_REQ,        "CCR"},
253   { MESSAGE_TYPE_RESET_CIRCUIT,         "RSC"},
254   { MESSAGE_TYPE_BLOCKING,              "BLO"},
255   { MESSAGE_TYPE_UNBLOCKING,            "UBL"},
256   { MESSAGE_TYPE_BLOCK_ACK,             "BLA"},
257   { MESSAGE_TYPE_UNBLOCK_ACK,           "UBLA"},
258   { MESSAGE_TYPE_CIRC_GRP_RST,          "GRS"},
259   { MESSAGE_TYPE_CIRC_GRP_BLCK,         "CGB"},
260   { MESSAGE_TYPE_CIRC_GRP_UNBL,         "CGU"},
261   { MESSAGE_TYPE_CIRC_GRP_BL_ACK,       "CGBA"},
262   { MESSAGE_TYPE_CIRC_GRP_UNBL_ACK,     "CGUA"},
263   { MESSAGE_TYPE_FACILITY_REQ,          "FAR"},
264   { MESSAGE_TYPE_FACILITY_ACC,          "FAA"},
265   { MESSAGE_TYPE_FACILITY_REJ,          "FRJ"},
266   { MESSAGE_TYPE_LOOP_BACK_ACK,         "LPA"},
267   { MESSAGE_TYPE_PASS_ALONG,            "PAM"},
268   { MESSAGE_TYPE_CIRC_GRP_RST_ACK,      "GRA"},
269   { MESSAGE_TYPE_CIRC_GRP_QRY,          "CQM"},
270   { MESSAGE_TYPE_CIRC_GRP_QRY_RSP,      "CQR"},
271   { MESSAGE_TYPE_CALL_PROGRSS,          "CPG"},
272   { MESSAGE_TYPE_USER2USER_INFO,        "UUI"},
273   { MESSAGE_TYPE_UNEQUIPPED_CIC,        "UCIC"},
274   { MESSAGE_TYPE_CONFUSION,             "CFN"},
275   { MESSAGE_TYPE_OVERLOAD,              "OLM"},
276   { MESSAGE_TYPE_CHARGE_INFO,           "CRG"},
277   { MESSAGE_TYPE_NETW_RESRC_MGMT,       "NRM"},
278   { MESSAGE_TYPE_FACILITY,              "FAC"},
279   { MESSAGE_TYPE_USER_PART_TEST,        "UPT"},
280   { MESSAGE_TYPE_USER_PART_AVAIL,       "UPA"},
281   { MESSAGE_TYPE_IDENT_REQ,             "IDR"},
282   { MESSAGE_TYPE_IDENT_RSP,             "IDS"},
283   { MESSAGE_TYPE_SEGMENTATION,          "SGM"},
284   { MESSAGE_TYPE_LOOP_PREVENTION,       "LOP"},
285   { MESSAGE_TYPE_APPLICATION_TRANS,             "APM"},
286   { MESSAGE_TYPE_PRE_RELEASE_INFO,              "PRI"},
287   { MESSAGE_TYPE_SUBSEQUENT_DIR_NUM,    "SDN"},
288   { 0,                                  NULL}};
289
290   /* Same as above but in acronym form (for the Info column) */
291 static const value_string ansi_isup_message_type_value_acro[] = {
292   { MESSAGE_TYPE_INITIAL_ADDR,          "IAM"},
293   { MESSAGE_TYPE_SUBSEQ_ADDR,           "SAM"},
294   { MESSAGE_TYPE_INFO_REQ,              "INR"},
295   { MESSAGE_TYPE_INFO,                  "INF"},
296   { MESSAGE_TYPE_CONTINUITY,            "COT"},
297   { MESSAGE_TYPE_ADDR_CMPL,             "ACM"},
298   { MESSAGE_TYPE_CONNECT,               "CON"},
299   { MESSAGE_TYPE_FORW_TRANS,            "FOT"},
300   { MESSAGE_TYPE_ANSWER,                "ANM"},
301   { MESSAGE_TYPE_RELEASE,               "REL"},
302   { MESSAGE_TYPE_SUSPEND,               "SUS"},
303   { MESSAGE_TYPE_RESUME,                "RES"},
304   { MESSAGE_TYPE_REL_CMPL,              "RLC"},
305   { MESSAGE_TYPE_CONT_CHECK_REQ,        "CCR"},
306   { MESSAGE_TYPE_RESET_CIRCUIT,         "RSC"},
307   { MESSAGE_TYPE_BLOCKING,              "BLO"},
308   { MESSAGE_TYPE_UNBLOCKING,            "UBL"},
309   { MESSAGE_TYPE_BLOCK_ACK,             "BLA"},
310   { MESSAGE_TYPE_UNBLOCK_ACK,           "UBLA"},
311   { MESSAGE_TYPE_CIRC_GRP_RST,          "GRS"},
312   { MESSAGE_TYPE_CIRC_GRP_BLCK,         "CGB"},
313   { MESSAGE_TYPE_CIRC_GRP_UNBL,         "CGU"},
314   { MESSAGE_TYPE_CIRC_GRP_BL_ACK,       "CGBA"},
315   { MESSAGE_TYPE_CIRC_GRP_UNBL_ACK,     "CGUA"},
316   { MESSAGE_TYPE_FACILITY_REQ,          "FAR"},
317   { MESSAGE_TYPE_FACILITY_ACC,          "FAA"},
318   { MESSAGE_TYPE_FACILITY_REJ,          "FRJ"},
319   { MESSAGE_TYPE_LOOP_BACK_ACK,         "LPA"},
320   { MESSAGE_TYPE_PASS_ALONG,            "PAM"},
321   { MESSAGE_TYPE_CIRC_GRP_RST_ACK,      "GRA"},
322   { MESSAGE_TYPE_CIRC_GRP_QRY,          "CQM"},
323   { MESSAGE_TYPE_CIRC_GRP_QRY_RSP,      "CQR"},
324   { MESSAGE_TYPE_CALL_PROGRSS,          "CPG"},
325   { MESSAGE_TYPE_USER2USER_INFO,        "UUI"},
326   { MESSAGE_TYPE_UNEQUIPPED_CIC,        "UCIC"},
327   { MESSAGE_TYPE_CONFUSION,             "CFN"},
328   { MESSAGE_TYPE_OVERLOAD,              "OLM"},
329   { MESSAGE_TYPE_CHARGE_INFO,           "CRG"},
330   { MESSAGE_TYPE_NETW_RESRC_MGMT,       "NRM"},
331   { MESSAGE_TYPE_FACILITY,              "FAC"},
332   { MESSAGE_TYPE_USER_PART_TEST,        "UPT"},
333   { MESSAGE_TYPE_USER_PART_AVAIL,       "UPA"},
334   { MESSAGE_TYPE_IDENT_REQ,             "IDR"},
335   { MESSAGE_TYPE_IDENT_RSP,             "IDS"},
336   { MESSAGE_TYPE_SEGMENTATION,          "SGM"},
337   { MESSAGE_TYPE_LOOP_PREVENTION,       "LOP"},
338   { MESSAGE_TYPE_APPLICATION_TRANS,             "APM"},
339   { MESSAGE_TYPE_PRE_RELEASE_INFO,              "PRI"},
340   { MESSAGE_TYPE_SUBSEQUENT_DIR_NUM,    "SDN"},
341   { ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES_ACK,             "CRA"},
342   { ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES,                 "CRM"},
343   { ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST_RSP,    "CVR"},
344   { ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST,                "CVT"},
345   { ANSI_ISUP_MESSAGE_TYPE_EXIT,                                "EXIT"},
346   { 0,                                  NULL}};
347
348 const value_string isup_parameter_type_value[] = {
349 { PARAM_TYPE_END_OF_OPT_PARAMS,        "End of optional parameters"},
350   { PARAM_TYPE_CALL_REF,               "Call Reference (national use)"},
351   { PARAM_TYPE_TRANSM_MEDIUM_REQU,     "Transmission medium requirement"},
352   { PARAM_TYPE_ACC_TRANSP,             "Access transport"},
353   { PARAM_TYPE_CALLED_PARTY_NR,        "Called party number"},
354   { PARAM_TYPE_SUBSQT_NR,              "Subsequent number"},
355   { PARAM_TYPE_NATURE_OF_CONN_IND,     "Nature of connection indicators"},
356   { PARAM_TYPE_FORW_CALL_IND,          "Forward call indicators"},
357   { PARAM_TYPE_OPT_FORW_CALL_IND,      "Optional forward call indicators"},
358   { PARAM_TYPE_CALLING_PRTY_CATEG,     "Calling party's category"},
359   { PARAM_TYPE_CALLING_PARTY_NR,       "Calling party number"},
360   { PARAM_TYPE_REDIRECTING_NR,         "Redirecting number"},
361   { PARAM_TYPE_REDIRECTION_NR,         "Redirection number"},
362   { PARAM_TYPE_CONNECTION_REQ,         "Connection request"},
363   { PARAM_TYPE_INFO_REQ_IND,           "Information request indicators (national use)"},
364   { PARAM_TYPE_INFO_IND,               "Information indicators (national use)"},
365   { PARAM_TYPE_CONTINUITY_IND,         "Continuity request"},
366   { PARAM_TYPE_BACKW_CALL_IND,         "Backward call indicators"},
367   { PARAM_TYPE_CAUSE_INDICATORS,       "Cause indicators"},
368   { PARAM_TYPE_REDIRECTION_INFO,       "Redirection information"},
369   { PARAM_TYPE_CIRC_GRP_SV_MSG_TYPE,   "Circuit group supervision message type"},
370   { PARAM_TYPE_RANGE_AND_STATUS,       "Range and Status"},
371   { PARAM_TYPE_FACILITY_IND,           "Facility indicator"},
372   { PARAM_TYPE_CLSD_USR_GRP_ILOCK_CD,  "Closed user group interlock code"},
373   { PARAM_TYPE_USER_SERVICE_INFO,      "User service information"},
374   { PARAM_TYPE_SIGNALLING_POINT_CODE,  "Signalling point code (national use)"},
375   { PARAM_TYPE_USER_TO_USER_INFO,      "User-to-user information"},
376   { PARAM_TYPE_CONNECTED_NR,           "Connected number"},
377   { PARAM_TYPE_SUSP_RESUME_IND,        "Suspend/Resume indicators"},
378   { PARAM_TYPE_TRANSIT_NETW_SELECT,    "Transit network selection (national use)"},
379   { PARAM_TYPE_EVENT_INFO,             "Event information"},
380   { PARAM_TYPE_CIRC_ASSIGN_MAP,        "Circuit assignment map"},
381   { PARAM_TYPE_CIRC_STATE_IND,         "Circuit state indicator (national use)"},
382   { PARAM_TYPE_AUTO_CONG_LEVEL,        "Automatic congestion level"},
383   { PARAM_TYPE_ORIG_CALLED_NR,         "Original called number"},
384   { PARAM_TYPE_OPT_BACKW_CALL_IND,     "Backward call indicators"},
385   { PARAM_TYPE_USER_TO_USER_IND,       "User-to-user indicators"},
386   { PARAM_TYPE_ORIG_ISC_POINT_CODE,    "Origination ISC point code"},
387   { PARAM_TYPE_GENERIC_NOTIF_IND,      "Generic notification indicator"},
388   { PARAM_TYPE_CALL_HIST_INFO,         "Call history information"},
389   { PARAM_TYPE_ACC_DELIV_INFO,         "Access delivery information"},
390   { PARAM_TYPE_NETW_SPECIFIC_FACLTY,   "Network specific facility (national use)"},
391   { PARAM_TYPE_USER_SERVICE_INFO_PR,   "User service information prime"},
392   { PARAM_TYPE_PROPAG_DELAY_COUNTER,   "Propagation delay counter"},
393   { PARAM_TYPE_REMOTE_OPERATIONS,      "Remote operations (national use)"},
394   { PARAM_TYPE_SERVICE_ACTIVATION,     "Service activation"},
395   { PARAM_TYPE_USER_TELESERV_INFO,     "User teleservice information"},
396   { PARAM_TYPE_TRANSM_MEDIUM_USED,     "Transmission medium used"},
397   { PARAM_TYPE_CALL_DIV_INFO,          "Call diversion information"},
398   { PARAM_TYPE_ECHO_CTRL_INFO,         "Echo control information"},
399   { PARAM_TYPE_MSG_COMPAT_INFO,        "Message compatibility information"},
400   { PARAM_TYPE_PARAM_COMPAT_INFO,      "Parameter compatibility information"},
401   { PARAM_TYPE_MLPP_PRECEDENCE,        "MLPP precedence"},
402   { PARAM_TYPE_MCID_REQ_IND,           "MCID request indicators"},
403   { PARAM_TYPE_MCID_RSP_IND,           "MCID response indicators"},
404   { PARAM_TYPE_HOP_COUNTER,            "Hop counter"},
405   { PARAM_TYPE_TRANSM_MEDIUM_RQUR_PR,  "Transmission medium requirement prime"},
406   { PARAM_TYPE_LOCATION_NR,            "Location number"},
407   { PARAM_TYPE_REDIR_NR_RSTRCT,        "Redirection number restriction"},
408   { PARAM_TYPE_CALL_TRANS_REF,         "Call transfer reference"},
409   { PARAM_TYPE_LOOP_PREV_IND,          "Loop prevention indicators"},
410   { PARAM_TYPE_CALL_TRANS_NR,          "Call transfer number"},
411   { PARAM_TYPE_CCSS,                   "CCSS"},
412   { PARAM_TYPE_FORW_GVNS,              "Forward GVNS"},
413   { PARAM_TYPE_BACKW_GVNS,             "Backward GVNS"},
414   { PARAM_TYPE_REDIRECT_CAPAB,         "Redirect capability (reserved for national use)"},
415   { PARAM_TYPE_NETW_MGMT_CTRL,         "Network management controls"},
416   { PARAM_TYPE_CORRELATION_ID,         "Correlation id"},
417   { PARAM_TYPE_SCF_ID,                 "SCF id"},
418   { PARAM_TYPE_CALL_DIV_TREAT_IND,     "Call diversion treatment indicators"},
419   { PARAM_TYPE_CALLED_IN_NR,           "Called IN number"},
420   { PARAM_TYPE_CALL_OFF_TREAT_IND,     "Call offering treatment indicators"},
421   { PARAM_TYPE_CHARGED_PARTY_IDENT,    "Charged party identification (national use)"},
422   { PARAM_TYPE_CONF_TREAT_IND,         "Conference treatment indicators"},
423   { PARAM_TYPE_DISPLAY_INFO,           "Display information"},
424   { PARAM_TYPE_UID_ACTION_IND,         "UID action indicators"},
425   { PARAM_TYPE_UID_CAPAB_IND,          "UID capability indicators"},
426   { PARAM_TYPE_REDIRECT_COUNTER,       "Redirect counter (reserved for national use)"},
427   { PARAM_TYPE_COLLECT_CALL_REQ,       "Collect call request"},
428   { PARAM_TYPE_GENERIC_NR,             "Generic number"},
429   { PARAM_TYPE_GENERIC_DIGITS,         "Generic digits (national use)"},
430   { PARAM_TYPE_APPLICATON_TRANS,       "Application transport"},
431   { 0,                                 NULL}};
432
433 static const value_string ansi_isup_parameter_type_value[] = {
434 { PARAM_TYPE_END_OF_OPT_PARAMS,        "End of optional parameters"},
435   { PARAM_TYPE_CALL_REF,               "Call Reference (national use)"},
436   { PARAM_TYPE_TRANSM_MEDIUM_REQU,     "Transmission medium requirement"},
437   { PARAM_TYPE_ACC_TRANSP,             "Access transport"},
438   { PARAM_TYPE_CALLED_PARTY_NR,        "Called party number"},
439   { PARAM_TYPE_SUBSQT_NR,              "Subsequent number"},
440   { PARAM_TYPE_NATURE_OF_CONN_IND,     "Nature of connection indicators"},
441   { PARAM_TYPE_FORW_CALL_IND,          "Forward call indicators"},
442   { PARAM_TYPE_OPT_FORW_CALL_IND,      "Optional forward call indicators"},
443   { PARAM_TYPE_CALLING_PRTY_CATEG,     "Calling party's category"},
444   { PARAM_TYPE_CALLING_PARTY_NR,       "Calling party number"},
445   { PARAM_TYPE_REDIRECTING_NR,         "Redirecting number"},
446   { PARAM_TYPE_REDIRECTION_NR,         "Redirection number"},
447   { PARAM_TYPE_CONNECTION_REQ,         "Connection request"},
448   { PARAM_TYPE_INFO_REQ_IND,           "Information request indicators (national use)"},
449   { PARAM_TYPE_INFO_IND,               "Information indicators (national use)"},
450   { PARAM_TYPE_CONTINUITY_IND,         "Continuity request"},
451   { PARAM_TYPE_BACKW_CALL_IND,         "Backward call indicators"},
452   { PARAM_TYPE_CAUSE_INDICATORS,       "Cause indicators"},
453   { PARAM_TYPE_REDIRECTION_INFO,       "Redirection information"},
454   { PARAM_TYPE_CIRC_GRP_SV_MSG_TYPE,   "Circuit group supervision message type"},
455   { PARAM_TYPE_RANGE_AND_STATUS,       "Range and Status"},
456   { PARAM_TYPE_FACILITY_IND,           "Facility indicator"},
457   { PARAM_TYPE_CLSD_USR_GRP_ILOCK_CD,  "Closed user group interlock code"},
458   { PARAM_TYPE_USER_SERVICE_INFO,      "User service information"},
459   { PARAM_TYPE_SIGNALLING_POINT_CODE,  "Signalling point code (national use)"},
460   { PARAM_TYPE_USER_TO_USER_INFO,      "User-to-user information"},
461   { PARAM_TYPE_CONNECTED_NR,           "Connected number"},
462   { PARAM_TYPE_SUSP_RESUME_IND,        "Suspend/Resume indicators"},
463   { PARAM_TYPE_TRANSIT_NETW_SELECT,    "Transit network selection (national use)"},
464   { PARAM_TYPE_EVENT_INFO,             "Event information"},
465   { PARAM_TYPE_CIRC_ASSIGN_MAP,        "Circuit assignment map"},
466   { PARAM_TYPE_CIRC_STATE_IND,         "Circuit state indicator (national use)"},
467   { PARAM_TYPE_AUTO_CONG_LEVEL,        "Automatic congestion level"},
468   { PARAM_TYPE_ORIG_CALLED_NR,         "Original called number"},
469   { PARAM_TYPE_OPT_BACKW_CALL_IND,     "Backward call indicators"},
470   { PARAM_TYPE_USER_TO_USER_IND,       "User-to-user indicators"},
471   { PARAM_TYPE_ORIG_ISC_POINT_CODE,    "Origination ISC point code"},
472   { PARAM_TYPE_GENERIC_NOTIF_IND,      "Generic notification indicator"},
473   { PARAM_TYPE_CALL_HIST_INFO,         "Call history information"},
474   { PARAM_TYPE_ACC_DELIV_INFO,         "Access delivery information"},
475   { PARAM_TYPE_NETW_SPECIFIC_FACLTY,   "Network specific facility (national use)"},
476   { PARAM_TYPE_USER_SERVICE_INFO_PR,   "User service information prime"},
477   { PARAM_TYPE_PROPAG_DELAY_COUNTER,   "Propagation delay counter"},
478   { PARAM_TYPE_REMOTE_OPERATIONS,      "Remote operations (national use)"},
479   { PARAM_TYPE_SERVICE_ACTIVATION,     "Service activation"},
480   { PARAM_TYPE_USER_TELESERV_INFO,     "User teleservice information"},
481   { PARAM_TYPE_TRANSM_MEDIUM_USED,     "Transmission medium used"},
482   { PARAM_TYPE_CALL_DIV_INFO,          "Call diversion information"},
483   { PARAM_TYPE_ECHO_CTRL_INFO,         "Echo control information"},
484   { PARAM_TYPE_MSG_COMPAT_INFO,        "Message compatibility information"},
485   { PARAM_TYPE_PARAM_COMPAT_INFO,      "Parameter compatibility information"},
486   { PARAM_TYPE_MLPP_PRECEDENCE,        "MLPP precedence"},
487   { PARAM_TYPE_MCID_REQ_IND,           "MCID request indicators"},
488   { PARAM_TYPE_MCID_RSP_IND,           "MCID response indicators"},
489   { PARAM_TYPE_HOP_COUNTER,            "Hop counter"},
490   { PARAM_TYPE_ORIG_LINE_INFO,         "Originating line info"},
491   { PARAM_TYPE_TRANSM_MEDIUM_RQUR_PR,  "Transmission medium requirement prime"},
492   { PARAM_TYPE_LOCATION_NR,            "Location number"},
493   { PARAM_TYPE_REDIR_NR_RSTRCT,        "Redirection number restriction"},
494   { PARAM_TYPE_CALL_TRANS_REF,         "Call transfer reference"},
495   { PARAM_TYPE_LOOP_PREV_IND,          "Loop prevention indicators"},
496   { PARAM_TYPE_CALL_TRANS_NR,          "Call transfer number"},
497   { PARAM_TYPE_CCSS,                   "CCSS"},
498   { PARAM_TYPE_FORW_GVNS,              "Forward GVNS"},
499   { PARAM_TYPE_BACKW_GVNS,             "Backward GVNS"},
500   { PARAM_TYPE_REDIRECT_CAPAB,         "Redirect capability (reserved for national use)"},
501   { PARAM_TYPE_NETW_MGMT_CTRL,         "Network management controls"},
502   { PARAM_TYPE_CORRELATION_ID,         "Correlation id"},
503   { PARAM_TYPE_SCF_ID,                 "SCF id"},
504   { PARAM_TYPE_CALL_DIV_TREAT_IND,     "Call diversion treatment indicators"},
505   { PARAM_TYPE_CALLED_IN_NR,           "Called IN number"},
506   { PARAM_TYPE_CALL_OFF_TREAT_IND,     "Call offering treatment indicators"},
507   { PARAM_TYPE_CHARGED_PARTY_IDENT,    "Charged party identification (national use)"},
508   { PARAM_TYPE_CONF_TREAT_IND,         "Conference treatment indicators"},
509   { PARAM_TYPE_DISPLAY_INFO,           "Display information"},
510   { PARAM_TYPE_UID_ACTION_IND,         "UID action indicators"},
511   { PARAM_TYPE_UID_CAPAB_IND,          "UID capability indicators"},
512   { PARAM_TYPE_REDIRECT_COUNTER,       "Redirect counter (reserved for national use)"},
513   { PARAM_TYPE_COLLECT_CALL_REQ,       "Collect call request"},
514   { PARAM_TYPE_GENERIC_NR,             "Generic number"},
515   { PARAM_TYPE_JURISDICTION,           "Jurisdiction"},
516   { PARAM_TYPE_GENERIC_NAME,           "Generic name"},
517   { PARAM_TYPE_GENERIC_DIGITS,         "Generic digits (national use)"},
518   { PARAM_TYPE_APPLICATON_TRANS,       "Application transport"},
519   { ANSI_ISUP_PARAM_TYPE_OPER_SERV_INF, "Operator Services information"},
520   { ANSI_ISUP_PARAM_TYPE_EGRESS,                "Egress"},
521   { ANSI_ISUP_PARAM_TYPE_JURISDICTION,  "Jurisdiction"},
522   { ANSI_ISUP_PARAM_TYPE_CARRIER_ID,    "Carrier identification"},
523   { ANSI_ISUP_PARAM_TYPE_BUSINESS_GRP,  "Buisiness group"},
524   { ANSI_ISUP_PARAM_TYPE_GENERIC_NAME,  "Generic name"},
525   { ANSI_ISUP_PARAM_TYPE_NOTIF_IND,             "Notification indicator"},
526   { ANSI_ISUP_PARAM_TYPE_CG_CHAR_IND,   "Circuit group characteristic indicator"},
527   { ANSI_ISUP_PARAM_TYPE_CVR_RESP_IND,  "Circuit validation response indicator"},
528   { ANSI_ISUP_PARAM_TYPE_OUT_TRK_GRP_NM,"Outgoing trunk group number"},
529   { ANSI_ISUP_PARAM_TYPE_CI_NAME_IND,   "Circuit identification name"},
530   { ANSI_ISUP_PARAM_CLLI_CODE,                  "COMMON LANGUAGE location identificatio (CLLI) code"},
531   { ANSI_ISUP_PARAM_ORIG_LINE_INF,              "Originating line information"},
532   { ANSI_ISUP_PARAM_CHRG_NO,                    "Charge number"},
533   { ANSI_ISUP_PARAM_SERV_CODE_IND,              "Service code indicator"},
534   { ANSI_ISUP_PARAM_SPEC_PROC_REQ,              "Special processing request"},
535   { ANSI_ISUP_PARAM_CARRIER_SEL_INF,    "Carrier selection information"},
536   { ANSI_ISUP_PARAM_NET_TRANS,                  "Network transport"},
537   { 0,                                 NULL}};
538
539 #define CIC_LENGTH                             2
540 #define BICC_CIC_LENGTH                        4
541 #define MESSAGE_TYPE_LENGTH                    1
542 #define COMMON_HEADER_LENGTH                   (CIC_LENGTH + MESSAGE_TYPE_LENGTH)
543 #define BICC_COMMON_HEADER_LENGTH              (BICC_CIC_LENGTH + MESSAGE_TYPE_LENGTH)
544
545 #define MAXDIGITS                              32 /* Max number of address digits */
546 #define MAXGNAME                               15 /* Max number of characters in generic name */
547
548 #define PARAMETER_TYPE_LENGTH                  1
549 #define PARAMETER_POINTER_LENGTH               1
550 #define PARAMETER_LENGTH_IND_LENGTH            1
551
552 /* All following parameter length definitions are WITHOUT the parameter type byte and length indicator for optional parameters*/
553 #define PARAMETER_NAME_LENGTH                  1
554 #define PARAMETER_LENGTH_IND_LENGTH            1
555 #define ACCESS_DELIVERY_INFO_LENGTH            1
556 #define AUTO_CONGEST_LEVEL_LENGTH              1
557 #define BACKWARD_CALL_IND_LENGTH               2
558 #define BACKWARD_GVNS_LENGTH                   1
559 #define CALL_DIV_INFO_LENGTH                   1
560 #define CALL_DIV_TREATMENT_IND_LENGTH          1
561 #define CALL_HISTORY_INFO_LENGTH               2
562 #define CALL_OFFERING_TREATMENT_IND_LENGTH     1
563 #define CALL_REFERENCE_LENGTH                  5
564 #define CALL_TRANSFER_REF_LENGTH               1
565 #define CALLING_PRTYS_CATEGORY_LENGTH          1
566 #define CCSS_LENGTH                            1
567 #define CIRCUIT_ASSIGNMENT_MAP_LENGTH          5
568 #define CIRC_GRP_SV_MSG_TYPE_LENGTH            1
569 #define CLOSED_USR_GRP_INTERLOCK_CODE_LENGTH   4
570 #define COLLECT_CALL_REQUEST_LENGTH            1
571 #define CONFERENCE_TREATMENT_IND_LENGTH        1
572 #define CONNECTION_REQUEST_LENGTH              7
573 #define CONTINUITY_IND_LENGTH                  1
574 #define ECHO_CONTROL_INFO_LENGTH               1
575 #define END_OF_OPT_PART_LENGTH                 1
576 #define EVENT_INFO_LENGTH                      1
577 #define FACILITY_IND_LENGTH                    1
578 #define FORWARD_CALL_IND_LENGTH                2
579 #define GENERIC_NOTIFICATION_IND_LENGTH        1
580 #define HOP_COUNTER_LENGTH                     1
581 #define ORIG_LINE_INFO_LENGTH                  1
582 #define INFO_IND_LENGTH                        2
583 #define INFO_REQUEST_IND_LENGTH                2
584 #define LOOP_PREVENTION_IND_LENGTH             1
585 #define MCID_REQUEST_IND_LENGTH                1
586 #define MCID_RESPONSE_IND_LENGTH               1
587 #define MLPP_PRECEDENCE_LENGTH                 1
588 #define NATURE_OF_CONNECTION_IND_LENGTH        1
589 #define NETWORK_MANAGEMENT_CONTROLS_LENGTH     1
590 #define OPTIONAL_BACKWARD_CALL_IND_LENGTH      1
591 #define OPTIONAL_FORWARD_CALL_IND_LENGTH       1
592 #define ORIGINAL_ISC_POINT_CODE_LENGTH         2
593 #define PROPAGATION_DELAY_COUNT_LENGTH         2
594 #define REDIRECTION_NUMBER_LENGTH              2
595 #define REDIRECTION_INFO_LENGTH                2
596 #define REDIRECTION_NUMBER_RESTRICTION_LENGTH  1
597 #define SIGNALLING_POINT_CODE_LENGTH           2
598 #define SUSPEND_RESUME_IND_LENGTH              1
599 #define TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH 1
600 #define TRANSMISSION_MEDIUM_RQMT_PRIME_LENGTH  1
601 #define TRANSMISSION_MEDIUM_USED_LENGTH        1
602 #define UID_ACTION_IND_LENGTH                  1
603 #define UID_CAPABILITY_IND_LENGTH              1
604 #define USER_TELESERVICE_INFO_LENGTH           2
605 #define USER_TO_USER_IND_LENGTH                1
606 #define RANGE_LENGTH                           1
607
608 #define CVR_RESP_IND_LENGTH                                             1
609 #define CG_CHAR_IND_LENGTH                                              1
610 #define CI_NAME_IND                                                             28
611 #define CLLI_CODE_LENGTH                                                13
612
613 #define CALL_ID_LENGTH        3 /* for parameter Call Reference */
614 #define SPC_LENGTH            2 /* for parameter Call Reference, Connection request */
615 #define LOCAL_REF_LENGTH      3 /* for parameter Connection request */
616 #define PROTOCOL_CLASS_LENGTH 1 /* for parameter Connection request */
617 #define CREDIT_LENGTH         1 /* for parameter Connection request */
618
619 #define CIC_OFFSET            0
620 #define BICC_CIC_OFFSET       0
621
622 #define NO_SATELLITE_CIRCUIT_IN_CONNECTION   0
623 #define ONE_SATELLITE_CIRCUIT_IN_CONNECTION  1
624 #define TWO_SATELLITE_CIRCUIT_IN_CONNECTION  2
625 static const value_string isup_satellite_ind_value[] = {
626   { NO_SATELLITE_CIRCUIT_IN_CONNECTION,          "No Satellite circuit in connection"},
627   { ONE_SATELLITE_CIRCUIT_IN_CONNECTION,         "One Satellite circuit in connection"},
628   { TWO_SATELLITE_CIRCUIT_IN_CONNECTION,         "Two Satellite circuits in connection"},
629   { 0,                                 NULL}};
630
631 #define CONTINUITY_CHECK_NOT_REQUIRED           0
632 #define CONTINUITY_CHECK_REQUIRED               1
633 #define CONTINUITY_CHECK_ON_A_PREVIOUS_CIRCUIT  2
634 static const value_string isup_continuity_check_ind_value[] = {
635   { CONTINUITY_CHECK_NOT_REQUIRED,               "Continuity check not required"},
636   { CONTINUITY_CHECK_REQUIRED,                   "Continuity check required on this circuit"},
637   { CONTINUITY_CHECK_ON_A_PREVIOUS_CIRCUIT ,     "Continuity check performed on a previous circuit"},
638   { 0,                                 NULL}};
639
640 static const true_false_string isup_echo_control_device_ind_value = {
641   "Echo control device included",
642   "Echo control device not included"
643 };
644
645 static const true_false_string isup_natnl_inatnl_call_ind_value = {
646   "Call to be treated as international call",
647   "Call to be treated as national call"
648 };
649
650 #define NO_END_TO_END_METHOD_AVAILABLE       0
651 #define PASS_ALONG_METHOD_AVAILABLE          1
652 #define SCCP_METHOD_AVAILABLE                2
653 #define PASS_ALONG_AND_SCCP_METHOD_AVAILABLE 3
654 static const value_string isup_end_to_end_method_ind_value[] = {
655   { NO_END_TO_END_METHOD_AVAILABLE,          "No End-to-end method available (only link-by-link method available)"},
656   { PASS_ALONG_METHOD_AVAILABLE,             "Pass-along method available (national use)"},
657   { SCCP_METHOD_AVAILABLE,                   "SCCP method available"},
658   { PASS_ALONG_AND_SCCP_METHOD_AVAILABLE,    "pass-along and SCCP method available (national use)"},
659   { 0,                                 NULL}};
660
661 static const true_false_string isup_interworking_ind_value = {
662   "interworking encountered",
663   "no interworking encountered (No.7 signalling all the way)"
664 };
665
666 static const true_false_string isup_end_to_end_info_ind_value = {
667   "end-to-end information available",
668   "no end-to-end information available"
669 };
670
671 static const true_false_string isup_ISDN_user_part_ind_value = {
672   "ISDN user part used all the way",
673   "ISDN user part not used all the way"
674 };
675
676 #define ISUP_PREFERED_ALL_THE_WAY               0
677 #define ISUP_NOT_REQUIRED_ALL_THE_WAY           1
678 #define ISUP_REQUIRED_ALL_WAY                   2
679 #define ISUP_ISDN_USER_PART_IND_SPARE           3
680 static const value_string isup_preferences_ind_value[] = {
681   { ISUP_PREFERED_ALL_THE_WAY,                   "ISDN user part prefered all the way"},
682   { ISUP_NOT_REQUIRED_ALL_THE_WAY,               "ISDN user part not required all the way"},
683   { ISUP_REQUIRED_ALL_WAY,                       "ISDN user part required all the way"},
684   { ISUP_ISDN_USER_PART_IND_SPARE,               "spare"},
685   { 0,                                 NULL}};
686
687 static const true_false_string isup_ISDN_originating_access_ind_value = {
688   "originating access ISDN",
689   "originating access non-ISDN"
690 };
691
692 static const true_false_string isup_ISDN_ported_num_trans_ind_value = {
693   "number translated",
694   "number not translated"
695 };
696
697 static const true_false_string isup_ISDN_qor_attempt_ind_value = {
698   "QoR routing attempt in progress",
699   "no QoR routing attempt in progress"
700 };
701
702 #define NO_INDICATION                                0
703 #define CONNECTIONLESS_METHOD_AVAILABLE              1
704 #define CONNECITON_ORIENTED_METHOD_AVAILABLE         2
705 #define CONNECTIONLESS_AND_ORIENTED_METHOD_AVAILABLE 3
706 static const value_string isup_SCCP_method_ind_value[] = {
707   { NO_INDICATION,                                  "No indication"},
708   { CONNECTIONLESS_METHOD_AVAILABLE,                "Connectionless method available (national use)"},
709   { CONNECITON_ORIENTED_METHOD_AVAILABLE,           "Connection oriented method available"},
710   { CONNECTIONLESS_AND_ORIENTED_METHOD_AVAILABLE,   "Connectionless and -oriented method available (national use)"},
711   { 0,                                 NULL}};
712
713 #define UNKNOWN_AT_THIS_TIME                 0
714 #define OPERATOR_FRENCH                      1
715 #define OPERATOR_ENGLISH                     2
716 #define OPERATOR_GERMAN                      3
717 #define OPERATOR_RUSSIAN                     4
718 #define OPERATOR_SPANISH                     5
719 #define ORDINARY_CALLING_SUBSCRIBER         10
720 #define CALLING_SUBSCRIBER_WITH_PRIORITY    11
721 #define DATA_CALL                           12
722 #define TEST_CALL                           13
723 #define PAYPHONE                            15
724 const value_string isup_calling_partys_category_value[] = {
725   { UNKNOWN_AT_THIS_TIME,               "Category unknown at this time (national use)"},
726   { OPERATOR_FRENCH,                    "operator, language French"},
727   { OPERATOR_ENGLISH,                   "operator, language English"},
728   { OPERATOR_GERMAN,                    "operator, language German"},
729   { OPERATOR_RUSSIAN,                   "operator, language Russian"},
730   { OPERATOR_SPANISH,                   "operator, language Spanish"},
731   { ORDINARY_CALLING_SUBSCRIBER,        "ordinary calling subscriber"},
732   { CALLING_SUBSCRIBER_WITH_PRIORITY,   "calling subscriber with priority"},
733   { DATA_CALL,                          "data call (voice band data)"},
734   { TEST_CALL,                          "test call"},
735   /* q.763-200212Amd2 */
736   { 14,                                                                 "IEPS call marking for preferential call set up"},
737   { PAYPHONE,                           "payphone"},
738   { 0,                                 NULL}};
739
740 #define CVR_RSP_IND_FAILURE             0
741 #define CVR_RSP_IND_SUCCESS             1
742
743 const value_string isup_cvr_rsp_ind_value[ ] = {
744         { CVR_RSP_IND_FAILURE, "CVR Response Fail" },
745         { CVR_RSP_IND_SUCCESS, "CVR Response Success" },
746         { 0,                                    NULL }
747 };
748
749 #define CVR_CG_IND_DOUBLE_SEIZE_NONE 0
750 #define CVR_CG_IND_DOUBLE_SEIZE_ODD  1
751 #define CVR_CG_IND_DOUBLE_SEIZE_EVEN 2
752 #define CVR_CG_IND_DOUBLE_SEIZE_ALL  3
753
754 const value_string isup_cvr_cg_double_seize_value[ ] = {
755         { CVR_CG_IND_DOUBLE_SEIZE_NONE, "Double Seize control NONE" },
756         { CVR_CG_IND_DOUBLE_SEIZE_ODD, "Double Seize control odd circuits"},
757         { CVR_CG_IND_DOUBLE_SEIZE_EVEN, "Double Seize control even circuits"},
758         { CVR_CG_IND_DOUBLE_SEIZE_ALL, "Double Seize control all circuits"},
759         {0, NULL }
760 };
761
762 #define CVR_CG_IND_CAR_IND_UNKNOWN              0
763 #define CVR_CG_IND_CAR_IND_ANALOG               1
764 #define CVR_CG_IND_CAR_IND_DIGITAL              2
765 #define CVR_CG_IND_CAR_IND_ANALOG_DIG   3
766
767 const value_string isup_cvr_cg_car_ind_value[ ] = {
768 { CVR_CG_IND_CAR_IND_UNKNOWN   , "Carrier Type Unknown" },
769 { CVR_CG_IND_CAR_IND_ANALOG    ,   "Carrier Type Analog" },
770 { CVR_CG_IND_CAR_IND_DIGITAL   ,   "Carrier Type Digital"},
771 { CVR_CG_IND_CAR_IND_ANALOG_DIG, "Carrier Type Digital And Analog"},
772 { 0, NULL }
773 };
774
775 #define CVR_CG_IND_ALARM_CAR_IND_UNKNOW         0
776 #define CVR_CG_IND_ALARM_CAR_IND_SOFTWARE       1
777 #define CVR_CG_IND_ALARM_CAR_IND_HARDWARE       2
778 #define CVR_CG_IND_ALARM_CAR_IND_SPARE          3
779
780 const value_string isup_cvr_alarm_car_ind_value[ ] = {
781         { CVR_CG_IND_ALARM_CAR_IND_UNKNOW     , "Alarm Carrier Ind Default"},
782         { CVR_CG_IND_ALARM_CAR_IND_SOFTWARE   , "Alarm Carrier Ind Software"},
783         { CVR_CG_IND_ALARM_CAR_IND_HARDWARE   , "Alarm Carrier Ind Hardware"},
784         { CVR_CG_IND_ALARM_CAR_IND_SPARE          , "Alarm Carrier Ind Spare"},
785         { 0, NULL }
786 };
787
788 #define CVR_CG_IND_CONT_CHK_UNKNOWN  0
789 #define CVR_CG_IND_CONT_CHK_NONE         1
790 #define CVR_CG_IND_CONT_CHK_STAT         2
791 #define CVR_CG_IND_CONT_CHK_PER_CALL 3
792
793 const value_string isup_cvr_cont_chk_ind_value[ ] = {
794
795         { CVR_CG_IND_CONT_CHK_UNKNOWN  , "Continuity Check Unknown"},
796         { CVR_CG_IND_CONT_CHK_NONE     , "Continuity Check NONE"},
797         { CVR_CG_IND_CONT_CHK_STAT     ,"Continuity Check Statistical"},
798         { CVR_CG_IND_CONT_CHK_PER_CALL  ,"Continuity Check Per Call"},
799         { 0, NULL }
800 };
801
802 #define MEDIUM_SPEECH                        0
803 #define MEDIUM_64KBS                         2
804 #define MEDIUM_3_1_KHZ_AUDIO                 3
805 #define MEDIUM_RESERVED_SERVICE2_1           4
806 #define MEDIUM_RESERVED_SERVICE1_2           5
807 #define MEDIUM_64KBS_PREFERED                6
808 #define MEDIUM_2_64KBS                       7
809 #define MEDIUM_384KBS                        8
810 #define MEDIUM_1536KBS                       9
811 #define MEDIUM_1920KBS                      10
812 #define MEDIUM_3_64KBS                      16
813 #define MEDIUM_4_64KBS                      17
814 #define MEDIUM_5_64KBS                      18
815 #define MEDIUM_7_64KBS                      20
816 #define MEDIUM_8_64KBS                      21
817 #define MEDIUM_9_64KBS                      22
818 #define MEDIUM_10_64KBS                     23
819 #define MEDIUM_11_64KBS                     24
820 #define MEDIUM_12_64KBS                     25
821 #define MEDIUM_13_64KBS                     26
822 #define MEDIUM_14_64KBS                     27
823 #define MEDIUM_15_64KBS                     28
824 #define MEDIUM_16_64KBS                     29
825 #define MEDIUM_17_64KBS                     30
826 #define MEDIUM_18_64KBS                     31
827 #define MEDIUM_19_64KBS                     32
828 #define MEDIUM_20_64KBS                     33
829 #define MEDIUM_21_64KBS                     34
830 #define MEDIUM_22_64KBS                     35
831 #define MEDIUM_23_64KBS                     36
832 #define MEDIUM_25_64KBS                     38
833 #define MEDIUM_26_64KBS                     39
834 #define MEDIUM_27_64KBS                     40
835 #define MEDIUM_28_64KBS                     41
836 #define MEDIUM_29_64KBS                     42
837
838 const value_string isup_transmission_medium_requirement_value[] = {
839   { MEDIUM_SPEECH,                       "speech"},
840   { MEDIUM_64KBS,                        "64 kbit/s unrestricted"},
841   { MEDIUM_3_1_KHZ_AUDIO,                "3.1 kHz audio"},
842   { MEDIUM_RESERVED_SERVICE2_1,          "reserved for alternate speech (service 2)/64 kbit/s unrestricted (service 1)"},
843   { MEDIUM_RESERVED_SERVICE1_2,          "reserved for alternate 64 kbit/s unrestricted (service 1)/speech (service 2)"},
844   { MEDIUM_64KBS_PREFERED,               "64 kbit/s prefered"},
845   { MEDIUM_2_64KBS,                      "2x64 kbit/s unrestricted"},
846   { MEDIUM_384KBS,                       "384 kbit/s unrestricted"},
847   { MEDIUM_1536KBS,                      "1536 kbit/s unrestricted"},
848   { MEDIUM_1920KBS,                      "1920 kbit/s unrestricted"},
849   { MEDIUM_3_64KBS,                      "3x64 kbit/s unrestricted"},
850   { MEDIUM_4_64KBS,                      "4x64 kbit/s unrestricted"},
851   { MEDIUM_5_64KBS,                      "5x64 kbit/s unrestricted"},
852   { MEDIUM_7_64KBS,                      "7x64 kbit/s unrestricted"},
853   { MEDIUM_8_64KBS,                      "8x64 kbit/s unrestricted"},
854   { MEDIUM_9_64KBS,                      "9x64 kbit/s unrestricted"},
855   { MEDIUM_10_64KBS,                     "10x64 kbit/s unrestricted"},
856   { MEDIUM_11_64KBS,                     "11x64 kbit/s unrestricted"},
857   { MEDIUM_12_64KBS,                     "12x64 kbit/s unrestricted"},
858   { MEDIUM_13_64KBS,                     "13x64 kbit/s unrestricted"},
859   { MEDIUM_14_64KBS,                     "14x64 kbit/s unrestricted"},
860   { MEDIUM_15_64KBS,                     "15x64 kbit/s unrestricted"},
861   { MEDIUM_16_64KBS,                     "16x64 kbit/s unrestricted"},
862   { MEDIUM_17_64KBS,                     "17x64 kbit/s unrestricted"},
863   { MEDIUM_18_64KBS,                     "18x64 kbit/s unrestricted"},
864   { MEDIUM_19_64KBS,                     "19x64 kbit/s unrestricted"},
865   { MEDIUM_20_64KBS,                     "20x64 kbit/s unrestricted"},
866   { MEDIUM_21_64KBS,                     "21x64 kbit/s unrestricted"},
867   { MEDIUM_22_64KBS,                     "22x64 kbit/s unrestricted"},
868   { MEDIUM_23_64KBS,                     "23x64 kbit/s unrestricted"},
869   { MEDIUM_25_64KBS,                     "25x64 kbit/s unrestricted"},
870   { MEDIUM_26_64KBS,                     "26x64 kbit/s unrestricted"},
871   { MEDIUM_27_64KBS,                     "27x64 kbit/s unrestricted"},
872   { MEDIUM_28_64KBS,                     "28x64 kbit/s unrestricted"},
873   { MEDIUM_29_64KBS,                     "29x64 kbit/s unrestricted"},
874   { 0,                                 NULL}};
875 static const value_string isup_transmission_medium_requirement_prime_value[] = {
876   { MEDIUM_SPEECH,                       "speech"},
877   { MEDIUM_64KBS,                        "reserved for 64 kbit/s unrestricted"},
878   { MEDIUM_3_1_KHZ_AUDIO,                "3.1 kHz audio"},
879   { MEDIUM_RESERVED_SERVICE2_1,          "reserved for alternate speech (service 2)/64 kbit/s unrestricted (service 1)"},
880   { MEDIUM_RESERVED_SERVICE1_2,          "reserved for alternate 64 kbit/s unrestricted (service 1)/speech (service 2)"},
881   { MEDIUM_64KBS_PREFERED,               "reserved for 64 kbit/s prefered"},
882   { MEDIUM_2_64KBS,                      "reserved for 2x64 kbit/s unrestricted"},
883   { MEDIUM_384KBS,                       "reserved for 384 kbit/s unrestricted"},
884   { MEDIUM_1536KBS,                      "reserved for 1536 kbit/s unrestricted"},
885   { MEDIUM_1920KBS,                      "reserved for 1920 kbit/s unrestricted"},
886   { 0,                                 NULL}};
887
888
889 /* Definitions for Called and Calling Party number */
890 #define ISUP_ODD_EVEN_MASK                       0x80
891 #define ISUP_NATURE_OF_ADDRESS_IND_MASK          0x7F
892 #define ISUP_INN_MASK                            0x80
893 #define ISUP_NI_MASK                             0x80
894 #define ISUP_NUMBERING_PLAN_IND_MASK             0x70
895 #define ISUP_ADDRESS_PRESENTATION_RESTR_IND_MASK 0x0C
896 #define ISUP_SCREENING_IND_MASK                  0x03
897 #define ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK       0x0F
898 #define ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK      0xF0
899
900 static const true_false_string isup_odd_even_ind_value = {
901   "odd number of address signals",
902   "even number of address signals"
903 };
904
905 #define ISUP_CALLED_PARTY_NATURE_SUBSCRIBER_NR  1
906 #define ISUP_CALLED_PARTY_NATURE_UNKNOWN        2
907 #define ISUP_CALLED_PARTY_NATURE_NATIONAL_NR    3
908 #define ISUP_CALLED_PARTY_NATURE_INTERNATNL_NR  4
909 #define ISUP_CALLED_PARTY_NATURE_NETW_SPEC_NR   5
910
911 #define ISUP_CHARGE_NATURE_ANI_CGPA_SUB_NR              1
912 #define ISUP_CHARGE_NATURE_ANI_NA                               2
913 #define ISUP_CHARGE_NATURE_ANI_CGPA_NAT_NR              3
914 #define ISUP_CHARGE_NATURE_ANI_CDPA_SUB_NR              5
915 #define ISUP_CHARGE_NATURE_ANI_CDPA_NO_NR               6
916 #define ISUP_CHARGE_NATURE_ANI_CDPA_NAT_NR              7
917
918 static const value_string isup_called_party_nature_of_address_ind_value[] = {
919   { ISUP_CALLED_PARTY_NATURE_SUBSCRIBER_NR,     "subscriber number (national use)"},
920   { ISUP_CALLED_PARTY_NATURE_UNKNOWN,           "unknown (national use)"},
921   { ISUP_CALLED_PARTY_NATURE_NATIONAL_NR,       "national (significant) number"},
922   { ISUP_CALLED_PARTY_NATURE_INTERNATNL_NR,     "international number"},
923   { ISUP_CALLED_PARTY_NATURE_NETW_SPEC_NR,      "network-specific number (national use)"},
924   { 0,                                 NULL}};
925
926 static const value_string isup_calling_party_nature_of_address_ind_value[] = {
927   { ISUP_CALLED_PARTY_NATURE_SUBSCRIBER_NR,     "subscriber number (national use)"},
928   { ISUP_CALLED_PARTY_NATURE_UNKNOWN,           "unknown (national use)"},
929   { ISUP_CALLED_PARTY_NATURE_NATIONAL_NR,       "national (significant) number"},
930   { ISUP_CALLED_PARTY_NATURE_INTERNATNL_NR,     "international number"},
931   { 0,                                 NULL}};
932
933 static const value_string isup_charge_number_nature_of_address_ind_value[] = {
934   { ISUP_CHARGE_NATURE_ANI_CGPA_SUB_NR,         "ANI of the calling party; subscriber number"},
935   { ISUP_CHARGE_NATURE_ANI_NA,                          "ANI not available or not provided"},
936   { ISUP_CHARGE_NATURE_ANI_CGPA_NAT_NR,     "ANI of the calling party; national number"},
937   { ISUP_CHARGE_NATURE_ANI_CDPA_SUB_NR,     "ANI of the called party; subscriber number"},
938   { ISUP_CHARGE_NATURE_ANI_CDPA_NO_NR,          "ANI of the called party; no number present"},
939   { ISUP_CHARGE_NATURE_ANI_CDPA_NAT_NR,     "ANI of the called party; national number"},
940   { 0,                                 NULL}};
941
942 #define ISUP_GENERIC_NAME_PRESENTATION_ALLOWED          0
943 #define ISUP_GENERIC_NAME_PRESENTATION_RESTRICT         1
944 #define ISUP_GENERIC_NAME_PRESENTATION_BLOCK_TOGGLE     2
945 #define ISUP_GENERIC_NAME_PRESENTATION_NO_INDIC         3
946 #define ISUP_GENERIC_NAME_TYPE_SPARE                            0
947 #define ISUP_GENERIC_NAME_TYPE_CALLING                          1
948 #define ISUP_GENERIC_NAME_TYPE_ORIG_CALLED                      2
949 #define ISUP_GENERIC_NAME_TYPE_REDIRECTING                      3
950 #define ISUP_GENERIC_NAME_TYPE_CONNECTED                        4
951
952 static const value_string isup_generic_name_presentation_value[] = {
953   { ISUP_GENERIC_NAME_PRESENTATION_ALLOWED,                     "presentation allowed"},
954   { ISUP_GENERIC_NAME_PRESENTATION_RESTRICT,            "presentation restricted"},
955   { ISUP_GENERIC_NAME_PRESENTATION_BLOCK_TOGGLE,        "blocking toggle"},
956   { ISUP_GENERIC_NAME_PRESENTATION_NO_INDIC,            "no indication"},
957   { 0,                                 NULL}};
958
959 static const true_false_string isup_generic_name_availability_value = {
960   "name not available",
961   "name available/unknown"
962 };
963
964 static const value_string isup_generic_name_type_value[] = {
965   { ISUP_GENERIC_NAME_TYPE_SPARE,                       "spare"},
966   { ISUP_GENERIC_NAME_TYPE_CALLING,                     "calling name"},
967   { ISUP_GENERIC_NAME_TYPE_ORIG_CALLED,         "original called name"},
968   { ISUP_GENERIC_NAME_TYPE_REDIRECTING,         "redirecting name"},
969   { ISUP_GENERIC_NAME_TYPE_CONNECTED,           "connected name"},
970   { 5,                                                                          "spare"},
971   { 6,                                                                          "spare"},
972   { 7,                                                                          "spare"},
973   { 0,                                 NULL}};
974
975 static const true_false_string isup_INN_ind_value = {
976   "routing to internal network number not allowed",
977   "routing to internal network number allowed "
978 };
979 static const true_false_string isup_NI_ind_value = {
980   "incomplete",
981   "complete"
982 };
983
984 #define ISDN_NUMBERING_PLAN                     1
985 #define DATA_NUMBERING_PLAN                     3
986 #define TELEX_NUMBERING_PLAN                    4
987 static const value_string isup_numbering_plan_ind_value[] = {
988   { ISDN_NUMBERING_PLAN,     "ISDN (Telephony) numbering plan"},
989   { DATA_NUMBERING_PLAN,     "Data numbering plan (national use)"},
990   { TELEX_NUMBERING_PLAN,    "Telex numbering plan (national use)"},
991   { 5,                       "Reserved for national use"},
992   { 6,                       "Reserved for national use"},
993   { 0,                                 NULL}};
994
995 #define ADDRESS_PRESETATION_ALLOWED      0
996 #define ADDRESS_PRESETATION_RESTRICTED   1
997 #define ADDRESS_NOT_AVAILABLE            2
998 static const value_string isup_address_presentation_restricted_ind_value[] = {
999   { ADDRESS_PRESETATION_ALLOWED,     "presentation allowed"},
1000   { ADDRESS_PRESETATION_RESTRICTED,  "presentation restricted"},
1001   { ADDRESS_NOT_AVAILABLE,           "address not available (national use)"},
1002   { 3,                                 "spare"},
1003   { 0,                                 NULL}};
1004
1005 static const value_string isup_screening_ind_value[] = {
1006   { 0,     "reserved"},
1007   { 1,     "user provided, verified and passed"},
1008   { 2,     "reserved"},
1009   { 3,     "network provided"},
1010   { 0,     NULL}};
1011
1012 static const value_string isup_screening_ind_enhanced_value[] = {
1013   { 0,     "user provided, not verified"},
1014   { 1,     "user provided, verified and passed"},
1015   { 2,     "user provided, verified and failed"},
1016   { 3,     "network provided"},
1017   { 0,     NULL}};
1018
1019 static const value_string isup_called_party_address_digit_value[] = {
1020   { 0,  "0"},
1021   { 1,  "1"},
1022   { 2,  "2"},
1023   { 3,  "3"},
1024   { 4,  "4"},
1025   { 5,  "5"},
1026   { 6,  "6"},
1027   { 7,  "7"},
1028   { 8,  "8"},
1029   { 9,  "9"},
1030   { 10, "spare"},
1031   { 11, "code 11 "},
1032   { 12, "code 12"},
1033   { 15, "Stop sending"},
1034   { 0,  NULL}};
1035
1036 static const value_string isup_calling_party_address_digit_value[] = {
1037   { 0,  "0"},
1038   { 1,  "1"},
1039   { 2,  "2"},
1040   { 3,  "3"},
1041   { 4,  "4"},
1042   { 5,  "5"},
1043   { 6,  "6"},
1044   { 7,  "7"},
1045   { 8,  "8"},
1046   { 9,  "9"},
1047   { 10, "spare"},
1048   { 11, "code 11 "},
1049   { 12, "code 12"},
1050   { 15, "spare"},
1051   { 0,  NULL}};
1052
1053 /*End of Called/Calling party address definitions */
1054
1055
1056 static const true_false_string isup_calling_party_address_request_ind_value = {
1057   "calling party address requested",
1058   "calling party address not requested"
1059 };
1060 static const true_false_string isup_holding_ind_value = {
1061   "holding requested",
1062   "holding not requested"
1063 };
1064 static const true_false_string isup_calling_partys_category_request_ind_value = {
1065   "Calling Party's category requested",
1066   "Calling Party's category not requested",
1067 };
1068 static const true_false_string isup_charge_information_request_ind_value = {
1069   "Charge Information requested",
1070   "Charge Information not requested"
1071 };
1072 static const true_false_string isup_malicious_call_identification_request_ind_value = {
1073   "Malicious call identification requested",
1074   "Malicious call identification not requested"
1075 };
1076
1077 #define CALLING_PARTY_ADDRESS_NOT_INCLUDED             0
1078 #define CALLING_PARTY_ADDRESS_NOT_AVAILABLE            1
1079 #define CALLING_PARTY_ADDRESS_INCLUDED                 3
1080 static const value_string isup_calling_party_address_response_ind_value[] = {
1081   { CALLING_PARTY_ADDRESS_NOT_INCLUDED, "Calling party address not included"},
1082   { CALLING_PARTY_ADDRESS_NOT_AVAILABLE,"Calling party address not available"},
1083   { 4,                                  "spare"},
1084   { CALLING_PARTY_ADDRESS_INCLUDED,     "Calling party address included"},
1085   { 0,                                 NULL}};
1086
1087 static const true_false_string isup_hold_provided_ind_value = {
1088   "hold provided",
1089   "hold not provided"
1090 };
1091 static const true_false_string isup_calling_partys_category_response_ind_value = {
1092   "Calling Party's category included",
1093   "Calling Party's category not included",
1094 };
1095 static const true_false_string isup_charge_information_response_ind_value = {
1096   "Charge Information included",
1097   "Charge Information not included"
1098 };
1099 static const true_false_string isup_solicited_information_ind_value = {
1100   "unsolicited",
1101   "solicited"
1102 };
1103
1104 static const true_false_string isup_continuity_ind_value = {
1105   "Continuity check successful",
1106   "Continuity ckec failed"
1107 };
1108
1109 #define CHARGE_NO_IND       0
1110 #define CHARGE_NO_CHARGE    1
1111 #define CHARGE_CHARGE       2
1112 static const value_string isup_charge_ind_value[] = {
1113   { CHARGE_NO_IND,    "No indication"},
1114   { CHARGE_NO_CHARGE, "No charge"},
1115   { CHARGE_CHARGE,    "Charge"},
1116   { 3,                "spare"},
1117   { 0,                NULL}};
1118
1119 #define CALLED_PARTYS_STATUS_NO_IND            0
1120 #define CALLED_PARTYS_STATUS_SUBSCR_FREE       1
1121 #define CALLED_PARTYS_STATUS_CONNECT_WHEN_FREE 2
1122 static const value_string isup_called_partys_status_ind_value[] = {
1123   { CALLED_PARTYS_STATUS_NO_IND,            "No indication"},
1124   { CALLED_PARTYS_STATUS_SUBSCR_FREE,       "Subscriber free"},
1125   { CALLED_PARTYS_STATUS_CONNECT_WHEN_FREE, "Connect when free (national use)"},
1126   { 3,                                      "spare"},
1127   { 0,                NULL}};
1128
1129 #define CALLED_PARTYS_CATEGORY_NO_IND            0
1130 #define CALLED_PARTYS_CATEGORY_ORDINARY_SUBSCR   1
1131 #define CALLED_PARTYS_CATEGORY_PAYPHONE          2
1132 static const value_string isup_called_partys_category_ind_value[] = {
1133   { CALLED_PARTYS_CATEGORY_NO_IND,             "No indication"},
1134   { CALLED_PARTYS_CATEGORY_ORDINARY_SUBSCR,    "Ordinary subscriber"},
1135   { CALLED_PARTYS_CATEGORY_PAYPHONE,           "Payphone"},
1136   { 3,                                         "spare"},
1137   { 0,                NULL}};
1138
1139 static const true_false_string isup_ISDN_terminating_access_ind_value = {
1140   "terminating access ISDN",
1141   "terminating access non-ISDN"
1142 };
1143
1144 static const true_false_string isup_suspend_resume_ind_value = {
1145   "network initiated",
1146   "ISDN subscriber initiated"
1147 };
1148 #define MAINTENANCE            0
1149 #define HARDWARE_FAILURE       1
1150 #define RES_FOR_NATNL_USE      2
1151 static const value_string isup_cgs_message_type_value[] = {
1152   { MAINTENANCE,            "maintenance oriented"},
1153   { HARDWARE_FAILURE,       "hardware failure oriented"},
1154   { RES_FOR_NATNL_USE,      "reserved for national use (ISUP'84)"},
1155   { 3,                      "spare"},
1156   { 0,                NULL}};
1157
1158 #define USER_TO_USER_SERVICE      2
1159 static const value_string isup_facility_ind_value[] = {
1160   { USER_TO_USER_SERVICE,     "user-to-user service"},
1161   { 0,                NULL}};
1162
1163 #define MTC_BLCK_STATE_TRANSIENT  0
1164 #define MTC_BLCK_STATE_UNEQUIPPED 3
1165 static const value_string isup_mtc_blocking_state_DC00_value[] = {
1166   {  MTC_BLCK_STATE_TRANSIENT,  "transient"},
1167   { 1,                          "spare"},
1168   { 2,                          "spare"},
1169   {  MTC_BLCK_STATE_UNEQUIPPED, "unequipped"},
1170   { 0,                NULL}};
1171
1172 #define MTC_BLCK_NO_BLOCKING      0
1173 #define MTC_LOCALLY_BLOCKED       1
1174 #define MTC_REMOTELY_BLOCKED      2
1175 #define MTC_LOCAL_REMOTE_BLOCKED  3
1176 static const value_string isup_mtc_blocking_state_DCnot00_value[] = {
1177   {  MTC_BLCK_NO_BLOCKING,     "no blocking (active)"},
1178   {  MTC_LOCALLY_BLOCKED,      "locally blocked"},
1179   {  MTC_REMOTELY_BLOCKED,     "remotely blocked"},
1180   {  MTC_LOCAL_REMOTE_BLOCKED, "locally and remotely blocked"},
1181   {  0,                NULL}};
1182
1183 #define CALL_PROC_INCOMING_BUSY 1
1184 #define CALL_PROC_OUTGOING_BUSY 2
1185 #define CALL_PROC_IDLE          3
1186 static const value_string isup_call_processing_state_value[] = {
1187   {  CALL_PROC_INCOMING_BUSY,     "circuit incoming busy"},
1188   {  CALL_PROC_OUTGOING_BUSY,     "circuit outgoing busy"},
1189   {  CALL_PROC_IDLE,              "idle"},
1190   {  0,                NULL}};
1191
1192 #define HW_BLCK_NO_BLOCKING          0
1193 #define HW_LOCALLY_BLOCKED           1
1194 #define HW_REMOTELY_BLOCKED          2
1195 #define HW_LOCAL_REMOTE_BLOCKED      3
1196 static const value_string isup_HW_blocking_state_value[] = {
1197   {  HW_BLCK_NO_BLOCKING,     "no blocking (active)"},
1198   {  HW_LOCALLY_BLOCKED,      "locally blocked"},
1199   {  HW_REMOTELY_BLOCKED,     "remotely blocked"},
1200   {  HW_LOCAL_REMOTE_BLOCKED, "locally and remotely blocked"},
1201   {  0,                NULL}};
1202
1203 #define EVENT_ALERTING      1
1204 #define EVENT_PROGRESS      2
1205 #define EVENT_INBAND_INFO   3
1206 #define EVENT_ON_BUSY       4
1207 #define EVENT_ON_NO_REPLY   5
1208 #define EVENT_UNCONDITIONAL 6
1209 static const value_string isup_event_ind_value[] = {
1210   /* according 3.21/Q.763 */
1211   {  EVENT_ALERTING,     "ALERTING"},
1212   {  EVENT_PROGRESS,     "PROGRESS"},
1213   {  EVENT_INBAND_INFO,  "in-band information or an appropriate pattern is now available"},
1214   {  EVENT_ON_BUSY,      "call forwarded on busy (national use)"},
1215   {  EVENT_ON_NO_REPLY,  "call forwarded on no reply (national use)"},
1216   {  EVENT_UNCONDITIONAL,"call forwarded unconditional (national use)"},
1217   {  0,                NULL}};
1218
1219 static const true_false_string isup_event_presentation_restricted_ind_value = {
1220   /* according 3.21/Q.763 */
1221   "presentation restricted",
1222   "no indication"
1223 };
1224 #define CUG_NON_CUG_CALL                      0
1225 #define CUG_CALL_OUTGOING_ACCESS_ALLOWED      2
1226 #define CUG_CALL_OUTGOING_ACCESS_NOT_ALLOWED  3
1227 static const value_string isup_CUG_call_ind_value[] = {
1228   /* according 3.38/Q.763 */
1229   {  CUG_NON_CUG_CALL,                     "non-CUG call"},
1230   {  1,                                    "spare"},
1231   {  CUG_CALL_OUTGOING_ACCESS_ALLOWED,     "closed user group call, outgoing access allowed"},
1232   {  CUG_CALL_OUTGOING_ACCESS_NOT_ALLOWED, "closed user group call, outgoing access not allowed"},
1233   {  0,                NULL}};
1234
1235
1236 static const true_false_string isup_simple_segmentation_ind_value = {
1237   /* according 3.38/Q.763 */
1238   "additional information will be sent in a segmentation message",
1239   "no additional information will be sent"
1240 };
1241
1242 static const true_false_string isup_connected_line_identity_request_ind_value = {
1243   /* according 3.38/Q.763 */
1244   "requested",
1245   "not requested"
1246 };
1247
1248 static const value_string isup_redirecting_ind_value[] = {
1249   /* according 3.45/Q.763 */
1250   {  0,        "no redirection (national use)"},
1251   {  1,        "call rerouted (national use)"},
1252   {  2,        "call rerouted, all redirection information presentation restricted (national use)"},
1253   {  3,        "call diverted"},
1254   {  4,        "call diverted, all redirection information presentation restricted"},
1255   {  5,        "call rerouted, redirection number presentation restricted (national use)"},
1256   {  6,        "call diversion, redirection number presentation restricted (national use)"},
1257   {  7,        "spare"},
1258   {  0,         NULL}};
1259
1260 static const value_string isup_original_redirection_reason_value[] = {
1261   /* according 3.45/Q.763 */
1262   {  0,        "unknown/not available"},
1263   {  1,        "user busy (national use)"},
1264   {  2,        "no reply (national use)"},
1265   {  3,        "unconditional (national use)"},
1266   {  0,         NULL}};
1267
1268 static const value_string isup_redirection_reason_value[] = {
1269   /* according 3.45/Q.763 */
1270   {  0,        "unknown/not available"},
1271   {  1,        "user busy (national use)"},
1272   {  2,        "no reply (national use)"},
1273   {  3,        "unconditional (national use)"},
1274   {  4,        "deflection during alerting"},
1275   {  5,        "deflection immediate response"},
1276   {  6,        "mobile subscriber not reachable"},
1277   {  0,         NULL}};
1278
1279 static const value_string isup_type_of_network_identification_value[] = {
1280   /* according 3.53/Q.763 */
1281   {  0,        "CCITT/ITU-T-standardized identification"},
1282   {  2,        "national network identification"},
1283   {  0,         NULL}};
1284
1285 static const value_string isup_network_identification_plan_value[] = {
1286   /* according 3.53/Q.763 */
1287   {  0,        "if CCITT/ITU-T id - unknown"},
1288   {  3,        "if CCITT/ITU-T id - public data network id code (X.121)"},
1289   {  6,        "if CCITT/ITU-T id - public land Mobile Network id code (E.211)"},
1290   {  0,         NULL}};
1291
1292 static const value_string isup_map_type_value[] = {
1293   /* according 3.69/Q.763 */
1294   {  1,        "1544 kbit/s digital path map format (64 kbit/s base rate"},
1295   {  2,        "2048 kbit/s digital path map format (64 kbit/s base rate"},
1296   {  0,         NULL}};
1297
1298 static const value_string isup_auto_congestion_level_value[] = {
1299   /* according 3.4/Q.763 */
1300   {  1,        "Congestion level 1 exceeded"},
1301   {  2,        "Congestion level 2 exceeded"},
1302   {  0,         NULL}};
1303
1304 static const true_false_string isup_inband_information_ind_value = {
1305   /* according 3.37/Q.763 */
1306   "in-band information or an appropirate pattern is now available",
1307   "no indication"
1308 };
1309 static const true_false_string isup_call_diversion_may_occur_ind_value = {
1310   /* according 3.37/Q.763 */
1311   "call diversion may occur",
1312   "no indication"
1313 };
1314 static const true_false_string isup_MLPP_user_ind_value = {
1315   /* according 3.37/Q.763 */
1316   "MLPP user",
1317   "no indication"
1318 };
1319
1320 static const true_false_string isup_access_delivery_ind_value = {
1321   /* according 3.2/Q.763 */
1322   "No set-up message generated",
1323   "Set-up message generated"
1324 };
1325
1326 static const value_string isup_loop_prevention_response_ind_value[] = {
1327   /* according 3.67/Q.763 */
1328   {  0,        "insufficient information"},
1329   {  1,        "no loop exists"},
1330   {  2,        "simultaneous transfer"},
1331   {  0,         NULL}};
1332
1333 static const true_false_string isup_temporary_alternative_routing_ind_value = {
1334   /* according 3.68/Q.763 */
1335   "TAR controlled call",
1336   "no indication"
1337 };
1338 static const true_false_string isup_extension_ind_value = {
1339   /* according 3.68/Q.763 */
1340   "last octet",
1341   "information continues through the next octet"
1342 };
1343
1344
1345
1346 static const value_string isup_call_to_be_diverted_ind_value[] = {
1347   /* according 3.72/Q.763 */
1348   {  0,        "no indication"},
1349   {  1,        "call diversion allowed"},
1350   {  2,        "call diversion not allowed"},
1351   {  3,        "spare"},
1352   {  0,         NULL}};
1353
1354 static const value_string isup_call_to_be_offered_ind_value[] = {
1355   /* according 3.72/Q.763 */
1356   {  0,        "no indication"},
1357   {  1,        "call offering not allowed"},
1358   {  2,        "call offering allowed"},
1359   {  3,        "spare"},
1360   {  0,         NULL}};
1361
1362 static const value_string isup_conference_acceptance_ind_value[] = {
1363   /* according 3.76/Q.763 */
1364   {  0,        "no indication"},
1365   {  1,        "accept conference request"},
1366   {  2,        "reject conference request"},
1367   {  3,        "spare"},
1368   {  0,         NULL}};
1369
1370 static const value_string isup_application_transport_parameter_value[] = {
1371   /* according 3.82/Q.763 */
1372   {  0,         "Unidentified Context and Error Handling (UCEH) ASE"},
1373   {  1,         "PSS1 ASE (VPN)"},
1374   {  2,         "spare"},
1375   {  3,         "Charging ASE"},
1376   {  4,         "GAT"},
1377   {  5,         "BAT ASE"},
1378   {  6,         "Enhanced Unidentified Context and Error Handling ASE (EUCEH ASE)"},
1379   {  0,         NULL}};
1380
1381 static const true_false_string isup_Release_call_indicator_value = {
1382   "release call",
1383   "do not release call"
1384 };
1385
1386 static const true_false_string isup_Send_notification_ind_value = {
1387   "send notification",
1388   "do not send notification"
1389 };
1390 static const value_string isup_APM_segmentation_ind_value[] = {
1391
1392   {  0x00,                     "final segment"},
1393   {  0x01,                     "number of following segments"},
1394   {  0x02,                     "number of following segments"},
1395   {  0x03,                     "number of following segments"},
1396   {  0x04,                     "number of following segments"},
1397   {  0x05,                     "number of following segments"},
1398   {  0x06,                     "number of following segments"},
1399   {  0x07,                     "number of following segments"},
1400   {  0x08,                     "number of following segments"},
1401   {  0x09,                     "number of following segments"},
1402   {  0,                NULL}};
1403
1404 static const true_false_string isup_Sequence_ind_value = {
1405   "new sequence",
1406   "subsequent segment to first segment"
1407 };
1408
1409
1410 /* Generalized bit masks for 8 and 16 bits fields */
1411 #define A_8BIT_MASK  0x01
1412 #define B_8BIT_MASK  0x02
1413 #define C_8BIT_MASK  0x04
1414 #define D_8BIT_MASK  0x08
1415 #define E_8BIT_MASK  0x10
1416 #define F_8BIT_MASK  0x20
1417 #define G_8BIT_MASK  0x40
1418 #define H_8BIT_MASK  0x80
1419
1420 #define BA_8BIT_MASK 0x03
1421 #define CB_8BIT_MASK 0x06
1422 #define DC_8BIT_MASK 0x0C
1423 #define ED_8BIT_MASK 0x18
1424 #define FE_8BIT_MASK 0x30
1425 #define GF_8BIT_MASK 0x60
1426 #define HG_8BIT_MASK 0xC0
1427 #define GFE_8BIT_MASK 0x70
1428 #define HGF_8BIT_MASK 0xE0
1429 #define DCBA_8BIT_MASK 0x0F
1430 #define EDCBA_8BIT_MASK 0x1F
1431 #define HGFE_8BIT_MASK 0xF0
1432 #define GFEDCBA_8BIT_MASK 0x7F
1433 #define FEDCBA_8BIT_MASK 0x3F
1434
1435 #define A_16BIT_MASK  0x0100
1436 #define B_16BIT_MASK  0x0200
1437 #define C_16BIT_MASK  0x0400
1438 #define D_16BIT_MASK  0x0800
1439 #define E_16BIT_MASK  0x1000
1440 #define F_16BIT_MASK  0x2000
1441 #define G_16BIT_MASK  0x4000
1442 #define H_16BIT_MASK  0x8000
1443 #define I_16BIT_MASK  0x0001
1444 #define J_16BIT_MASK  0x0002
1445 #define K_16BIT_MASK  0x0004
1446 #define L_16BIT_MASK  0x0008
1447 #define M_16BIT_MASK  0x0010
1448 #define N_16BIT_MASK  0x0020
1449 #define O_16BIT_MASK  0x0040
1450 #define P_16BIT_MASK  0x0080
1451
1452 #define BA_16BIT_MASK 0x0300
1453 #define CB_16BIT_MASK 0x0600
1454 #define DC_16BIT_MASK 0x0C00
1455 #define FE_16BIT_MASK 0x3000
1456 #define HG_16BIT_MASK 0xC000
1457 #define KJ_16BIT_MASK 0x0006
1458 #define PO_16BIT_MASK 0x00C0
1459
1460 #define CBA_16BIT_MASK 0x0700
1461 #define KJI_16BIT_MASK 0x0007
1462 #define HGFE_16BIT_MASK 0xF000
1463 #define PONM_16BIT_MASK 0x00F0
1464
1465 /* Initialize the protocol and registered fields */
1466 static int proto_isup = -1;
1467 static int proto_bicc = -1;
1468 static module_t *isup_module;
1469
1470 static gboolean isup_show_cic_in_info = TRUE;
1471
1472 static int hf_isup_called = -1;
1473 static int hf_isup_calling = -1;
1474 static int hf_isup_redirecting = -1;
1475
1476 static int hf_isup_cic = -1;
1477 static int hf_bicc_cic = -1;
1478
1479 static int isup_tap = -1;
1480
1481 static int hf_isup_message_type = -1;
1482 static int hf_isup_parameter_type = -1;
1483 static int hf_isup_parameter_length = -1;
1484 static int hf_isup_mandatory_variable_parameter_pointer = -1;
1485 static int hf_isup_pointer_to_start_of_optional_part = -1;
1486
1487 static int hf_isup_cvr_rsp_ind = -1;
1488 static int hf_isup_cvr_cg_car_ind = -1;
1489 static int hf_isup_cvr_cg_double_seize = -1;
1490 static int hf_isup_cvr_cg_alarm_car_ind = -1;
1491 static int hf_isup_cvr_cont_chk_ind = -1;
1492
1493 static int hf_isup_satellite_indicator = -1;
1494 static int hf_isup_continuity_check_indicator = -1;
1495 static int hf_isup_echo_control_device_indicator = -1;
1496
1497 static int hf_isup_forw_call_natnl_inatnl_call_indicator = -1;
1498 static int hf_isup_forw_call_end_to_end_method_indicator = -1;
1499 static int hf_isup_forw_call_interworking_indicator = -1;
1500 static int hf_isup_forw_call_end_to_end_info_indicator = -1;
1501 static int hf_isup_forw_call_isdn_user_part_indicator = -1;
1502 static int hf_isup_forw_call_preferences_indicator = -1;
1503 static int hf_isup_forw_call_isdn_access_indicator = -1;
1504 static int hf_isup_forw_call_ported_num_trans_indicator = -1;
1505 static int hf_isup_forw_call_qor_attempt_indicator = -1;
1506 static int hf_isup_forw_call_sccp_method_indicator = -1;
1507
1508 static int hf_isup_calling_partys_category = -1;
1509
1510 static int hf_isup_transmission_medium_requirement = -1;
1511
1512 static int hf_isup_odd_even_indicator = -1;
1513 static int hf_isup_called_party_nature_of_address_indicator = -1;
1514 static int hf_isup_calling_party_nature_of_address_indicator = -1;
1515 static int hf_isup_inn_indicator = -1;
1516 static int hf_isup_ni_indicator = -1;
1517 static int hf_isup_numbering_plan_indicator = -1;
1518 static int hf_isup_address_presentation_restricted_indicator = -1;
1519 static int hf_isup_screening_indicator = -1;
1520 static int hf_isup_screening_indicator_enhanced = -1;
1521 static int hf_isup_called_party_odd_address_signal_digit = -1;
1522 static int hf_isup_calling_party_odd_address_signal_digit = -1;
1523 static int hf_isup_called_party_even_address_signal_digit               = -1;
1524 static int hf_isup_calling_party_even_address_signal_digit              = -1;
1525
1526 static int hf_isup_generic_name_presentation  = -1;
1527 static int hf_isup_generic_name_availability  = -1;
1528 static int hf_isup_generic_name_type          = -1;
1529 static int hf_isup_generic_name_ia5           = -1;
1530
1531 static int hf_isup_OECD_inf_ind                                         = -1;
1532 static int hf_isup_IECD_inf_ind                                         = -1;
1533 static int hf_isup_OECD_req_ind                                         = -1;
1534 static int hf_isup_IECD_req_ind                                         = -1;
1535
1536 static int hf_isup_calling_party_address_request_indicator = -1;
1537 static int hf_isup_info_req_holding_indicator = -1;
1538 static int hf_isup_calling_partys_category_request_indicator = -1;
1539 static int hf_isup_charge_information_request_indicator = -1;
1540 static int hf_isup_charge_number_nature_of_address_indicator = -1;
1541 static int hf_isup_malicious_call_identification_request_indicator = -1;
1542
1543 static int hf_isup_calling_party_address_response_indicator = -1;
1544 static int hf_isup_hold_provided_indicator = -1;
1545 static int hf_isup_calling_partys_category_response_indicator = -1;
1546 static int hf_isup_charge_information_response_indicator = -1;
1547 static int hf_isup_solicited_indicator = -1;
1548
1549 static int hf_isup_continuity_indicator = -1;
1550
1551 static int hf_isup_backw_call_charge_ind = -1 ;
1552 static int hf_isup_backw_call_called_partys_status_ind = -1;
1553 static int hf_isup_backw_call_called_partys_category_ind = -1;
1554 static int hf_isup_backw_call_end_to_end_method_ind = -1;
1555 static int hf_isup_backw_call_interworking_ind = -1;
1556 static int hf_isup_backw_call_end_to_end_info_ind = -1;
1557 static int hf_isup_backw_call_isdn_user_part_ind = -1;
1558 static int hf_isup_backw_call_holding_ind = -1;
1559 static int hf_isup_backw_call_isdn_access_ind = -1;
1560 static int hf_isup_backw_call_echo_control_device_ind = -1;
1561 static int hf_isup_backw_call_sccp_method_ind = -1;
1562
1563 static int hf_isup_cause_indicator = -1;
1564 static int hf_ansi_isup_cause_indicator = -1;
1565
1566 static int hf_isup_suspend_resume_indicator = -1;
1567
1568 static int hf_isup_range_indicator = -1;
1569 static int hf_isup_cgs_message_type = -1;
1570
1571 static int hf_isup_mtc_blocking_state1 = -1;
1572 static int hf_isup_mtc_blocking_state2 = -1;
1573 static int hf_isup_call_proc_state = -1;
1574 static int hf_isup_hw_blocking_state = -1;
1575
1576 static int hf_isup_event_ind = -1;
1577 static int hf_isup_event_presentation_restricted_ind = -1;
1578
1579 static int hf_isup_cug_call_ind = -1;
1580 static int hf_isup_simple_segmentation_ind = -1;
1581 static int hf_isup_connected_line_identity_request_ind = -1;
1582
1583 static int hf_isup_redirecting_ind = -1;
1584 static int hf_isup_original_redirection_reason = -1;
1585 static int hf_isup_redirection_counter = -1;
1586 static int hf_isup_redirection_reason = -1;
1587
1588 static int hf_isup_type_of_network_identification = -1;
1589 static int hf_isup_network_identification_plan = -1;
1590
1591 static int hf_isup_map_type = -1;
1592
1593 static int hf_isup_automatic_congestion_level                           = -1;
1594
1595 static int hf_isup_inband_information_ind                                       = -1;
1596 static int hf_isup_call_diversion_may_occur_ind                         = -1;
1597 static int hf_isup_mlpp_user_ind                                                        = -1;
1598
1599 static int hf_isup_UUI_type                                                                     = -1;
1600 static int hf_isup_UUI_req_service1                                                     = -1;
1601 static int hf_isup_UUI_req_service2                                                     = -1;
1602 static int hf_isup_UUI_req_service3                                                     = -1;
1603 static int hf_isup_UUI_res_service1                                                     = -1;
1604 static int hf_isup_UUI_res_service2                                                     = -1;
1605 static int hf_isup_UUI_res_service3                                                     = -1;
1606 static int hf_isup_UUI_network_discard_ind                                      = -1;
1607 static int hf_isup_access_delivery_ind                                          = -1;
1608
1609 static int hf_isup_transmission_medium_requirement_prime        = -1;
1610
1611 static int hf_isup_loop_prevention_response_ind                         = -1;
1612
1613 static int hf_isup_temporary_alternative_routing_ind            = -1;
1614 static int hf_isup_extension_ind                                                        = -1;
1615
1616 static int hf_isup_call_to_be_diverted_ind                                      = -1;
1617
1618 static int hf_isup_call_to_be_offered_ind                                       = -1;
1619
1620 static int hf_isup_conference_acceptance_ind                            = -1;
1621
1622 static int hf_isup_transit_at_intermediate_exchange_ind         = -1;
1623 static int hf_isup_Release_call_ind                                             = -1;
1624 static int hf_isup_Send_notification_ind                                        = -1;
1625 static int hf_isup_Discard_message_ind_value                            = -1;
1626 static int hf_isup_Discard_parameter_ind                                        = -1;
1627 static int hf_isup_Pass_on_not_possible_indicator                       = -1;
1628 static int hf_isup_pass_on_not_possible_indicator2                      = -1;
1629 static int hf_isup_Broadband_narrowband_interworking_ind        = -1;
1630 static int hf_isup_Broadband_narrowband_interworking_ind2       = -1;
1631
1632 static int hf_isup_app_cont_ident                                       = -1;
1633 static int hf_isup_app_Send_notification_ind            = -1;
1634 static int hf_isup_apm_segmentation_ind                         = -1;
1635 static int hf_isup_apm_si_ind                                           = -1;
1636 static int hf_isup_apm_slr                                                      = -1;
1637 static int hf_isup_orig_addr_len                                        = -1;
1638 static int hf_isup_dest_addr_len                                        = -1;
1639 static int hf_isup_app_Release_call_ind                         = -1;
1640 static int hf_isup_cause_location                                       = -1;
1641
1642 static int hf_ansi_isup_coding_standard                         = -1;
1643
1644 static int hf_length_indicator                                          = -1;
1645 static int hf_afi                                                                       = -1;
1646 static int hf_bicc_nsap_dsp                                                     = -1;
1647 static int hf_bat_ase_identifier                                        = -1;
1648
1649 static int hf_Action_Indicator                                          = -1;
1650
1651 static int hf_Instruction_ind_for_general_action                                = -1;
1652
1653 static int hf_Send_notification_ind_for_general_action                  = -1;
1654
1655 static int hf_Instruction_ind_for_pass_on_not_possible                  = -1;
1656
1657 static int hf_Send_notification_ind_for_pass_on_not_possible    = -1;
1658 static int hf_BCTP_Version_Indicator                                    = -1;
1659 static int hf_Tunnelled_Protocol_Indicator                              = -1;
1660 static int hf_TPEI                                                      = -1;
1661 static int hf_BVEI                                                      = -1;
1662 static int hf_bncid                                                     = -1;
1663 static int hf_bat_ase_biwfa                                             = -1;
1664 static int hf_characteristics                                           = -1;
1665
1666 static int hf_Organization_Identifier                                   = -1;
1667 static int hf_codec_type                                                = -1;
1668 static int hf_etsi_codec_type                                           = -1;
1669 static int hf_active_code_set  = -1;
1670 static int hf_active_code_set_12_2  = -1;
1671 static int hf_active_code_set_10_2  = -1;
1672 static int hf_active_code_set_7_95  = -1;
1673 static int hf_active_code_set_7_40  = -1;
1674 static int hf_active_code_set_6_70  = -1;
1675 static int hf_active_code_set_5_90  = -1;
1676 static int hf_active_code_set_5_15  = -1;
1677 static int hf_active_code_set_4_75  = -1;
1678 static int hf_supported_code_set  = -1;
1679 static int hf_supported_code_set_12_2  = -1;
1680 static int hf_supported_code_set_10_2  = -1;
1681 static int hf_supported_code_set_7_95  = -1;
1682 static int hf_supported_code_set_7_40  = -1;
1683 static int hf_supported_code_set_6_70  = -1;
1684 static int hf_supported_code_set_5_90  = -1;
1685 static int hf_supported_code_set_5_15  = -1;
1686 static int hf_supported_code_set_4_75  = -1;
1687 static int hf_optimisation_mode  = -1;
1688 static int hf_max_codec_modes  = -1;
1689 static int hf_bearer_control_tunneling                  = -1;
1690 static int hf_Local_BCU_ID                                              = -1;
1691 static int hf_late_cut_trough_cap_ind                   = -1;
1692 static int hf_bat_ase_signal                                    = -1;
1693 static int hf_bat_ase_duration                                  = -1;
1694 static int hf_bat_ase_bearer_redir_ind                  = -1;
1695 static int hf_BAT_ASE_Comp_Report_Reason                = -1;
1696 static int hf_BAT_ASE_Comp_Report_ident                 = -1;
1697 static int hf_BAT_ASE_Comp_Report_diagnostic    = -1;
1698 static int hf_nsap_ipv4_addr                                    = -1;
1699 static int hf_nsap_ipv6_addr                                    = -1;
1700 static int hf_iana_icp                                                  = -1;
1701
1702 static int hf_isup_apm_msg_fragments = -1;
1703 static int hf_isup_apm_msg_fragment = -1;
1704 static int hf_isup_apm_msg_fragment_overlap = -1;
1705 static int hf_isup_apm_msg_fragment_overlap_conflicts = -1;
1706 static int hf_isup_apm_msg_fragment_multiple_tails = -1;
1707 static int hf_isup_apm_msg_fragment_too_long_fragment = -1;
1708 static int hf_isup_apm_msg_fragment_error = -1;
1709 static int hf_isup_apm_msg_reassembled_in = -1;
1710
1711 /* Initialize the subtree pointers */
1712 static gint ett_isup                                                    = -1;
1713 static gint ett_isup_parameter                                  = -1;
1714 static gint ett_isup_address_digits                     = -1;
1715 static gint ett_isup_pass_along_message                 = -1;
1716 static gint ett_isup_circuit_state_ind                  = -1;
1717 static gint ett_bat_ase                                                 = -1;
1718 static gint ett_bicc                                                    = -1;
1719 static gint ett_bat_ase_element                                 = -1;
1720 static gint ett_bat_ase_iwfa                                    = -1;
1721 static gint ett_acs                                                             = -1;
1722 static gint ett_scs                                                             = -1;
1723
1724 static gint ett_isup_apm_msg_fragment = -1;
1725 static gint ett_isup_apm_msg_fragments = -1;
1726
1727
1728 static dissector_handle_t sdp_handle = NULL;
1729 static dissector_handle_t q931_ie_handle = NULL;
1730
1731 /* Declarations to desegment APM Messages */
1732 static gboolean isup_apm_desegment = TRUE;
1733
1734 static const fragment_items isup_apm_msg_frag_items = {
1735         /* Fragment subtrees */
1736         &ett_isup_apm_msg_fragment,
1737         &ett_isup_apm_msg_fragments,
1738         /* Fragment fields */
1739         &hf_isup_apm_msg_fragments,
1740         &hf_isup_apm_msg_fragment,
1741         &hf_isup_apm_msg_fragment_overlap,
1742         &hf_isup_apm_msg_fragment_overlap_conflicts,
1743         &hf_isup_apm_msg_fragment_multiple_tails,
1744         &hf_isup_apm_msg_fragment_too_long_fragment,
1745         &hf_isup_apm_msg_fragment_error,
1746         /* Reassembled in field */
1747         &hf_isup_apm_msg_reassembled_in,
1748         /* Tag */
1749         "ISUP APM Message fragments"
1750 };
1751
1752 static GHashTable *isup_apm_msg_fragment_table = NULL;
1753 static GHashTable *isup_apm_msg_reassembled_table = NULL;
1754
1755
1756 static void
1757 isup_apm_defragment_init(void)
1758 {
1759         fragment_table_init (&isup_apm_msg_fragment_table);
1760         reassembled_table_init(&isup_apm_msg_reassembled_table);
1761 }
1762
1763 /* Info for the tap that must be passed between procedures */
1764 gchar *tap_called_number = NULL;
1765 gchar *tap_calling_number = NULL;
1766 guint8 tap_cause_value = 0;
1767
1768 /* ------------------------------------------------------------------
1769   Mapping number to ASCII-character
1770  ------------------------------------------------------------------ */
1771 static char number_to_char(int number)
1772 {
1773   if (number < 10)
1774     return ((char) number + ASCII_NUMBER_DELTA);
1775   else
1776     return ((char) number + ASCII_LETTER_DELTA);
1777 }
1778
1779 /* ------------------------------------------------------------------ */
1780 /* Dissectors for all used parameter types                            */
1781 /* ------------------------------------------------------------------ */
1782 /* argument tvbuff_t contains only parameter-specific length          */
1783 /* length indicator is already dissected in dissect_isup_message() or */
1784 /* dissect_isup_optional_parameter()                                  */
1785 /* ------------------------------------------------------------------ */
1786 /* ------------------------------------------------------------------
1787  Dissector Parameter circuit validation response indicator
1788  */
1789
1790 static void
1791 dissect_isup_cvr_response_ind_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1792 {
1793         guint8 cvr_response_ind;
1794
1795         cvr_response_ind = tvb_get_guint8(parameter_tvb, 0);
1796         proto_tree_add_uint(parameter_tree, hf_isup_cvr_rsp_ind, parameter_tvb, 0, CVR_RESP_IND_LENGTH, cvr_response_ind );
1797         proto_item_set_text(parameter_item, "Circuit Validation Test Response Indicator: 0x%x", cvr_response_ind );
1798
1799 }
1800
1801 /* ------------------------------------------------------------------
1802  Dissector Parameter circuit validation response - circuit group
1803  characters
1804  */
1805 static void
1806 dissect_isup_circuit_group_char_ind_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1807 {
1808         guint8 cvr_cg_char_ind;
1809
1810         cvr_cg_char_ind = tvb_get_guint8(parameter_tvb, 0);
1811         proto_tree_add_uint(parameter_tree, hf_isup_cvr_cg_car_ind, parameter_tvb, 0, CG_CHAR_IND_LENGTH, cvr_cg_char_ind );
1812         proto_tree_add_uint(parameter_tree, hf_isup_cvr_cg_double_seize, parameter_tvb, 0, CG_CHAR_IND_LENGTH, cvr_cg_char_ind );
1813         proto_tree_add_uint(parameter_tree, hf_isup_cvr_cg_alarm_car_ind, parameter_tvb, 0, CG_CHAR_IND_LENGTH, cvr_cg_char_ind );
1814         proto_tree_add_uint(parameter_tree, hf_isup_cvr_cont_chk_ind, parameter_tvb, 0, CG_CHAR_IND_LENGTH, cvr_cg_char_ind );
1815
1816         proto_item_set_text(parameter_item, "Circuit Validation Test Response Circuit Group Characterstics: 0x%x", cvr_cg_char_ind );
1817 }
1818
1819 /* ------------------------------------------------------------------
1820  Dissector Parameter nature of connection flags
1821  */
1822 static void
1823 dissect_isup_nature_of_connection_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1824 {
1825   guint8 nature_of_connection_ind;
1826
1827   nature_of_connection_ind = tvb_get_guint8(parameter_tvb, 0);
1828   proto_tree_add_uint(parameter_tree, hf_isup_satellite_indicator, parameter_tvb, 0,NATURE_OF_CONNECTION_IND_LENGTH, nature_of_connection_ind);
1829   proto_tree_add_uint(parameter_tree, hf_isup_continuity_check_indicator, parameter_tvb, 0,NATURE_OF_CONNECTION_IND_LENGTH, nature_of_connection_ind);
1830   proto_tree_add_boolean(parameter_tree, hf_isup_echo_control_device_indicator, parameter_tvb, 0,  NATURE_OF_CONNECTION_IND_LENGTH, nature_of_connection_ind);
1831
1832   proto_item_set_text(parameter_item, "Nature of Connection Indicators: 0x%x", nature_of_connection_ind);
1833 }
1834
1835 /* ------------------------------------------------------------------
1836  Dissector Parameter Forward Call Indicators
1837  */
1838 static void
1839 dissect_isup_forward_call_indicators_parameter(tvbuff_t *parameter_tvb,proto_tree *parameter_tree, proto_item *parameter_item)
1840 {
1841   guint16 forward_call_ind;
1842
1843   forward_call_ind = tvb_get_ntohs(parameter_tvb, 0);
1844   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_natnl_inatnl_call_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1845   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);
1846   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_interworking_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1847   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);
1848   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_isdn_user_part_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1849   proto_tree_add_uint(parameter_tree, hf_isup_forw_call_preferences_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1850   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_isdn_access_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1851   proto_tree_add_uint(parameter_tree, hf_isup_forw_call_sccp_method_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1852   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_ported_num_trans_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1853   proto_tree_add_boolean(parameter_tree, hf_isup_forw_call_qor_attempt_indicator, parameter_tvb, 0, FORWARD_CALL_IND_LENGTH, forward_call_ind);
1854
1855   proto_item_set_text(parameter_item, "Forward Call Indicators: 0x%x", forward_call_ind );
1856 }
1857
1858 /* ------------------------------------------------------------------
1859  Dissector Parameter Calling Party's Category
1860  */
1861 static void
1862 dissect_isup_calling_partys_category_parameter(tvbuff_t *parameter_tvb,proto_tree *parameter_tree, proto_item *parameter_item)
1863 {
1864   guint8 calling_partys_category;
1865
1866   calling_partys_category = tvb_get_guint8(parameter_tvb, 0);
1867   proto_tree_add_uint(parameter_tree, hf_isup_calling_partys_category, parameter_tvb, 0, CALLING_PRTYS_CATEGORY_LENGTH, calling_partys_category);
1868
1869   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"));
1870 }
1871
1872
1873 /* ------------------------------------------------------------------
1874   Dissector Parameter Transmission medium requirement
1875  */
1876 static void
1877 dissect_isup_transmission_medium_requirement_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1878 {
1879   guint8 transmission_medium_requirement;
1880
1881   transmission_medium_requirement = tvb_get_guint8(parameter_tvb, 0);
1882   proto_tree_add_uint(parameter_tree, hf_isup_transmission_medium_requirement, parameter_tvb, 0, TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH,transmission_medium_requirement);
1883
1884   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"));
1885 }
1886 /* ------------------------------------------------------------------
1887   Dissector Parameter Called party number
1888  */
1889 void
1890 dissect_isup_called_party_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1891 {
1892   proto_item *address_digits_item;
1893   proto_tree *address_digits_tree;
1894   guint8 indicators1, indicators2;
1895   guint8 address_digit_pair=0;
1896   gint offset=0;
1897   gint i=0;
1898   gint length;
1899   char called_number[MAXDIGITS + 1]="";
1900   e164_info_t e164_info;
1901   gint number_plan;
1902
1903   indicators1 = tvb_get_guint8(parameter_tvb, 0);
1904   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
1905   proto_tree_add_uint(parameter_tree, hf_isup_called_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
1906   indicators2 = tvb_get_guint8(parameter_tvb, 1);
1907   number_plan = (indicators2 & 0x70)>> 4;
1908   proto_tree_add_boolean(parameter_tree, hf_isup_inn_indicator, parameter_tvb, 1, 1, indicators2);
1909   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
1910   offset = 2;
1911
1912   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
1913                                             offset, -1,
1914                                             "Called Party Number");
1915   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
1916
1917   while((length = tvb_reported_length_remaining(parameter_tvb, offset)) > 0){
1918           address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
1919           proto_tree_add_uint(address_digits_tree, hf_isup_called_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1920           called_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
1921                 if (i > MAXDIGITS)
1922                         THROW(ReportedBoundsError);
1923                 if ((length - 1) > 0 ){
1924                         proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1925                         called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1926                         if (i > MAXDIGITS)
1927                                 THROW(ReportedBoundsError);
1928                         }
1929                 offset++;
1930                 }
1931   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
1932                 proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
1933                 called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1934                 if (i > MAXDIGITS)
1935                         THROW(ReportedBoundsError);
1936   }
1937
1938   called_number[i++] = '\0';
1939   proto_item_set_text(address_digits_item, "Called Party Number: %s", called_number);
1940   proto_item_set_text(parameter_item, "Called Party Number: %s", called_number);
1941   if ( number_plan == 1 ) {
1942                 e164_info.e164_number_type = CALLED_PARTY_NUMBER;
1943                 e164_info.nature_of_address = indicators1 & 0x7f;
1944                 e164_info.E164_number_str = called_number;
1945                 e164_info.E164_number_length = i - 1;
1946                 dissect_e164_number(parameter_tvb, address_digits_tree, 2, (offset - 2), e164_info);
1947                 proto_tree_add_string_hidden(address_digits_tree, hf_isup_called, parameter_tvb,
1948                 offset - length, length, called_number);
1949   } else {
1950                 proto_tree_add_string(address_digits_tree, hf_isup_called, parameter_tvb,
1951                         offset - length, length, called_number);
1952   }
1953   tap_called_number = ep_strdup(called_number);
1954 }
1955 /* ------------------------------------------------------------------
1956   Dissector Parameter  Subsequent number
1957  */
1958 static void
1959 dissect_isup_subsequent_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
1960 {
1961   proto_item *address_digits_item;
1962   proto_tree *address_digits_tree;
1963   guint8 indicators1;
1964   guint8 address_digit_pair=0;
1965   gint offset=0;
1966   gint i=0;
1967   gint length;
1968   char called_number[MAXDIGITS + 1]="";
1969
1970   indicators1 = tvb_get_guint8(parameter_tvb, 0);
1971   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
1972   offset = 1;
1973
1974   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
1975                                             offset, -1,
1976                                             "Subsequent Number");
1977   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
1978
1979   while((length = tvb_reported_length_remaining(parameter_tvb, offset)) > 0){
1980     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
1981     proto_tree_add_uint(address_digits_tree, hf_isup_called_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1982     called_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
1983     if (i > MAXDIGITS)
1984       THROW(ReportedBoundsError);
1985     if ((length - 1) > 0 ){
1986       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
1987       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1988       if (i > MAXDIGITS)
1989         THROW(ReportedBoundsError);
1990     }
1991     offset++;
1992   }
1993
1994   if (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
1995       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
1996       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
1997       if (i > MAXDIGITS)
1998         THROW(ReportedBoundsError);
1999   }
2000   called_number[i++] = '\0';
2001
2002   proto_item_set_text(address_digits_item, "Subsequent Number: %s", called_number);
2003   proto_item_set_text(parameter_item, "Subsequent Number: %s", called_number);
2004
2005 }
2006 /* ------------------------------------------------------------------
2007   Dissector Parameter Information Request Indicators
2008  */
2009 static void
2010 dissect_isup_information_request_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2011 {
2012   guint16 information_request_indicators;
2013
2014   information_request_indicators = tvb_get_ntohs(parameter_tvb, 0);
2015   proto_tree_add_boolean(parameter_tree, hf_isup_calling_party_address_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
2016   proto_tree_add_boolean(parameter_tree, hf_isup_info_req_holding_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
2017   proto_tree_add_boolean(parameter_tree, hf_isup_calling_partys_category_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
2018   proto_tree_add_boolean(parameter_tree, hf_isup_charge_information_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
2019   proto_tree_add_boolean(parameter_tree, hf_isup_malicious_call_identification_request_indicator, parameter_tvb, 0, INFO_REQUEST_IND_LENGTH,  information_request_indicators);
2020
2021
2022   proto_item_set_text(parameter_item, "Information request indicators: 0x%x", information_request_indicators);
2023 }
2024 /* ------------------------------------------------------------------
2025   Dissector Parameter Information Indicators
2026  */
2027 static void
2028 dissect_isup_information_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2029 {
2030   guint16 information_indicators;
2031
2032   information_indicators = tvb_get_ntohs(parameter_tvb, 0);
2033   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_address_response_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
2034   proto_tree_add_boolean(parameter_tree, hf_isup_hold_provided_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
2035   proto_tree_add_boolean(parameter_tree, hf_isup_calling_partys_category_response_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
2036   proto_tree_add_boolean(parameter_tree, hf_isup_charge_information_response_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
2037   proto_tree_add_boolean(parameter_tree, hf_isup_solicited_indicator, parameter_tvb, 0, INFO_IND_LENGTH,  information_indicators);
2038
2039
2040   proto_item_set_text(parameter_item, "Information indicators: 0x%x", information_indicators);
2041 }
2042 /* ------------------------------------------------------------------
2043   Dissector Parameter Continuity Indicators
2044  */
2045 static void
2046 dissect_isup_continuity_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2047 {
2048   guint8 continuity_indicators;
2049
2050   continuity_indicators = tvb_get_guint8(parameter_tvb, 0);
2051   proto_tree_add_boolean(parameter_tree, hf_isup_continuity_indicator, parameter_tvb, 0, CONTINUITY_IND_LENGTH,  continuity_indicators);
2052
2053   proto_item_set_text(parameter_item, "Continuity indicators: 0x%x", continuity_indicators);
2054 }
2055 /* ------------------------------------------------------------------
2056  Dissector Parameter Backward Call Indicators
2057  */
2058 static void
2059 dissect_isup_backward_call_indicators_parameter(tvbuff_t *parameter_tvb,proto_tree *parameter_tree, proto_item *parameter_item)
2060 {
2061   guint16 backward_call_ind;
2062
2063   backward_call_ind = tvb_get_ntohs(parameter_tvb, 0);
2064
2065
2066   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_charge_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2067   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_called_partys_status_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2068   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_called_partys_category_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2069   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);
2070   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_interworking_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2071   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);
2072   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_isdn_user_part_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2073   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_holding_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH,  backward_call_ind);
2074   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_isdn_access_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2075   proto_tree_add_boolean(parameter_tree, hf_isup_backw_call_echo_control_device_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2076   proto_tree_add_uint(parameter_tree, hf_isup_backw_call_sccp_method_ind, parameter_tvb, 0, BACKWARD_CALL_IND_LENGTH, backward_call_ind);
2077
2078   proto_item_set_text(parameter_item, "Backward Call Indicators: 0x%x", backward_call_ind);
2079 }
2080 /* ------------------------------------------------------------------
2081   Dissector Parameter Cause Indicators - no detailed dissection since defined in Rec. Q.850
2082  */
2083
2084 /*
2085  * Cause codes for Cause.
2086  * The decoding of cause indicators parameter field are defined in ITU-T
2087  * Recommendation Q.850; those are different from the ones in the Q.931
2088  * dissector, as that has some values not specified by the standard but
2089  * that appear to be used for purposes other than the ones in Q.850.
2090  */
2091 const value_string q850_cause_code_vals[] = {
2092         { 0x00, "Valid cause code not yet received" },
2093         { 0x01, "Unallocated (unassigned) number" },
2094         { 0x02, "No route to specified transit network" },
2095         { 0x03, "No route to destination" },
2096         { 0x04, "Send special information tone" },
2097         { 0x05, "Misdialled trunk prefix" },
2098         { 0x06, "Channel unacceptable" },
2099         { 0x07, "Call awarded and being delivered in an established channel" },
2100         { 0x08, "Preemption" },
2101         { 0x09, "Preemption - circuit reserved for reuse" },
2102         { 0x0E, "QoR: ported number" },
2103         { 0x10, "Normal call clearing" },
2104         { 0x11, "User busy" },
2105         { 0x12, "No user responding" },
2106         { 0x13, "No answer from user (user alerted)" },
2107         { 0x14, "Subscriber absent" },
2108         { 0x15, "Call rejected" },
2109         { 0x16, "Number changed" },
2110         { 0x17, "Redirection to new destination" },
2111         { 0x18, "Call rejected due to feature at the destination" },
2112         { 0x19, "Exchange routing error" },
2113         { 0x1A, "Non-selected user clearing" },
2114         { 0x1B, "Destination out of order" },
2115         { 0x1C, "Invalid number format (address incomplete)" },
2116         { 0x1D, "Facility rejected" },
2117         { 0x1E, "Response to STATUS ENQUIRY" },
2118         { 0x1F, "Normal unspecified" },
2119         { 0x21, "Circuit out of order" },
2120         { 0x22, "No circuit/channel available" },
2121         { 0x26, "Network out of order" },
2122         { 0x27, "Permanent frame mode connection out of service" },
2123         { 0x28, "Permanent frame mode connection operational" },
2124         { 0x29, "Temporary failure" },
2125         { 0x2A, "Switching equipment congestion" },
2126         { 0x2B, "Access information discarded" },
2127         { 0x2C, "Requested circuit/channel not available" },
2128         { 0x2E, "Precedence call blocked" },
2129         { 0x2F, "Resources unavailable, unspecified" },
2130         { 0x31, "Quality of service unavailable" },
2131         { 0x32, "Requested facility not subscribed" },
2132         { 0x35, "Outgoing calls barred within CUG" },
2133         { 0x37, "Incoming calls barred within CUG" },
2134         { 0x38, "Call waiting not subscribed" },
2135         { 0x39, "Bearer capability not authorized" },
2136         { 0x3A, "Bearer capability not presently available" },
2137         { 0x3E, "Inconsistency in designated outgoing access information and subscriber class" },
2138         { 0x3F, "Service or option not available, unspecified" },
2139         { 0x41, "Bearer capability not implemented" },
2140         { 0x42, "Channel type not implemented" },
2141         { 0x45, "Requested facility not implemented" },
2142         { 0x46, "Only restricted digital information bearer capability is available" },
2143         { 0x4F, "Service or option not implemented, unspecified" },
2144         { 0x51, "Invalid call reference value" },
2145         { 0x52, "Identified channel does not exist" },
2146         { 0x53, "Call identity does not exist for suspended call" },
2147         { 0x54, "Call identity in use" },
2148         { 0x55, "No call suspended" },
2149         { 0x56, "Call having the requested call identity has been cleared" },
2150         { 0x57, "Called user not member of CUG" },
2151         { 0x58, "Incompatible destination" },
2152         { 0x5A, "Non-existing CUG" },
2153         { 0x5B, "Invalid transit network selection (national use)" },
2154         { 0x5F, "Invalid message, unspecified" },
2155         { 0x60, "Mandatory information element is missing" },
2156         { 0x61, "Message type non-existent or not implemented" },
2157         { 0x62, "Message not compatible with call state or message type non-existent or not implemented" },
2158         { 0x63, "Information element nonexistant or not implemented" },
2159         { 0x64, "Invalid information element contents" },
2160         { 0x65, "Message not compatible with call state" },
2161         { 0x66, "Recovery on timer expiry" },
2162         { 0x67, "Parameter non-existent or not implemented - passed on" },
2163         { 0x6E, "Message with unrecognized parameter discarded" },
2164         { 0x6F, "Protocol error, unspecified" },
2165         { 0x7F, "Internetworking, unspecified" },
2166         { 0,    NULL }
2167 };
2168
2169 static const value_string ansi_isup_cause_code_vals[] = {
2170         { 0x00, "Valid cause code not yet received" },
2171         { 0x01, "Unallocated (unassigned) number" },
2172         { 0x02, "No route to specified transit network" },
2173         { 0x03, "No route to destination" },
2174         { 0x04, "Send special information tone" },
2175         { 0x05, "Misdialled trunk prefix" },
2176         { 0x06, "Channel unacceptable" },
2177         { 0x07, "Call awarded and being delivered in an established channel" },
2178         { 0x08, "Preemption" },
2179         { 0x09, "Preemption - circuit reserved for reuse" },
2180         { 0x0E, "QoR: ported number" },
2181         { 0x10, "Normal call clearing" },
2182         { 0x11, "User busy" },
2183         { 0x12, "No user responding" },
2184         { 0x13, "No answer from user (user alerted)" },
2185         { 0x14, "Subscriber absent" },
2186         { 0x15, "Call rejected" },
2187         { 0x16, "Number changed" },
2188         { 23,   "Unallocated destination number" },
2189         { 24,   "Undefined business group" },
2190         { 0x19, "Exchange routing error" },
2191         { 0x1A, "Non-selected user clearing" },
2192         { 0x1B, "Destination out of order" },
2193         { 0x1C, "Invalid number format (address incomplete)" },
2194         { 0x1D, "Facility rejected" },
2195         { 0x1E, "Response to STATUS ENQUIRY" },
2196         { 0x1F, "Normal unspecified" },
2197         { 0x21, "Circuit out of order" },
2198         { 0x22, "No circuit/channel available" },
2199         { 0x26, "Network out of order" },
2200         { 0x27, "Permanent frame mode connection out of service" },
2201         { 0x28, "Permanent frame mode connection operational" },
2202         { 0x29, "Temporary failure" },
2203         { 0x2A, "Switching equipment congestion" },
2204         { 0x2B, "Access information discarded" },
2205         { 0x2C, "Requested circuit/channel not available" },
2206         { 45,   "Preemption" },
2207         { 0x2E, "Precedence call blocked" },
2208         { 0x2F, "Resources unavailable, unspecified" },
2209         { 0x31, "Quality of service unavailable" },
2210         { 0x32, "Requested facility not subscribed" },
2211         { 51,   "Call type incompatible with service request" },
2212         { 0x35, "Outgoing calls barred within CUG" },
2213         { 54,   "Call blocked due to group restriction" },
2214         { 0x37, "Incoming calls barred within CUG" },
2215         { 0x38, "Call waiting not subscribed" },
2216         { 0x39, "Bearer capability not authorized" },
2217         { 0x3A, "Bearer capability not presently available" },
2218         { 0x3E, "Inconsistency in designated outgoing access information and subscriber class" },
2219         { 0x3F, "Service or option not available, unspecified" },
2220         { 0x41, "Bearer capability not implemented" },
2221         { 0x42, "Channel type not implemented" },
2222         { 0x45, "Requested facility not implemented" },
2223         { 0x46, "Only restricted digital information bearer capability is available" },
2224         { 0x4F, "Service or option not implemented, unspecified" },
2225         { 0x51, "Invalid call reference value" },
2226         { 0x52, "Identified channel does not exist" },
2227         { 0x53, "Call identity does not exist for suspended call" },
2228         { 0x54, "Call identity in use" },
2229         { 0x55, "No call suspended" },
2230         { 0x56, "Call having the requested call identity has been cleared" },
2231         { 0x57, "Called user not member of CUG" },
2232         { 0x58, "Incompatible destination" },
2233         { 0x5A, "Non-existing CUG" },
2234         { 0x5B, "Invalid transit network selection (national use)" },
2235         { 0x5F, "Invalid message, unspecified" },
2236         { 0x60, "Mandatory information element is missing" },
2237         { 0x61, "Message type non-existent or not implemented" },
2238         { 0x62, "Message not compatible with call state or message type non-existent or not implemented" },
2239         { 0x63, "Information element nonexistant or not implemented" },
2240         { 0x64, "Invalid information element contents" },
2241         { 0x65, "Message not compatible with call state" },
2242         { 0x66, "Recovery on timer expiry" },
2243         { 0x67, "Parameter non-existent or not implemented - passed on" },
2244         { 0x6E, "Message with unrecognized parameter discarded" },
2245         { 0x6F, "Protocol error, unspecified" },
2246         { 0x7F, "Internetworking, unspecified" },
2247         { 0,    NULL }
2248 };
2249
2250 static const value_string ansi_isup_coding_standard_vals[] = {
2251         { 0, "CCITT Standard" },
2252         { 1, "Reserved for other international standards" },
2253         { 2, "ANSI Standard" },
2254         { 3, "Reserved" },
2255         { 0,    NULL }
2256 };
2257 void
2258 dissect_isup_cause_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2259 { guint length = tvb_reported_length(parameter_tvb);
2260   proto_tree_add_text(parameter_tree, parameter_tvb,0, -1, "Cause indicators (-> Q.850)");
2261   dissect_q931_cause_ie(parameter_tvb,0,length,
2262                                             parameter_tree,
2263                                             hf_isup_cause_indicator, &tap_cause_value);
2264   proto_item_set_text(parameter_item, "Cause indicators, see Q.850 (%u byte%s length)", length , plurality(length, "", "s"));
2265 }
2266
2267 static void
2268 dissect_ansi_isup_cause_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2269 {
2270         guint8 coding_standard;
2271         guint8 cause_value;
2272         int offset = 0;
2273         guint length = tvb_reported_length(parameter_tvb);
2274
2275         coding_standard = (tvb_get_guint8(parameter_tvb, offset)&&0x60)>>5;
2276
2277         switch (coding_standard) {
2278         case 0:
2279                 /*CCITT*/
2280                 proto_tree_add_item(parameter_tree, hf_isup_cause_location, parameter_tvb, offset, 1, FALSE);
2281                 proto_tree_add_item(parameter_tree, hf_ansi_isup_coding_standard, parameter_tvb, offset, 1, FALSE);
2282                 proto_tree_add_item(parameter_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, FALSE);
2283                 offset ++;
2284                 length--;
2285                 if (length == 0)
2286                         return;
2287                 proto_tree_add_item(parameter_tree, hf_isup_cause_indicator, parameter_tvb, offset, 1, FALSE);
2288                 cause_value=tvb_get_guint8(parameter_tvb, offset)&0x7f;
2289                 offset ++;
2290                 length--;
2291                 if (length == 0) {
2292                         proto_item_set_text(parameter_item, "Cause indicators: %s (%u)", val_to_str(cause_value, q850_cause_code_vals, "spare"),cause_value );
2293                         return;
2294                 }
2295                 proto_tree_add_text(parameter_tree, parameter_tvb, offset,
2296                     length, "Diagnostic: %s",
2297                     tvb_bytes_to_str(parameter_tvb, offset, length));
2298                 return;
2299         case 2:
2300                 /*ANSI*/
2301                 proto_tree_add_item(parameter_tree, hf_isup_cause_location, parameter_tvb, offset, 1, FALSE);
2302                 proto_tree_add_item(parameter_tree, hf_ansi_isup_coding_standard, parameter_tvb, offset, 1, FALSE);
2303                 proto_tree_add_item(parameter_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, FALSE);
2304                 offset ++;
2305                 length--;
2306                 if (length == 0)
2307                         return;
2308                 proto_tree_add_item(parameter_tree, hf_ansi_isup_cause_indicator, parameter_tvb, offset, 1, FALSE);
2309                 offset ++;
2310                 length--;
2311                 cause_value=tvb_get_guint8(parameter_tvb, offset)&0x7f;
2312                 if (length == 0) {
2313                         proto_item_set_text(parameter_item, "Cause indicators: %s (%u)", val_to_str(cause_value, ansi_isup_cause_code_vals, "spare"),cause_value );
2314                         return;
2315                 }
2316                 proto_tree_add_text(parameter_tree, parameter_tvb, offset,
2317                     length, "Diagnostic: %s",
2318                     tvb_bytes_to_str(parameter_tvb, offset, length));
2319                 return;
2320         default:
2321                 proto_tree_add_item(parameter_tree, hf_ansi_isup_coding_standard, parameter_tvb, offset, 1, FALSE);
2322                 proto_tree_add_item(parameter_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, FALSE);
2323                 break;
2324         }
2325         proto_item_set_text(parameter_item, "Cause indicators(%u byte%s length)", length , plurality(length, "", "s"));
2326 }
2327
2328 /* ------------------------------------------------------------------
2329   Dissector Parameter Suspend/Resume Indicators
2330  */
2331 static void
2332 dissect_isup_suspend_resume_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2333 {
2334   guint8 indicators;
2335
2336   indicators = tvb_get_guint8(parameter_tvb, 0);
2337   proto_tree_add_boolean(parameter_tree, hf_isup_suspend_resume_indicator, parameter_tvb, 0, SUSPEND_RESUME_IND_LENGTH,  indicators);
2338
2339   proto_item_set_text(parameter_item, "Suspend/Resume indicator: 0x%x", indicators);
2340 }
2341 /* ------------------------------------------------------------------
2342   Dissector Parameter Range and Status Indicators
2343  */
2344 static void
2345 dissect_isup_range_and_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2346 {
2347   guint8 range, actual_status_length;
2348
2349   range = tvb_get_guint8(parameter_tvb, 0);
2350   proto_tree_add_uint_format(parameter_tree, hf_isup_range_indicator, parameter_tvb, 0, RANGE_LENGTH, range, "Range: %u", range);
2351   actual_status_length = tvb_reported_length_remaining(parameter_tvb, RANGE_LENGTH);
2352   if (actual_status_length > 0)
2353     proto_tree_add_text(parameter_tree, parameter_tvb , RANGE_LENGTH, -1, "Status subfield");
2354   else
2355     proto_tree_add_text(parameter_tree, parameter_tvb , 0, 0, "Status subfield is not present with this message type");
2356
2357
2358   proto_item_set_text(parameter_item, "Range (%u) and status", range);
2359 }
2360 /* ------------------------------------------------------------------
2361   Dissector Parameter Circuit group supervision message type
2362  */
2363 static void
2364 dissect_isup_circuit_group_supervision_message_type_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2365 {
2366   guint8 cgs_message_type;
2367
2368   cgs_message_type = tvb_get_guint8(parameter_tvb, 0);
2369   proto_tree_add_uint(parameter_tree, hf_isup_cgs_message_type, parameter_tvb, 0, CIRC_GRP_SV_MSG_TYPE_LENGTH, cgs_message_type);
2370
2371   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);
2372 }
2373 /* ------------------------------------------------------------------
2374   Dissector Parameter Facility indicator parameter
2375  */
2376 static void
2377 dissect_isup_facility_ind_parameter(tvbuff_t *parameter_tvb, proto_item *parameter_item)
2378 {
2379   guint8 indicator;
2380
2381   indicator = tvb_get_guint8(parameter_tvb, 0);
2382
2383   proto_item_set_text(parameter_item, "Facility indicator: %s (%u)"  ,val_to_str(indicator, isup_facility_ind_value,"spare"), indicator);
2384 }
2385 /* ------------------------------------------------------------------
2386   Dissector Parameter Circuit state indicator
2387  */
2388 static void
2389 dissect_isup_circuit_state_ind_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2390 {
2391   proto_item *circuit_state_item;
2392   proto_tree *circuit_state_tree;
2393   guint8 circuit_state;
2394   gint offset=0;
2395   gint i=0;
2396   gint length;
2397
2398   while((length = tvb_reported_length_remaining(parameter_tvb, offset)) > 0){
2399     circuit_state_item = proto_tree_add_text(parameter_tree, parameter_tvb,
2400                                              offset, -1,
2401                                              "Circuit# CIC+%u state", i);
2402     circuit_state_tree = proto_item_add_subtree(circuit_state_item, ett_isup_circuit_state_ind);
2403     circuit_state = tvb_get_guint8(parameter_tvb, offset);
2404     if ((circuit_state & DC_8BIT_MASK) == 0){
2405       proto_tree_add_uint(circuit_state_tree, hf_isup_mtc_blocking_state1, parameter_tvb, offset, 1, circuit_state);
2406       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"));
2407     }
2408     else {
2409       proto_tree_add_uint(circuit_state_tree, hf_isup_mtc_blocking_state2, parameter_tvb, offset, 1, circuit_state);
2410       proto_tree_add_uint(circuit_state_tree, hf_isup_call_proc_state, parameter_tvb, offset, 1, circuit_state);
2411       proto_tree_add_uint(circuit_state_tree, hf_isup_hw_blocking_state, parameter_tvb, offset, 1, circuit_state);
2412       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"));
2413     }
2414     offset++;
2415   }
2416   proto_item_set_text(parameter_item, "Circuit state indicator (national use)");
2417 }
2418 /* ------------------------------------------------------------------
2419   Dissector Parameter Event information
2420  */
2421 static void
2422 dissect_isup_event_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2423 {
2424   guint8 indicators;
2425
2426   indicators = tvb_get_guint8(parameter_tvb, 0);
2427   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);
2428   proto_tree_add_boolean(parameter_tree, hf_isup_event_presentation_restricted_ind, parameter_tvb, 0, EVENT_INFO_LENGTH, indicators);
2429
2430   proto_item_set_text(parameter_item,"Event information: %s (%u)", val_to_str(indicators & GFEDCBA_8BIT_MASK, isup_event_ind_value, "spare"),indicators );
2431 }
2432 /* ------------------------------------------------------------------
2433   Dissector Parameter User-to-user information- no detailed dissection since defined in Rec. Q.931
2434  */
2435 static void
2436 dissect_isup_user_to_user_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2437 { guint length = tvb_reported_length(parameter_tvb);
2438   proto_tree_add_text(parameter_tree, parameter_tvb, 0, -1,
2439           "User-to-user info (-> Q.931)");
2440   dissect_q931_user_user_ie(parameter_tvb, 0, length,
2441     parameter_tree );
2442   proto_item_set_text(parameter_item, "User-to-user information,(%u byte%s length)",
2443         length , plurality(length, "", "s"));
2444 }
2445 /* ------------------------------------------------------------------
2446   Dissector Parameter Call Reference
2447  */
2448 static void
2449 dissect_isup_call_reference_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
2450 {
2451   guint32 call_id;
2452   guint16 spc;
2453
2454   call_id = tvb_get_ntoh24(parameter_tvb, 0);
2455   spc = tvb_get_letohs(parameter_tvb, CALL_ID_LENGTH) & 0x3FFF; /*since 1st 2 bits spare */
2456   proto_tree_add_text(parameter_tree, parameter_tvb, 0, CALL_ID_LENGTH, "Call identity: %u", call_id);
2457   proto_tree_add_text(parameter_tree, parameter_tvb, CALL_ID_LENGTH, SPC_LENGTH, "Signalling Point Code: %u", spc);
2458
2459   proto_item_set_text(parameter_item, "Call Reference: Call ID = %u, SPC = %u", call_id, spc);
2460 }
2461 /* ------------------------------------------------------------------
2462   Dissector Parameter Access Transport - no detailed dissection since defined in Rec. Q.931
2463  */
2464 static void
2465 dissect_isup_access_transport_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree,
2466                          proto_item *parameter_item, packet_info *pinfo)
2467 { guint length = tvb_reported_length(parameter_tvb);
2468
2469   proto_tree_add_text(parameter_tree, parameter_tvb, 0, -1,
2470           "Access transport parameter field (-> Q.931)");
2471
2472   if (q931_ie_handle)
2473     call_dissector(q931_ie_handle, parameter_tvb, pinfo, parameter_tree);
2474
2475   proto_item_set_text(parameter_item, "Access transport (%u byte%s length)",
2476           length , plurality(length, "", "s"));
2477 }
2478
2479 /* dissect x.213 NSAP coded Address */
2480
2481 static const value_string x213_afi_value[] = {
2482         { 0x34, "IANA ICP"},
2483         { 0x35, "IANA ICP"},
2484         { 0x36, "X.121"},
2485         { 0x37, "X.121"},
2486         { 0x38, "ISO DCC"},
2487         { 0x39, "ISO DCC"},
2488         { 0x40, "F.69"},
2489         { 0x41, "F.69"},
2490         { 0x42, "E.163"},
2491         { 0x43, "E.163"},
2492         { 0x44, "E.164"},
2493         { 0x45, "E.164"},
2494         { 0x46, "ISO 6523-ICD"},
2495         { 0x47, "ISO 6523-ICD"},
2496         { 0x48, "Local"},
2497         { 0x49, "Local"},
2498         { 0x50, "Local ISO/IEC 646 character "},
2499         { 0x51, "Local ( National character )"},
2500         { 0x52, "X.121"},
2501         { 0x53, "X.121"},
2502         { 0x54, "F.69"},
2503         { 0x55, "F.69"},
2504         { 0x56, "E.163"},
2505         { 0x57, "E.163"},
2506         { 0x58, "E.164"},
2507         { 0x59, "E.164"},
2508
2509         { 0x76, "ITU-T IND"},
2510         { 0x77, "ITU-T IND"},
2511
2512         { 0xb8, "IANA ICP Group no"},
2513         { 0xb9, "IANA ICP Group no"},
2514         { 0xba, "X.121 Group no"},
2515         { 0xbb, "X.121 Group no"},
2516         { 0xbc, "ISO DCC Group no"},
2517         { 0xbd, "ISO DCC Group no"},
2518         { 0xbe, "F.69 Group no"},
2519         { 0xbf, "F.69 Group no"},
2520         { 0xc0, "E.163 Group no"},
2521         { 0xc1, "E.163 Group no"},
2522         { 0xc2, "E.164 Group no"},
2523         { 0xc3, "E.164 Group no"},
2524         { 0xc4, "ISO 6523-ICD Group no"},
2525         { 0xc5, "ISO 6523-ICD Group no"},
2526         { 0xc6, "Local Group no"},
2527         { 0xc7, "Local Group no"},
2528         { 0xc8, "Local ISO/IEC 646 character Group no"},
2529         { 0xc9, "Local ( National character ) Group no"},
2530         { 0xca, "X.121 Group no"},
2531         { 0xcb, "X.121 Group no"},
2532         { 0xcd, "F.69 Group no"},
2533         { 0xce, "F.69 Group no"},
2534         { 0xcf, "E.163 Group no"},
2535         { 0xde, "E.163 Group no"},
2536         { 0xd0, "E.164 Group no"},
2537         { 0xd1, "E.164 Group no"},
2538
2539         { 0xe2, "ITU-T IND Group no"},
2540         { 0xe3, "ITU-T IND Group no"},
2541         { 0,    NULL }
2542 };
2543
2544
2545 /* Up-to-date information on the allocated ICP values can be found in   */
2546 /*draft-gray-rfc1888bis-01 at                                           */
2547 /*http://www.ietf.org/internet-drafts/draft-gray-rfc1888bis-01.txt      */
2548 static const value_string iana_icp_values[] = {
2549         {   0x0, "IP Version 6 Address"},
2550         {   0x1, "IP Version 4 Address"},
2551         { 0,    NULL }
2552 };
2553
2554 /*
2555  * XXX - shouldn't there be a centralized routine for dissecting NSAPs?
2556  * See also "dissect_atm_nsap()" in epan/dissectors/packet-arp.c and
2557  * "print_nsap_net_buf()" and "print_nsap_net()" in epan/osi_utils.c.
2558  */
2559 void
2560 dissect_nsap(tvbuff_t *parameter_tvb,gint offset,gint len, proto_tree *parameter_tree)
2561 {
2562         guint8 afi, cc_length = 0;
2563         guint8 length = 0, address_digit_pair = 0;
2564         guint icp,  cc, id_code, cc_offset;
2565
2566         afi = tvb_get_guint8(parameter_tvb, offset);
2567
2568         switch ( afi ) {
2569                 case 0x35:      /* IANA ICP Binary fortmat*/
2570                         proto_tree_add_text(parameter_tree, parameter_tvb, offset, 3,
2571                             "IDP = %s", tvb_bytes_to_str(parameter_tvb, offset, 3));
2572
2573                         proto_tree_add_uint(parameter_tree, hf_afi, parameter_tvb, offset, 1, afi );
2574                         offset = offset + 1;
2575                         icp = tvb_get_ntohs(parameter_tvb, offset);
2576                         proto_tree_add_uint(parameter_tree, hf_iana_icp, parameter_tvb, offset, 1, icp );
2577                         if ( icp == 0 ){ /* IPv6 addr */
2578                                 proto_tree_add_text(parameter_tree, parameter_tvb, offset + 2 , 17,
2579                                     "DSP = %s", tvb_bytes_to_str(parameter_tvb, offset + 2, 17));
2580                                 proto_tree_add_item(parameter_tree, hf_nsap_ipv6_addr, parameter_tvb, offset + 2,
2581                                     16, FALSE);
2582
2583                         }
2584                         else { /* IPv4 addr */
2585                                 /* XXX - this is really only for ICP 1 */
2586                                 proto_tree_add_text(parameter_tree, parameter_tvb, offset + 2, 17,
2587                                     "DSP = %s", tvb_bytes_to_str(parameter_tvb, offset + 2, 17));
2588                                 proto_tree_add_item(parameter_tree, hf_nsap_ipv4_addr, parameter_tvb, offset + 2, 4, FALSE);
2589                         }
2590
2591                         break;
2592                 case 0x45:      /* E.164 ATM format */
2593                 case 0xC3:      /* E.164 ATM group format */
2594                         proto_tree_add_text(parameter_tree, parameter_tvb, offset, 9,
2595                             "IDP = %s", tvb_bytes_to_str(parameter_tvb, offset, 9));
2596
2597                         proto_tree_add_uint(parameter_tree, hf_afi, parameter_tvb, offset, 1, afi );
2598
2599                         proto_tree_add_text(parameter_tree, parameter_tvb, offset + 1, 8,
2600                             "IDI = %s", tvb_bytes_to_str(parameter_tvb, offset + 1, 8));
2601                         offset = offset +1;
2602                         /* Dissect country code after removing non significant zeros */
2603                         cc_offset = offset;
2604                         address_digit_pair = tvb_get_guint8(parameter_tvb, cc_offset);
2605                         while ( address_digit_pair == 0 ) {
2606                                 cc_offset = cc_offset + 1;
2607                                 address_digit_pair = tvb_get_guint8(parameter_tvb, cc_offset);
2608                         }
2609                         cc = tvb_get_ntohs(parameter_tvb, cc_offset);
2610                         if (( address_digit_pair & 0xf0 ) != 0 )
2611                                 cc = cc >> 4;
2612
2613                         switch ( cc & 0x0f00 ) {
2614
2615                         case 0x0 :
2616                                 cc_length = 1;
2617                                 break;
2618
2619                         case 0x0100 : cc_length = 1;
2620                                 break;
2621
2622                         case 0x0200 :
2623                                 switch ( cc & 0x00f0 ) {
2624                                         case 0 :
2625                                         case 0x70 :
2626                                                 cc_length = 2;
2627                                                 break;
2628                                         default :
2629                                                 cc_length = 3;
2630                                                 break;
2631                                         }
2632                                 break;
2633
2634                         case 0x0300 :
2635                                 switch ( cc & 0x00f0 ) {
2636                                         case 0 :
2637                                         case 0x10 :
2638                                         case 0x20 :
2639                                         case 0x30 :
2640                                         case 0x40 :
2641                                         case 0x60 :
2642                                         case 0x90 :
2643                                                 cc_length = 2;
2644                                                 break;
2645                                         default :
2646                                                 cc_length = 3;
2647                                                 break;
2648                                 }
2649                                 break;
2650                         case 0x0400 :
2651                                 switch ( cc & 0x00f0 ) {
2652                                         case 0x20 :
2653                                                 cc_length = 3;
2654                                                 break;
2655                                 default :
2656                                         cc_length = 2;
2657                                         break;
2658                                 }
2659                                 break;
2660
2661                         case 0x0500 :
2662                                 switch ( cc & 0x00f0 ) {
2663                                         case 0 :
2664                                         case 0x90 :
2665                                                 cc_length = 3;
2666                                                 break;
2667                                 default :
2668                                         cc_length = 2;
2669                                         break;
2670                                 }
2671                                 break;
2672
2673                         case 0x0600 :
2674                                 switch ( cc & 0x00f0 ) {
2675                                         case 0x70 :
2676                                         case 0x80 :
2677                                         case 0x90 :
2678                                                 cc_length = 3;
2679                                                 break;
2680                                         default :
2681                                                 cc_length = 2;
2682                                                 break;
2683                                 }
2684                                 break;
2685
2686                         case 0x0700 : cc_length = 1;
2687                                 break;
2688
2689                         case 0x0800 :
2690                                 switch ( cc & 0x00f0 ) {
2691                                         case 0x10:
2692                                         case 0x20:
2693                                         case 0x40:
2694                                         case 0x60:
2695                                                 cc_length = 2;
2696                                                 break;
2697                                 default :
2698                                         cc_length = 3;
2699                                         break;
2700                                 }
2701                                 break;
2702
2703                         case 0x0900 :
2704                                 switch ( cc & 0x00f0 ) {
2705                                         case 0 :
2706                                         case 0x10 :
2707                                         case 0x20 :
2708                                         case 0x30 :
2709                                         case 0x40 :
2710                                         case 0x50 :
2711                                         case 0x80 :
2712                                                 cc_length = 2;
2713                                                 break;
2714                                         default :
2715                                                 cc_length = 3;
2716                                                 break;
2717                                 }
2718                                 break;
2719
2720                         default:
2721                                 break;
2722                         }/* End switch cc */
2723                         switch ( cc_length ) {
2724                         case 0x1 :      cc = cc >> 8;
2725                                 length = 1;
2726                                 break;
2727                         case 0x2 :      cc = cc >> 4;
2728                                 length = 1;
2729                                 break;
2730                         default:
2731                                 length = 2;
2732                                 break;
2733                         }/* end switch cc_length */
2734                         proto_tree_add_text(parameter_tree,parameter_tvb, cc_offset, length,"Country Code: %x %s length %u",cc,
2735                                         val_to_str(cc,E164_country_code_value,"unknown (%x)"),cc_length);
2736                         switch ( cc ) {
2737                         case 0x882 :
2738                                         id_code = tvb_get_ntohs(parameter_tvb, cc_offset + 1);
2739                                         id_code = (id_code & 0x0fff) >> 4;
2740                                         proto_tree_add_text(parameter_tree,parameter_tvb, (cc_offset + 1), 2,"Identification Code: %x %s ",id_code,
2741                                                 val_to_str(id_code,E164_International_Networks_vals,"unknown (%x)"));
2742                                 break;
2743                         default:;
2744                         }
2745                         proto_tree_add_text(parameter_tree,parameter_tvb, cc_offset, length,"DSP length %u(len %u -9 )",(len-9),len );
2746
2747                         proto_tree_add_item(parameter_tree, hf_bicc_nsap_dsp, parameter_tvb, offset + 8, (len - 9),FALSE);
2748
2749                         break;
2750                 default:
2751                         proto_tree_add_uint(parameter_tree, hf_afi, parameter_tvb, offset, len, afi );
2752                 }/* end switch afi */
2753
2754 }
2755
2756
2757 #define  ACTION_INDICATOR                               0x01
2758 #define  BACKBONE_NETWORK_CONNECTION_IDENTIFIER         0x02
2759 #define  INTERWORKING_FUNCTION_ADDRESS                  0x03
2760 #define  CODEC_LIST                                     0x04
2761 #define  CODEC                                          0x05
2762 #define  BAT_COMPATIBILITY_REPORT                       0x06
2763 #define  BEARER_NETWORK_CONNECTION_CHARACTERISTICS      0x07
2764 #define  BEARER_CONTROL_INFORMATION                     0x08
2765 #define  BEARER_CONTROL_TUNNELLING                      0x09
2766 #define  BEARER_CONTROL_UNIT_IDENTIFIER                 0x0A
2767 #define  SIGNAL                                         0x0B
2768 #define  BEARER_REDIRECTION_CAPABILITY                  0x0C
2769 #define  BEARER_REDIRECTION_INDICATORS                  0x0D
2770 #define  SIGNAL_TYPE                                    0x0E
2771 #define  DURATION                                       0x0F
2772
2773
2774 static const value_string bat_ase_list_of_Identifiers_vals[] = {
2775
2776         { 0x00                                          ,       "spare" },
2777         { ACTION_INDICATOR                              ,       "Action Indicator" },
2778         { BACKBONE_NETWORK_CONNECTION_IDENTIFIER        ,       "Backbone Network Connection Identifier" },
2779         { INTERWORKING_FUNCTION_ADDRESS                 ,       "Interworking Function Address" },
2780         { CODEC_LIST                                    ,       "Codec List" },
2781         { CODEC                                         ,       "Codec" },
2782         { BAT_COMPATIBILITY_REPORT                      ,       "BAT Compatibility Report" },
2783         { BEARER_NETWORK_CONNECTION_CHARACTERISTICS     ,       "Bearer Network Connection Characteristics" },
2784         { BEARER_CONTROL_INFORMATION                    ,       "Bearer Control Information"},
2785         { BEARER_CONTROL_TUNNELLING                     ,       "Bearer Control Tunnelling"},
2786         { BEARER_CONTROL_UNIT_IDENTIFIER                ,       "Bearer Control Unit Identifier" },
2787         { SIGNAL                                        ,       "Signal"},
2788         { BEARER_REDIRECTION_CAPABILITY                 ,       "Bearer Redirection Capability"},
2789         { BEARER_REDIRECTION_INDICATORS                 ,       "Bearer Redirection Indicators"},
2790         { SIGNAL_TYPE                                   ,       "Signal Type"},
2791         { DURATION                                      ,       "Duration" },
2792         { 0,    NULL }
2793 };
2794
2795 /*ITU-T Q.765.5 (06/2000) 13*/
2796 static const value_string Instruction_indicator_for_general_action_vals[] =
2797 {
2798   { 0,     "Pass on information element"},
2799   { 1,     "Discard information element"},
2800   { 2,     "Discard BICC data"},
2801   { 3,     "Release call"},
2802   { 0,     NULL}};
2803
2804 static const value_string Instruction_indicator_for_pass_on_not_possible_vals[] = {
2805   { 0,     "Release call"},
2806   { 1,     "Discard information element"},
2807   { 2,     "Discard BICC data"},
2808   { 3,     "reserved (interpreted as 00)"},
2809   { 0,     NULL}};
2810
2811 static value_string bat_ase_action_indicator_field_vals[] = {
2812
2813         { 0x00, "no indication"},
2814         { 0x01, "connect backward"},
2815         { 0x02, "connect forward"},
2816         { 0x03, "connect forward, no notification"},
2817         { 0x04, "connect forward, plus notification"},
2818         { 0x05, "connect forward, no notification + selected codec"},
2819         { 0x06, "connect forward, plus notification + selected codec"},
2820         { 0x07, "use idle"},
2821         { 0x08, "connected"},
2822         { 0x09, "switched"},
2823         { 0x0a, "selected codec"},
2824         { 0x0b, "modify codec"},
2825         { 0x0c, "successful codec modification"},
2826         { 0x0d, "codec modification failure"},
2827         { 0x0e, "mid-call codec negotiation"},
2828         { 0x0f, "modify to selected codec information"},
2829         { 0x10, "mid-call codec negotiation failure"},
2830         { 0x11, "start signal, notify"},
2831         { 0x12, "start signal, no notify"},
2832         { 0x13, "stop signal, notify"},
2833         { 0x14, "stop signal, no notify"},
2834         { 0x15, "start signal acknowledge"},
2835         { 0x16, "start signal reject"},
2836         { 0x17, "stop signal acknowledge"},
2837         { 0x18, "bearer redirect"},
2838         { 0,    NULL }
2839 };
2840
2841 static const true_false_string BCTP_BVEI_value  = {
2842   "Version Error Indication, BCTP version not supported",
2843   "No indication"
2844 };
2845
2846 static value_string BCTP_Tunnelled_Protocol_Indicator_vals[] = {
2847
2848         { 0x20, "IPBCP (text encoded)"},
2849         { 0x21, "spare (text encoded protocol)"},
2850         { 0x22, "not used"},
2851         { 0,    NULL }
2852 };
2853
2854 static const true_false_string BCTP_TPEI_value  = {
2855   "Protocol Error Indication, Bearer Control Protocol not supported",
2856   "No indication"
2857 };
2858
2859
2860 #define  ITU_T                                  0x01
2861 #define  ETSI                                   0x02
2862
2863 static const value_string bat_ase_organization_identifier_subfield_vals[] = {
2864
2865         { 0x00, "no indication"},
2866         { 0x01, "ITU-T"},
2867         { 0x02, "ETSI (refer to TS 26.103)"},
2868         { 0,    NULL }
2869 };
2870
2871 #define G_711_64_A                                              0x01
2872 #define G_711_64_U                                              0x02
2873 #define G_711_56_A                                              0x03
2874 #define G_711_56_U                                              0x04
2875 #define G_722_SB_ADPCM                                  0x05
2876 #define G_723_1                                                 0x06
2877 #define G_723_1_Annex_A                                 0x07
2878 #define G_726_ADPCM                                             0x08
2879 #define G_727_Embedded_ADPCM                    0x09
2880 #define G_728                                                   0x0a
2881 #define G_729_CS_ACELP                                  0x0b
2882 #define G_729_Annex_B                                   0x0c
2883
2884 static const value_string ITU_T_codec_type_subfield_vals[] = {
2885
2886         { 0x00,                                 "no indication"},
2887         { G_711_64_A,                   "G.711 64 kbit/s A-law"},
2888         { G_711_64_U,                   "G.711 64 kbit/s -law"},
2889         { G_711_56_A,                   "G.711 56 kbit/s A-law"},
2890         { G_711_56_U,                   "G.711 56 kbit/s -law"},
2891         { G_722_SB_ADPCM,               "G.722 (SB-ADPCM)"},
2892         { G_723_1,                              "G.723.1"},
2893         { G_723_1_Annex_A,              "G.723.1 Annex A (silence suppression)"},
2894         { G_726_ADPCM,                  "G.726 (ADPCM)"},
2895         { G_727_Embedded_ADPCM, "G.727 (Embedded ADPCM)"},
2896         { G_728,                                "G.728"},
2897         { G_729_CS_ACELP,               "G.729 (CS-ACELP)"},
2898         { G_729_Annex_B,                "G.729 Annex B (silence suppression)"},
2899         { 0,    NULL }
2900 };
2901
2902 static const value_string ETSI_codec_type_subfield_vals[] = {
2903
2904         { 0x00, "GSM Full Rate (13.0 kBit/s)( GSM FR )"},
2905         { 0x01, "GSM Half Rate (5.6 kBit/s) ( GSM HR )"},
2906         { 0x02, "GSM Enhanced Full Rate (12.2 kBit/s)( GSM EFR )"},
2907         { 0x03, "Full Rate Adaptive Multi-Rate ( FR AMR )"},
2908         { 0x04, "Half Rate Adaptive Multi-Rate ( HR AMR )"},
2909         { 0x05, "UMTS Adaptive Multi-Rate ( UMTS AMR )"},
2910         { 0x06, "UMTS Adaptive Multi-Rate 2 ( UMTS AMR 2 )"},
2911         { 0x07, "TDMA Enhanced Full Rate (7.4 kBit/s) ( TDMA EFR )"},
2912         { 0x08, "PDC Enhanced Full Rate (6.7 kBit/s) ( PDC EFR )"},
2913         { 0x09, "Full Rate Adaptive Multi-Rate WideBand ( FR AMR-WB )"},
2914         { 0x0a, "UMTS Adaptive Multi-Rate WideBand ( UMTS AMR-WB )"},
2915         { 0x0b, "8PSK Half Rate Adaptive Multi-Rate ( OHR AMR )"},
2916         { 0x0c, "8PSK Full Rate Adaptive Multi-Rate WideBand  ( OFR AMR-WB )"},
2917         { 0x0d, "8PSK Half Rate Adaptive Multi-Rate WideBand ( OHR AMR-WB )"},
2918         { 0xfe, "Reserved for future use."},
2919         { 0xff, "Reserved for MuMe dummy Codec Type ( MuMe )"},
2920         { 0,    NULL }
2921 };
2922
2923 static const value_string bat_initial_codec_mode_vals[] = {
2924         {0x7, "12.2 kbps"},
2925         {0x6, "10.2 kbps"},
2926         {0x5, "7.95 kbps"},
2927         {0x4, "7.40 kbps"},
2928         {0x3, "6.70 kbps"},
2929         {0x2, "5.90 kbps"},
2930         {0x1, "5.15 kbps"},
2931         {0x0, "4.75 kbps"},
2932         {0, NULL}
2933 };
2934
2935 static const value_string optimisation_mode_vals[] = {
2936         { 0,    "Optimisation of the ACS not supported,"},
2937         { 1,    "Optimisation of the ACS supported,"},
2938         { 0,    NULL }
2939 };
2940
2941 const value_string bearer_network_connection_characteristics_vals[] = {
2942
2943         { 0x00, "no indication"},
2944         { 0x01, "AAL type 1"},
2945         { 0x02, "AAL type 2"},
2946         { 0x03, "Structured AAL type 1"},
2947         { 0x04, "IP/RTP"},
2948         { 0x05, "TDM (reserved for use by ITU-T Rec. Q.1950)"},
2949         { 0,    NULL }
2950 };
2951
2952 static const true_false_string Bearer_Control_Tunnelling_ind_value  = {
2953   "Tunnelling to be used",
2954   "No indication"
2955 };
2956
2957 static const true_false_string late_cut_trough_cap_ind_value  = {
2958   "Late Cut-through supported",
2959   "Late Cut-through not supported"
2960 };
2961 /*  ITU-T Rec. Q.765.5/Amd.1 (07/2001) */
2962 static const value_string Bearer_Redirection_Indicator_vals[] = {
2963         { 0x00, " no indication"},
2964         { 0x01, "late cut-through request"},
2965         { 0x02, "redirect temporary reject"},
2966         { 0x03, "redirect backwards request"},
2967         { 0x04, "redirect forwards request"},
2968         { 0x05, "redirect bearer release request"},
2969         { 0x06, "redirect bearer release proceed"},
2970         { 0x07, "redirect bearer release complete"},
2971         { 0x08, "redirect cut-through request"},
2972         { 0x09, "redirect bearer connected indication"},
2973         { 0x0a, "redirect failure"},
2974         { 0x0b, "new connection identifier"},
2975         { 0,    NULL }
2976 };
2977
2978 /*26/Q.765.5 - Signal Type */
2979 static const value_string BAt_ASE_Signal_Type_vals[] = {
2980         { 0x00, "DTMF 0"},
2981         { 0x01, "DTMF 1"},
2982         { 0x02, "DTMF 2"},
2983         { 0x03, "DTMF 3"},
2984         { 0x04, "DTMF 4"},
2985         { 0x05, "DTMF 5"},
2986         { 0x06, "DTMF 6"},
2987         { 0x07, "DTMF 7"},
2988         { 0x08, "DTMF 8"},
2989         { 0x09, "DTMF 9"},
2990         { 0x0a, "DTMF *"},
2991         { 0x0b, "DTMF #"},
2992         { 0x0c, "DTMF A"},
2993         { 0x0d, "DTMF B"},
2994         { 0x0e, "DTMF C"},
2995         { 0x1f, "DTMF D"},
2996         { 0x40, "dial tone"},
2997         { 0x41, "PABX internal dial tone"},
2998         { 0x42, "special dial tone"},
2999         { 0x43, "second dial tone"},
3000         { 0x44, "ringing tone"},
3001         { 0x45, "special ringing tone"},
3002         { 0x46, "busy tone"},
3003         { 0x47, "congestion tone"},
3004         { 0x48, "special information tone"},
3005         { 0x49, "warning tone"},
3006         { 0x4a, "intrusion tone"},
3007         { 0x4b, "call waiting tone"},
3008         { 0x4c, "pay tone"},
3009         { 0x4d, "payphone recognition tone"},
3010         { 0x4e, "comfort tone"},
3011         { 0x4f, "tone on hold"},
3012         { 0x50, "record tone"},
3013         { 0x51, "Caller waiting tone"},
3014         { 0x52, "positive indication tone"},
3015         { 0x53, "negative indication tone"},
3016         { 0,    NULL }
3017 };
3018
3019 static const value_string BAT_ASE_Report_Reason_vals[] = {
3020
3021         { 0x00, "no indication"},
3022         { 0x01, "information element non-existent or not implemented"},
3023         { 0x02, "BICC data with unrecognized information element, discarded"},
3024         { 0,    NULL }
3025 };
3026 /* This routine should bve called with offset at Organization_Identifier not the lengh indicator
3027  * because of use from other disectors.
3028  */
3029 extern int dissect_codec_mode(proto_tree *tree, tvbuff_t *tvb, int offset, int len) {
3030         guint8 tempdata;
3031         proto_tree *scs_item, *acs_item;
3032         proto_tree *scs_tree, *acs_tree;
3033
3034
3035         tempdata = tvb_get_guint8(tvb, offset);
3036         proto_tree_add_uint(tree, hf_Organization_Identifier , tvb, offset, 1, tempdata );
3037         switch ( tempdata ){
3038                 case ITU_T :
3039                         offset = offset + 1;
3040                         tempdata = tvb_get_guint8(tvb, offset);
3041                         proto_tree_add_uint(tree, hf_codec_type , tvb, offset, 1, tempdata );
3042                         offset = offset + 1;
3043                         switch ( tempdata ) {
3044                                 case G_711_64_A :
3045                                 case G_711_64_U :
3046                                 case G_711_56_A :
3047                                 case G_711_56_U :
3048                                 case G_722_SB_ADPCM :
3049                                 case G_723_1 :
3050                                 case G_723_1_Annex_A :
3051                                         /* These codecs have no configuration data */
3052                                         break;
3053                                 case G_726_ADPCM :
3054                                 case G_727_Embedded_ADPCM :
3055                                         /* four bit config data, TODO decode config */
3056                                         if ( len > 2 ) {
3057                                                 tempdata = tvb_get_guint8(tvb, offset);
3058                                                 proto_tree_add_text(tree, tvb, offset, 1, "Configuration data : 0x%x", tempdata);
3059                                                 offset = offset + 1;
3060                                         }
3061                                         break;
3062                                 case G_728 :
3063                                 case G_729_CS_ACELP :
3064                                 case G_729_Annex_B :
3065                                         /* three bit config data, TODO decode config */
3066                                         if ( len > 2 ) {
3067                                                 tempdata = tvb_get_guint8(tvb, offset);
3068                                                 proto_tree_add_text(tree, tvb, offset, 1 , "Configuration data : 0x%x", tempdata);
3069                                                 offset = offset + 1;
3070                                         }
3071                                         break;
3072                                 default:
3073                                         break;
3074
3075                         }
3076                                 break;
3077                 case ETSI:
3078                         offset = offset + 1;
3079                         tempdata = tvb_get_guint8(tvb, offset);
3080                         proto_tree_add_uint(tree, hf_etsi_codec_type , tvb, offset, 1, tempdata );
3081                         if ( len > 2 )  {
3082                                 offset = offset + 1;
3083                                 tempdata = tvb_get_guint8(tvb, offset);
3084
3085                                 acs_item = proto_tree_add_item(tree, hf_active_code_set, tvb, offset, 1, TRUE);
3086                                 acs_tree = proto_item_add_subtree(acs_item,ett_acs);
3087                                 proto_tree_add_item(acs_tree, hf_active_code_set_12_2, tvb, offset, 1, TRUE);
3088                                 proto_tree_add_item(acs_tree, hf_active_code_set_10_2, tvb, offset, 1, TRUE);
3089                                 proto_tree_add_item(acs_tree, hf_active_code_set_7_95, tvb, offset, 1, TRUE);
3090                                 proto_tree_add_item(acs_tree, hf_active_code_set_7_40, tvb, offset, 1, TRUE);
3091                                 proto_tree_add_item(acs_tree, hf_active_code_set_6_70, tvb, offset, 1, TRUE);
3092                                 proto_tree_add_item(acs_tree, hf_active_code_set_5_90, tvb, offset, 1, TRUE);
3093                                 proto_tree_add_item(acs_tree, hf_active_code_set_5_15, tvb, offset, 1, TRUE);
3094                                 proto_tree_add_item(acs_tree, hf_active_code_set_4_75, tvb, offset, 1, TRUE);
3095
3096                         }
3097                         if ( len > 3 )  {
3098                                 offset = offset + 1;
3099                                 tempdata = tvb_get_guint8(tvb, offset);
3100
3101                                 scs_item = proto_tree_add_item(tree, hf_supported_code_set, tvb, offset, 1, TRUE);
3102                                 scs_tree = proto_item_add_subtree(scs_item,ett_scs);
3103                                 proto_tree_add_item(scs_tree, hf_supported_code_set_12_2, tvb, offset, 1, TRUE);
3104                                 proto_tree_add_item(scs_tree, hf_supported_code_set_10_2, tvb, offset, 1, TRUE);
3105                                 proto_tree_add_item(scs_tree, hf_supported_code_set_7_95, tvb, offset, 1, TRUE);
3106                                 proto_tree_add_item(scs_tree, hf_supported_code_set_7_40, tvb, offset, 1, TRUE);
3107                                 proto_tree_add_item(scs_tree, hf_supported_code_set_6_70, tvb, offset, 1, TRUE);
3108                                 proto_tree_add_item(scs_tree, hf_supported_code_set_5_90, tvb, offset, 1, TRUE);
3109                                 proto_tree_add_item(scs_tree, hf_supported_code_set_5_15, tvb, offset, 1, TRUE);
3110                                 proto_tree_add_item(scs_tree, hf_supported_code_set_4_75, tvb, offset, 1, TRUE);
3111                         }
3112                         if ( len > 4 )  {
3113                                 offset = offset + 1;
3114                                 proto_tree_add_item(tree, hf_optimisation_mode, tvb, offset, 1, TRUE);
3115                                 proto_tree_add_item(tree, hf_max_codec_modes, tvb, offset, 1, TRUE);
3116                         }
3117                         offset = offset + 1;
3118                         break;
3119                 default:
3120                         offset = offset + 1;
3121                         tempdata = tvb_get_guint8(tvb, offset);
3122                         proto_tree_add_text(tree, tvb, offset, len ,
3123                                                                 "Unknown organisation Identifier ( Non ITU-T/ETSI codec ) %u", tempdata);
3124                         offset = offset + len - 1;
3125                         break;
3126         }
3127         /* switch OID */
3128
3129         return offset;
3130 }
3131
3132 static int
3133 dissect_codec(tvbuff_t *parameter_tvb, proto_tree *bat_ase_element_tree, gint length_indicator, gint offset,gint identifier)
3134 {
3135 /* offset is at length indicator e.g 1 step past identifier */
3136 guint8 compatibility_info;
3137
3138         proto_tree_add_uint(bat_ase_element_tree , hf_bat_ase_identifier , parameter_tvb, offset - 1, 1, identifier );
3139         proto_tree_add_uint(bat_ase_element_tree , hf_length_indicator  , parameter_tvb, offset, 1, length_indicator );
3140         offset = offset + 1;
3141         compatibility_info = tvb_get_guint8(parameter_tvb, offset);
3142         proto_tree_add_uint(bat_ase_element_tree, hf_Instruction_ind_for_general_action , parameter_tvb, offset, 1, compatibility_info );
3143         proto_tree_add_boolean(bat_ase_element_tree, hf_Send_notification_ind_for_general_action , parameter_tvb, offset, 1, compatibility_info );
3144         proto_tree_add_uint(bat_ase_element_tree, hf_Instruction_ind_for_pass_on_not_possible , parameter_tvb, offset, 1, compatibility_info );
3145         proto_tree_add_boolean(bat_ase_element_tree, hf_Send_notification_ind_for_pass_on_not_possible , parameter_tvb, offset, 1, compatibility_info );
3146         proto_tree_add_boolean(bat_ase_element_tree, hf_isup_extension_ind , parameter_tvb, offset, 1, compatibility_info );
3147
3148         offset = dissect_codec_mode(bat_ase_element_tree, parameter_tvb, offset+1,length_indicator-1);
3149 return offset;
3150 }
3151
3152 /* Dissect BAT ASE message according to Q.765.5 200006 and Amendment 1 200107
3153  * Layout of message            Length                  Octet
3154  *      Element name
3155  *      Identifier                                      1                       1
3156  *      Length indicator                        1                       2
3157  *      Compatibility information       1                       3
3158  *      Contents                                        1                       4
3159  *      Identifier                                      n                       m
3160  *      Length indicator                        n
3161  *      Compatibility information       n
3162  *      Contents                                        n                       p
3163  */
3164
3165 static void
3166 dissect_bat_ase_Encapsulated_Application_Information(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *parameter_tree, gint offset)
3167 {
3168         gint            length = tvb_reported_length_remaining(parameter_tvb, offset), list_end;
3169         tvbuff_t        *next_tvb;
3170         proto_tree      *bat_ase_tree, *bat_ase_element_tree, *bat_ase_iwfa_tree;
3171         proto_item      *bat_ase_item, *bat_ase_element_item, *bat_ase_iwfa_item;
3172         guint8 identifier,content, BCTP_Indicator_field_1, BCTP_Indicator_field_2;
3173         guint8 tempdata, element_no, number_of_indicators;
3174         guint16 sdp_length;
3175         guint8 diagnostic_len;
3176         guint8 length_ind_len;
3177         guint tempdata16;
3178         guint content_len, length_indicator;
3179         guint duration;
3180         guint diagnostic;
3181         guint32 bncid, Local_BCU_ID;
3182         element_no = 0;
3183
3184         bat_ase_item = proto_tree_add_text(parameter_tree,parameter_tvb, offset, -1,
3185                 "Bearer Association Transport (BAT) Application Service Element (ASE) Encapsulated Application Information:");
3186         bat_ase_tree = proto_item_add_subtree(bat_ase_item , ett_bat_ase);
3187
3188         proto_tree_add_text(bat_ase_tree, parameter_tvb, offset, -1,
3189                 "BAT ASE Encapsulated Application Information, (%u byte%s length)", length, plurality(length, "", "s"));
3190         while(tvb_reported_length_remaining(parameter_tvb, offset) > 0){
3191                 element_no = element_no + 1;
3192                 identifier = tvb_get_guint8(parameter_tvb, offset);
3193
3194                 /* length indicator may be 11 bits long                         */
3195                 offset = offset + 1;
3196                 proto_tree_add_item( bat_ase_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, FALSE );
3197                 tempdata = tvb_get_guint8(parameter_tvb, offset);
3198                 if ( tempdata & 0x80 ) {
3199                         length_indicator = tempdata & 0x7f;
3200                         length_ind_len = 1;
3201                 }
3202                 else {
3203                         offset = offset + 1;
3204                         tempdata16 = ( tempdata & 0x7f );
3205                         length_indicator = tvb_get_guint8(parameter_tvb, offset)& 0x0f;
3206                         length_indicator = length_indicator << 7;
3207                         length_indicator = length_indicator + tempdata16;
3208                         length_ind_len = 2;
3209                 }
3210
3211                 bat_ase_element_item = proto_tree_add_text(bat_ase_tree,parameter_tvb,
3212                         ( offset - length_ind_len),(length_indicator + 2),"BAT ASE Element %u, Identifier: %s",element_no,
3213                                         val_to_str(identifier,bat_ase_list_of_Identifiers_vals,"unknown (%u)"));
3214                 bat_ase_element_tree = proto_item_add_subtree(bat_ase_element_item ,
3215                         ett_bat_ase_element);
3216                 if ( identifier != CODEC ) {
3217                 /* identifier, lengt indicator and compabillity info must be printed inside CODEC */
3218                 /* dissection in order to use dissect_codec routine for codec list */
3219                 proto_tree_add_uint(bat_ase_element_tree , hf_bat_ase_identifier , parameter_tvb,
3220                         offset - length_ind_len, 1, identifier );
3221                 proto_tree_add_uint(bat_ase_element_tree , hf_length_indicator  , parameter_tvb,
3222                         offset - length_ind_len + 1, length_ind_len, length_indicator );
3223
3224                 offset = offset + 1;
3225                 proto_tree_add_item( bat_ase_element_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, FALSE );
3226                 proto_tree_add_item( bat_ase_element_tree, hf_Send_notification_ind_for_pass_on_not_possible, parameter_tvb, offset, 1, FALSE );
3227                 proto_tree_add_item( bat_ase_element_tree, hf_Instruction_ind_for_pass_on_not_possible, parameter_tvb, offset, 1, FALSE );
3228                 proto_tree_add_item( bat_ase_element_tree, hf_Send_notification_ind_for_general_action, parameter_tvb, offset, 1, FALSE );
3229                 proto_tree_add_item( bat_ase_element_tree, hf_Instruction_ind_for_general_action, parameter_tvb, offset, 1, FALSE );
3230                 offset = offset + 1;
3231                 }
3232                 content_len = length_indicator - 1 ; /* exclude the treated Compatibility information */
3233
3234                 /* content will be different depending on identifier */
3235                 switch ( identifier ){
3236
3237                         case ACTION_INDICATOR :
3238
3239                                 content = tvb_get_guint8(parameter_tvb, offset);
3240                                 proto_tree_add_uint(bat_ase_element_tree, hf_Action_Indicator , parameter_tvb, offset, 1, content );
3241                                 proto_item_append_text(bat_ase_element_item, " - %s",
3242                                                  val_to_str(content,bat_ase_action_indicator_field_vals, "unknown (%u)"));
3243                                 offset = offset + 1;
3244                                 break;
3245                         case BACKBONE_NETWORK_CONNECTION_IDENTIFIER :
3246
3247                                 bncid = tvb_get_ntohl(parameter_tvb, offset);
3248                                 switch ( content_len ){
3249                                 case 1:
3250                                                 bncid = bncid & 0x000000ff;
3251                                                 break;
3252                                 case 2:
3253                                                 bncid = bncid & 0x0000ffff;
3254                                                 break;
3255                                 case 3:
3256                                                 bncid = bncid & 0x00ffffff;
3257                                                 break;
3258                                 case 4:;
3259                                 default:;
3260                                 }
3261                                 proto_tree_add_uint_format(bat_ase_element_tree, hf_bncid, parameter_tvb, offset, content_len, bncid, "BNCId: 0x%08x", bncid);
3262                                 proto_item_append_text(bat_ase_element_item, " - 0x%08x",bncid);
3263                                 offset = offset + content_len;
3264
3265                         break;
3266                         case INTERWORKING_FUNCTION_ADDRESS :
3267                                 bat_ase_iwfa_item = proto_tree_add_item(bat_ase_element_tree, hf_bat_ase_biwfa, parameter_tvb, offset, content_len,
3268                                                             FALSE);
3269                                 bat_ase_iwfa_tree = proto_item_add_subtree(bat_ase_iwfa_item , ett_bat_ase_iwfa);
3270                                 dissect_nsap(parameter_tvb, offset, content_len, bat_ase_iwfa_tree);
3271
3272                                 offset = offset + content_len;
3273                         break;
3274                         case CODEC_LIST :
3275                                 list_end = offset + content_len;
3276                                 while ( offset < ( list_end - 1 )) {
3277                                         identifier = tvb_get_guint8(parameter_tvb, offset);
3278                                         offset = offset + 1;
3279                                         tempdata = tvb_get_guint8(parameter_tvb, offset);
3280                                                 if ( tempdata & 0x80 ) {
3281                                                         length_indicator = tempdata & 0x7f;
3282                                                 }
3283                                                 else {
3284                                                         offset = offset +1;
3285                                                         length_indicator = tvb_get_guint8(parameter_tvb, offset);
3286                                                         length_indicator = length_indicator << 7;
3287                                                         length_indicator = length_indicator & ( tempdata & 0x7f );
3288                                                 }
3289                                         offset = dissect_codec(parameter_tvb, bat_ase_element_tree, length_indicator , offset, identifier);
3290                                 }
3291                         break;
3292                         case CODEC :
3293                                 /* offset is at length indicator in this case */
3294                                 offset = dissect_codec(parameter_tvb, bat_ase_element_tree, length_indicator , offset, identifier);
3295                                 break;/* case codec */
3296                         case BAT_COMPATIBILITY_REPORT :
3297                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
3298                                 proto_tree_add_uint(bat_ase_element_tree, hf_BAT_ASE_Comp_Report_Reason, parameter_tvb, offset, 1, tempdata );
3299                                 offset = offset + 1;
3300
3301                                 diagnostic_len = content_len - 1;
3302                                 while ( diagnostic_len > 0 ) {
3303                                         tempdata = tvb_get_guint8(parameter_tvb, offset);
3304                                         proto_tree_add_uint(bat_ase_element_tree, hf_BAT_ASE_Comp_Report_ident, parameter_tvb, offset, 1, tempdata );
3305                                         offset = offset + 1;
3306                                         diagnostic = tvb_get_letohs(parameter_tvb, offset);
3307                                         proto_tree_add_uint(bat_ase_element_tree, hf_BAT_ASE_Comp_Report_diagnostic, parameter_tvb, offset, 2, diagnostic);
3308                                         offset = offset + 2;
3309                                         diagnostic_len = diagnostic_len - 3;
3310                                 }
3311                         break;
3312                         case BEARER_NETWORK_CONNECTION_CHARACTERISTICS :
3313                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
3314                                 proto_tree_add_uint(bat_ase_element_tree, hf_characteristics , parameter_tvb,
3315                                                  offset, 1, tempdata );
3316                                 proto_item_append_text(bat_ase_element_item, " - %s",
3317                                                  val_to_str(tempdata,bearer_network_connection_characteristics_vals, "unknown (%u)"));
3318
3319                                 offset = offset + content_len;
3320                         break;
3321 /* The Bearer Control Information information element contains the bearer control tunnelling protocol */
3322 /* ITU-T Q.1990 (2001), BICC bearer control tunnelling protocol. */
3323
3324                         case BEARER_CONTROL_INFORMATION :
3325                                 BCTP_Indicator_field_1 = tvb_get_guint8(parameter_tvb, offset);
3326                                 proto_tree_add_uint(bat_ase_element_tree, hf_BCTP_Version_Indicator,
3327                                         parameter_tvb, offset, 1, BCTP_Indicator_field_1 );
3328
3329                                 proto_tree_add_boolean(bat_ase_element_tree, hf_BVEI,
3330                                         parameter_tvb, offset, 1, BCTP_Indicator_field_1 );
3331                                 offset = offset + 1;
3332
3333                                 BCTP_Indicator_field_2 = tvb_get_guint8(parameter_tvb, offset);
3334
3335                                 proto_tree_add_uint(bat_ase_element_tree, hf_Tunnelled_Protocol_Indicator ,
3336                                         parameter_tvb, offset, 1, BCTP_Indicator_field_2 );
3337
3338                                 proto_tree_add_boolean(bat_ase_element_tree, hf_TPEI,
3339                                         parameter_tvb, offset, 1, BCTP_Indicator_field_2 );
3340                                 offset = offset + 1;
3341
3342                                 sdp_length = ( length_indicator ) - 3;
3343
3344                                 if(sdp_length > tvb_length_remaining(parameter_tvb,offset)){
3345                                         /* If this is a segmented message we may not have all the data */
3346                                         next_tvb = tvb_new_subset(parameter_tvb, offset, -1, -1);
3347                                 }else{
3348                                         next_tvb = tvb_new_subset(parameter_tvb, offset, sdp_length, sdp_length);
3349                                 }
3350                                 call_dissector(sdp_handle, next_tvb, pinfo, bat_ase_element_tree);
3351                                 offset = offset + sdp_length;
3352
3353
3354                         break;
3355                         case BEARER_CONTROL_TUNNELLING :
3356
3357                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
3358                                 proto_tree_add_boolean(bat_ase_element_tree, hf_bearer_control_tunneling , parameter_tvb, offset, 1, ( tempdata & 0x01 ) );
3359                                 if ( tempdata & 0x01 )
3360                                         proto_item_append_text(bat_ase_element_item, " - Tunnelling to be used ");
3361
3362                                 offset = offset + content_len;
3363                         break;
3364                         case BEARER_CONTROL_UNIT_IDENTIFIER :
3365                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
3366                                 proto_tree_add_text(bat_ase_element_tree, parameter_tvb, offset, 1, "Network ID Length indicator= %u",tempdata);
3367                                 offset = offset +1;
3368                                 if ( tempdata > 0 ) {
3369                                         offset = offset +1;
3370
3371 /* Q.765.5 amd 1
3372         Network ID
3373         The coding of the Network ID field is identical to the coding of the Network ID field in the
3374         Global Call Reference parameter as specified in clause 6/Q.1902.3 (see [3]).
3375         NOTE .When used inside a network domain, the Network ID may be omitted by setting the
3376         Network ID Length indicator to the value "0".
3377         Q.1902.3
3378         The following codes are used in the subfields of the global call reference parameter field:
3379         a) Network ID
3380         The Network ID contains the value field (coded according to ASN.1 BER) of an object
3381         identifier identifying the network. This means that the tag and length fields are omitted.
3382         An example of such an object identifier can be the following:
3383         .{itu-t (0) administration (2) national regulatory authority (x) network (y)}
3384         The value for x is the value of the national regulatory authority (one of the Data Country
3385         Codes associated to the country as specified in ITU-T X.121 shall be used for "national
3386         regulatory authority"), the value for y is under the control of the national regulatory
3387         authority concerned.
3388         b) Node ID
3389         A binary number that uniquely identifies within the network the node which generates the
3390         call reference.
3391         c) Call Reference ID
3392         A binary number used for the call reference of the call. This is generated by the node for
3393         each call.
3394
3395 */
3396                                         proto_tree_add_text(bat_ase_element_tree, parameter_tvb, offset, tempdata , "Network ID: %s",
3397                                                             tvb_bytes_to_str(parameter_tvb, offset, tempdata));
3398                                         offset = offset + tempdata;
3399                                 } /* end if */
3400
3401                                 Local_BCU_ID = tvb_get_letohl(parameter_tvb, offset);
3402                                 proto_tree_add_uint_format(bat_ase_element_tree, hf_Local_BCU_ID , parameter_tvb, offset, 4, Local_BCU_ID , "Local BCU ID : 0x%08x", Local_BCU_ID );
3403                                 offset = offset + 4;
3404                         break;
3405                         case SIGNAL :
3406                                 /* As type is Constructor new elements follow, return to main loop */
3407                         break;
3408                         case BEARER_REDIRECTION_CAPABILITY :
3409                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
3410                                 proto_tree_add_boolean(bat_ase_element_tree, hf_late_cut_trough_cap_ind , parameter_tvb, offset, 1, tempdata );
3411                                 offset = offset + content_len;
3412                         break;
3413                         case BEARER_REDIRECTION_INDICATORS :
3414                                 number_of_indicators = 0;
3415                                 while ( number_of_indicators < content_len ) {
3416                                         tempdata = tvb_get_guint8(parameter_tvb, offset);
3417                                         proto_tree_add_uint(bat_ase_element_tree, hf_bat_ase_bearer_redir_ind , parameter_tvb, offset, 1, tempdata );
3418                                         offset = offset + 1;
3419                                         number_of_indicators = number_of_indicators + 1;
3420                                 }
3421                         break;
3422                         case SIGNAL_TYPE :
3423                                 tempdata = tvb_get_guint8(parameter_tvb, offset);
3424                                 proto_tree_add_uint(bat_ase_element_tree, hf_bat_ase_signal , parameter_tvb, offset, 1, tempdata );
3425                                 offset = offset + content_len;
3426                         break;
3427                         case DURATION :
3428                                 duration = tvb_get_letohs(parameter_tvb, offset);
3429                                 proto_tree_add_uint(bat_ase_element_tree, hf_bat_ase_duration , parameter_tvb, offset, 2, duration );
3430                                 offset = offset + content_len;
3431                         break;
3432                         default :
3433                                 proto_tree_add_text(bat_ase_element_tree, parameter_tvb, offset,content_len , "Default ?, (%u byte%s length)", (content_len), plurality(content_len, "", "s"));
3434                                 offset = offset + content_len;
3435                         }
3436         }
3437
3438 }
3439
3440
3441
3442 /*
3443 Octet
3444         -------------------------------------------
3445 1       | ext. Application context identifier lsb
3446         -------------------------------------------
3447 1a      | ext. msb
3448         -------------------------------------------
3449 2       | ext. spare                                            SNI RCI
3450         -------------------------------------------
3451 3       | ext. SI APM segmentation indicator
3452         -------------------------------------------
3453 3a      | ext. Segmentation local reference
3454         -------------------------------------------
3455 4a      |
3456 :       |       APM-user information
3457 4n      |
3458         +-------------------------------------------
3459
3460         Figure 77/Q.763 . Application transport parameter field
3461   */
3462 static void
3463 dissect_isup_application_transport_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *parameter_tree, proto_item *parameter_item)
3464 {
3465
3466         guint8 application_transport_instruction_ind;
3467         guint8 si_and_apm_seg_ind;
3468         guint8 apm_Segmentation_local_ref = 0;
3469         guint16 aci16;
3470         gint offset = 0;
3471         guint8 octet;
3472         guint length = tvb_reported_length(parameter_tvb);
3473
3474         gboolean more_frag;
3475         gboolean   save_fragmented;
3476         tvbuff_t* new_tvb = NULL;
3477         tvbuff_t* next_tvb = NULL;
3478         fragment_data *frag_msg = NULL;
3479
3480         proto_tree_add_text(parameter_tree, parameter_tvb, offset, -1, "Application transport parameter fields:");
3481         proto_item_set_text(parameter_item, "Application transport, (%u byte%s length)", length , plurality(length, "", "s"));
3482         aci16 = tvb_get_guint8(parameter_tvb, offset);
3483
3484         if ( (aci16 & H_8BIT_MASK) == 0x80) {
3485                 /* Octet 1 */
3486                 aci16 = aci16 & 0x7f;
3487                 proto_tree_add_item( parameter_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, FALSE );
3488                 proto_tree_add_uint(parameter_tree, hf_isup_app_cont_ident , parameter_tvb, offset, 1, aci16);
3489                 offset = offset + 1;
3490                 }
3491         /* Octet 1a */
3492         else {
3493                 aci16 = (aci16<<8) | (tvb_get_guint8(parameter_tvb, offset) & 0x7f);
3494                 proto_tree_add_uint(parameter_tree, hf_isup_app_cont_ident , parameter_tvb, offset, 2, aci16);
3495                 offset = offset + 2;
3496         }
3497
3498         /* Octet 2 */
3499         proto_tree_add_text(parameter_tree, parameter_tvb, offset, -1, "Application transport instruction indicators: ");
3500         application_transport_instruction_ind = tvb_get_guint8(parameter_tvb, offset);
3501         proto_tree_add_item( parameter_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, FALSE );
3502         proto_tree_add_item( parameter_tree, hf_isup_app_Send_notification_ind, parameter_tvb, offset, 1, FALSE );
3503         proto_tree_add_item( parameter_tree, hf_isup_app_Release_call_ind, parameter_tvb, offset, 1, FALSE );
3504         offset = offset + 1;
3505
3506         /* Octet 3*/
3507         proto_tree_add_text(parameter_tree, parameter_tvb, offset, 1, "APM segmentation indicator:");
3508         si_and_apm_seg_ind  = tvb_get_guint8(parameter_tvb, offset);
3509         proto_tree_add_item( parameter_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, FALSE );
3510         proto_tree_add_item( parameter_tree, hf_isup_apm_si_ind, parameter_tvb, offset, 1, FALSE );
3511         proto_tree_add_item( parameter_tree, hf_isup_apm_segmentation_ind, parameter_tvb, offset, 1, FALSE );
3512         offset = offset + 1;
3513
3514         /* Octet 3a */
3515         if ( (si_and_apm_seg_ind & H_8BIT_MASK) == 0x00) {
3516                 apm_Segmentation_local_ref  = tvb_get_guint8(parameter_tvb, offset);
3517                 proto_tree_add_item( parameter_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, FALSE );
3518                 proto_tree_add_item( parameter_tree, hf_isup_apm_slr, parameter_tvb, offset, 1, FALSE );
3519                 offset = offset + 1;
3520         }
3521         /* For APM'98'-user applications. ( aci 0 - 3 ), APM-user information field starts at octet 4 */
3522         if (aci16 > 3) {
3523                 /* Octet 4 Originating Address length */
3524                 octet = tvb_get_guint8(parameter_tvb,offset);
3525                 proto_tree_add_item( parameter_tree, hf_isup_orig_addr_len, parameter_tvb, offset, 1, FALSE );
3526                 offset++;
3527                 if ( octet != 0){
3528                         /* 4b */
3529                         proto_tree_add_item( parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, offset, 1, FALSE );
3530                         /* nature of address indicator */
3531                         offset++;
3532                         proto_tree_add_item( parameter_tree, hf_isup_inn_indicator, parameter_tvb, offset, 1, FALSE );
3533                         proto_tree_add_item( parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, offset, 1, FALSE );
3534                         offset++;
3535                         /* Address digits */
3536                         proto_tree_add_text(parameter_tree, parameter_tvb, offset, octet - 2, "Address digits");
3537                         offset = offset + octet - 2;
3538                 }
3539                 /* Octet 5 Destination Address length */
3540                 octet = tvb_get_guint8(parameter_tvb,offset);
3541                 proto_tree_add_item( parameter_tree, hf_isup_dest_addr_len, parameter_tvb, offset, 1, FALSE );
3542                 offset++;
3543                 if ( octet != 0){
3544                         /* 4b */
3545                         proto_tree_add_item( parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, offset, 1, FALSE );
3546                         /* nature of address indicator */
3547                         offset++;
3548                         proto_tree_add_item( parameter_tree, hf_isup_inn_indicator, parameter_tvb, offset, 1, FALSE );
3549                         proto_tree_add_item( parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, offset, 1, FALSE );
3550                         offset++;
3551                         /* Address digits */
3552                         proto_tree_add_text(parameter_tree, parameter_tvb, offset, octet - 2, "Address digits");
3553                         offset = offset + octet - 2;
3554                 }
3555         }
3556         /*
3557          * Defragment ?
3558          *
3559          */
3560         if (isup_apm_desegment){
3561                 if ((si_and_apm_seg_ind != 0xc0) && ((si_and_apm_seg_ind & H_8BIT_MASK)!=0x80)){
3562                         g_warning("got here Frame %u",pinfo->fd->num);
3563                         /* Segmented message */
3564                         save_fragmented = pinfo->fragmented;
3565                         pinfo->fragmented = TRUE;
3566                         more_frag = TRUE;
3567                         if ((si_and_apm_seg_ind == 0))
3568                                 more_frag = FALSE;
3569
3570                         frag_msg = fragment_add_seq_next(parameter_tvb, offset, pinfo,
3571                                         (apm_Segmentation_local_ref & 0x7f),                    /* ID for fragments belonging together */
3572                                         isup_apm_msg_fragment_table,                                    /* list of message fragments */
3573                                         isup_apm_msg_reassembled_table,                                 /* list of reassembled messages */
3574                                         tvb_length_remaining(parameter_tvb, offset),    /* fragment length - to the end */
3575                                         more_frag);                                                                             /* More fragments? */
3576
3577                         if ((si_and_apm_seg_ind & 0x3f) !=0 && (si_and_apm_seg_ind &0x40) !=0){
3578                                 /* First fragment set number of fragments */
3579                                 fragment_set_tot_len(pinfo, apm_Segmentation_local_ref & 0x7f, isup_apm_msg_fragment_table, (si_and_apm_seg_ind & 0x3f));
3580                         }
3581
3582                         new_tvb = process_reassembled_data(parameter_tvb, offset, pinfo,
3583                                 "Reassembled Message", frag_msg, &isup_apm_msg_frag_items,
3584                                 NULL, parameter_tree);
3585
3586                         if (frag_msg) { /* Reassembled */
3587                                 if (check_col(pinfo->cinfo, COL_INFO))
3588                                         col_append_str(pinfo->cinfo, COL_INFO,
3589                                         " (Message Reassembled)");
3590                         } else { /* Not last packet of reassembled Short Message */
3591                                 if (check_col(pinfo->cinfo, COL_INFO))
3592                                         col_append_str(pinfo->cinfo, COL_INFO,
3593                                         " (Message fragment )");
3594                         }
3595
3596                         pinfo->fragmented = save_fragmented;
3597                 }
3598         }/*isup_apm_desegment*/
3599
3600         if ( offset == (gint)length){
3601                 /* No data */
3602                 proto_tree_add_text(parameter_tree, parameter_tvb, offset, 0, "Empty APM-user information field"  );
3603                 return;
3604         }
3605         if (new_tvb) { /* take it all */
3606                 next_tvb = new_tvb;
3607         } else { /* make a new subset */
3608                 next_tvb = tvb_new_subset(parameter_tvb, offset, -1, -1);
3609         }
3610
3611         proto_tree_add_text(parameter_tree, parameter_tvb, offset, -1,
3612                 "APM-user information field (%u Bytes)",tvb_length_remaining(parameter_tvb, offset));
3613
3614         /* dissect BAT ASE element, without transparent data ( Q.765.5-200006) */
3615         if ((aci16 & 0x7fff) != 5) {
3616                 proto_tree_add_text(parameter_tree, parameter_tvb, offset, -1, "No further dissection of APM-user information field");
3617                 return;
3618         }
3619
3620         dissect_bat_ase_Encapsulated_Application_Information(next_tvb, pinfo, parameter_tree, 0);
3621 }
3622
3623
3624
3625 /* ------------------------------------------------------------------
3626   Dissector Parameter Optional Forward Call indicators
3627  */
3628 static void
3629 dissect_isup_optional_forward_call_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3630 {
3631   guint8 indicators;
3632
3633   indicators = tvb_get_guint8(parameter_tvb, 0);
3634   proto_tree_add_uint(parameter_tree, hf_isup_cug_call_ind, parameter_tvb, 0, OPTIONAL_FORWARD_CALL_IND_LENGTH, indicators);
3635   proto_tree_add_boolean(parameter_tree, hf_isup_simple_segmentation_ind, parameter_tvb, 0, OPTIONAL_FORWARD_CALL_IND_LENGTH, indicators);
3636   proto_tree_add_boolean(parameter_tree, hf_isup_connected_line_identity_request_ind, parameter_tvb, 0, OPTIONAL_FORWARD_CALL_IND_LENGTH, indicators);
3637
3638
3639   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 );
3640 }
3641 /* ------------------------------------------------------------------
3642   Dissector Parameter calling party number
3643  */
3644 void
3645 dissect_isup_calling_party_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3646 {
3647   proto_item *address_digits_item;
3648   proto_tree *address_digits_tree;
3649   guint8 indicators1, indicators2;
3650   guint8 address_digit_pair=0;
3651   gint offset=0;
3652   gint i=0;
3653   gint length;
3654   char calling_number[MAXDIGITS + 1]="";
3655   e164_info_t e164_info;
3656   gint number_plan;
3657
3658   indicators1 = tvb_get_guint8(parameter_tvb, 0);
3659   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
3660   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
3661   indicators2 = tvb_get_guint8(parameter_tvb, 1);
3662   number_plan = (indicators2 & 0x70)>> 4;
3663   proto_tree_add_boolean(parameter_tree, hf_isup_ni_indicator, parameter_tvb, 1, 1, indicators2);
3664   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
3665   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
3666   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator, parameter_tvb, 1, 1, indicators2);
3667   offset = 2;
3668
3669   length = tvb_length_remaining(parameter_tvb, offset);
3670   if (length > 0) {
3671     address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
3672                                               offset, -1,
3673                                               "Calling Party Number");
3674     address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
3675
3676     while(length > 0){
3677       address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
3678       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3679       calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
3680       if (i > MAXDIGITS)
3681         THROW(ReportedBoundsError);
3682       if ((length - 1) > 0 ){
3683         proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3684         calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3685         if (i > MAXDIGITS)
3686           THROW(ReportedBoundsError);
3687       }
3688       offset++;
3689       length = tvb_length_remaining(parameter_tvb, offset);
3690     }
3691
3692     if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
3693       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
3694       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3695       if (i > MAXDIGITS)
3696         THROW(ReportedBoundsError);
3697     }
3698     proto_item_set_text(address_digits_item, "Calling Party Number: %s", calling_number);
3699     calling_number[i++] = '\0';
3700     if ( number_plan == 1 ) {
3701       e164_info.e164_number_type = CALLING_PARTY_NUMBER;
3702       e164_info.nature_of_address = indicators1 & 0x7f;
3703       e164_info.E164_number_str = calling_number;
3704       e164_info.E164_number_length = i - 1;
3705       dissect_e164_number(parameter_tvb, address_digits_tree, 2, (offset - 2), e164_info);
3706       proto_tree_add_string_hidden(address_digits_tree, hf_isup_calling, parameter_tvb,
3707             offset - length, length, calling_number);
3708     } else {
3709       proto_tree_add_string(address_digits_tree, hf_isup_calling, parameter_tvb,
3710           offset - length, length, calling_number);
3711     }
3712   }
3713   proto_item_set_text(parameter_item, "Calling Party Number: %s", calling_number);
3714   tap_calling_number = ep_strdup(calling_number);
3715 }
3716 /* ------------------------------------------------------------------
3717   Dissector Parameter Original called  number
3718  */
3719 void
3720 dissect_isup_original_called_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3721 {
3722   proto_item *address_digits_item;
3723   proto_tree *address_digits_tree;
3724   guint8 indicators1, indicators2;
3725   guint8 address_digit_pair=0;
3726   gint offset=0;
3727   gint i=0;
3728   gint length;
3729   char calling_number[MAXDIGITS + 1]="";
3730
3731   indicators1 = tvb_get_guint8(parameter_tvb, 0);
3732   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
3733   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
3734   indicators2 = tvb_get_guint8(parameter_tvb, 1);
3735   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
3736   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
3737   offset = 2;
3738
3739   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
3740                                             offset, -1,
3741                                             "Original Called Number");
3742   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
3743
3744   length = tvb_length_remaining(parameter_tvb, offset);
3745   while(length > 0){
3746     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
3747     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3748     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
3749     if (i > MAXDIGITS)
3750       THROW(ReportedBoundsError);
3751     if ((length - 1) > 0 ){
3752       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3753       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3754       if (i > MAXDIGITS)
3755         THROW(ReportedBoundsError);
3756     }
3757     offset++;
3758     length = tvb_length_remaining(parameter_tvb, offset);
3759   }
3760
3761   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
3762       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
3763       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3764       if (i > MAXDIGITS)
3765         THROW(ReportedBoundsError);
3766   }
3767   calling_number[i++] = '\0';
3768
3769   proto_item_set_text(address_digits_item, "Original Called Number: %s", calling_number);
3770   proto_item_set_text(parameter_item, "Original Called Number: %s", calling_number);
3771
3772 }
3773 /* ------------------------------------------------------------------
3774   Dissector Parameter Redirecting number
3775  */
3776 void
3777 dissect_isup_redirecting_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3778 {
3779   proto_item *address_digits_item;
3780   proto_tree *address_digits_tree;
3781   guint8 indicators1, indicators2;
3782   guint8 address_digit_pair=0;
3783   gint offset=0;
3784   gint i=0;
3785   gint length;
3786   char calling_number[MAXDIGITS + 1]="";
3787
3788   indicators1 = tvb_get_guint8(parameter_tvb, 0);
3789   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
3790   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
3791   indicators2 = tvb_get_guint8(parameter_tvb, 1);
3792   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
3793   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
3794   offset = 2;
3795
3796   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
3797                                             offset, -1,
3798                                             "Redirecting Number");
3799   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
3800
3801   length = tvb_length_remaining(parameter_tvb, offset);
3802   while(length > 0){
3803     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
3804     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3805     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
3806     if (i > MAXDIGITS)
3807       THROW(ReportedBoundsError);
3808     if ((length - 1) > 0 ){
3809       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3810       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3811       if (i > MAXDIGITS)
3812         THROW(ReportedBoundsError);
3813     }
3814     offset++;
3815     length = tvb_length_remaining(parameter_tvb, offset);
3816   }
3817
3818   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
3819       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
3820       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3821       if (i > MAXDIGITS)
3822         THROW(ReportedBoundsError);
3823   }
3824   calling_number[i++] = '\0';
3825
3826   proto_item_set_text(address_digits_item, "Redirecting Number: %s", calling_number);
3827   proto_tree_add_string(address_digits_tree, hf_isup_redirecting, parameter_tvb, offset - length, length, calling_number);
3828   proto_item_set_text(parameter_item, "Redirecting Number: %s", calling_number);
3829 }
3830 /* ------------------------------------------------------------------
3831   Dissector Parameter Redirection number
3832  */
3833 static void
3834 dissect_isup_redirection_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3835 {
3836   proto_item *address_digits_item;
3837   proto_tree *address_digits_tree;
3838   guint8 indicators1, indicators2;
3839   guint8 address_digit_pair=0;
3840   gint offset=0;
3841   gint i=0;
3842   gint length;
3843   char called_number[MAXDIGITS + 1]="";
3844
3845   indicators1 = tvb_get_guint8(parameter_tvb, 0);
3846   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
3847   proto_tree_add_uint(parameter_tree, hf_isup_called_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
3848   indicators2 = tvb_get_guint8(parameter_tvb, 1);
3849   proto_tree_add_boolean(parameter_tree, hf_isup_inn_indicator, parameter_tvb, 1, 1, indicators2);
3850   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
3851   offset = 2;
3852
3853   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
3854                                             offset, -1,
3855                                             "Redirection Number");
3856   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
3857
3858   length = tvb_length_remaining(parameter_tvb, offset);
3859   while(length > 0){
3860     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
3861     proto_tree_add_uint(address_digits_tree, hf_isup_called_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3862     called_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
3863     if (i > MAXDIGITS)
3864       THROW(ReportedBoundsError);
3865     if ((length - 1) > 0 ){
3866       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
3867       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3868       if (i > MAXDIGITS)
3869         THROW(ReportedBoundsError);
3870     }
3871     offset++;
3872     length = tvb_length_remaining(parameter_tvb, offset);
3873   }
3874
3875   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
3876       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
3877       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
3878       if (i > MAXDIGITS)
3879         THROW(ReportedBoundsError);
3880   }
3881   called_number[i++] = '\0';
3882
3883   proto_item_set_text(address_digits_item, "Redirection Number: %s", called_number);
3884   proto_item_set_text(parameter_item, "Redirection Number: %s", called_number);
3885 }
3886 /* ------------------------------------------------------------------
3887   Dissector Parameter Connection request
3888  */
3889 static void
3890 dissect_isup_connection_request_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3891 {
3892   guint32 local_ref;
3893   guint16 spc;
3894   guint8 protocol_class, credit, offset=0;
3895
3896   local_ref = tvb_get_ntoh24(parameter_tvb, 0);
3897   proto_tree_add_text(parameter_tree, parameter_tvb, offset, LOCAL_REF_LENGTH, "Local Reference: %u", local_ref);
3898   offset = LOCAL_REF_LENGTH;
3899   spc = tvb_get_letohs(parameter_tvb,offset) & 0x3FFF; /*since 1st 2 bits spare */
3900   proto_tree_add_text(parameter_tree, parameter_tvb, offset, SPC_LENGTH, "Signalling Point Code: %u", spc);
3901   offset += SPC_LENGTH;
3902   protocol_class = tvb_get_guint8(parameter_tvb, offset);
3903   proto_tree_add_text(parameter_tree, parameter_tvb, offset, PROTOCOL_CLASS_LENGTH, "Protocol Class: %u", protocol_class);
3904   offset += PROTOCOL_CLASS_LENGTH;
3905   credit = tvb_get_guint8(parameter_tvb, offset);
3906   proto_tree_add_text(parameter_tree, parameter_tvb, offset, CREDIT_LENGTH, "Credit: %u", credit);
3907   offset += CREDIT_LENGTH;
3908
3909   proto_item_set_text(parameter_item, "Connection request: Local Reference = %u, SPC = %u, Protocol Class = %u, Credit = %u", local_ref, spc, protocol_class, credit);
3910 }
3911 /* ------------------------------------------------------------------
3912   Dissector Parameter Redirection information
3913  */
3914 void
3915 dissect_isup_redirection_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3916 {
3917   if (tvb_length(parameter_tvb) == 2){
3918     guint16 indicators;
3919     indicators = tvb_get_ntohs(parameter_tvb, 0);
3920     proto_tree_add_uint(parameter_tree, hf_isup_redirecting_ind, parameter_tvb,0 , REDIRECTION_INFO_LENGTH, indicators);
3921     proto_tree_add_uint(parameter_tree, hf_isup_original_redirection_reason, parameter_tvb,0 , REDIRECTION_INFO_LENGTH, indicators);
3922     proto_tree_add_uint(parameter_tree, hf_isup_redirection_counter, parameter_tvb,0 , REDIRECTION_INFO_LENGTH, indicators);
3923     proto_tree_add_uint(parameter_tree, hf_isup_redirection_reason, parameter_tvb,0 , REDIRECTION_INFO_LENGTH, indicators);
3924     proto_item_set_text(parameter_item, "Redirection Information");
3925   }
3926   else { /* ISUP'88 (blue book) */
3927     guint16 indicators;
3928     indicators = tvb_get_guint8(parameter_tvb, 0) * 0x100; /*since 2nd octet isn't present*/
3929     proto_tree_add_uint(parameter_tree, hf_isup_redirecting_ind, parameter_tvb, 0, 1, indicators);
3930     proto_tree_add_uint(parameter_tree, hf_isup_original_redirection_reason, parameter_tvb,0 , 1, indicators);
3931     proto_item_set_text(parameter_item, "Redirection Information (2nd octet not present since ISUP '88)");
3932   }
3933 }
3934 /* ------------------------------------------------------------------
3935   Dissector Parameter Closed user group interlock code
3936  */
3937 static void
3938 dissect_isup_closed_user_group_interlock_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3939 {
3940   char NI_digits[5]="";
3941   guint8 digit_pair;
3942   guint16 bin_code;
3943
3944   digit_pair = tvb_get_guint8(parameter_tvb, 0);
3945   NI_digits[0] = number_to_char((digit_pair & HGFE_8BIT_MASK) / 0x10);
3946   NI_digits[1] = number_to_char(digit_pair & DCBA_8BIT_MASK);
3947   digit_pair = tvb_get_guint8(parameter_tvb, 1);
3948   NI_digits[2] = number_to_char((digit_pair & HGFE_8BIT_MASK) / 0x10);
3949   NI_digits[3] = number_to_char(digit_pair & DCBA_8BIT_MASK);
3950   NI_digits[4] = '\0';
3951   proto_tree_add_text(parameter_tree, parameter_tvb, 0, 2, "Network Identity: %s", NI_digits);
3952   bin_code = tvb_get_ntohs(parameter_tvb, 2);
3953   proto_tree_add_text(parameter_tree, parameter_tvb, 3, 2, "Binary Code: 0x%x", bin_code);
3954   proto_item_set_text(parameter_item, "Closed user group interlock code: NI = %s, Binary code = 0x%x", NI_digits, bin_code);
3955 }
3956 /* ------------------------------------------------------------------
3957   Dissector Parameter User service information- no detailed dissection since defined in Rec. Q.931
3958  */
3959 static void
3960 dissect_isup_user_service_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3961 { guint length = tvb_length(parameter_tvb);
3962   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length,
3963           "User service information (-> Q.931 Bearer_capability)");
3964   proto_item_set_text(parameter_item, "User service information, (%u byte%s length)",
3965           length , plurality(length, "", "s"));
3966   dissect_q931_bearer_capability_ie(parameter_tvb,
3967                                             0, length,
3968                                             parameter_tree);
3969 }
3970 /* ------------------------------------------------------------------
3971   Dissector Parameter Signalling point code
3972  */
3973 static void
3974 dissect_isup_signalling_point_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3975 {
3976   guint16 spc;
3977
3978   spc = tvb_get_letohs(parameter_tvb, 0) & 0x3FFF; /*since 1st 2 bits spare */
3979   proto_tree_add_text(parameter_tree, parameter_tvb, 0, SIGNALLING_POINT_CODE_LENGTH, "Signalling Point Code: %u", spc);
3980
3981   proto_item_set_text(parameter_item, "Signalling point code: %u", spc);
3982 }
3983 /* ------------------------------------------------------------------
3984   Dissector Parameter Connected number
3985  */
3986 static void
3987 dissect_isup_connected_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
3988 {
3989   proto_item *address_digits_item;
3990   proto_tree *address_digits_tree;
3991   guint8 indicators1, indicators2;
3992   guint8 address_digit_pair=0;
3993   gint offset=0;
3994   gint i=0;
3995   gint length;
3996   char calling_number[MAXDIGITS + 1]="";
3997
3998   indicators1 = tvb_get_guint8(parameter_tvb, 0);
3999   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
4000   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
4001   indicators2 = tvb_get_guint8(parameter_tvb, 1);
4002   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
4003   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
4004   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator, parameter_tvb, 1, 1, indicators2);
4005   offset = 2;
4006
4007   length = tvb_length_remaining(parameter_tvb, offset);
4008   if (length == 0)
4009         return; /* empty connected number */
4010   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
4011                                             offset, -1,
4012                                             "Connected Number");
4013   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
4014
4015   while(length > 0){
4016     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
4017     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
4018     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
4019     if (i > MAXDIGITS)
4020       THROW(ReportedBoundsError);
4021     if ((length - 1) > 0 ){
4022       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
4023       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
4024       if (i > MAXDIGITS)
4025         THROW(ReportedBoundsError);
4026     }
4027     offset++;
4028     length = tvb_length_remaining(parameter_tvb, offset);
4029   }
4030
4031   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
4032       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
4033       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
4034       if (i > MAXDIGITS)
4035         THROW(ReportedBoundsError);
4036   }
4037   calling_number[i++] = '\0';
4038
4039   proto_item_set_text(address_digits_item, "Connected Number: %s", calling_number);
4040   proto_item_set_text(parameter_item, "Connected Number: %s", calling_number);
4041
4042 }
4043 /* ------------------------------------------------------------------
4044   Dissector Transit network selection
4045  */
4046 static void
4047 dissect_isup_transit_network_selection_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4048 {
4049   proto_item *address_digits_item;
4050   proto_tree *address_digits_tree;
4051   guint8 indicators;
4052   guint8 address_digit_pair=0;
4053   gint offset=0;
4054   gint i=0;
4055   gint length;
4056   char network_id[MAXDIGITS + 1]="";
4057
4058   indicators = tvb_get_guint8(parameter_tvb, 0);
4059   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators);
4060   proto_tree_add_uint(parameter_tree, hf_isup_type_of_network_identification, parameter_tvb, 0, 1, indicators);
4061   proto_tree_add_uint(parameter_tree, hf_isup_network_identification_plan, parameter_tvb, 0, 1, indicators);
4062   offset = 1;
4063
4064   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
4065                                             offset, -1,
4066                                             "Network identification");
4067   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
4068
4069   length = tvb_length_remaining(parameter_tvb, offset);
4070   while(length > 0){
4071     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
4072     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
4073     network_id[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
4074     if (i > MAXDIGITS)
4075       THROW(ReportedBoundsError);
4076     if ((length - 1) > 0 ){
4077       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
4078       network_id[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
4079       if (i > MAXDIGITS)
4080         THROW(ReportedBoundsError);
4081     }
4082     offset++;
4083     length = tvb_length_remaining(parameter_tvb, offset);
4084   }
4085
4086   if  (((indicators & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
4087       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
4088       network_id[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
4089       if (i > MAXDIGITS)
4090         THROW(ReportedBoundsError);
4091   }
4092   network_id[i++] = '\0';
4093
4094   proto_item_set_text(address_digits_item, "Network identification: %s", network_id);
4095   proto_item_set_text(parameter_item, "Transit network selection: %s", network_id);
4096
4097 }
4098 /* ------------------------------------------------------------------
4099   Dissector Parameter Circuit assignment map
4100  */
4101 static void
4102 dissect_isup_circuit_assignment_map_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4103 { guint8 map_type;
4104
4105   map_type = tvb_get_guint8(parameter_tvb, 0);
4106   proto_tree_add_uint(parameter_tree, hf_isup_map_type, parameter_tvb, 0, 1, map_type);
4107   proto_tree_add_text(parameter_tree, parameter_tvb, 1, 5, "Circuit assignment map (bit position indicates usage of corresponding circuit->3.69/Q.763)");
4108   proto_item_set_text(parameter_item, "Circuit assignment map");
4109 }
4110 /* ------------------------------------------------------------------
4111   Dissector Parameter Automatic congestion level
4112  */
4113 static void
4114 dissect_isup_automatic_congestion_level_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4115 { guint8 congestion_level;
4116
4117   congestion_level = tvb_get_guint8(parameter_tvb, 0);
4118   proto_tree_add_uint(parameter_tree, hf_isup_automatic_congestion_level, parameter_tvb, 0, AUTO_CONGEST_LEVEL_LENGTH, congestion_level);
4119   proto_item_set_text(parameter_item, "Automatic congestion level: %s (%u)", val_to_str(congestion_level, isup_auto_congestion_level_value, "spare"), congestion_level);
4120 }
4121 /* ------------------------------------------------------------------
4122   Dissector Parameter Optional backward Call indicators
4123  */
4124 static void
4125 dissect_isup_optional_backward_call_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4126 {
4127   guint8 indicators;
4128
4129   indicators = tvb_get_guint8(parameter_tvb, 0);
4130   proto_tree_add_boolean(parameter_tree, hf_isup_inband_information_ind, parameter_tvb, 0, OPTIONAL_BACKWARD_CALL_IND_LENGTH, indicators);
4131   proto_tree_add_boolean(parameter_tree, hf_isup_call_diversion_may_occur_ind, parameter_tvb, 0, OPTIONAL_BACKWARD_CALL_IND_LENGTH, indicators);
4132   proto_tree_add_boolean(parameter_tree, hf_isup_simple_segmentation_ind, parameter_tvb, 0, OPTIONAL_BACKWARD_CALL_IND_LENGTH, indicators);
4133   proto_tree_add_boolean(parameter_tree, hf_isup_mlpp_user_ind, parameter_tvb, 0, OPTIONAL_BACKWARD_CALL_IND_LENGTH, indicators);
4134
4135
4136   proto_item_set_text(parameter_item,"Optional backward call indicators: 0x%x", indicators );
4137 }
4138 /* ------------------------------------------------------------------
4139   Dissector Parameter User-to-user indicators
4140  */
4141 static const true_false_string isup_UUI_type_value = {
4142   "Response",
4143   "Request"
4144 };
4145 static const value_string isup_UUI_request_service_values[] = {
4146   { 0,  "No information"},
4147   { 1,  "Spare"},
4148   { 2,  "Request, not essential"},
4149   { 3,  "Request,essential"},
4150   { 0,  NULL}
4151 };
4152
4153 static const value_string isup_UUI_response_service_values[] = {
4154   { 0,  "No information"},
4155   { 1,  "Not provided"},
4156   { 2,  "Provided"},
4157   { 3,  "Spare"},
4158   { 0,  NULL}
4159 };
4160 static const true_false_string isup_UUI_network_discard_ind_value= {
4161   "User-to-user information discarded by the network",
4162   "No information"
4163 };
4164
4165 static void
4166 dissect_isup_user_to_user_indicators_parameter(tvbuff_t *parameter_tvb,
4167                                                                                            proto_tree *parameter_tree,
4168                                                                                            proto_item *parameter_item)
4169 {
4170   guint8 indicators;
4171
4172   indicators = tvb_get_guint8(parameter_tvb, 0);
4173   proto_tree_add_boolean(parameter_tree, hf_isup_UUI_type, parameter_tvb, 0, 1, indicators);
4174   if ( (indicators & 0x01) == 0 ){
4175           /* Request */
4176           proto_tree_add_uint(parameter_tree, hf_isup_UUI_req_service1, parameter_tvb, 0, 1, indicators);
4177           proto_tree_add_uint(parameter_tree, hf_isup_UUI_req_service2, parameter_tvb, 0, 1, indicators);
4178           proto_tree_add_uint(parameter_tree, hf_isup_UUI_req_service3, parameter_tvb, 0, 1, indicators);
4179   }
4180   else {
4181           /* Response */
4182           proto_tree_add_uint(parameter_tree, hf_isup_UUI_res_service1, parameter_tvb, 0, 1, indicators);
4183           proto_tree_add_uint(parameter_tree, hf_isup_UUI_res_service2, parameter_tvb, 0, 1, indicators);
4184           proto_tree_add_uint(parameter_tree, hf_isup_UUI_res_service3, parameter_tvb, 0, 1, indicators);
4185           proto_tree_add_boolean(parameter_tree, hf_isup_UUI_network_discard_ind, parameter_tvb, 0, 1, indicators);
4186
4187   }
4188   proto_item_set_text(parameter_item,"User-to-user indicators: 0x%x", indicators );
4189 }
4190 /* ------------------------------------------------------------------
4191   Dissector Parameter Original ISC point code
4192  */
4193 static void
4194 dissect_isup_original_isc_point_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4195 {
4196   guint16 spc;
4197
4198   spc = tvb_get_letohs(parameter_tvb, 0) & 0x3FFF; /*since 1st 2 bits spare */
4199   proto_tree_add_text(parameter_tree, parameter_tvb, 0, ORIGINAL_ISC_POINT_CODE_LENGTH, "Origination ISC Point Code: %u", spc);
4200
4201   proto_item_set_text(parameter_item, "Origination ISC point code: %u", spc);
4202 }
4203 /* ------------------------------------------------------------------
4204   Dissector Parameter Generic notification indicator
4205  */
4206 static void
4207 dissect_isup_generic_notification_indicator_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4208 {
4209   guint8 indicators;
4210
4211   indicators = tvb_get_guint8(parameter_tvb, 0);
4212   proto_tree_add_text(parameter_tree, parameter_tvb, 0, GENERIC_NOTIFICATION_IND_LENGTH, "Generic notification indicator: 0x%x (refer to 3.25/Q.763 for detailed decoding)", indicators );
4213   proto_item_set_text(parameter_item,"Generic notification indicator: 0x%x", indicators );
4214 }
4215 /* ------------------------------------------------------------------
4216   Dissector Parameter Call history information
4217  */
4218 static void
4219 dissect_isup_call_history_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4220 {
4221   guint16 info;
4222
4223   info = tvb_get_ntohs(parameter_tvb, 0);
4224   proto_tree_add_text(parameter_tree, parameter_tvb, 0, CALL_HISTORY_INFO_LENGTH, "Call history info: propagation delay = %u ms", info);
4225   proto_item_set_text(parameter_item,"Call history info: propagation delay = %u ms", info);
4226 }
4227 /* ------------------------------------------------------------------
4228   Dissector Parameter Access delivery information
4229  */
4230 static void
4231 dissect_isup_access_delivery_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4232 { guint8 indicator;
4233
4234   indicator = tvb_get_guint8(parameter_tvb, 0);
4235   proto_tree_add_boolean(parameter_tree, hf_isup_access_delivery_ind, parameter_tvb, 0, ACCESS_DELIVERY_INFO_LENGTH, indicator);
4236   proto_item_set_text(parameter_item, "Access delivery information: 0x%x", indicator);
4237 }
4238 /* ------------------------------------------------------------------
4239   Dissector Parameter Network specific facility
4240  */
4241 static void
4242 dissect_isup_network_specific_facility_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4243 { guint length = tvb_length(parameter_tvb);
4244   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Network specific facility (refer to 3.36/Q.763 for detailed decoding)");
4245   proto_item_set_text(parameter_item, "Network specific facility (%u byte%s length)", length , plurality(length, "", "s"));
4246 }
4247 /* ------------------------------------------------------------------
4248   Dissector Parameter User service information prime
4249  */
4250 static void
4251 dissect_isup_user_service_information_prime_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4252 { guint length = tvb_length(parameter_tvb);
4253   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length,
4254           "User service information prime (-> Q.931 Bearer capability information IE)");
4255   dissect_q931_bearer_capability_ie(parameter_tvb,
4256                                             0, length,
4257                                             parameter_tree);
4258
4259   proto_item_set_text(parameter_item, "User service information prime, (%u byte%s length)",
4260           length , plurality(length, "", "s"));
4261 }
4262 /* ------------------------------------------------------------------
4263   Dissector Parameter Propagation delay counter
4264  */
4265 static void
4266 dissect_isup_propagation_delay_counter_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4267 {
4268   guint16 info;
4269
4270   info = tvb_get_ntohs(parameter_tvb, 0);
4271   proto_tree_add_text(parameter_tree, parameter_tvb, 0, PROPAGATION_DELAY_COUNT_LENGTH, "Propagation delay counter = %u ms", info);
4272   proto_item_set_text(parameter_item,"Propagation delay counter = %u ms", info);
4273 }
4274 /* ------------------------------------------------------------------
4275   Dissector Parameter Remote operations
4276  */
4277 static void
4278 dissect_isup_remote_operations_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4279 { guint length = tvb_length(parameter_tvb);
4280   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Remote operations");
4281   proto_item_set_text(parameter_item, "Remote operations (%u byte%s length)", length , plurality(length, "", "s"));
4282 }
4283 /* ------------------------------------------------------------------
4284   Dissector Parameter Service activation
4285  */
4286 static void
4287 dissect_isup_service_activation_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4288 {
4289   guint i;
4290   guint8 feature_code;
4291   guint length = tvb_length(parameter_tvb);
4292   for (i=0; i< length; i++){
4293     feature_code = tvb_get_guint8(parameter_tvb, i);
4294     proto_tree_add_text(parameter_tree, parameter_tvb, i, 1, "Feature Code %u: %u", i+1, feature_code);
4295   }
4296   proto_item_set_text(parameter_item, "Service Activation (%u byte%s length)", length , plurality(length, "", "s"));
4297 }
4298 /* ------------------------------------------------------------------
4299   Dissector Parameter User service information prime - no detailed dissection since defined in Rec. Q.931
4300  */
4301 static void
4302 dissect_isup_user_teleservice_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4303 {
4304   guint length = tvb_length(parameter_tvb);
4305   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length,
4306           "User teleservice information (-> Q.931 High Layer Compatibility IE)");
4307
4308   dissect_q931_high_layer_compat_ie(parameter_tvb, 0, length, parameter_tree);
4309
4310   proto_item_set_text(parameter_item,
4311           "User teleservice information");
4312 }
4313 /* ------------------------------------------------------------------
4314   Dissector Parameter Transmission medium requirement used
4315  */
4316 static void
4317 dissect_isup_transmission_medium_used_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4318 {
4319   guint8 transmission_medium_requirement;
4320
4321   transmission_medium_requirement = tvb_get_guint8(parameter_tvb, 0);
4322   proto_tree_add_uint(parameter_tree, hf_isup_transmission_medium_requirement_prime, parameter_tvb, 0, TRANSMISSION_MEDIUM_RQMT_PRIME_LENGTH,transmission_medium_requirement);
4323
4324   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"));
4325 }
4326 /* ------------------------------------------------------------------
4327   Dissector Parameter Call diversion information
4328  */
4329 static void
4330 dissect_isup_call_diversion_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4331 { guint8 indicator;
4332
4333   indicator = tvb_get_guint8(parameter_tvb, 0);
4334   proto_tree_add_text(parameter_tree, parameter_tvb, 0, CALL_DIV_INFO_LENGTH, "Call diversion information: 0x%x (refer to 3.6/Q.763 for detailed decoding)", indicator);
4335   proto_item_set_text(parameter_item, "Call diversion information: 0x%x", indicator);
4336 }
4337 /* ------------------------------------------------------------------
4338   Dissector Parameter Echo control  information
4339  */
4340 static const value_string OECD_inf_ind_vals[] = {
4341         {0x00, "no information"},
4342         {0x01, "outgoing echo control device not included and not available"},
4343         {0x02, "outgoing echo control device included"},
4344         {0x03, "outgoing echo control device not included but available"},
4345         { 0,    NULL }
4346 };
4347 static const value_string IECD_inf_ind_vals[] = {
4348         {0x00, "no information"},
4349         {0x01, "incoming echo control device not included and not available"},
4350         {0x02, "incoming echo control device included"},
4351         {0x03, "incoming echo control device not included but available"},
4352         { 0,    NULL }
4353 };
4354
4355 static const value_string OECD_req_ind_vals[] = {
4356         {0x00, "no information"},
4357         {0x01, "outgoing echo control device activation request"},
4358         {0x02, "outgoing echo control device deactivation request"},
4359         {0x03, "spare"},
4360         { 0,    NULL }
4361 };
4362
4363 static const value_string IECD_req_ind_vals[] = {
4364         {0x00, "no information"},
4365         {0x01, "incoming echo control device activation request"},
4366         {0x02, "incoming echo control device deactivation request"},
4367         {0x03, "spare"},
4368         { 0,    NULL }
4369 };
4370
4371 static void
4372 dissect_isup_echo_control_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4373 { guint8 indicator;
4374   gint offset = 0;
4375   indicator = tvb_get_guint8(parameter_tvb, 0);
4376   proto_tree_add_text(parameter_tree, parameter_tvb, 0, ECHO_CONTROL_INFO_LENGTH,
4377           "Echo control information: 0x%x", indicator);
4378
4379   proto_tree_add_uint(parameter_tree, hf_isup_OECD_inf_ind,
4380                 parameter_tvb, offset, 1, indicator );
4381
4382   proto_tree_add_uint(parameter_tree, hf_isup_IECD_inf_ind,
4383                 parameter_tvb, offset, 1, indicator );
4384
4385   proto_tree_add_uint(parameter_tree, hf_isup_OECD_req_ind,
4386                 parameter_tvb, offset, 1, indicator );
4387
4388   proto_tree_add_uint(parameter_tree, hf_isup_IECD_req_ind,
4389                 parameter_tvb, offset, 1, indicator );
4390
4391   proto_item_set_text(parameter_item, "Echo control information: 0x%x", indicator);
4392 }
4393 /* ------------------------------------------------------------------
4394   Dissector Parameter Message compatibility information
4395  */
4396
4397 static const true_false_string isup_pass_on_not_possible_indicator_value = {
4398         "discard information",
4399         "release call",
4400 };
4401
4402 static void
4403 dissect_isup_message_compatibility_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4404 {
4405  guint length = tvb_length(parameter_tvb);
4406  guint instruction_indicators;
4407  gint offset = 0;
4408  instruction_indicators = tvb_get_guint8(parameter_tvb, offset);
4409
4410  proto_tree_add_text(parameter_tree, parameter_tvb, 0, length,
4411           "Message compatibility information");
4412
4413  proto_tree_add_boolean(parameter_tree, hf_isup_transit_at_intermediate_exchange_ind,
4414                 parameter_tvb, offset, 1, instruction_indicators );
4415
4416  proto_tree_add_boolean(parameter_tree, hf_isup_Release_call_ind,
4417          parameter_tvb, offset, 1, instruction_indicators );
4418
4419  proto_tree_add_boolean(parameter_tree, hf_isup_Send_notification_ind,
4420          parameter_tvb, offset, 1, instruction_indicators );
4421
4422  proto_tree_add_boolean(parameter_tree, hf_isup_Discard_message_ind_value,
4423          parameter_tvb, offset, 1, instruction_indicators );
4424
4425  proto_tree_add_boolean(parameter_tree, hf_isup_pass_on_not_possible_indicator2,
4426          parameter_tvb, offset, 1,instruction_indicators);
4427
4428  proto_tree_add_uint(parameter_tree, hf_isup_Broadband_narrowband_interworking_ind2,
4429          parameter_tvb, offset, 1,instruction_indicators);
4430
4431  proto_tree_add_boolean(parameter_tree, hf_isup_extension_ind ,
4432          parameter_tvb, offset, 1, instruction_indicators );
4433
4434   proto_item_set_text(parameter_item, "Message compatibility information (%u byte%s length)",
4435           length , plurality(length, "", "s"));
4436 }
4437 /* ------------------------------------------------------------------
4438   Dissector Parameter compatibility information
4439  */
4440 static const true_false_string isup_transit_at_intermediate_exchange_ind_value  = {
4441   "End node interpretation",
4442   "Transit interpretation"
4443 };
4444
4445
4446 static const true_false_string isup_Discard_message_ind_value = {
4447         "Discard message",
4448         "Do not discard message (pass on)",
4449 };
4450
4451 static const true_false_string isup_Discard_parameter_ind_value = {
4452         "Discard parameter",
4453         "Do not discard parameter (pass on)",
4454 };
4455
4456 static const value_string isup_Pass_on_not_possible_indicator_vals[] = {
4457         { 0x00, "Release call" },
4458         { 0x01, "Discard message" },
4459         { 0x02, "Discard parameter" },
4460         { 0x03, "Reserved (interpreted as 00)" },
4461         { 0, NULL },
4462 };
4463 static const value_string ISUP_Broadband_narrowband_interworking_indicator_vals[] = {
4464         { 0x00, "Pass on" },
4465         { 0x01, "Discard message" },
4466         { 0x02, "Release call" },
4467         { 0x03, "Discard parameter" },
4468         { 0, NULL },
4469 };
4470
4471 static void
4472 dissect_isup_parameter_compatibility_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4473 {
4474   guint  length = tvb_length(parameter_tvb);
4475   guint  len = length;
4476   guint8 upgraded_parameter, upgraded_parameter_no;
4477   guint8 offset;
4478   guint8 instruction_indicators;
4479   offset = 0;
4480   upgraded_parameter_no = 0;
4481
4482   proto_item_set_text(parameter_item, "Parameter compatibility information (%u byte%s length)", length , plurality(length, "", "s"));
4483 /* etxrab Decoded as per Q.763 section 3.41 */
4484
4485   while ( len > 0 ) {
4486   upgraded_parameter_no = upgraded_parameter_no + 1;
4487   upgraded_parameter = tvb_get_guint8(parameter_tvb, offset);
4488
4489   proto_tree_add_text(parameter_tree, parameter_tvb, offset, 1,
4490             "Upgraded parameter no: %u = %s", upgraded_parameter_no,
4491             val_to_str(upgraded_parameter, isup_parameter_type_value, "unknown (%u)"));
4492   offset += 1;
4493   len -= 1;
4494   instruction_indicators = tvb_get_guint8(parameter_tvb, offset);
4495
4496   proto_tree_add_text(parameter_tree, parameter_tvb, offset, 1,
4497                     "Instruction indicators: 0x%x ",
4498                     instruction_indicators);
4499
4500  proto_tree_add_boolean(parameter_tree, hf_isup_transit_at_intermediate_exchange_ind,
4501                 parameter_tvb, offset, 1, instruction_indicators );
4502
4503  proto_tree_add_boolean(parameter_tree, hf_isup_Release_call_ind, parameter_tvb, offset, 1, instruction_indicators );
4504
4505  proto_tree_add_boolean(parameter_tree, hf_isup_Send_notification_ind, parameter_tvb, offset, 1, instruction_indicators );
4506
4507  proto_tree_add_boolean(parameter_tree, hf_isup_Discard_message_ind_value, parameter_tvb, offset, 1, instruction_indicators );
4508
4509  proto_tree_add_boolean(parameter_tree, hf_isup_Discard_parameter_ind, parameter_tvb, offset, 1, instruction_indicators );
4510
4511  proto_tree_add_uint(parameter_tree, hf_isup_Pass_on_not_possible_indicator, parameter_tvb, offset, 1,instruction_indicators);
4512
4513  proto_tree_add_boolean(parameter_tree, hf_isup_extension_ind , parameter_tvb, offset, 1, instruction_indicators );
4514
4515   offset += 1;
4516   len -= 1;
4517   if (!(instruction_indicators & H_8BIT_MASK)) {
4518                 if (len == 0)
4519                         return;
4520                   instruction_indicators = tvb_get_guint8(parameter_tvb, offset);
4521                  proto_tree_add_uint(parameter_tree, hf_isup_Broadband_narrowband_interworking_ind, parameter_tvb, offset, 1,instruction_indicators);
4522                  offset += 1;
4523                   len -= 1;
4524                   }
4525    if (len == 0)
4526    return;
4527   ;
4528  }
4529 /* etxrab */
4530
4531 }
4532 /* ------------------------------------------------------------------
4533   Dissector Parameter MLPP precedence
4534  */
4535 static void
4536 dissect_isup_mlpp_precedence_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4537 {
4538   char NI_digits[5]="";
4539   guint8 indicators, digit_pair;
4540   guint32 bin_code;
4541
4542   indicators = tvb_get_guint8(parameter_tvb, 0);
4543   proto_tree_add_text(parameter_tree, parameter_tvb, 0, 1, "LFB (Bits 6+7) and precedence level (Bits 1-4): 0x%x",indicators);
4544   digit_pair = tvb_get_guint8(parameter_tvb, 1);
4545   NI_digits[0] = number_to_char((digit_pair & HGFE_8BIT_MASK) / 0x10);
4546   NI_digits[1] = number_to_char(digit_pair & DCBA_8BIT_MASK);
4547   digit_pair = tvb_get_guint8(parameter_tvb, 2);
4548   NI_digits[2] = number_to_char((digit_pair & HGFE_8BIT_MASK) / 0x10);
4549   NI_digits[3] = number_to_char(digit_pair & DCBA_8BIT_MASK);
4550   NI_digits[4] = '\0';
4551   proto_tree_add_text(parameter_tree, parameter_tvb, 1, 2, "Network Identity: %s", NI_digits);
4552   bin_code = tvb_get_ntoh24(parameter_tvb, 3);
4553   proto_tree_add_text(parameter_tree, parameter_tvb, 3, 3, "MLPP service domain: 0x%x", bin_code);
4554   proto_item_set_text(parameter_item, "MLPP precedence: NI = %s, MLPP service domain = 0x%x", NI_digits, bin_code);
4555 }
4556 /* ------------------------------------------------------------------
4557   Dissector Parameter MCID request indicators
4558  */
4559 static void
4560 dissect_isup_mcid_request_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4561 { guint8 indicator;
4562
4563   indicator = tvb_get_guint8(parameter_tvb, 0);
4564   proto_tree_add_text(parameter_tree, parameter_tvb, 0,MCID_REQUEST_IND_LENGTH, "MCID request indicators: 0x%x (MCID requested by Bit1=1, Holding requested by Bit2=1 see 3.31/Q.763)", indicator);
4565   proto_item_set_text(parameter_item, "MCID request indicators: 0x%x", indicator);
4566 }
4567 /* ------------------------------------------------------------------
4568   Dissector Parameter MCID response indicators
4569  */
4570 static void
4571 dissect_isup_mcid_response_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4572 { guint8 indicator;
4573
4574   indicator = tvb_get_guint8(parameter_tvb, 0);
4575   proto_tree_add_text(parameter_tree, parameter_tvb, 0,MCID_RESPONSE_IND_LENGTH, "MCID response indicators: 0x%x (MCID included if Bit1=1, Holding provided if Bit2=1 see 3.32/Q.763)", indicator);
4576   proto_item_set_text(parameter_item, "MCID response indicators: 0x%x", indicator);
4577 }
4578 /* ------------------------------------------------------------------
4579   Dissector Parameter Hop counter
4580  */
4581 static void
4582 dissect_isup_hop_counter_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4583 { guint8 counter;
4584
4585   counter = tvb_get_guint8(parameter_tvb, 0) & EDCBA_8BIT_MASK; /* since bits H,G and F are spare */
4586   proto_tree_add_text(parameter_tree, parameter_tvb, 0, HOP_COUNTER_LENGTH, "Hop counter: %u", counter);
4587   proto_item_set_text(parameter_item,  "Hop counter: %u", counter);
4588 }
4589 /* ------------------------------------------------------------------
4590   Dissector Parameter Originating line information
4591  */
4592 static void
4593 dissect_isup_orig_line_info_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4594 { guint8 info;
4595
4596   info = tvb_get_guint8(parameter_tvb, 0);
4597   proto_tree_add_text(parameter_tree, parameter_tvb, 0, ORIG_LINE_INFO_LENGTH, "Originating line info: %u", info);
4598   proto_item_set_text(parameter_item,  "Originating line info: %u (ANI II if < 51, reserved otherwise)", info);
4599 }
4600 /* ------------------------------------------------------------------
4601   Dissector Parameter Transmission medium requirement prime
4602  */
4603 static void
4604 dissect_isup_transmission_medium_requirement_prime_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4605 {
4606   guint8 transmission_medium_requirement;
4607
4608   transmission_medium_requirement = tvb_get_guint8(parameter_tvb, 0);
4609   proto_tree_add_uint(parameter_tree, hf_isup_transmission_medium_requirement_prime, parameter_tvb, 0, TRANSMISSION_MEDIUM_RQMT_PRIME_LENGTH,transmission_medium_requirement);
4610
4611   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"));
4612 }
4613
4614 /* ------------------------------------------------------------------
4615   Dissector Parameter location number
4616  */
4617 static void
4618 dissect_isup_location_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4619 {
4620   proto_item *address_digits_item;
4621   proto_tree *address_digits_tree;
4622   guint8 indicators1, indicators2;
4623   guint8 address_digit_pair=0;
4624   gint offset=0;
4625   gint i=0;
4626   gint length;
4627   char calling_number[MAXDIGITS + 1]="";
4628
4629   indicators1 = tvb_get_guint8(parameter_tvb, 0);
4630   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
4631   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
4632   indicators2 = tvb_get_guint8(parameter_tvb, 1);
4633   proto_tree_add_boolean(parameter_tree, hf_isup_inn_indicator, parameter_tvb, 1, 1, indicators2);
4634   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
4635   if ((indicators2 & GFE_8BIT_MASK) == 0x50)
4636     proto_tree_add_text(parameter_tree, parameter_tvb, 1, 1, "Different meaning for Location Number: Numbering plan indicator = private numbering plan");
4637   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
4638   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator, parameter_tvb, 1, 1, indicators2);
4639
4640    /* NOTE  When the address presentation restricted indicator indicates address not available, the
4641     * subfields in items a), b), c) and d) are coded with 0's, and the screening indicator is set to 11
4642     * (network provided).
4643         * BUG 938 - Just check if there is someting more to dissect.
4644     */
4645   if (tvb_length_remaining(parameter_tvb, offset) < 3){
4646     proto_tree_add_text(parameter_tree, parameter_tvb, 1, -1, "Location number: address not available");
4647     proto_item_set_text(parameter_item, "Location number: address not available");
4648     return;
4649   }
4650
4651   offset = 2;
4652
4653   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
4654                                             offset, -1,
4655                                             "Location number");
4656   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
4657
4658   length = tvb_length_remaining(parameter_tvb, offset);
4659   while(length > 0){
4660     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
4661     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
4662     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
4663     if (i > MAXDIGITS)
4664       THROW(ReportedBoundsError);
4665     if ((length - 1) > 0 ){
4666       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
4667       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
4668       if (i > MAXDIGITS)
4669         THROW(ReportedBoundsError);
4670     }
4671     offset++;
4672     length = tvb_length_remaining(parameter_tvb, offset);
4673   }
4674
4675   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
4676       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
4677       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
4678       if (i > MAXDIGITS)
4679         THROW(ReportedBoundsError);
4680   }
4681   calling_number[i++] = '\0';
4682
4683   proto_item_set_text(address_digits_item, "Location number: %s", calling_number);
4684   proto_item_set_text(parameter_item, "Location number: %s", calling_number);
4685
4686 }
4687 /* ------------------------------------------------------------------
4688   Dissector Parameter Redirection number restiriction
4689  */
4690 static void
4691 dissect_isup_redirection_number_restriction_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4692 {
4693   guint8 indicator;
4694
4695   indicator = tvb_get_guint8(parameter_tvb, 0);
4696   switch (indicator & BA_8BIT_MASK) {
4697   case 0:
4698     proto_tree_add_text(parameter_tree, parameter_tvb, 0, REDIRECTION_NUMBER_RESTRICTION_LENGTH, "Presentation indicator: Presentation allowed");
4699     break;
4700   case 1:
4701     proto_tree_add_text(parameter_tree, parameter_tvb, 0, REDIRECTION_NUMBER_RESTRICTION_LENGTH, "Presentation indicator: Presentation restricted");
4702     break;
4703   default:
4704     proto_tree_add_text(parameter_tree, parameter_tvb, 0, REDIRECTION_NUMBER_RESTRICTION_LENGTH, "Presentation indicator: spare");
4705     break;
4706   }
4707   proto_item_set_text(parameter_item, "Redirection number restriction: 0x%x ", indicator);
4708 }
4709 /* ------------------------------------------------------------------
4710   Dissector Parameter Call transfer identity
4711  */
4712 static void
4713 dissect_isup_call_transfer_reference_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4714 { guint8 id;
4715
4716   id = tvb_get_guint8(parameter_tvb, 0);
4717   proto_tree_add_text(parameter_tree, parameter_tvb, 0, CALL_TRANSFER_REF_LENGTH, "Call transfer identity: %u", id);
4718   proto_item_set_text(parameter_item,  "Call transfer reference: %u", id);
4719 }
4720 /* ------------------------------------------------------------------
4721   Dissector Parameter Loop prevention
4722  */
4723 static void
4724 dissect_isup_loop_prevention_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4725 {
4726   guint8 indicator;
4727
4728   indicator = tvb_get_guint8(parameter_tvb, 0);
4729   if ((indicator & A_8BIT_MASK)==0) {
4730     proto_tree_add_text(parameter_tree, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, "Type: Request");
4731     proto_item_set_text(parameter_item, "Loop prevention indicators: Request (%u)", indicator);
4732   }
4733   else {
4734     proto_tree_add_text(parameter_tree, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, "Type: Response");
4735     proto_tree_add_uint(parameter_tree, hf_isup_loop_prevention_response_ind, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, indicator);
4736     proto_item_set_text(parameter_item, "Loop prevention indicators: Response (%u)", indicator);
4737   }
4738 }
4739 /* ------------------------------------------------------------------
4740   Dissector Parameter Call transfer number
4741  */
4742 static void
4743 dissect_isup_call_transfer_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4744 {
4745   proto_item *address_digits_item;
4746   proto_tree *address_digits_tree;
4747   guint8 indicators1, indicators2;
4748   guint8 address_digit_pair=0;
4749   gint offset=0;
4750   gint i=0;
4751   gint length;
4752   char calling_number[MAXDIGITS + 1]="";
4753
4754   indicators1 = tvb_get_guint8(parameter_tvb, 0);
4755   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
4756   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
4757   indicators2 = tvb_get_guint8(parameter_tvb, 1);
4758   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
4759   if ((indicators2 & GFE_8BIT_MASK) == 0x50)
4760     proto_tree_add_text(parameter_tree, parameter_tvb, 1, 1, "Different meaning for Call Transfer Number: Numbering plan indicator = private numbering plan");
4761   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
4762   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator_enhanced, parameter_tvb, 1, 1, indicators2);
4763   offset = 2;
4764
4765   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
4766                                             offset, -1,
4767                                             "Call transfer number");
4768   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
4769
4770   length = tvb_length_remaining(parameter_tvb, offset);
4771   while(length > 0){
4772     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
4773     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
4774     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
4775     if (i > MAXDIGITS)
4776       THROW(ReportedBoundsError);
4777     if ((length - 1) > 0 ){
4778       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
4779       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
4780       if (i > MAXDIGITS)
4781         THROW(ReportedBoundsError);
4782     }
4783     offset++;
4784     length = tvb_length_remaining(parameter_tvb, offset);
4785   }
4786
4787   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
4788       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
4789       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
4790       if (i > MAXDIGITS)
4791         THROW(ReportedBoundsError);
4792   }
4793   calling_number[i++] = '\0';
4794
4795   proto_item_set_text(address_digits_item, "Call transfer number: %s", calling_number);
4796   proto_item_set_text(parameter_item, "Call transfer number: %s", calling_number);
4797
4798 }
4799 /* ------------------------------------------------------------------
4800   Dissector Parameter CCSS
4801  */
4802 static void
4803 dissect_isup_ccss_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4804 {
4805   guint8 indicator;
4806
4807   indicator = tvb_get_guint8(parameter_tvb, 0);
4808   if ((indicator & A_8BIT_MASK)==0) {
4809     proto_tree_add_text(parameter_tree, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, "CCSS call indicator: no indication");
4810     proto_item_set_text(parameter_item, "CCSS call indicator: no indication (%u)", indicator);
4811   }
4812   else {
4813     proto_tree_add_text(parameter_tree, parameter_tvb, 0, LOOP_PREVENTION_IND_LENGTH, "CCSS call indicator: CCSS call");
4814     proto_item_set_text(parameter_item, "CCSS call indicator: CCSS call (%u)", indicator);
4815   }
4816 }
4817 /* ------------------------------------------------------------------
4818  Parameter Forward GVNS
4819  */
4820 static void
4821 dissect_isup_forward_gvns_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4822 { guint length = tvb_length(parameter_tvb);
4823   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Forward GVNS (refer to 3.66/Q.763 for detailed decoding)");
4824   proto_item_set_text(parameter_item, "Forward GVNS (%u Byte%s)", length , plurality(length, "", "s"));
4825 }
4826 /* ------------------------------------------------------------------
4827  Parameter Redirect capability
4828  */
4829 static void
4830 dissect_isup_redirect_capability_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4831 { guint length = tvb_length(parameter_tvb);
4832   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Redirect capability (format is a national matter)");
4833   proto_item_set_text(parameter_item, "Redirect Capability (%u Byte%s)", length , plurality(length, "", "s"));
4834 }
4835 /* ------------------------------------------------------------------
4836   Dissector Parameter Backward GVNS
4837  */
4838 static void
4839 dissect_isup_backward_gvns_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4840 { guint8 indicator;
4841
4842   indicator = tvb_get_guint8(parameter_tvb, 0);
4843   proto_tree_add_text(parameter_tree, parameter_tvb, 0, BACKWARD_GVNS_LENGTH, "Backward GVNS: 0x%x (refer to 3.62/Q.763 for detailed decoding)", indicator);
4844   proto_item_set_text(parameter_item, "Backward GVNS: 0x%x", indicator);
4845 }
4846 /* ------------------------------------------------------------------
4847   Dissector Parameter Network management controls
4848  */
4849 static void
4850 dissect_isup_network_management_controls_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4851 { guint8 indicator;
4852
4853   indicator = tvb_get_guint8(parameter_tvb, 0);
4854   proto_tree_add_boolean(parameter_tree, hf_isup_temporary_alternative_routing_ind, parameter_tvb, 0,NETWORK_MANAGEMENT_CONTROLS_LENGTH, indicator);
4855   proto_tree_add_boolean(parameter_tree, hf_isup_extension_ind, parameter_tvb, 0,NETWORK_MANAGEMENT_CONTROLS_LENGTH, indicator);
4856   proto_item_set_text(parameter_item, "Network management controls: 0x%x", indicator);
4857 }
4858 /* ------------------------------------------------------------------
4859   Dissector Parameter Correlation id - no detailed dissection since defined in Rec. Q.1281
4860  */
4861 static void
4862 dissect_isup_correlation_id_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4863 { guint length = tvb_length(parameter_tvb);
4864   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Correlation ID (-> Q.1281)");
4865   proto_item_set_text(parameter_item, "Correlation ID, see Q.1281 (%u Byte%s)", length , plurality(length, "", "s"));
4866 }
4867 /* ------------------------------------------------------------------
4868   Dissector Parameter SCF id - no detailed dissection since defined in Rec. Q.1281
4869  */
4870 static void
4871 dissect_isup_scf_id_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4872 { guint length = tvb_length(parameter_tvb);
4873   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "SCF ID (-> Q.1281)");
4874   proto_item_set_text(parameter_item, "SCF ID, see Q.1281 (%u Byte%s)", length , plurality(length, "", "s"));
4875 }
4876 /* ------------------------------------------------------------------
4877   Dissector Parameter Call diversion treatment indicators
4878  */
4879 static void
4880 dissect_isup_call_diversion_treatment_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4881 { guint8 indicator;
4882
4883   indicator = tvb_get_guint8(parameter_tvb, 0);
4884   proto_tree_add_uint(parameter_tree, hf_isup_call_to_be_diverted_ind, parameter_tvb, 0,CALL_DIV_TREATMENT_IND_LENGTH, indicator);
4885   proto_tree_add_boolean(parameter_tree, hf_isup_extension_ind, parameter_tvb, 0, CALL_DIV_TREATMENT_IND_LENGTH, indicator);
4886   proto_item_set_text(parameter_item, "Call diversion treatment indicators: 0x%x", indicator);
4887 }
4888 /* ------------------------------------------------------------------
4889   Dissector Parameter called IN  number
4890  */
4891 static void
4892 dissect_isup_called_in_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4893 {
4894   proto_item *address_digits_item;
4895   proto_tree *address_digits_tree;
4896   guint8 indicators1, indicators2;
4897   guint8 address_digit_pair=0;
4898   gint offset=0;
4899   gint i=0;
4900   gint length;
4901   char calling_number[MAXDIGITS + 1]="";
4902
4903   indicators1 = tvb_get_guint8(parameter_tvb, 0);
4904   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
4905   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
4906   indicators2 = tvb_get_guint8(parameter_tvb, 1);
4907   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
4908   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 1, 1, indicators2);
4909   offset = 2;
4910
4911   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
4912                                             offset, -1,
4913                                             "Called IN Number");
4914   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
4915
4916   length = tvb_length_remaining(parameter_tvb, offset);
4917   while(length > 0){
4918     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
4919     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
4920     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
4921     if (i > MAXDIGITS)
4922       THROW(ReportedBoundsError);
4923     if ((length - 1) > 0 ){
4924       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
4925       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
4926       if (i > MAXDIGITS)
4927         THROW(ReportedBoundsError);
4928     }
4929     offset++;
4930     length = tvb_length_remaining(parameter_tvb, offset);
4931   }
4932
4933   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
4934       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
4935       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
4936       if (i > MAXDIGITS)
4937         THROW(ReportedBoundsError);
4938   }
4939   calling_number[i++] = '\0';
4940
4941   proto_item_set_text(address_digits_item, "Called IN Number: %s", calling_number);
4942   proto_item_set_text(parameter_item, "Called IN Number: %s", calling_number);
4943
4944 }
4945 /* ------------------------------------------------------------------
4946   Dissector Parameter Call offering treatment indicators
4947  */
4948 static void
4949 dissect_isup_call_offering_treatment_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4950 { guint8 indicator;
4951
4952   indicator = tvb_get_guint8(parameter_tvb, 0);
4953   proto_tree_add_uint(parameter_tree, hf_isup_call_to_be_offered_ind, parameter_tvb, 0,CALL_OFFERING_TREATMENT_IND_LENGTH, indicator);
4954   proto_tree_add_boolean(parameter_tree, hf_isup_extension_ind, parameter_tvb, 0, CALL_OFFERING_TREATMENT_IND_LENGTH, indicator);
4955   proto_item_set_text(parameter_item, "Call offering treatment indicators: 0x%x", indicator);
4956 }
4957 /* ------------------------------------------------------------------
4958  Parameter Charged party identification
4959  */
4960 static void
4961 dissect_isup_charged_party_identification_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4962 { guint length = tvb_length(parameter_tvb);
4963   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Charged party identification (format is national network specific)");
4964   proto_item_set_text(parameter_item, "Charged party identification (%u Byte%s)", length , plurality(length, "", "s"));
4965 }
4966 /* ------------------------------------------------------------------
4967   Dissector Parameter Conference treatment indicators
4968  */
4969 static void
4970 dissect_isup_conference_treatment_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4971 { guint8 indicator;
4972
4973   indicator = tvb_get_guint8(parameter_tvb, 0);
4974   proto_tree_add_uint(parameter_tree, hf_isup_conference_acceptance_ind, parameter_tvb, 0,CONFERENCE_TREATMENT_IND_LENGTH, indicator);
4975   proto_tree_add_boolean(parameter_tree, hf_isup_extension_ind, parameter_tvb, 0, CONFERENCE_TREATMENT_IND_LENGTH, indicator);
4976   proto_item_set_text(parameter_item, "Conference treatment indicators: 0x%x", indicator);
4977 }
4978 /* ------------------------------------------------------------------
4979   Dissector Parameter Display information
4980  * TODO Output Display info :
4981  * Quote from Q.931:
4982  * 4.5.16 Display
4983  * The purpose of the Display information element is to supply display information
4984  * that may be displayed by the user. The information contained in this element is coded
4985  * in IA5 characters.
4986  * 8 7 6 5 4 3 2 1   Octet
4987  * 0 0 1 0 1 0 0 0   1      Display information element identifier
4988  *                   2      Length of display contents
4989  * 0                 3      Display information (IA5 characters)
4990  * etc.
4991  * - end - quote -
4992  * Assuming octet 2 and onwards is pased here - just output text ?
4993  */
4994 static void
4995 dissect_isup_display_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
4996 { guint length = tvb_length(parameter_tvb);
4997   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length,
4998           "Display information (-> Q.931)");
4999   proto_item_set_text(parameter_item, "Display information (%u Byte%s)",
5000           length , plurality(length, "", "s"));
5001 }
5002 /* ------------------------------------------------------------------
5003  Parameter UID action indicators
5004  */
5005 static void
5006 dissect_isup_uid_action_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
5007 { guint8 indicator;
5008
5009   indicator = tvb_get_guint8(parameter_tvb, 0);
5010   proto_tree_add_text(parameter_tree, parameter_tvb, 0,UID_ACTION_IND_LENGTH, "UID action indicators: 0x%x (refer to 3.78/Q.763 for detailed decoding)", indicator);
5011   proto_item_set_text(parameter_item, "UID action indicators: 0x%x", indicator);
5012 }
5013 /* ------------------------------------------------------------------
5014  Parameter UID capability indicators
5015  */
5016 static void
5017 dissect_isup_uid_capability_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
5018 { guint8 indicator;
5019
5020   indicator = tvb_get_guint8(parameter_tvb, 0);
5021   proto_tree_add_text(parameter_tree, parameter_tvb, 0,UID_CAPABILITY_IND_LENGTH, "UID capability indicators: 0x%x (refer to 3.79/Q.763 for detailed decoding)", indicator);
5022   proto_item_set_text(parameter_item, "UID capability indicators: 0x%x", indicator);
5023 }
5024 /* ------------------------------------------------------------------
5025  Parameter Redirect counter
5026  */
5027 static void
5028 dissect_isup_redirect_counter_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
5029 { guint length = tvb_length(parameter_tvb);
5030   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Redirect counter (format is a national matter)");
5031   proto_item_set_text(parameter_item, "Redirect counter (%u Byte%s)", length , plurality(length, "", "s"));
5032 }
5033 /* ------------------------------------------------------------------
5034   Dissector Parameter Collect call request
5035  */
5036 static void
5037 dissect_isup_collect_call_request_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
5038 { guint8 indicator;
5039
5040   indicator = tvb_get_guint8(parameter_tvb, 0);
5041   if ((indicator & A_8BIT_MASK) == 0) {
5042     proto_tree_add_text(parameter_tree, parameter_tvb, 0, COLLECT_CALL_REQUEST_LENGTH, "Collect call request indicator: no indication");
5043     proto_item_set_text(parameter_item, "Collect call reqeust: no indication (0x%x)", indicator);
5044   }
5045   else {
5046     proto_tree_add_text(parameter_tree, parameter_tvb, 0, COLLECT_CALL_REQUEST_LENGTH, "Collect call request indicator: collect call requested");
5047     proto_item_set_text(parameter_item, "Collect call reqeust: collect call requested (0x%x)", indicator);
5048   }
5049 }
5050 /* ------------------------------------------------------------------
5051   Dissector Parameter Generic number
5052  */
5053 static void
5054 dissect_isup_generic_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
5055 {
5056   proto_item *address_digits_item;
5057   proto_tree *address_digits_tree;
5058   guint8 indicators1, indicators2, nr_qualifier_ind;
5059   guint8 address_digit_pair=0;
5060   gint offset=0;
5061   gint i=0;
5062   gint length;
5063   char calling_number[MAXDIGITS + 1]="";
5064
5065   nr_qualifier_ind = tvb_get_guint8(parameter_tvb, 0);
5066   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);
5067   indicators1 = tvb_get_guint8(parameter_tvb, 1);
5068   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 1, 1, indicators1);
5069   proto_tree_add_uint(parameter_tree, hf_isup_calling_party_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
5070   indicators2 = tvb_get_guint8(parameter_tvb, 2);
5071   proto_tree_add_boolean(parameter_tree, hf_isup_ni_indicator, parameter_tvb, 2, 1, indicators2);
5072   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 2, 1, indicators2);
5073   if ((indicators2 & GFE_8BIT_MASK) == 0x50)
5074     proto_tree_add_text(parameter_tree, parameter_tvb, 2, 1, "Different meaning for Generic Number: Numbering plan indicator = private numbering plan");
5075   proto_tree_add_uint(parameter_tree, hf_isup_address_presentation_restricted_indicator, parameter_tvb, 2, 1, indicators2);
5076   proto_tree_add_uint(parameter_tree, hf_isup_screening_indicator_enhanced, parameter_tvb, 2, 1, indicators2);
5077   offset = 3;
5078
5079   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
5080                                             offset, -1,
5081                                             "Generic number");
5082   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
5083
5084   length = tvb_length_remaining(parameter_tvb, offset);
5085   while(length > 0){
5086     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
5087     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
5088     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
5089     if (i > MAXDIGITS)
5090       THROW(ReportedBoundsError);
5091     if ((length - 1) > 0 ){
5092       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
5093       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
5094       if (i > MAXDIGITS)
5095         THROW(ReportedBoundsError);
5096     }
5097     offset++;
5098     length = tvb_length_remaining(parameter_tvb, offset);
5099   }
5100
5101   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
5102       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
5103       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
5104       if (i > MAXDIGITS)
5105         THROW(ReportedBoundsError);
5106   }
5107   calling_number[i++] = '\0';
5108
5109   proto_item_set_text(address_digits_item, "Generic number: %s", calling_number);
5110   proto_item_set_text(parameter_item, "Generic number: %s", calling_number);
5111
5112 }
5113 /* ------------------------------------------------------------------
5114   Dissector Parameter  Jurisdiction parameter
5115  */
5116 static void
5117 dissect_isup_jurisdiction_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
5118 {
5119   proto_item *address_digits_item;
5120   proto_tree *address_digits_tree;
5121   guint8 address_digit_pair=0;
5122   gint offset=0;
5123   gint i=0;
5124   gint length;
5125   char called_number[MAXDIGITS + 1]="";
5126
5127   offset = 0;
5128
5129   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
5130                                             offset, -1,
5131                                             "Jurisdiction");
5132   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
5133
5134   while((length = tvb_reported_length_remaining(parameter_tvb, offset)) > 0){
5135     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
5136     proto_tree_add_uint(address_digits_tree, hf_isup_called_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
5137     called_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
5138     if (i > MAXDIGITS)
5139       THROW(ReportedBoundsError);
5140     if ((length - 1) > 0 ){
5141       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
5142       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
5143       if (i > MAXDIGITS)
5144         THROW(ReportedBoundsError);
5145     }
5146     offset++;
5147   }
5148
5149   if (tvb_length(parameter_tvb) > 0){
5150       proto_tree_add_uint(address_digits_tree, hf_isup_called_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
5151       called_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
5152       if (i > MAXDIGITS)
5153         THROW(ReportedBoundsError);
5154   }
5155   called_number[i++] = '\0';
5156
5157   proto_item_set_text(address_digits_item, "Jurisdiction: %s", called_number);
5158   proto_item_set_text(parameter_item, "Jurisdiction: %s", called_number);
5159
5160 }/* ------------------------------------------------------------------
5161   Dissector Parameter Generic name
5162  */
5163 static void
5164 dissect_isup_generic_name_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
5165 {
5166   guint8 indicator;
5167   gint gen_name_length;
5168   char *gen_name=NULL;
5169
5170   gen_name=ep_alloc(MAXGNAME + 1);
5171   gen_name[0] = '\0';
5172   gen_name_length = tvb_length(parameter_tvb) - 1;
5173   indicator = tvb_get_guint8(parameter_tvb, 0);
5174   proto_tree_add_uint(parameter_tree, hf_isup_generic_name_presentation, parameter_tvb, 1, 1, indicator);
5175   proto_tree_add_boolean(parameter_tree, hf_isup_generic_name_availability, parameter_tvb, 1, 1, indicator);
5176   proto_tree_add_uint(parameter_tree, hf_isup_generic_name_type, parameter_tvb, 1, 1, indicator);
5177   gen_name = tvb_get_ephemeral_string(parameter_tvb,1,gen_name_length);
5178   gen_name[gen_name_length] = '\0';
5179   proto_tree_add_string(parameter_tree, hf_isup_generic_name_ia5, parameter_tvb, 2, gen_name_length, gen_name);
5180   proto_item_set_text(parameter_item, "Generic name: %s", gen_name);
5181
5182   }
5183
5184 /* ------------------------------------------------------------------
5185  Dissector Parameter Generic digits
5186  */
5187 static void
5188 dissect_isup_generic_digits_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
5189 { guint length = tvb_length(parameter_tvb);
5190   proto_tree_add_text(parameter_tree, parameter_tvb, 0, length, "Generic digits (refer to 3.24/Q.673 for detailed decoding)");
5191   proto_item_set_text(parameter_item, "Generic digits (%u Byte%s)", length , plurality(length, "", "s"));
5192 }
5193
5194 /* ------------------------------------------------------------------
5195   Dissector Parameter Charge number
5196  */
5197 void
5198 dissect_isup_charge_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item)
5199 {
5200   proto_item *address_digits_item;
5201   proto_tree *address_digits_tree;
5202   guint8 indicators1, indicators2;
5203   guint8 address_digit_pair=0;
5204   gint offset=0;
5205   gint i=0;
5206   gint length;
5207   char calling_number[MAXDIGITS + 1]="";
5208
5209   indicators1 = tvb_get_guint8(parameter_tvb, 0);
5210   proto_tree_add_boolean(parameter_tree, hf_isup_odd_even_indicator, parameter_tvb, 0, 1, indicators1);
5211   proto_tree_add_uint(parameter_tree, hf_isup_charge_number_nature_of_address_indicator, parameter_tvb, 0, 1, indicators1);
5212   indicators2 = tvb_get_guint8(parameter_tvb, 1);
5213   proto_tree_add_uint(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, 1, 1, indicators2);
5214   offset = 2;
5215
5216   address_digits_item = proto_tree_add_text(parameter_tree, parameter_tvb,
5217                                             offset, -1,
5218                                             "Charge Number");
5219   address_digits_tree = proto_item_add_subtree(address_digits_item, ett_isup_address_digits);
5220
5221   length = tvb_length_remaining(parameter_tvb, offset);
5222   while(length > 0){
5223     address_digit_pair = tvb_get_guint8(parameter_tvb, offset);
5224     proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_odd_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
5225     calling_number[i++] = number_to_char(address_digit_pair & ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK);
5226     if (i > MAXDIGITS)
5227       THROW(ReportedBoundsError);
5228     if ((length - 1) > 0 ){
5229       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset, 1, address_digit_pair);
5230       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
5231       if (i > MAXDIGITS)
5232         THROW(ReportedBoundsError);
5233     }
5234     offset++;
5235     length = tvb_length_remaining(parameter_tvb, offset);
5236   }
5237
5238   if  (((indicators1 & 0x80) == 0) && (tvb_length(parameter_tvb) > 0)){ /* Even Indicator set -> last even digit is valid & has be displayed */
5239       proto_tree_add_uint(address_digits_tree, hf_isup_calling_party_even_address_signal_digit, parameter_tvb, offset - 1, 1, address_digit_pair);
5240       calling_number[i++] = number_to_char((address_digit_pair & ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK) / 0x10);
5241       if (i > MAXDIGITS)
5242         THROW(ReportedBoundsError);
5243   }
5244   calling_number[i++] = '\0';
5245
5246   proto_item_set_text(address_digits_item, "Charge Number: %s", calling_number);
5247   proto_item_set_text(parameter_item, "Charge Number: %s", calling_number);
5248
5249 }
5250 /* ------------------------------------------------------------------ */
5251 static void
5252 dissect_isup_unknown_parameter(tvbuff_t *parameter_tvb, proto_item *parameter_item)
5253 { guint length = tvb_length(parameter_tvb);
5254   proto_item_set_text(parameter_item, "Parameter Type unknown/reserved (%u Byte%s)", length , plurality(length, "", "s"));
5255 }
5256 /* ------------------------------------------------------------------ */
5257
5258 /* ------------------------------------------------------------------
5259   Dissector all optional parameters
5260 */
5261 static void
5262 dissect_isup_optional_parameter(tvbuff_t *optional_parameters_tvb,packet_info *pinfo, proto_tree *isup_tree)
5263 { proto_item* parameter_item;
5264   proto_tree* parameter_tree;
5265   gint offset = 0;
5266   guint parameter_type, parameter_length, actual_length;
5267   tvbuff_t *parameter_tvb;
5268   guint8 octet;
5269
5270   /* Dissect all optional parameters while end of message isn't reached */
5271   parameter_type = 0xFF; /* Start-initializiation since parameter_type is used for while-condition */
5272
5273   while ((tvb_length_remaining(optional_parameters_tvb, offset)  >= 1) && (parameter_type != PARAM_TYPE_END_OF_OPT_PARAMS)){
5274     parameter_type = tvb_get_guint8(optional_parameters_tvb, offset);
5275
5276     if (parameter_type != PARAM_TYPE_END_OF_OPT_PARAMS){
5277       parameter_length = tvb_get_guint8(optional_parameters_tvb, offset + PARAMETER_TYPE_LENGTH);
5278
5279       parameter_item = proto_tree_add_text(isup_tree, optional_parameters_tvb,
5280                                            offset,
5281                                            parameter_length  + PARAMETER_TYPE_LENGTH + PARAMETER_LENGTH_IND_LENGTH,
5282                                            "Parameter: type %u",
5283                                            parameter_type);
5284       parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5285       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"));
5286       offset += PARAMETER_TYPE_LENGTH;
5287
5288           octet = tvb_get_guint8(optional_parameters_tvb,offset);
5289
5290       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);
5291       offset += PARAMETER_LENGTH_IND_LENGTH;
5292           if ( octet == 0 )
5293                   continue;
5294
5295       actual_length = tvb_length_remaining(optional_parameters_tvb, offset);
5296       if (actual_length > 0){
5297                   parameter_tvb = tvb_new_subset(optional_parameters_tvb, offset, MIN(parameter_length, actual_length), parameter_length);
5298                   switch (parameter_type) {
5299                         case PARAM_TYPE_CALL_REF:
5300                                 dissect_isup_call_reference_parameter(parameter_tvb, parameter_tree, parameter_item);
5301                                 break;
5302                         case PARAM_TYPE_TRANSM_MEDIUM_REQU:
5303                                 dissect_isup_transmission_medium_requirement_parameter(parameter_tvb, parameter_tree, parameter_item);
5304                                 break;
5305                         case PARAM_TYPE_ACC_TRANSP:
5306                                 dissect_isup_access_transport_parameter(parameter_tvb, parameter_tree, parameter_item, pinfo);
5307                                 break;
5308                         case PARAM_TYPE_CALLED_PARTY_NR:
5309                                 dissect_isup_called_party_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5310                                 break;
5311                         case PARAM_TYPE_SUBSQT_NR:
5312                                 dissect_isup_subsequent_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5313                                 break;
5314                         case PARAM_TYPE_NATURE_OF_CONN_IND:
5315                                 dissect_isup_nature_of_connection_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5316                                 break;
5317                         case PARAM_TYPE_FORW_CALL_IND:
5318                                 dissect_isup_forward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5319                                 break;
5320                         case PARAM_TYPE_OPT_FORW_CALL_IND:
5321                                 dissect_isup_optional_forward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5322                                 break;
5323                         case PARAM_TYPE_CALLING_PRTY_CATEG:
5324                                 dissect_isup_calling_partys_category_parameter(parameter_tvb, parameter_tree, parameter_item);
5325                                 break;
5326                         case PARAM_TYPE_CALLING_PARTY_NR:
5327                                 dissect_isup_calling_party_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5328                                 break;
5329                         case PARAM_TYPE_REDIRECTING_NR:
5330                                 dissect_isup_redirecting_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5331                                 break;
5332                         case PARAM_TYPE_REDIRECTION_NR:
5333                                 dissect_isup_redirection_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5334                                 break;
5335                         case PARAM_TYPE_CONNECTION_REQ:
5336                                 dissect_isup_connection_request_parameter(parameter_tvb, parameter_tree, parameter_item);
5337                                 break;
5338                         case PARAM_TYPE_INFO_REQ_IND:
5339                                 dissect_isup_information_request_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5340                                 break;
5341                         case PARAM_TYPE_INFO_IND:
5342                                 dissect_isup_information_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5343                                 break;
5344                         case PARAM_TYPE_CONTINUITY_IND:
5345                                 dissect_isup_continuity_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5346                                 break;
5347                         case PARAM_TYPE_BACKW_CALL_IND:
5348                                 dissect_isup_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5349                                 break;
5350                         case PARAM_TYPE_CAUSE_INDICATORS:
5351                                 dissect_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5352                                 break;
5353                         case PARAM_TYPE_REDIRECTION_INFO:
5354                                 dissect_isup_redirection_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5355                                 break;
5356                         case PARAM_TYPE_CIRC_GRP_SV_MSG_TYPE:
5357                                 dissect_isup_circuit_group_supervision_message_type_parameter(parameter_tvb, parameter_tree, parameter_item);
5358                                 break;
5359                         case PARAM_TYPE_RANGE_AND_STATUS:
5360                                 dissect_isup_range_and_status_parameter(parameter_tvb, parameter_tree, parameter_item);
5361                                 break;
5362                         case PARAM_TYPE_FACILITY_IND:
5363                                 dissect_isup_facility_ind_parameter(parameter_tvb, parameter_item);
5364                                 break;
5365                         case PARAM_TYPE_CLSD_USR_GRP_ILOCK_CD:
5366                                 dissect_isup_closed_user_group_interlock_code_parameter(parameter_tvb, parameter_tree, parameter_item);
5367                                 break;
5368                         case PARAM_TYPE_USER_SERVICE_INFO:
5369                                 dissect_isup_user_service_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5370                                 break;
5371                         case PARAM_TYPE_SIGNALLING_POINT_CODE:
5372                                 dissect_isup_signalling_point_code_parameter(parameter_tvb, parameter_tree, parameter_item);
5373                                 break;
5374                         case PARAM_TYPE_USER_TO_USER_INFO:
5375                                 dissect_isup_user_to_user_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5376                                 break;
5377                         case PARAM_TYPE_CONNECTED_NR:
5378                                 dissect_isup_connected_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5379                                 break;
5380                         case PARAM_TYPE_SUSP_RESUME_IND:
5381                                 dissect_isup_suspend_resume_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5382                                 break;
5383                         case PARAM_TYPE_TRANSIT_NETW_SELECT:
5384                                 dissect_isup_transit_network_selection_parameter(parameter_tvb, parameter_tree, parameter_item);
5385                                 break;
5386                         case PARAM_TYPE_EVENT_INFO:
5387                                 dissect_isup_event_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5388                                 break;
5389                         case PARAM_TYPE_CIRC_ASSIGN_MAP:
5390                                 dissect_isup_circuit_assignment_map_parameter(parameter_tvb, parameter_tree, parameter_item);
5391                                 break;
5392                         case PARAM_TYPE_CIRC_STATE_IND:
5393                                 dissect_isup_circuit_state_ind_parameter(parameter_tvb, parameter_tree, parameter_item);
5394                                 break;
5395                         case PARAM_TYPE_AUTO_CONG_LEVEL:
5396                                 dissect_isup_automatic_congestion_level_parameter(parameter_tvb, parameter_tree, parameter_item);
5397                                 break;
5398                         case PARAM_TYPE_ORIG_CALLED_NR:
5399                                 dissect_isup_original_called_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5400                                 break;
5401                         case PARAM_TYPE_OPT_BACKW_CALL_IND:
5402                                 dissect_isup_optional_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5403                                 break;
5404                         case PARAM_TYPE_USER_TO_USER_IND:
5405                                 dissect_isup_user_to_user_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5406                                 break;
5407                         case PARAM_TYPE_ORIG_ISC_POINT_CODE:
5408                                 dissect_isup_original_isc_point_code_parameter(parameter_tvb, parameter_tree, parameter_item);
5409                                 break;
5410                         case PARAM_TYPE_GENERIC_NOTIF_IND:
5411                                 dissect_isup_generic_notification_indicator_parameter(parameter_tvb, parameter_tree, parameter_item);
5412                                 break;
5413                         case PARAM_TYPE_CALL_HIST_INFO :
5414                                 dissect_isup_call_history_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5415                                 break;
5416                         case PARAM_TYPE_ACC_DELIV_INFO:
5417                                 dissect_isup_access_delivery_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5418                                 break;
5419                         case PARAM_TYPE_NETW_SPECIFIC_FACLTY:
5420                                 dissect_isup_network_specific_facility_parameter(parameter_tvb, parameter_tree, parameter_item);
5421                                 break;
5422                         case PARAM_TYPE_USER_SERVICE_INFO_PR:
5423                                 dissect_isup_user_service_information_prime_parameter(parameter_tvb, parameter_tree, parameter_item);
5424                                 break;
5425                         case PARAM_TYPE_PROPAG_DELAY_COUNTER:
5426                                 dissect_isup_propagation_delay_counter_parameter(parameter_tvb, parameter_tree, parameter_item);
5427                                 break;
5428                         case PARAM_TYPE_REMOTE_OPERATIONS:
5429                                 dissect_isup_remote_operations_parameter(parameter_tvb, parameter_tree, parameter_item);
5430                                 break;
5431                         case PARAM_TYPE_SERVICE_ACTIVATION:
5432                                 dissect_isup_service_activation_parameter(parameter_tvb, parameter_tree, parameter_item);
5433                                 break;
5434                         case PARAM_TYPE_USER_TELESERV_INFO:
5435                                 dissect_isup_user_teleservice_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5436                                 break;
5437                         case PARAM_TYPE_TRANSM_MEDIUM_USED:
5438                                 dissect_isup_transmission_medium_used_parameter(parameter_tvb, parameter_tree, parameter_item);
5439                                 break;
5440                         case PARAM_TYPE_CALL_DIV_INFO:
5441                                 dissect_isup_call_diversion_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5442                                 break;
5443                         case PARAM_TYPE_ECHO_CTRL_INFO:
5444                                 dissect_isup_echo_control_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5445                                 break;
5446                         case PARAM_TYPE_MSG_COMPAT_INFO:
5447                                 dissect_isup_message_compatibility_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5448                                 break;
5449                         case PARAM_TYPE_PARAM_COMPAT_INFO:
5450                                 dissect_isup_parameter_compatibility_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5451                                 break;
5452                         case PARAM_TYPE_MLPP_PRECEDENCE:
5453                                 dissect_isup_mlpp_precedence_parameter(parameter_tvb, parameter_tree, parameter_item);
5454                                 break;
5455                         case PARAM_TYPE_MCID_REQ_IND:
5456                                 dissect_isup_mcid_request_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5457                                 break;
5458                         case PARAM_TYPE_MCID_RSP_IND:
5459                                 dissect_isup_mcid_response_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5460                                 break;
5461                         case PARAM_TYPE_HOP_COUNTER:
5462                                 dissect_isup_hop_counter_parameter(parameter_tvb, parameter_tree, parameter_item);
5463                                 break;
5464                         case PARAM_TYPE_TRANSM_MEDIUM_RQUR_PR:
5465                                 dissect_isup_transmission_medium_requirement_prime_parameter(parameter_tvb, parameter_tree, parameter_item);
5466                                 break;
5467                         case PARAM_TYPE_LOCATION_NR:
5468                                 dissect_isup_location_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5469                                 break;
5470                         case PARAM_TYPE_REDIR_NR_RSTRCT:
5471                                 dissect_isup_redirection_number_restriction_parameter(parameter_tvb, parameter_tree, parameter_item);
5472                                 break;
5473                         case PARAM_TYPE_CALL_TRANS_REF:
5474                                 dissect_isup_call_transfer_reference_parameter(parameter_tvb, parameter_tree, parameter_item);
5475                                 break;
5476                         case PARAM_TYPE_LOOP_PREV_IND:
5477                                 dissect_isup_loop_prevention_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5478                                 break;
5479                         case PARAM_TYPE_CALL_TRANS_NR:
5480                                 dissect_isup_call_transfer_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5481                                 break;
5482                         case PARAM_TYPE_CCSS:
5483                                 dissect_isup_ccss_parameter(parameter_tvb, parameter_tree, parameter_item);
5484                                 break;
5485                         case PARAM_TYPE_FORW_GVNS:
5486                                 dissect_isup_forward_gvns_parameter(parameter_tvb, parameter_tree, parameter_item);
5487                                 break;
5488                         case PARAM_TYPE_BACKW_GVNS:
5489                                 dissect_isup_backward_gvns_parameter(parameter_tvb, parameter_tree, parameter_item);
5490                                 break;
5491                         case PARAM_TYPE_REDIRECT_CAPAB:
5492                                 dissect_isup_redirect_capability_parameter(parameter_tvb, parameter_tree, parameter_item);
5493                                 break;
5494                         case PARAM_TYPE_NETW_MGMT_CTRL:
5495                                 dissect_isup_network_management_controls_parameter(parameter_tvb, parameter_tree, parameter_item);
5496                                 break;
5497                         case PARAM_TYPE_CORRELATION_ID:
5498                                 dissect_isup_correlation_id_parameter(parameter_tvb, parameter_tree, parameter_item);
5499                                 break;
5500                         case PARAM_TYPE_SCF_ID:
5501                                 dissect_isup_scf_id_parameter(parameter_tvb, parameter_tree, parameter_item);
5502                                 break;
5503                         case PARAM_TYPE_CALL_DIV_TREAT_IND:
5504                                 dissect_isup_call_diversion_treatment_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5505                                 break;
5506                         case PARAM_TYPE_CALLED_IN_NR:
5507                                 dissect_isup_called_in_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5508                                 break;
5509                         case PARAM_TYPE_CALL_OFF_TREAT_IND:
5510                                 dissect_isup_call_offering_treatment_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5511                                 break;
5512                         case PARAM_TYPE_CHARGED_PARTY_IDENT:
5513                                 dissect_isup_charged_party_identification_parameter(parameter_tvb, parameter_tree, parameter_item);
5514                                 break;
5515                         case PARAM_TYPE_CONF_TREAT_IND:
5516                                 dissect_isup_conference_treatment_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5517                                 break;
5518                         case PARAM_TYPE_DISPLAY_INFO:
5519                                 dissect_isup_display_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5520                                 break;
5521                         case PARAM_TYPE_UID_ACTION_IND:
5522                                 dissect_isup_uid_action_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5523                                 break;
5524                         case PARAM_TYPE_UID_CAPAB_IND:
5525                                 dissect_isup_uid_capability_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5526                                 break;
5527                         case PARAM_TYPE_REDIRECT_COUNTER:
5528                                 dissect_isup_redirect_counter_parameter(parameter_tvb, parameter_tree, parameter_item);
5529                                 break;
5530                         case PARAM_TYPE_COLLECT_CALL_REQ:
5531                                 dissect_isup_collect_call_request_parameter(parameter_tvb, parameter_tree, parameter_item);
5532                                 break;
5533                         case PARAM_TYPE_GENERIC_NR:
5534                                 dissect_isup_generic_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5535                                 break;
5536                         case PARAM_TYPE_GENERIC_DIGITS:
5537                                 dissect_isup_generic_digits_parameter(parameter_tvb, parameter_tree, parameter_item);
5538                                 break;
5539                         case PARAM_TYPE_APPLICATON_TRANS:
5540                                 dissect_isup_application_transport_parameter(parameter_tvb, pinfo, parameter_tree, parameter_item);
5541                                 break;
5542
5543                         default:
5544                                 dissect_isup_unknown_parameter(parameter_tvb, parameter_item);
5545                                 break;
5546                         }
5547
5548
5549                         offset += MIN(parameter_length, actual_length);
5550                 }
5551
5552          }
5553     else {
5554                 /* End of optional parameters is reached */
5555                 proto_tree_add_uint_format(isup_tree, hf_isup_parameter_type, optional_parameters_tvb , offset, PARAMETER_TYPE_LENGTH, parameter_type, "End of optional parameters (%u)", parameter_type);
5556     }
5557   }
5558 }
5559
5560 /* ------------------------------------------------------------------
5561   Dissector all ANSI optional parameters
5562   TODO: Actullay make this dissect ANSI :) - It's still plain old ITU for now
5563 */
5564 static void
5565 dissect_ansi_isup_optional_parameter(tvbuff_t *optional_parameters_tvb,packet_info *pinfo, proto_tree *isup_tree)
5566 { proto_item* parameter_item;
5567   proto_tree* parameter_tree;
5568   gint offset = 0;
5569   guint parameter_type, parameter_length, actual_length;
5570   tvbuff_t *parameter_tvb;
5571   guint8 octet;
5572
5573   /* Dissect all optional parameters while end of message isn't reached */
5574   parameter_type = 0xFF; /* Start-initializiation since parameter_type is used for while-condition */
5575
5576   while ((tvb_length_remaining(optional_parameters_tvb, offset)  >= 1) && (parameter_type != PARAM_TYPE_END_OF_OPT_PARAMS)){
5577     parameter_type = tvb_get_guint8(optional_parameters_tvb, offset);
5578
5579     if (parameter_type != PARAM_TYPE_END_OF_OPT_PARAMS){
5580       parameter_length = tvb_get_guint8(optional_parameters_tvb, offset + PARAMETER_TYPE_LENGTH);
5581
5582       parameter_item = proto_tree_add_text(isup_tree, optional_parameters_tvb,
5583                                            offset,
5584                                            parameter_length  + PARAMETER_TYPE_LENGTH + PARAMETER_LENGTH_IND_LENGTH,
5585                                            "Parameter: type %u",
5586                                            parameter_type);
5587       parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5588       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, ansi_isup_parameter_type_value,"unknown"));
5589       offset += PARAMETER_TYPE_LENGTH;
5590
5591           octet = tvb_get_guint8(optional_parameters_tvb,offset);
5592
5593       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);
5594       offset += PARAMETER_LENGTH_IND_LENGTH;
5595           if ( octet == 0 )
5596                   continue;
5597
5598       actual_length = tvb_length_remaining(optional_parameters_tvb, offset);
5599       if (actual_length > 0){
5600                   parameter_tvb = tvb_new_subset(optional_parameters_tvb, offset, MIN(parameter_length, actual_length), parameter_length);
5601                   switch (parameter_type) {
5602                         case PARAM_TYPE_CALL_REF:
5603                                 dissect_isup_call_reference_parameter(parameter_tvb, parameter_tree, parameter_item);
5604                                 break;
5605                         case PARAM_TYPE_TRANSM_MEDIUM_REQU:
5606                                 dissect_isup_transmission_medium_requirement_parameter(parameter_tvb, parameter_tree, parameter_item);
5607                                 break;
5608                         case PARAM_TYPE_ACC_TRANSP:
5609                                 dissect_isup_access_transport_parameter(parameter_tvb, parameter_tree, parameter_item, pinfo);
5610                                 break;
5611                         case PARAM_TYPE_CALLED_PARTY_NR:
5612                                 dissect_isup_called_party_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5613                                 break;
5614                         case PARAM_TYPE_SUBSQT_NR:
5615                                 dissect_isup_subsequent_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5616                                 break;
5617                         case PARAM_TYPE_NATURE_OF_CONN_IND:
5618                                 dissect_isup_nature_of_connection_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5619                                 break;
5620                         case PARAM_TYPE_FORW_CALL_IND:
5621                                 dissect_isup_forward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5622                                 break;
5623                         case PARAM_TYPE_OPT_FORW_CALL_IND:
5624                                 dissect_isup_optional_forward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5625                                 break;
5626                         case PARAM_TYPE_CALLING_PRTY_CATEG:
5627                                 dissect_isup_calling_partys_category_parameter(parameter_tvb, parameter_tree, parameter_item);
5628                                 break;
5629                         case PARAM_TYPE_CALLING_PARTY_NR:
5630                                 dissect_isup_calling_party_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5631                                 break;
5632                         case PARAM_TYPE_REDIRECTING_NR:
5633                                 dissect_isup_redirecting_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5634                                 break;
5635                         case PARAM_TYPE_REDIRECTION_NR:
5636                                 dissect_isup_redirection_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5637                                 break;
5638                         case PARAM_TYPE_CONNECTION_REQ:
5639                                 dissect_isup_connection_request_parameter(parameter_tvb, parameter_tree, parameter_item);
5640                                 break;
5641                         case PARAM_TYPE_INFO_REQ_IND:
5642                                 dissect_isup_information_request_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5643                                 break;
5644                         case PARAM_TYPE_INFO_IND:
5645                                 dissect_isup_information_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5646                                 break;
5647                         case PARAM_TYPE_CONTINUITY_IND:
5648                                 dissect_isup_continuity_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5649                                 break;
5650                         case PARAM_TYPE_BACKW_CALL_IND:
5651                                 dissect_isup_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5652                                 break;
5653                         case PARAM_TYPE_CAUSE_INDICATORS:
5654                                 dissect_ansi_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5655                                 break;
5656                         case PARAM_TYPE_REDIRECTION_INFO:
5657                                 dissect_isup_redirection_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5658                                 break;
5659                         case PARAM_TYPE_CIRC_GRP_SV_MSG_TYPE:
5660                                 dissect_isup_circuit_group_supervision_message_type_parameter(parameter_tvb, parameter_tree, parameter_item);
5661                                 break;
5662                         case PARAM_TYPE_RANGE_AND_STATUS:
5663                                 dissect_isup_range_and_status_parameter(parameter_tvb, parameter_tree, parameter_item);
5664                                 break;
5665                         case PARAM_TYPE_FACILITY_IND:
5666                                 dissect_isup_facility_ind_parameter(parameter_tvb, parameter_item);
5667                                 break;
5668                         case PARAM_TYPE_CLSD_USR_GRP_ILOCK_CD:
5669                                 dissect_isup_closed_user_group_interlock_code_parameter(parameter_tvb, parameter_tree, parameter_item);
5670                                 break;
5671                         case PARAM_TYPE_USER_SERVICE_INFO:
5672                                 dissect_isup_user_service_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5673                                 break;
5674                         case PARAM_TYPE_SIGNALLING_POINT_CODE:
5675                                 dissect_isup_signalling_point_code_parameter(parameter_tvb, parameter_tree, parameter_item);
5676                                 break;
5677                         case PARAM_TYPE_USER_TO_USER_INFO:
5678                                 dissect_isup_user_to_user_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5679                                 break;
5680                         case PARAM_TYPE_CONNECTED_NR:
5681                                 dissect_isup_connected_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5682                                 break;
5683                         case PARAM_TYPE_SUSP_RESUME_IND:
5684                                 dissect_isup_suspend_resume_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5685                                 break;
5686                         case PARAM_TYPE_TRANSIT_NETW_SELECT:
5687                                 dissect_isup_transit_network_selection_parameter(parameter_tvb, parameter_tree, parameter_item);
5688                                 break;
5689                         case PARAM_TYPE_EVENT_INFO:
5690                                 dissect_isup_event_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5691                                 break;
5692                         case PARAM_TYPE_CIRC_ASSIGN_MAP:
5693                                 dissect_isup_circuit_assignment_map_parameter(parameter_tvb, parameter_tree, parameter_item);
5694                                 break;
5695                         case PARAM_TYPE_CIRC_STATE_IND:
5696                                 dissect_isup_circuit_state_ind_parameter(parameter_tvb, parameter_tree, parameter_item);
5697                                 break;
5698                         case PARAM_TYPE_AUTO_CONG_LEVEL:
5699                                 dissect_isup_automatic_congestion_level_parameter(parameter_tvb, parameter_tree, parameter_item);
5700                                 break;
5701                         case PARAM_TYPE_ORIG_CALLED_NR:
5702                                 dissect_isup_original_called_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5703                                 break;
5704                         case PARAM_TYPE_OPT_BACKW_CALL_IND:
5705                                 dissect_isup_optional_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5706                                 break;
5707                         case PARAM_TYPE_USER_TO_USER_IND:
5708                                 dissect_isup_user_to_user_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5709                                 break;
5710                         case PARAM_TYPE_ORIG_ISC_POINT_CODE:
5711                                 dissect_isup_original_isc_point_code_parameter(parameter_tvb, parameter_tree, parameter_item);
5712                                 break;
5713                         case PARAM_TYPE_GENERIC_NOTIF_IND:
5714                                 dissect_isup_generic_notification_indicator_parameter(parameter_tvb, parameter_tree, parameter_item);
5715                                 break;
5716                         case PARAM_TYPE_CALL_HIST_INFO :
5717                                 dissect_isup_call_history_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5718                                 break;
5719                         case PARAM_TYPE_ACC_DELIV_INFO:
5720                                 dissect_isup_access_delivery_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5721                                 break;
5722                         case PARAM_TYPE_NETW_SPECIFIC_FACLTY:
5723                                 dissect_isup_network_specific_facility_parameter(parameter_tvb, parameter_tree, parameter_item);
5724                                 break;
5725                         case PARAM_TYPE_USER_SERVICE_INFO_PR:
5726                                 dissect_isup_user_service_information_prime_parameter(parameter_tvb, parameter_tree, parameter_item);
5727                                 break;
5728                         case PARAM_TYPE_PROPAG_DELAY_COUNTER:
5729                                 dissect_isup_propagation_delay_counter_parameter(parameter_tvb, parameter_tree, parameter_item);
5730                                 break;
5731                         case PARAM_TYPE_REMOTE_OPERATIONS:
5732                                 dissect_isup_remote_operations_parameter(parameter_tvb, parameter_tree, parameter_item);
5733                                 break;
5734                         case PARAM_TYPE_SERVICE_ACTIVATION:
5735                                 dissect_isup_service_activation_parameter(parameter_tvb, parameter_tree, parameter_item);
5736                                 break;
5737                         case PARAM_TYPE_USER_TELESERV_INFO:
5738                                 dissect_isup_user_teleservice_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5739                                 break;
5740                         case PARAM_TYPE_TRANSM_MEDIUM_USED:
5741                                 dissect_isup_transmission_medium_used_parameter(parameter_tvb, parameter_tree, parameter_item);
5742                                 break;
5743                         case PARAM_TYPE_CALL_DIV_INFO:
5744                                 dissect_isup_call_diversion_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5745                                 break;
5746                         case PARAM_TYPE_ECHO_CTRL_INFO:
5747                                 dissect_isup_echo_control_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5748                                 break;
5749                         case PARAM_TYPE_MSG_COMPAT_INFO:
5750                                 dissect_isup_message_compatibility_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5751                                 break;
5752                         case PARAM_TYPE_PARAM_COMPAT_INFO:
5753                                 dissect_isup_parameter_compatibility_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5754                                 break;
5755                         case PARAM_TYPE_MLPP_PRECEDENCE:
5756                                 dissect_isup_mlpp_precedence_parameter(parameter_tvb, parameter_tree, parameter_item);
5757                                 break;
5758                         case PARAM_TYPE_MCID_REQ_IND:
5759                                 dissect_isup_mcid_request_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5760                                 break;
5761                         case PARAM_TYPE_MCID_RSP_IND:
5762                                 dissect_isup_mcid_response_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5763                                 break;
5764                         case PARAM_TYPE_HOP_COUNTER:
5765                                 dissect_isup_hop_counter_parameter(parameter_tvb, parameter_tree, parameter_item);
5766                                 break;
5767                         case PARAM_TYPE_ORIG_LINE_INFO:
5768                                 dissect_isup_orig_line_info_parameter(parameter_tvb, parameter_tree, parameter_item);
5769                                 break;
5770                         case PARAM_TYPE_TRANSM_MEDIUM_RQUR_PR:
5771                                 dissect_isup_transmission_medium_requirement_prime_parameter(parameter_tvb, parameter_tree, parameter_item);
5772                                 break;
5773                         case PARAM_TYPE_LOCATION_NR:
5774                                 dissect_isup_location_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5775                                 break;
5776                         case PARAM_TYPE_REDIR_NR_RSTRCT:
5777                                 dissect_isup_redirection_number_restriction_parameter(parameter_tvb, parameter_tree, parameter_item);
5778                                 break;
5779                         case PARAM_TYPE_CALL_TRANS_REF:
5780                                 dissect_isup_call_transfer_reference_parameter(parameter_tvb, parameter_tree, parameter_item);
5781                                 break;
5782                         case PARAM_TYPE_LOOP_PREV_IND:
5783                                 dissect_isup_loop_prevention_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5784                                 break;
5785                         case PARAM_TYPE_CALL_TRANS_NR:
5786                                 dissect_isup_call_transfer_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5787                                 break;
5788                         case PARAM_TYPE_CCSS:
5789                                 dissect_isup_ccss_parameter(parameter_tvb, parameter_tree, parameter_item);
5790                                 break;
5791                         case PARAM_TYPE_FORW_GVNS:
5792                                 dissect_isup_forward_gvns_parameter(parameter_tvb, parameter_tree, parameter_item);
5793                                 break;
5794                         case PARAM_TYPE_BACKW_GVNS:
5795                                 dissect_isup_backward_gvns_parameter(parameter_tvb, parameter_tree, parameter_item);
5796                                 break;
5797                         case PARAM_TYPE_REDIRECT_CAPAB:
5798                                 dissect_isup_redirect_capability_parameter(parameter_tvb, parameter_tree, parameter_item);
5799                                 break;
5800                         case PARAM_TYPE_NETW_MGMT_CTRL:
5801                                 dissect_isup_network_management_controls_parameter(parameter_tvb, parameter_tree, parameter_item);
5802                                 break;
5803                         case PARAM_TYPE_CORRELATION_ID:
5804                                 dissect_isup_correlation_id_parameter(parameter_tvb, parameter_tree, parameter_item);
5805                                 break;
5806                         case PARAM_TYPE_SCF_ID:
5807                                 dissect_isup_scf_id_parameter(parameter_tvb, parameter_tree, parameter_item);
5808                                 break;
5809                         case PARAM_TYPE_CALL_DIV_TREAT_IND:
5810                                 dissect_isup_call_diversion_treatment_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5811                                 break;
5812                         case PARAM_TYPE_CALLED_IN_NR:
5813                                 dissect_isup_called_in_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5814                                 break;
5815                         case PARAM_TYPE_CALL_OFF_TREAT_IND:
5816                                 dissect_isup_call_offering_treatment_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5817                                 break;
5818                         case PARAM_TYPE_CHARGED_PARTY_IDENT:
5819                                 dissect_isup_charged_party_identification_parameter(parameter_tvb, parameter_tree, parameter_item);
5820                                 break;
5821                         case PARAM_TYPE_CONF_TREAT_IND:
5822                                 dissect_isup_conference_treatment_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5823                                 break;
5824                         case PARAM_TYPE_DISPLAY_INFO:
5825                                 dissect_isup_display_information_parameter(parameter_tvb, parameter_tree, parameter_item);
5826                                 break;
5827                         case PARAM_TYPE_UID_ACTION_IND:
5828                                 dissect_isup_uid_action_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5829                                 break;
5830                         case PARAM_TYPE_UID_CAPAB_IND:
5831                                 dissect_isup_uid_capability_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5832                                 break;
5833                         case PARAM_TYPE_REDIRECT_COUNTER:
5834                                 dissect_isup_redirect_counter_parameter(parameter_tvb, parameter_tree, parameter_item);
5835                                 break;
5836                         case PARAM_TYPE_COLLECT_CALL_REQ:
5837                                 dissect_isup_collect_call_request_parameter(parameter_tvb, parameter_tree, parameter_item);
5838                                 break;
5839                         case PARAM_TYPE_GENERIC_NR:
5840                                 dissect_isup_generic_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5841                                 break;
5842                         case PARAM_TYPE_JURISDICTION:
5843                                 dissect_isup_jurisdiction_parameter(parameter_tvb, parameter_tree, parameter_item);
5844                                 break;
5845                         case PARAM_TYPE_GENERIC_NAME:
5846                                 dissect_isup_generic_name_parameter(parameter_tvb, parameter_tree, parameter_item);
5847                                 break;
5848                         case PARAM_TYPE_GENERIC_DIGITS:
5849                                 dissect_isup_generic_digits_parameter(parameter_tvb, parameter_tree, parameter_item);
5850                                 break;
5851                         case PARAM_TYPE_CHARGE_NR:
5852                                 dissect_isup_charge_number_parameter(parameter_tvb, parameter_tree, parameter_item);
5853                                 break;
5854                         case PARAM_TYPE_APPLICATON_TRANS:
5855                                 dissect_isup_application_transport_parameter(parameter_tvb, pinfo, parameter_tree, parameter_item);
5856                                 break;
5857
5858                         default:
5859                                 dissect_isup_unknown_parameter(parameter_tvb, parameter_item);
5860                                 break;
5861                         }
5862
5863
5864                         offset += MIN(parameter_length, actual_length);
5865                 }
5866
5867          }
5868     else {
5869                 /* End of optional parameters is reached */
5870                 proto_tree_add_uint_format(isup_tree, hf_isup_parameter_type, optional_parameters_tvb , offset, PARAMETER_TYPE_LENGTH, parameter_type, "End of optional parameters (%u)", parameter_type);
5871     }
5872   }
5873 }
5874 /* ------------------------------------------------------------------ */
5875 /* Dissectors for all used message types                              */
5876 /* Called by dissect_isup_message(),                                  */
5877 /* call parameter dissectors in order of mandatory parameters         */
5878 /* (since not labeled)                                                */
5879 /* ------------------------------------------------------------------
5880   Dissector Message Type Circuit Validation Test Response
5881  */
5882 static gint
5883 dissect_ansi_isup_circuit_validation_test_resp_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
5884 {
5885   proto_item* parameter_item;
5886   proto_tree* parameter_tree;
5887   tvbuff_t *parameter_tvb;
5888   gint offset = 0;
5889   gint parameter_type,actual_length;
5890
5891   /* Do stuff for first mandatory fixed parameter: CVR Repsonse Indicator */
5892   parameter_type = ANSI_ISUP_PARAM_TYPE_CVR_RESP_IND;
5893   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset, CVR_RESP_IND_LENGTH, "CVR Reponse Indicator");
5894
5895   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5896   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,"CVR Reponse Indicator"));
5897
5898   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5899
5900   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CVR_RESP_IND_LENGTH, actual_length), CVR_RESP_IND_LENGTH);
5901   dissect_isup_cvr_response_ind_parameter(parameter_tvb, parameter_tree, parameter_item);
5902   offset += CVR_RESP_IND_LENGTH;
5903
5904   /* Do stuff for second mandatory fixed parameter: CG Characterstics Indicator */
5905   parameter_type = ANSI_ISUP_PARAM_TYPE_CG_CHAR_IND;
5906   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
5907                                                                            CG_CHAR_IND_LENGTH,
5908                                                                        "Circuit Group Characterstics Indicators");
5909   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5910   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,"Circuit Group Characters"));
5911   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5912   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CG_CHAR_IND_LENGTH, actual_length), CG_CHAR_IND_LENGTH);
5913   dissect_isup_circuit_group_char_ind_parameter(parameter_tvb, parameter_tree, parameter_item);
5914   offset += CG_CHAR_IND_LENGTH;
5915
5916   return offset;
5917 }
5918 /* ------------------------------------------------------------------
5919   Dissector Message Type Circuit Reservation
5920  */
5921 static gint
5922 dissect_ansi_isup_circuit_reservation_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
5923 { proto_item* parameter_item;
5924   proto_tree* parameter_tree;
5925   tvbuff_t *parameter_tvb;
5926   gint offset = 0;
5927   gint parameter_type, actual_length;
5928
5929   /* Do stuff for mandatory fixed parameter: Nature of Connection Indicators */
5930   parameter_type = PARAM_TYPE_NATURE_OF_CONN_IND;
5931   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
5932                                        NATURE_OF_CONNECTION_IND_LENGTH,
5933                                        "Nature of Connection Indicators");
5934   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5935   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"));
5936   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5937   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(NATURE_OF_CONNECTION_IND_LENGTH, actual_length), NATURE_OF_CONNECTION_IND_LENGTH);
5938   dissect_isup_nature_of_connection_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5939   offset += NATURE_OF_CONNECTION_IND_LENGTH;
5940
5941   return offset;
5942 }
5943 /* ------------------------------------------------------------------
5944   Dissector Message Type Initial address message
5945  */
5946 static gint
5947 dissect_isup_initial_address_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
5948 { proto_item* parameter_item;
5949   proto_tree* parameter_tree;
5950   tvbuff_t *parameter_tvb;
5951   gint offset = 0;
5952   gint parameter_type, parameter_pointer, parameter_length, actual_length;
5953
5954   /* Do stuff for first mandatory fixed parameter: Nature of Connection Indicators */
5955   parameter_type = PARAM_TYPE_NATURE_OF_CONN_IND;
5956   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
5957                                        NATURE_OF_CONNECTION_IND_LENGTH,
5958                                        "Nature of Connection Indicators");
5959   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5960   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"));
5961   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5962   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(NATURE_OF_CONNECTION_IND_LENGTH, actual_length), NATURE_OF_CONNECTION_IND_LENGTH);
5963   dissect_isup_nature_of_connection_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5964   offset += NATURE_OF_CONNECTION_IND_LENGTH;
5965
5966   /* Do stuff for 2nd mandatory fixed parameter: Forward Call Indicators */
5967   parameter_type =  PARAM_TYPE_FORW_CALL_IND;
5968   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
5969                                        FORWARD_CALL_IND_LENGTH,
5970                                        "Forward Call Indicators");
5971   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5972   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"));
5973   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5974   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(FORWARD_CALL_IND_LENGTH, actual_length), FORWARD_CALL_IND_LENGTH );
5975   dissect_isup_forward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
5976   offset +=  FORWARD_CALL_IND_LENGTH;
5977
5978   /* Do stuff for 3nd mandatory fixed parameter: Calling party's category */
5979   parameter_type = PARAM_TYPE_CALLING_PRTY_CATEG;
5980   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
5981                                        CALLING_PRTYS_CATEGORY_LENGTH,
5982                                        "Calling Party's category");
5983   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5984   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"));
5985   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
5986   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CALLING_PRTYS_CATEGORY_LENGTH, actual_length),CALLING_PRTYS_CATEGORY_LENGTH );
5987   dissect_isup_calling_partys_category_parameter(parameter_tvb, parameter_tree, parameter_item);
5988   offset += CALLING_PRTYS_CATEGORY_LENGTH;
5989
5990   switch (isup_standard){
5991   case ITU_STANDARD:
5992     /* If ITU, do stuff for 4th mandatory fixed parameter: Transmission medium requirement */
5993     parameter_type = PARAM_TYPE_TRANSM_MEDIUM_REQU;
5994     parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
5995                                          TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH,
5996                                          "Transmission medium requirement");
5997     parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
5998     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"));
5999     actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6000     parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH, actual_length), TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH);
6001     dissect_isup_transmission_medium_requirement_parameter(parameter_tvb, parameter_tree, parameter_item);
6002     offset += TRANSMISSION_MEDIUM_REQUIREMENT_LENGTH;
6003     break;
6004   case ANSI_STANDARD:
6005     /* If ANSI, do stuff for the first mandatory variable parameter, USER_SERVICE_INFORMATION */
6006     parameter_type = PARAM_TYPE_USER_SERVICE_INFO;
6007     parameter_pointer = tvb_get_guint8(message_tvb, offset);
6008     parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
6009     parameter_item = proto_tree_add_text(isup_tree, message_tvb,
6010                                          offset +  parameter_pointer,
6011                                          parameter_length + PARAMETER_LENGTH_IND_LENGTH,
6012                                          "User Service Information");
6013     parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6014     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"));
6015     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);
6016     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);
6017     actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6018     parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
6019     dissect_isup_user_service_information_parameter(parameter_tvb, parameter_tree, parameter_item);
6020     offset += PARAMETER_POINTER_LENGTH;
6021     break;
6022   }
6023
6024   /* Do stuff for mandatory variable parameter Called party number */
6025   parameter_type = PARAM_TYPE_CALLED_PARTY_NR;
6026   parameter_pointer = tvb_get_guint8(message_tvb, offset);
6027   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
6028
6029   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
6030                                        offset +  parameter_pointer,
6031                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
6032                                        "Called Party Number");
6033   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6034   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"));
6035   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);
6036   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);
6037   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6038   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
6039   dissect_isup_called_party_number_parameter(parameter_tvb, parameter_tree, parameter_item);
6040   offset += PARAMETER_POINTER_LENGTH;
6041
6042   return offset;
6043 }
6044 /* ------------------------------------------------------------------
6045   Dissector Message Type subsequent address message
6046  */
6047 static gint dissect_isup_subsequent_address_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6048 { proto_item* parameter_item;
6049   proto_tree* parameter_tree;
6050   tvbuff_t *parameter_tvb;
6051   gint offset = 0;
6052   gint parameter_type, parameter_pointer, parameter_length, actual_length;
6053
6054   /* Do stuff for mandatory variable parameter Subsequent number */
6055   parameter_type = PARAM_TYPE_SUBSQT_NR;
6056
6057   parameter_pointer = tvb_get_guint8(message_tvb, offset);
6058   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
6059
6060   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
6061                                        offset +  parameter_pointer,
6062                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
6063                                        "Subsequent Number");
6064   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6065   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"));
6066   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);
6067   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);
6068   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6069   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
6070   dissect_isup_subsequent_number_parameter(parameter_tvb, parameter_tree, parameter_item);
6071   offset += PARAMETER_POINTER_LENGTH;
6072
6073   return offset;
6074 }
6075
6076 /* ------------------------------------------------------------------
6077   Dissector Message Type Information request message
6078  */
6079 static gint
6080 dissect_isup_information_request_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6081 { proto_item* parameter_item;
6082   proto_tree* parameter_tree;
6083   tvbuff_t *parameter_tvb;
6084   gint offset = 0;
6085   gint parameter_type, actual_length;
6086
6087   /* Do stuff for first mandatory fixed parameter: Information request indicators*/
6088   parameter_type = PARAM_TYPE_INFO_REQ_IND;
6089   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
6090                                        INFO_REQUEST_IND_LENGTH,
6091                                        "Information request indicators");
6092   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6093   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"));
6094   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6095   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(INFO_REQUEST_IND_LENGTH, actual_length), INFO_REQUEST_IND_LENGTH);
6096   dissect_isup_information_request_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
6097   offset += INFO_REQUEST_IND_LENGTH;
6098   return offset;
6099 }
6100 /* ------------------------------------------------------------------
6101   Dissector Message Type Information
6102  */
6103 static gint
6104 dissect_isup_information_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6105 { proto_item* parameter_item;
6106   proto_tree* parameter_tree;
6107   tvbuff_t *parameter_tvb;
6108   gint offset = 0;
6109   gint parameter_type, actual_length;
6110
6111   /* Do stuff for first mandatory fixed parameter: Information  indicators*/
6112   parameter_type = PARAM_TYPE_INFO_IND;
6113   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
6114                                        INFO_IND_LENGTH,
6115                                        "Information indicators");
6116   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6117   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"));
6118   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6119   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(INFO_IND_LENGTH, actual_length), INFO_IND_LENGTH);
6120   dissect_isup_information_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
6121   offset += INFO_IND_LENGTH;
6122   return offset;
6123 }
6124 /* ------------------------------------------------------------------
6125   Dissector Message Type Continuity
6126  */
6127 static gint
6128 dissect_isup_continuity_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6129 { proto_item* parameter_item;
6130   proto_tree* parameter_tree;
6131   tvbuff_t *parameter_tvb;
6132   gint offset = 0;
6133   gint parameter_type, actual_length;
6134
6135   /* Do stuff for first mandatory fixed parameter: Continuity indicators*/
6136   parameter_type = PARAM_TYPE_CONTINUITY_IND;
6137   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
6138                                        CONTINUITY_IND_LENGTH,
6139                                        "Continuity indicators");
6140   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6141   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"));
6142   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6143   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CONTINUITY_IND_LENGTH, actual_length), CONTINUITY_IND_LENGTH);
6144   dissect_isup_continuity_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
6145   offset += CONTINUITY_IND_LENGTH;
6146   return offset;
6147 }
6148 /* ------------------------------------------------------------------
6149   Dissector Message Type Address complete
6150  */
6151 static gint
6152 dissect_isup_address_complete_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6153 { proto_item* parameter_item;
6154   proto_tree* parameter_tree;
6155   tvbuff_t *parameter_tvb;
6156   gint offset = 0;
6157   gint parameter_type, actual_length;
6158
6159   /* Do stuff for first mandatory fixed parameter: backward call indicators*/
6160   parameter_type = PARAM_TYPE_BACKW_CALL_IND;
6161   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
6162                                        BACKWARD_CALL_IND_LENGTH,
6163                                        "Backward Call Indicators");
6164   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6165   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"));
6166   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6167   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(BACKWARD_CALL_IND_LENGTH, actual_length), BACKWARD_CALL_IND_LENGTH);
6168   dissect_isup_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
6169   offset += BACKWARD_CALL_IND_LENGTH;
6170   return offset;
6171 }
6172 /* ------------------------------------------------------------------
6173   Dissector Message Type Connect
6174  */
6175 static gint
6176 dissect_isup_connect_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6177 { proto_item* parameter_item;
6178   proto_tree* parameter_tree;
6179   tvbuff_t *parameter_tvb;
6180   gint offset = 0;
6181   gint parameter_type, actual_length;
6182
6183   /* Do stuff for first mandatory fixed parameter: backward call indicators*/
6184   parameter_type = PARAM_TYPE_BACKW_CALL_IND;
6185   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
6186                                        BACKWARD_CALL_IND_LENGTH,
6187                                        "Backward Call Indicators");
6188   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6189   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"));
6190   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6191   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(BACKWARD_CALL_IND_LENGTH, actual_length), BACKWARD_CALL_IND_LENGTH);
6192   dissect_isup_backward_call_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
6193   offset += BACKWARD_CALL_IND_LENGTH;
6194   return offset;
6195 }
6196 /* ------------------------------------------------------------------
6197   Dissector Message Type release message
6198  */
6199 static gint
6200 dissect_isup_release_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6201 { proto_item* parameter_item;
6202   proto_tree* parameter_tree;
6203   tvbuff_t *parameter_tvb;
6204   gint offset = 0;
6205   gint parameter_type, parameter_pointer, parameter_length, actual_length;
6206
6207   /* Do stuff for mandatory variable parameter Cause indicators */
6208   parameter_type =  PARAM_TYPE_CAUSE_INDICATORS;
6209
6210   parameter_pointer = tvb_get_guint8(message_tvb, offset);
6211   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
6212
6213   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
6214                                        offset +  parameter_pointer,
6215                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
6216                                        "Cause indicators");
6217   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6218   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"));
6219   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);
6220   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);
6221   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6222   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
6223   switch (isup_standard){
6224   case ITU_STANDARD:
6225           dissect_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
6226           break;
6227   case ANSI_STANDARD:
6228           dissect_ansi_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
6229           break;
6230   }
6231   offset += PARAMETER_POINTER_LENGTH;
6232
6233   return offset;
6234 }
6235 /* ------------------------------------------------------------------
6236   Dissector Message Type Resume/Suspend
6237  */
6238 static gint
6239 dissect_isup_suspend_resume_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6240 { proto_item* parameter_item;
6241   proto_tree* parameter_tree;
6242   tvbuff_t *parameter_tvb;
6243   gint offset = 0;
6244   gint parameter_type, actual_length;
6245
6246   /* Do stuff for first mandatory fixed parameter: backward call indicators*/
6247   parameter_type = PARAM_TYPE_SUSP_RESUME_IND;
6248   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
6249                                        SUSPEND_RESUME_IND_LENGTH,
6250                                        "Suspend/Resume indicator");
6251   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6252   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"));
6253   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6254   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(SUSPEND_RESUME_IND_LENGTH, actual_length), SUSPEND_RESUME_IND_LENGTH);
6255   dissect_isup_suspend_resume_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
6256   offset += SUSPEND_RESUME_IND_LENGTH;
6257   return offset;
6258 }
6259 /* ------------------------------------------------------------------
6260   Dissector Message Type Circuit group reset/query message
6261  */
6262 static gint
6263 dissect_isup_circuit_group_reset_query_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6264 { proto_item* parameter_item;
6265   proto_tree* parameter_tree;
6266   tvbuff_t *parameter_tvb;
6267   gint offset = 0;
6268   gint parameter_type, parameter_pointer, parameter_length, actual_length;
6269
6270   /* Do stuff for mandatory variable parameter range and status*/
6271   parameter_type =  PARAM_TYPE_RANGE_AND_STATUS;
6272
6273   parameter_pointer = tvb_get_guint8(message_tvb, offset);
6274   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
6275
6276   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
6277                                        offset +  parameter_pointer,
6278                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
6279                                        "Range and status");
6280   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6281   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"));
6282   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);
6283   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);
6284   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6285   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
6286   dissect_isup_range_and_status_parameter(parameter_tvb, parameter_tree, parameter_item);
6287   offset += PARAMETER_POINTER_LENGTH;
6288
6289   return offset;
6290 }
6291 /* ------------------------------------------------------------------
6292   Dissector Message Type Circuit group blocking/blocking ack/unblocking/unblocking ack messages
6293  */
6294 static gint
6295 dissect_isup_circuit_group_blocking_messages(tvbuff_t *message_tvb, proto_tree *isup_tree)
6296 { proto_item* parameter_item;
6297   proto_tree* parameter_tree;
6298   tvbuff_t *parameter_tvb;
6299   gint offset = 0;
6300   gint parameter_type, parameter_pointer, parameter_length, actual_length;
6301
6302    /* Do stuff for first mandatory fixed parameter: circuit group supervision message type*/
6303   parameter_type = PARAM_TYPE_CIRC_GRP_SV_MSG_TYPE;
6304   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
6305                                        CIRC_GRP_SV_MSG_TYPE_LENGTH,
6306                                        "Circuit group supervision message type");
6307   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6308   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"));
6309   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6310   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(CIRC_GRP_SV_MSG_TYPE_LENGTH, actual_length), CIRC_GRP_SV_MSG_TYPE_LENGTH);
6311   dissect_isup_circuit_group_supervision_message_type_parameter(parameter_tvb, parameter_tree, parameter_item);
6312   offset += CIRC_GRP_SV_MSG_TYPE_LENGTH;
6313
6314   /* Do stuff for mandatory variable parameter range and status*/
6315   parameter_type =  PARAM_TYPE_RANGE_AND_STATUS;
6316
6317   parameter_pointer = tvb_get_guint8(message_tvb, offset);
6318   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
6319
6320   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
6321                                        offset +  parameter_pointer,
6322                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
6323                                        "Range and status");
6324   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6325   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"));
6326   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);
6327   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);
6328   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6329   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
6330   dissect_isup_range_and_status_parameter(parameter_tvb, parameter_tree, parameter_item);
6331   offset += PARAMETER_POINTER_LENGTH;
6332
6333   return offset;
6334 }
6335
6336 /* ------------------------------------------------------------------
6337   Dissector Message Type Facility request/accepted
6338  */
6339 static gint
6340 dissect_isup_facility_request_accepted_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6341 { proto_item* parameter_item;
6342   proto_tree* parameter_tree;
6343   tvbuff_t *parameter_tvb;
6344   gint offset = 0;
6345   gint parameter_type, actual_length;
6346
6347   /* Do stuff for first mandatory fixed parameter: facility indicators*/
6348   parameter_type = PARAM_TYPE_FACILITY_IND;
6349   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
6350                                        FACILITY_IND_LENGTH,
6351                                        "Facility indicator");
6352   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6353   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"));
6354   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6355   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(FACILITY_IND_LENGTH, actual_length), FACILITY_IND_LENGTH);
6356   dissect_isup_facility_ind_parameter(parameter_tvb, parameter_item);
6357   offset += FACILITY_IND_LENGTH;
6358   return offset;
6359 }
6360 /* ------------------------------------------------------------------
6361   Dissector Message Type Facility reject
6362  */
6363 static gint
6364 dissect_isup_facility_reject_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6365 { proto_item* parameter_item;
6366   proto_tree* parameter_tree;
6367   tvbuff_t *parameter_tvb;
6368   gint offset = 0;
6369   gint parameter_type, parameter_pointer, parameter_length, actual_length;
6370
6371   /* Do stuff for first mandatory fixed parameter: facility indicators*/
6372   parameter_type = PARAM_TYPE_FACILITY_IND;
6373   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
6374                                        FACILITY_IND_LENGTH,
6375                                        "Facility indicator");
6376   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6377   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"));
6378   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6379   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(FACILITY_IND_LENGTH, actual_length), FACILITY_IND_LENGTH);
6380   dissect_isup_facility_ind_parameter(parameter_tvb, parameter_item);
6381   offset += FACILITY_IND_LENGTH;
6382
6383   /* Do stuff for mandatory variable parameter Cause indicators */
6384   parameter_type =  PARAM_TYPE_CAUSE_INDICATORS;
6385
6386   parameter_pointer = tvb_get_guint8(message_tvb, offset);
6387   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
6388
6389   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
6390                                        offset +  parameter_pointer,
6391                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
6392                                        "Cause indicators, see Q.850");
6393   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6394   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"));
6395   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);
6396   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);
6397   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6398   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
6399   switch (isup_standard){
6400   case ITU_STANDARD:
6401           dissect_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
6402           break;
6403   case ANSI_STANDARD:
6404           dissect_ansi_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
6405           break;
6406   }
6407   offset += PARAMETER_POINTER_LENGTH;
6408
6409   return offset;
6410 }
6411 /* ------------------------------------------------------------------
6412   Dissector Message Type Circuit group reset acknowledgement message
6413  */
6414 static gint
6415 dissect_isup_circuit_group_reset_acknowledgement_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6416 { proto_item* parameter_item;
6417   proto_tree* parameter_tree;
6418   tvbuff_t *parameter_tvb;
6419   gint offset = 0;
6420   gint parameter_type, parameter_pointer, parameter_length, actual_length;
6421
6422   /* Do stuff for mandatory variable parameter range and status*/
6423   parameter_type =  PARAM_TYPE_RANGE_AND_STATUS;
6424
6425   parameter_pointer = tvb_get_guint8(message_tvb, offset);
6426   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
6427
6428   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
6429                                        offset +  parameter_pointer,
6430                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
6431                                        "Range and status");
6432   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6433   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"));
6434   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);
6435   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);
6436   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6437   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
6438   dissect_isup_range_and_status_parameter(parameter_tvb, parameter_tree, parameter_item);
6439   offset += PARAMETER_POINTER_LENGTH;
6440
6441   return offset;
6442 }
6443 /* ------------------------------------------------------------------
6444   Dissector Message Type Circuit group query response message
6445  */
6446 static gint
6447 dissect_isup_circuit_group_query_response_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6448 { proto_item* parameter_item;
6449   proto_tree* parameter_tree;
6450   tvbuff_t *parameter_tvb;
6451   gint offset = 0;
6452   gint parameter_type, parameter_pointer, parameter_length, actual_length;
6453
6454   /* Do stuff for 1. mandatory variable parameter range and status*/
6455   parameter_type =  PARAM_TYPE_RANGE_AND_STATUS;
6456
6457   parameter_pointer = tvb_get_guint8(message_tvb, offset);
6458   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
6459
6460   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
6461                                        offset +  parameter_pointer,
6462                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
6463                                        "Range and status");
6464   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6465   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"));
6466   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);
6467   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);
6468   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6469   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
6470   dissect_isup_range_and_status_parameter(parameter_tvb, parameter_tree, parameter_item);
6471   offset += PARAMETER_POINTER_LENGTH;
6472
6473   /* Do stuff for 2. mandatory variable parameter Circuit state indicator*/
6474   parameter_type = PARAM_TYPE_CIRC_STATE_IND;
6475
6476   parameter_pointer = tvb_get_guint8(message_tvb, offset);
6477   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
6478
6479   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
6480                                        offset +  parameter_pointer,
6481                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
6482                                        "Circuit state indicator (national use)");
6483   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6484   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"));
6485   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);
6486   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);
6487   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6488   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
6489   dissect_isup_circuit_state_ind_parameter(parameter_tvb, parameter_tree, parameter_item);
6490   offset += PARAMETER_POINTER_LENGTH;
6491
6492   return offset;
6493 }
6494 /* ------------------------------------------------------------------
6495   Dissector Message Type Call Progress
6496 */
6497 static gint
6498 dissect_isup_call_progress_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6499 { proto_item* parameter_item;
6500   proto_tree* parameter_tree;
6501   tvbuff_t *parameter_tvb;
6502   gint offset = 0;
6503   gint parameter_type, actual_length;
6504
6505   /* Do stuff for first mandatory fixed parameter: Event information*/
6506   parameter_type = PARAM_TYPE_EVENT_INFO;
6507   parameter_item = proto_tree_add_text(isup_tree, message_tvb, offset,
6508                                        EVENT_INFO_LENGTH,
6509                                        "Event information");
6510   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6511   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"));
6512   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6513   parameter_tvb = tvb_new_subset(message_tvb, offset, MIN(EVENT_INFO_LENGTH, actual_length), EVENT_INFO_LENGTH);
6514   dissect_isup_event_information_parameter(parameter_tvb, parameter_tree, parameter_item);
6515   offset += EVENT_INFO_LENGTH;
6516   return offset;
6517 }
6518 /* ------------------------------------------------------------------
6519   Dissector Message Type User-to-User information
6520  */
6521 static gint
6522 dissect_isup_user_to_user_information_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6523 { proto_item* parameter_item;
6524   proto_tree* parameter_tree;
6525   tvbuff_t *parameter_tvb;
6526   gint offset = 0;
6527   gint parameter_type, parameter_pointer, parameter_length, actual_length;
6528
6529   /* Do stuff for mandatory variable parameter User-to-user information*/
6530   parameter_type =  PARAM_TYPE_USER_TO_USER_INFO;
6531
6532   parameter_pointer = tvb_get_guint8(message_tvb, offset);
6533   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
6534
6535   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
6536                                        offset +  parameter_pointer,
6537                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
6538                                        "User-to-user information, see Q.931");
6539   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6540   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"));
6541   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);
6542   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);
6543   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6544   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
6545   dissect_isup_user_to_user_information_parameter(parameter_tvb, parameter_tree, parameter_item);
6546   offset += PARAMETER_POINTER_LENGTH;
6547
6548   return offset;
6549 }
6550 /* ------------------------------------------------------------------
6551   Dissector Message Type Confusion
6552  */
6553 static gint
6554 dissect_isup_confusion_message(tvbuff_t *message_tvb, proto_tree *isup_tree)
6555 { proto_item* parameter_item;
6556   proto_tree* parameter_tree;
6557   tvbuff_t *parameter_tvb;
6558   gint offset = 0;
6559   gint parameter_type, parameter_pointer, parameter_length, actual_length;
6560
6561   /* Do stuff for mandatory variable parameter Cause indicators */
6562   parameter_type =  PARAM_TYPE_CAUSE_INDICATORS;
6563
6564   parameter_pointer = tvb_get_guint8(message_tvb, offset);
6565   parameter_length = tvb_get_guint8(message_tvb, offset + parameter_pointer);
6566
6567   parameter_item = proto_tree_add_text(isup_tree, message_tvb,
6568                                        offset +  parameter_pointer,
6569                                        parameter_length + PARAMETER_LENGTH_IND_LENGTH,
6570                                        "Cause indicators, see Q.850");
6571   parameter_tree = proto_item_add_subtree(parameter_item, ett_isup_parameter);
6572   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"));
6573   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);
6574   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);
6575   actual_length = tvb_ensure_length_remaining(message_tvb, offset);
6576   parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, MIN(parameter_length, actual_length), parameter_length );
6577
6578   switch (isup_standard){
6579   case ITU_STANDARD:
6580           dissect_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
6581           break;
6582   case ANSI_STANDARD:
6583           dissect_ansi_isup_cause_indicators_parameter(parameter_tvb, parameter_tree, parameter_item);
6584           break;
6585   }
6586   offset += PARAMETER_POINTER_LENGTH;
6587
6588   return offset;
6589 }
6590 /* ------------------------------------------------------------------ */
6591 static void
6592 dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup_tree)
6593 {
6594   static isup_tap_rec_t tap_rec;
6595   tvbuff_t *parameter_tvb;
6596   tvbuff_t *optional_parameter_tvb;
6597   proto_item* pass_along_item;
6598   proto_tree* pass_along_tree;
6599   gint offset, bufferlength;
6600   guint8 message_type, opt_parameter_pointer;
6601   gint opt_part_possible = FALSE; /* default setting - for message types allowing optional
6602                                      params explicitely set to TRUE in case statement */
6603   tap_calling_number = NULL;
6604   offset = 0;
6605
6606   /* Extract message type field */
6607   message_type = tvb_get_guint8(message_tvb,0);
6608
6609   switch (isup_standard){
6610   case ITU_STANDARD:
6611           proto_tree_add_uint_format(isup_tree, hf_isup_message_type, message_tvb, 0, MESSAGE_TYPE_LENGTH, message_type, "Message type: %s (%u)", val_to_str(message_type, isup_message_type_value, "reserved"), message_type);
6612           break;
6613   case ANSI_STANDARD:
6614           proto_tree_add_uint_format(isup_tree, hf_isup_message_type, message_tvb, 0, MESSAGE_TYPE_LENGTH, message_type, "Message type: %s (%u)", val_to_str(message_type, ansi_isup_message_type_value, "reserved"), message_type);
6615           break;
6616   }
6617    offset +=  MESSAGE_TYPE_LENGTH;
6618
6619    tap_rec.message_type = message_type;
6620    tap_rec.calling_number = NULL;
6621    tap_rec.called_number = NULL;
6622
6623    parameter_tvb = tvb_new_subset(message_tvb, offset, -1, -1);
6624
6625    /* distinguish between message types:*/
6626         switch (isup_standard){
6627                 case ITU_STANDARD:
6628                         switch (message_type) {
6629                         case MESSAGE_TYPE_INITIAL_ADDR:
6630                                 offset += dissect_isup_initial_address_message(parameter_tvb, isup_tree);
6631                                 opt_part_possible = TRUE;
6632                                 break;
6633                         case MESSAGE_TYPE_SUBSEQ_ADDR:
6634                                 offset += dissect_isup_subsequent_address_message(parameter_tvb, isup_tree);
6635                                 opt_part_possible = TRUE;
6636                                 break;
6637                         case MESSAGE_TYPE_INFO_REQ:
6638                                 offset += dissect_isup_information_request_message(parameter_tvb, isup_tree);
6639                                 opt_part_possible = TRUE;
6640                                 break;
6641                         case MESSAGE_TYPE_INFO:
6642                                 offset += dissect_isup_information_message(parameter_tvb, isup_tree);
6643                                 opt_part_possible = TRUE;
6644                                 break;
6645                         case MESSAGE_TYPE_CONTINUITY:
6646                                 offset += dissect_isup_continuity_message(parameter_tvb, isup_tree);
6647                                 break;
6648                         case MESSAGE_TYPE_ADDR_CMPL:
6649                                 offset += dissect_isup_address_complete_message(parameter_tvb, isup_tree);
6650                                 opt_part_possible = TRUE;
6651                                 break;
6652                         case MESSAGE_TYPE_CONNECT:
6653                                 offset += dissect_isup_connect_message(parameter_tvb, isup_tree);
6654                                 opt_part_possible = TRUE;
6655                                 break;
6656                         case MESSAGE_TYPE_FORW_TRANS:
6657                                 /* no dissector necessary since no mandatory parameters included */
6658                                 opt_part_possible = TRUE;
6659                                 break;
6660                         case MESSAGE_TYPE_ANSWER:
6661                                 /* no dissector necessary since no mandatory parameters included */
6662                                 opt_part_possible = TRUE;
6663                                 break;
6664                         case MESSAGE_TYPE_RELEASE:
6665                                 offset += dissect_isup_release_message(parameter_tvb, isup_tree);
6666                                 opt_part_possible = TRUE;
6667                                 break;
6668                         case MESSAGE_TYPE_SUSPEND:
6669                                 offset += dissect_isup_suspend_resume_message(parameter_tvb, isup_tree);
6670                                 opt_part_possible = TRUE;
6671                                 break;
6672                         case MESSAGE_TYPE_RESUME:
6673                                 offset += dissect_isup_suspend_resume_message(parameter_tvb, isup_tree);
6674                                 opt_part_possible = TRUE;
6675                                 break;
6676                         case MESSAGE_TYPE_REL_CMPL:
6677                                 /* no dissector necessary since no mandatory parameters included */
6678                                 opt_part_possible = TRUE;
6679                                 break;
6680                         case MESSAGE_TYPE_CONT_CHECK_REQ:
6681                                 /* no dissector necessary since no mandatory parameters included */
6682                                 break;
6683                         case MESSAGE_TYPE_RESET_CIRCUIT:
6684                                 /* no dissector necessary since no mandatory parameters included */
6685                                 break;
6686                         case MESSAGE_TYPE_BLOCKING:
6687                                 /* no dissector necessary since no mandatory parameters included */
6688                                 break;
6689                         case MESSAGE_TYPE_UNBLOCKING:
6690                                 /* no dissector necessary since no mandatory parameters included */
6691                                 break;
6692                         case MESSAGE_TYPE_BLOCK_ACK:
6693                                 /* no dissector necessary since no mandatory parameters included */
6694                                 break;
6695                         case MESSAGE_TYPE_UNBLOCK_ACK:
6696                                 /* no dissector necessary since no mandatory parameters included */
6697                                 break;
6698                         case MESSAGE_TYPE_CIRC_GRP_RST:
6699                                 offset += dissect_isup_circuit_group_reset_query_message(parameter_tvb, isup_tree);
6700                                 break;
6701                         case MESSAGE_TYPE_CIRC_GRP_BLCK:
6702                                 offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
6703                                 break;
6704                         case MESSAGE_TYPE_CIRC_GRP_UNBL:
6705                                 offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
6706                                 break;
6707                         case MESSAGE_TYPE_CIRC_GRP_BL_ACK:
6708                                 offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
6709                                 break;
6710                         case MESSAGE_TYPE_CIRC_GRP_UNBL_ACK:
6711                                 offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
6712                                 break;
6713                         case MESSAGE_TYPE_FACILITY_REQ:
6714                                 offset += dissect_isup_facility_request_accepted_message(parameter_tvb, isup_tree);
6715                                 opt_part_possible = TRUE;
6716                                 break;
6717                         case MESSAGE_TYPE_FACILITY_ACC:
6718                                 offset += dissect_isup_facility_request_accepted_message(parameter_tvb, isup_tree);
6719                                 opt_part_possible = TRUE;
6720                                 break;
6721                         case MESSAGE_TYPE_FACILITY_REJ:
6722                                 offset += dissect_isup_facility_reject_message(parameter_tvb, isup_tree);
6723                                 opt_part_possible = TRUE;
6724                                 break;
6725                         case MESSAGE_TYPE_LOOP_BACK_ACK:
6726                                 /* no dissector necessary since no mandatory parameters included */
6727                                 break;
6728                         case MESSAGE_TYPE_PASS_ALONG:
6729                                 /* call dissect_isup_message recursively */
6730                                 {       guint8 pa_message_type;
6731                                         pa_message_type = tvb_get_guint8(parameter_tvb, 0);
6732                                         pass_along_item = proto_tree_add_text(isup_tree, parameter_tvb, offset, -1, "Pass-along: %s Message (%u)", val_to_str(pa_message_type, isup_message_type_value_acro, "reserved"), pa_message_type);
6733                                         pass_along_tree = proto_item_add_subtree(pass_along_item, ett_isup_pass_along_message);
6734                                         dissect_isup_message(parameter_tvb, pinfo, pass_along_tree);
6735                                         break;
6736                                 }
6737                         case MESSAGE_TYPE_CIRC_GRP_RST_ACK:
6738                                 offset += dissect_isup_circuit_group_reset_acknowledgement_message(parameter_tvb, isup_tree);
6739                                 break;
6740                         case MESSAGE_TYPE_CIRC_GRP_QRY:
6741                                 offset += dissect_isup_circuit_group_reset_query_message(parameter_tvb, isup_tree);
6742                                 break;
6743                         case MESSAGE_TYPE_CIRC_GRP_QRY_RSP:
6744                                 offset += dissect_isup_circuit_group_query_response_message(parameter_tvb, isup_tree);
6745                                 break;
6746                         case MESSAGE_TYPE_CALL_PROGRSS:
6747                                 offset += dissect_isup_call_progress_message(parameter_tvb, isup_tree);
6748                                 opt_part_possible = TRUE;
6749                                 break;
6750                         case MESSAGE_TYPE_USER2USER_INFO:
6751                                 offset += dissect_isup_user_to_user_information_message(parameter_tvb, isup_tree);
6752                                 opt_part_possible = TRUE;
6753                                 break;
6754                         case MESSAGE_TYPE_UNEQUIPPED_CIC:
6755                                 /* no dissector necessary since no mandatory parameters included */
6756                                 break;
6757                         case MESSAGE_TYPE_CONFUSION:
6758                                 offset += dissect_isup_confusion_message(parameter_tvb, isup_tree);
6759                                 opt_part_possible = TRUE;
6760                                 break;
6761                         case MESSAGE_TYPE_OVERLOAD:
6762                                 /* no dissector necessary since no mandatory parameters included */
6763                                 break;
6764                         case MESSAGE_TYPE_CHARGE_INFO:
6765                                 /* do nothing since format is a national matter */
6766                                 bufferlength = tvb_length_remaining(message_tvb, offset);
6767                                 if (bufferlength != 0)
6768                                         proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Format is a national matter");
6769                                 break;
6770                         case MESSAGE_TYPE_NETW_RESRC_MGMT:
6771                                 /* no dissector necessary since no mandatory parameters included */
6772                                 opt_part_possible = TRUE;
6773                                 break;
6774                         case MESSAGE_TYPE_FACILITY:
6775                                 /* no dissector necessary since no mandatory parameters included */
6776                                 opt_part_possible = TRUE;
6777                                 break;
6778                         case MESSAGE_TYPE_USER_PART_TEST:
6779                                 /* no dissector necessary since no mandatory parameters included */
6780                                 opt_part_possible = TRUE;
6781                                 break;
6782                         case MESSAGE_TYPE_USER_PART_AVAIL:
6783                                 /* no dissector necessary since no mandatory parameters included */
6784                                 opt_part_possible = TRUE;
6785                                 break;
6786                         case MESSAGE_TYPE_IDENT_REQ:
6787                                 /* no dissector necessary since no mandatory parameters included */
6788                                 opt_part_possible = TRUE;
6789                                 break;
6790                         case MESSAGE_TYPE_IDENT_RSP:
6791                                 /* no dissector necessary since no mandatory parameters included */
6792                                 opt_part_possible = TRUE;
6793                                 break;
6794                         case MESSAGE_TYPE_SEGMENTATION:
6795                                 /* no dissector necessary since no mandatory parameters included */
6796                                 opt_part_possible = TRUE;
6797                                 break;
6798                         case MESSAGE_TYPE_LOOP_PREVENTION:
6799                                 /* no dissector necessary since no mandatory parameters included */
6800                                 opt_part_possible = TRUE;
6801                                 break;
6802                         case MESSAGE_TYPE_APPLICATION_TRANS:
6803                                 /* no dissector necessary since no mandatory parameters included */
6804                                 opt_part_possible = TRUE;
6805                                 break;
6806                         case MESSAGE_TYPE_PRE_RELEASE_INFO:
6807                                 /* no dissector necessary since no mandatory parameters included */
6808                                 opt_part_possible = TRUE;
6809                                 break;
6810                         case MESSAGE_TYPE_SUBSEQUENT_DIR_NUM:
6811                                 /* do nothing since format is a national matter */
6812                                 bufferlength = tvb_length_remaining(message_tvb, offset);
6813                                 if (bufferlength != 0)
6814                                         proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Format is a national matter");
6815                                 break;
6816                         default:
6817                                 bufferlength = tvb_length_remaining(message_tvb, offset);
6818                                 if (bufferlength != 0)
6819                                         proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Unknown Message type (possibly reserved/used in former ISUP version)");
6820                                 break;
6821                         }
6822                         break;
6823                 case ANSI_STANDARD:
6824                         /* TODO if neccessary make new "dissect_ansi_isup_xxx() routines or add branches in the current ones.
6825                          */
6826                         switch (message_type) {
6827                         case MESSAGE_TYPE_INITIAL_ADDR:
6828                                 offset += dissect_isup_initial_address_message(parameter_tvb, isup_tree);
6829                                 opt_part_possible = TRUE;
6830                                 break;
6831                         case MESSAGE_TYPE_SUBSEQ_ADDR:
6832                                 offset += dissect_isup_subsequent_address_message(parameter_tvb, isup_tree);
6833                                 opt_part_possible = TRUE;
6834                                 break;
6835                         case MESSAGE_TYPE_INFO_REQ:
6836                                 offset += dissect_isup_information_request_message(parameter_tvb, isup_tree);
6837                                 opt_part_possible = TRUE;
6838                                 break;
6839                         case MESSAGE_TYPE_INFO:
6840                                 offset += dissect_isup_information_message(parameter_tvb, isup_tree);
6841                                 opt_part_possible = TRUE;
6842                                 break;
6843                         case MESSAGE_TYPE_CONTINUITY:
6844                                 offset += dissect_isup_continuity_message(parameter_tvb, isup_tree);
6845                                 break;
6846                         case MESSAGE_TYPE_ADDR_CMPL:
6847                                 offset += dissect_isup_address_complete_message(parameter_tvb, isup_tree);
6848                                 opt_part_possible = TRUE;
6849                                 break;
6850                         case MESSAGE_TYPE_CONNECT:
6851                                 offset += dissect_isup_connect_message(parameter_tvb, isup_tree);
6852                                 opt_part_possible = TRUE;
6853                                 break;
6854                         case MESSAGE_TYPE_FORW_TRANS:
6855                                 /* no dissector necessary since no mandatory parameters included */
6856                                 opt_part_possible = TRUE;
6857                                 break;
6858                         case MESSAGE_TYPE_ANSWER:
6859                                 /* no dissector necessary since no mandatory parameters included */
6860                                 opt_part_possible = TRUE;
6861                                 break;
6862                         case MESSAGE_TYPE_RELEASE:
6863                                 offset += dissect_isup_release_message(parameter_tvb, isup_tree);
6864                                 opt_part_possible = TRUE;
6865                                 break;
6866                         case MESSAGE_TYPE_SUSPEND:
6867                                 offset += dissect_isup_suspend_resume_message(parameter_tvb, isup_tree);
6868                                 opt_part_possible = TRUE;
6869                                 break;
6870                         case MESSAGE_TYPE_RESUME:
6871                                 offset += dissect_isup_suspend_resume_message(parameter_tvb, isup_tree);
6872                                 opt_part_possible = TRUE;
6873                                 break;
6874                         case MESSAGE_TYPE_REL_CMPL:
6875                                 /* no dissector necessary since no mandatory parameters included */
6876                                 break;
6877                         case MESSAGE_TYPE_CONT_CHECK_REQ:
6878                                 /* no dissector necessary since no mandatory parameters included */
6879                                 break;
6880                         case MESSAGE_TYPE_RESET_CIRCUIT:
6881                                 /* no dissector necessary since no mandatory parameters included */
6882                                 break;
6883                         case MESSAGE_TYPE_BLOCKING:
6884                                 /* no dissector necessary since no mandatory parameters included */
6885                                 break;
6886                         case MESSAGE_TYPE_UNBLOCKING:
6887                                 /* no dissector necessary since no mandatory parameters included */
6888                                 break;
6889                         case MESSAGE_TYPE_BLOCK_ACK:
6890                                 /* no dissector necessary since no mandatory parameters included */
6891                                 break;
6892                         case MESSAGE_TYPE_UNBLOCK_ACK:
6893                                 /* no dissector necessary since no mandatory parameters included */
6894                                 break;
6895                         case MESSAGE_TYPE_CIRC_GRP_RST:
6896                                 offset += dissect_isup_circuit_group_reset_query_message(parameter_tvb, isup_tree);
6897                                 break;
6898                         case MESSAGE_TYPE_CIRC_GRP_BLCK:
6899                                 offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
6900                                 break;
6901                         case MESSAGE_TYPE_CIRC_GRP_UNBL:
6902                                 offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
6903                                 break;
6904                         case MESSAGE_TYPE_CIRC_GRP_BL_ACK:
6905                                 offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
6906                                 break;
6907                         case MESSAGE_TYPE_CIRC_GRP_UNBL_ACK:
6908                                 offset += dissect_isup_circuit_group_blocking_messages(parameter_tvb, isup_tree);
6909                                 break;
6910                         case MESSAGE_TYPE_FACILITY_REQ:
6911                                 offset += dissect_isup_facility_request_accepted_message(parameter_tvb, isup_tree);
6912                                 opt_part_possible = TRUE;
6913                                 break;
6914                         case MESSAGE_TYPE_FACILITY_ACC:
6915                                 offset += dissect_isup_facility_request_accepted_message(parameter_tvb, isup_tree);
6916                                 opt_part_possible = TRUE;
6917                                 break;
6918                         case MESSAGE_TYPE_FACILITY_REJ:
6919                                 offset += dissect_isup_facility_reject_message(parameter_tvb, isup_tree);
6920                                 opt_part_possible = TRUE;
6921                                 break;
6922                         case MESSAGE_TYPE_LOOP_BACK_ACK:
6923                                 /* no dissector necessary since no mandatory parameters included */
6924                                 break;
6925                         case MESSAGE_TYPE_PASS_ALONG:
6926                                 /* call dissect_isup_message recursively */
6927                                 {       guint8 pa_message_type;
6928                                         pa_message_type = tvb_get_guint8(parameter_tvb, 0);
6929                                         pass_along_item = proto_tree_add_text(isup_tree, parameter_tvb, offset, -1, "Pass-along: %s Message (%u)", val_to_str(pa_message_type, isup_message_type_value_acro, "reserved"), pa_message_type);
6930                                         pass_along_tree = proto_item_add_subtree(pass_along_item, ett_isup_pass_along_message);
6931                                         dissect_isup_message(parameter_tvb, pinfo, pass_along_tree);
6932                                         break;
6933                                 }
6934                         case MESSAGE_TYPE_CIRC_GRP_RST_ACK:
6935                                 offset += dissect_isup_circuit_group_reset_acknowledgement_message(parameter_tvb, isup_tree);
6936                                 break;
6937                         case MESSAGE_TYPE_CIRC_GRP_QRY:
6938                                 offset += dissect_isup_circuit_group_reset_query_message(parameter_tvb, isup_tree);
6939                                 break;
6940                         case MESSAGE_TYPE_CIRC_GRP_QRY_RSP:
6941                                 offset += dissect_isup_circuit_group_query_response_message(parameter_tvb, isup_tree);
6942                                 break;
6943                         case MESSAGE_TYPE_CALL_PROGRSS:
6944                                 offset += dissect_isup_call_progress_message(parameter_tvb, isup_tree);
6945                                 opt_part_possible = TRUE;
6946                                 break;
6947                         case MESSAGE_TYPE_USER2USER_INFO:
6948                                 offset += dissect_isup_user_to_user_information_message(parameter_tvb, isup_tree);
6949                                 opt_part_possible = TRUE;
6950                                 break;
6951                         case MESSAGE_TYPE_UNEQUIPPED_CIC:
6952                                 /* no dissector necessary since no mandatory parameters included */
6953                                 break;
6954                         case MESSAGE_TYPE_CONFUSION:
6955                                 offset += dissect_isup_confusion_message(parameter_tvb, isup_tree);
6956                                 opt_part_possible = TRUE;
6957                                 break;
6958                         case MESSAGE_TYPE_OVERLOAD:
6959                                 /* no dissector necessary since no mandatory parameters included */
6960                                 break;
6961                         case MESSAGE_TYPE_CHARGE_INFO:
6962                                 /* do nothing since format is a national matter */
6963                                 bufferlength = tvb_length_remaining(message_tvb, offset);
6964                                 if (bufferlength != 0)
6965                                         proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Format is a national matter");
6966                                 break;
6967                         case MESSAGE_TYPE_NETW_RESRC_MGMT:
6968                                 /* no dissector necessary since no mandatory parameters included */
6969                                 opt_part_possible = TRUE;
6970                                 break;
6971                         case MESSAGE_TYPE_FACILITY:
6972                                 /* no dissector necessary since no mandatory parameters included */
6973                                 opt_part_possible = TRUE;
6974                                 break;
6975                         case MESSAGE_TYPE_USER_PART_TEST:
6976                                 /* no dissector necessary since no mandatory parameters included */
6977                                 opt_part_possible = TRUE;
6978                                 break;
6979                         case MESSAGE_TYPE_USER_PART_AVAIL:
6980                                 /* no dissector necessary since no mandatory parameters included */
6981                                 opt_part_possible = TRUE;
6982                                 break;
6983                         case MESSAGE_TYPE_IDENT_REQ:
6984                                 /* no dissector necessary since no mandatory parameters included */
6985                                 opt_part_possible = TRUE;
6986                                 break;
6987                         case MESSAGE_TYPE_IDENT_RSP:
6988                                 /* no dissector necessary since no mandatory parameters included */
6989                                 opt_part_possible = TRUE;
6990                                 break;
6991                         case MESSAGE_TYPE_SEGMENTATION:
6992                                 /* no dissector necessary since no mandatory parameters included */
6993                                 opt_part_possible = TRUE;
6994                                 break;
6995                         case MESSAGE_TYPE_LOOP_PREVENTION:
6996                                 /* no dissector necessary since no mandatory parameters included */
6997                                 opt_part_possible = TRUE;
6998                                 break;
6999                         case MESSAGE_TYPE_APPLICATION_TRANS:
7000                                 /* no dissector necessary since no mandatory parameters included */
7001                                 opt_part_possible = TRUE;
7002                                 break;
7003                         case MESSAGE_TYPE_PRE_RELEASE_INFO:
7004                                 /* no dissector necessary since no mandatory parameters included */
7005                                 opt_part_possible = TRUE;
7006                                 break;
7007                         case MESSAGE_TYPE_SUBSEQUENT_DIR_NUM:
7008                                 /* do nothing since format is a national matter */
7009                                 bufferlength = tvb_length_remaining(message_tvb, offset);
7010                                 if (bufferlength != 0)
7011                                         proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Format is a national matter");
7012                                 break;
7013                         case ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES_ACK:
7014                                 /* no dissector necessary since no mandatory parameters included */
7015                                 break;
7016                         case ANSI_ISUP_MESSAGE_TYPE_CIRCUIT_RES:
7017                                 offset += dissect_ansi_isup_circuit_reservation_message( parameter_tvb, isup_tree );
7018                                 break;
7019                         case ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST_RSP:
7020                                 opt_part_possible = TRUE;
7021                                 offset += dissect_ansi_isup_circuit_validation_test_resp_message( parameter_tvb, isup_tree );
7022                                 break;
7023                         case ANSI_ISUP_MESSAGE_TYPE_CCT_VAL_TEST:
7024                                 /* no dissector necessary since no mandatory parameters included */
7025                                 break;
7026                         default:
7027                                 bufferlength = tvb_length_remaining(message_tvb, offset);
7028                                 if (bufferlength != 0)
7029                                         proto_tree_add_text(isup_tree, parameter_tvb, 0, bufferlength, "Unknown Message type (possibly reserved/used in former ISUP version)");
7030                                 break;
7031                         }
7032                         break;
7033   }
7034
7035    /* extract pointer to start of optional part (if any) */
7036    if (opt_part_possible == TRUE){
7037      opt_parameter_pointer = tvb_get_guint8(message_tvb, offset);
7038      if (opt_parameter_pointer > 0){
7039        proto_tree_add_uint_format(isup_tree, hf_isup_pointer_to_start_of_optional_part, message_tvb, offset, PARAMETER_POINTER_LENGTH, opt_parameter_pointer, "Pointer to start of optional part: %u", opt_parameter_pointer);
7040        offset += opt_parameter_pointer;
7041        optional_parameter_tvb = tvb_new_subset(message_tvb, offset, -1, -1 );
7042            switch(isup_standard){
7043            case ITU_STANDARD:
7044                    dissect_isup_optional_parameter(optional_parameter_tvb, pinfo, isup_tree);
7045                    break;
7046            case ANSI_STANDARD:
7047                    dissect_ansi_isup_optional_parameter(optional_parameter_tvb, pinfo, isup_tree);
7048                    break;
7049            }
7050      }
7051      else
7052        proto_tree_add_uint_format(isup_tree, hf_isup_pointer_to_start_of_optional_part, message_tvb, offset, PARAMETER_POINTER_LENGTH, opt_parameter_pointer, "No optional parameter present (Pointer: %u)", opt_parameter_pointer);
7053    }
7054    else if (message_type !=MESSAGE_TYPE_CHARGE_INFO)
7055      proto_tree_add_text(isup_tree, message_tvb, 0, 0, "No optional parameters are possible with this message type");
7056    /* if there are calling/called number, we'll get them for the tap */
7057
7058    tap_rec.calling_number=tap_calling_number?tap_calling_number:ep_strdup("");
7059    tap_rec.called_number=tap_called_number;
7060    tap_rec.cause_value=tap_cause_value;
7061    tap_queue_packet(isup_tap, pinfo, &tap_rec);
7062 }
7063
7064 /* ------------------------------------------------------------------ */
7065 static void
7066 dissect_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
7067 {
7068
7069 /* Set up structures needed to add the protocol subtree and manage it */
7070         proto_item *ti;
7071         proto_tree *isup_tree = NULL;
7072         tvbuff_t *message_tvb;
7073         guint16 cic;
7074         guint8 message_type;
7075
7076         switch(mtp3_standard){
7077         case ANSI_STANDARD:
7078                 isup_standard = ANSI_STANDARD;
7079                 break;
7080         default:
7081                 isup_standard = ITU_STANDARD;
7082         }
7083
7084 /* Make entries in Protocol column and Info column on summary display */
7085         switch (isup_standard){
7086         case ITU_STANDARD:
7087                 if (check_col(pinfo->cinfo, COL_PROTOCOL))
7088                         col_set_str(pinfo->cinfo, COL_PROTOCOL, "ISUP(ITU)");
7089                 break;
7090         case ANSI_STANDARD:
7091                 if (check_col(pinfo->cinfo, COL_PROTOCOL))
7092                         col_set_str(pinfo->cinfo, COL_PROTOCOL, "ISUP(ANSI)");
7093                 break;
7094         }
7095
7096 /* Extract message type field */
7097         message_type = tvb_get_guint8(tvb, CIC_OFFSET + CIC_LENGTH);
7098         /* dissect CIC in main dissector since pass-along message type carrying complete IUSP message w/o CIC needs
7099            recursive message dissector call */
7100         if (mtp3_standard == ANSI_STANDARD)
7101                 cic = tvb_get_letohs(tvb, CIC_OFFSET) & 0x3FFF; /*since upper 2 bits spare */
7102         else /* ITU, China, and Japan; yes, J7's CICs are a different size */
7103                 cic = tvb_get_letohs(tvb, CIC_OFFSET) & 0x0FFF; /*since upper 4 bits spare */
7104
7105         pinfo->ctype = CT_ISUP;
7106         pinfo->circuit_id = cic;
7107
7108         if (check_col(pinfo->cinfo, COL_INFO))
7109         {
7110                 if (isup_show_cic_in_info){
7111                         switch (isup_standard){
7112                         case ITU_STANDARD:
7113                                 col_add_fstr(pinfo->cinfo, COL_INFO, "%s (CIC %u) ", val_to_str(message_type, isup_message_type_value_acro, "reserved"), cic);
7114                                 break;
7115                         case ANSI_STANDARD:
7116                                 col_add_fstr(pinfo->cinfo, COL_INFO, "%s (CIC %u) ", val_to_str(message_type, ansi_isup_message_type_value_acro, "reserved"), cic);
7117                                 break;
7118                         }
7119                 }else{
7120                         switch (isup_standard){
7121                         case ITU_STANDARD:
7122                                 col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_type, isup_message_type_value_acro, "reserved"));
7123                                 break;
7124                         case ANSI_STANDARD:
7125                                 col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_type, ansi_isup_message_type_value_acro, "reserved"));
7126                                 break;
7127                         }
7128                 }
7129         }
7130
7131         /* In the interest of speed, if "tree" is NULL, don't do any work not
7132      * necessary to generate protocol tree items.
7133          */
7134         if (tree) {
7135                 ti = proto_tree_add_item(tree, proto_isup, tvb, 0, -1, FALSE);
7136                 isup_tree = proto_item_add_subtree(ti, ett_isup);
7137
7138
7139                 proto_tree_add_uint_format(isup_tree, hf_isup_cic, tvb, CIC_OFFSET, CIC_LENGTH, cic, "CIC: %u", cic);
7140         }
7141
7142         message_tvb = tvb_new_subset(tvb, CIC_LENGTH, -1, -1);
7143         dissect_isup_message(message_tvb, pinfo, isup_tree);
7144 }
7145
7146 /* ------------------------------------------------------------------ */
7147 static void
7148 dissect_bicc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
7149 {
7150
7151 /* Set up structures needed to add the protocol subtree and manage it */
7152         proto_item *ti;
7153         proto_tree *bicc_tree = NULL;
7154         tvbuff_t *message_tvb;
7155         guint32 bicc_cic;
7156         guint8 message_type;
7157
7158         /*circuit_t *circuit;*/
7159
7160 /* Make entries in Protocol column and Info column on summary display */
7161         if (check_col(pinfo->cinfo, COL_PROTOCOL))
7162                 col_set_str(pinfo->cinfo, COL_PROTOCOL, "BICC");
7163
7164 /* Extract message type field */
7165         message_type = tvb_get_guint8(tvb, BICC_CIC_OFFSET + BICC_CIC_LENGTH);
7166
7167         if (check_col(pinfo->cinfo, COL_INFO))
7168                 col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_type, isup_message_type_value_acro, "reserved"));
7169
7170         /* dissect CIC in main dissector since pass-along message type carrying complete BICC/ISUP message w/o CIC needs
7171          * recursive message dissector call
7172          */
7173         bicc_cic = tvb_get_letohl(tvb, BICC_CIC_OFFSET);
7174
7175         pinfo->ctype = CT_BICC;
7176         pinfo->circuit_id = bicc_cic;
7177
7178         /* In the interest of speed, if "tree" is NULL, don't do any work not
7179          * necessary to generate protocol tree items.
7180          */
7181         if (tree) {
7182                 ti = proto_tree_add_item(tree, proto_bicc, tvb, 0, -1, FALSE);
7183                 bicc_tree = proto_item_add_subtree(ti, ett_bicc);
7184
7185
7186                 proto_tree_add_uint_format(bicc_tree, hf_bicc_cic, tvb, BICC_CIC_OFFSET, BICC_CIC_LENGTH, bicc_cic, "CIC: %u", bicc_cic);
7187         }
7188
7189         message_tvb = tvb_new_subset(tvb, BICC_CIC_LENGTH, -1, -1);
7190         dissect_isup_message(message_tvb, pinfo, bicc_tree);
7191 }
7192
7193 static void
7194 dissect_application_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
7195 {
7196 /* Set up structures needed to add the protocol subtree and manage it */
7197         proto_item *ti;
7198         proto_tree *isup_tree = NULL;
7199         tvbuff_t *message_tvb;
7200         guint8 message_type;
7201
7202 /* Make entries in Protocol column and Info column on summary display */
7203         if (check_col(pinfo->cinfo, COL_PROTOCOL))
7204                 col_append_str(pinfo->cinfo, COL_PROTOCOL, "/ISUP(ITU)");
7205
7206 /* Extract message type field */
7207         message_type = tvb_get_guint8(tvb, 0);
7208         /* application/ISUP has no  CIC  */
7209         if (check_col(pinfo->cinfo, COL_INFO))
7210                 col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "ISUP:%s", val_to_str(message_type, isup_message_type_value_acro, "reserved"));
7211
7212 /* In the interest of speed, if "tree" is NULL, don't do any work not
7213    necessary to generate protocol tree items. */
7214         if (tree) {
7215                 ti = proto_tree_add_item(tree, proto_isup, tvb, 0, -1, FALSE);
7216                 isup_tree = proto_item_add_subtree(ti, ett_isup);
7217         }
7218
7219         message_tvb = tvb_new_subset(tvb, 0, -1, -1);
7220         dissect_isup_message(message_tvb, pinfo, isup_tree);
7221 }
7222 /* ---------------------------------------------------- stats tree
7223 */
7224 static int st_node_msg = -1;
7225 static int st_node_dir = -1;
7226
7227 static void msg_stats_tree_init(stats_tree* st) {
7228         st_node_msg = stats_tree_create_node(st, "Messages by Type", 0, TRUE);
7229         st_node_dir = stats_tree_create_node(st, "Messages by Direction", 0, TRUE);
7230 }
7231
7232 static int msg_stats_tree_packet(stats_tree *st  , packet_info *pinfo, epan_dissect_t *edt _U_, const void *p ) {
7233         const gchar* msg = match_strval(((const isup_tap_rec_t*)p)->message_type, isup_message_type_value_acro);
7234         gchar src[MAX_ADDR_STR_LEN];
7235         gchar dst[MAX_ADDR_STR_LEN];
7236         gchar dir[MAX_ADDR_STR_LEN];
7237         int msg_node;
7238         int dir_node;
7239
7240         address_to_str_buf(&(pinfo->src), src, sizeof src);
7241         address_to_str_buf(&(pinfo->dst), dst, sizeof dst);
7242         g_snprintf(dir,sizeof(dir),"%s->%s",src,dst);
7243
7244         msg_node = tick_stat_node(st, msg, st_node_msg, TRUE);
7245         tick_stat_node(st, dir, msg_node, FALSE);
7246
7247         dir_node = tick_stat_node(st, dir, st_node_dir, TRUE);
7248         tick_stat_node(st, msg, dir_node, FALSE);
7249
7250         return 1;
7251 }
7252
7253 /*---------------------------------------------------------------------*/
7254 /* Register the protocol with Wireshark */
7255 void
7256 proto_register_isup(void)
7257 {
7258 /* Setup list of header fields  See Section 1.6.1 for details*/
7259         static hf_register_info hf[] = {
7260                 { &hf_isup_cic,
7261                         { "CIC",           "isup.cic",
7262                         FT_UINT16, BASE_HEX, NULL, 0x0,
7263                           "", HFILL }},
7264
7265                 { &hf_isup_message_type,
7266                         { "Message Type",  "isup.message_type",
7267                         FT_UINT8, BASE_DEC, NULL, 0x0,
7268                         "", HFILL }},
7269
7270                 { &hf_isup_parameter_type,
7271                         { "Parameter Type",  "isup.parameter_type",
7272                         FT_UINT8, BASE_DEC, NULL, 0x0,
7273                         "", HFILL }},
7274
7275                 { &hf_isup_parameter_length,
7276                         { "Parameter Length",  "isup.parameter_length",
7277                         FT_UINT8, BASE_DEC, NULL, 0x0,
7278                         "", HFILL }},
7279
7280                 { &hf_isup_mandatory_variable_parameter_pointer,
7281                         { "Pointer to Parameter",  "isup.mandatory_variable_parameter_pointer",
7282                         FT_UINT8, BASE_DEC, NULL, 0x0,
7283                         "", HFILL }},
7284
7285                 { &hf_isup_pointer_to_start_of_optional_part,
7286                         { "Pointer to optional parameter part",  "isup.optional_parameter_part_pointer",
7287                         FT_UINT8, BASE_DEC, NULL, 0x0,
7288                         "", HFILL }},
7289
7290                 { &hf_isup_satellite_indicator,
7291                         { "Satellite Indicator",  "isup.satellite_indicator",
7292                         FT_UINT8, BASE_HEX, VALS(isup_satellite_ind_value), BA_8BIT_MASK,
7293                         "", HFILL }},
7294
7295                 { &hf_isup_continuity_check_indicator,
7296                         { "Continuity Check Indicator",  "isup.continuity_check_indicator",
7297                         FT_UINT8, BASE_HEX, VALS(isup_continuity_check_ind_value), DC_8BIT_MASK,
7298                         "", HFILL }},
7299
7300                 { &hf_isup_echo_control_device_indicator,
7301                         { "Echo Control Device Indicator",  "isup.echo_control_device_indicator",
7302                         FT_BOOLEAN, 8, TFS(&isup_echo_control_device_ind_value),E_8BIT_MASK,
7303                         "", HFILL }},
7304
7305                 { &hf_isup_forw_call_natnl_inatnl_call_indicator,
7306                         { "National/international call indicator",  "isup.forw_call_natnl_inatnl_call_indicator",
7307                         FT_BOOLEAN, 16, TFS(&isup_natnl_inatnl_call_ind_value),A_16BIT_MASK,
7308                         "", HFILL }},
7309
7310                 { &hf_isup_forw_call_end_to_end_method_indicator,
7311                         { "End-to-end method indicator",  "isup.forw_call_end_to_end_method_indicator",
7312                         FT_UINT16, BASE_HEX, VALS(isup_end_to_end_method_ind_value), CB_16BIT_MASK,
7313                         "", HFILL }},
7314
7315                 { &hf_isup_forw_call_interworking_indicator,
7316                         { "Interworking indicator",  "isup.forw_call_interworking_indicator",
7317                         FT_BOOLEAN, 16, TFS(&isup_interworking_ind_value), D_16BIT_MASK,
7318                         "", HFILL }},
7319
7320                 { &hf_isup_forw_call_end_to_end_info_indicator,
7321                         { "End-to-end information indicator",  "isup.forw_call_end_to_end_information_indicator",
7322                         FT_BOOLEAN, 16, TFS(&isup_end_to_end_info_ind_value), E_16BIT_MASK,
7323                         "", HFILL }},
7324
7325                 { &hf_isup_forw_call_isdn_user_part_indicator,
7326                         { "ISDN user part indicator",  "isup.forw_call_isdn_user_part_indicator",
7327                         FT_BOOLEAN, 16, TFS(&isup_ISDN_user_part_ind_value), F_16BIT_MASK,
7328                         "", HFILL }},
7329
7330                 { &hf_isup_forw_call_preferences_indicator,
7331                         { "ISDN user part preference indicator",  "isup.forw_call_preferences_indicator",
7332                         FT_UINT16, BASE_HEX, VALS(isup_preferences_ind_value), HG_16BIT_MASK,
7333                         "", HFILL }},
7334
7335                 { &hf_isup_forw_call_isdn_access_indicator,
7336                         { "ISDN access indicator",  "isup.forw_call_isdn_access_indicator",
7337                         FT_BOOLEAN, 16, TFS(&isup_ISDN_originating_access_ind_value), I_16BIT_MASK,
7338                         "", HFILL }},
7339
7340                 { &hf_isup_forw_call_sccp_method_indicator,
7341                         { "SCCP method indicator",  "isup.forw_call_sccp_method_indicator",
7342                         FT_UINT16, BASE_HEX, VALS(isup_SCCP_method_ind_value), KJ_16BIT_MASK,
7343                         "", HFILL }},
7344
7345                 { &hf_isup_forw_call_ported_num_trans_indicator,
7346                         { "Ported number translation indicator",  "isup.forw_call_ported_num_trans_indicator",
7347                         FT_BOOLEAN, 16, TFS(&isup_ISDN_ported_num_trans_ind_value), M_16BIT_MASK,
7348                         "", HFILL }},
7349
7350                 { &hf_isup_forw_call_qor_attempt_indicator,
7351                         { "Query on Release attempt indicator",  "isup.forw_call_isdn_access_indicator",
7352                         FT_BOOLEAN, 16, TFS(&isup_ISDN_qor_attempt_ind_value), N_16BIT_MASK,
7353                         "", HFILL }},
7354
7355                 { &hf_isup_calling_partys_category,
7356                         { "Calling Party's category",  "isup.calling_partys_category",
7357                         FT_UINT8, BASE_HEX, VALS(isup_calling_partys_category_value), 0x0,
7358                         "", HFILL }},
7359
7360                 { &hf_isup_transmission_medium_requirement,
7361                         { "Transmission medium requirement",  "isup.transmission_medium_requirement",
7362                         FT_UINT8, BASE_DEC, VALS(isup_transmission_medium_requirement_value), 0x0,
7363                         "", HFILL }},
7364
7365                 { &hf_isup_odd_even_indicator,
7366                         { "Odd/even indicator",  "isup.isdn_odd_even_indicator",
7367                         FT_BOOLEAN, 8, TFS(&isup_odd_even_ind_value), ISUP_ODD_EVEN_MASK,
7368                         "", HFILL }},
7369
7370                 { &hf_isup_generic_name_presentation,
7371                         { "Presentation indicator",  "isup.isdn_generic_name_presentation",
7372                         FT_UINT8, BASE_DEC, VALS(isup_generic_name_presentation_value), BA_8BIT_MASK,
7373                         "", HFILL }},
7374
7375                 { &hf_isup_generic_name_availability,
7376                         { "Availability indicator",  "isup.isdn_generic_name_availability",
7377                         FT_BOOLEAN, 8, TFS(&isup_generic_name_availability_value), E_8BIT_MASK,
7378                         "", HFILL }},
7379
7380                 { &hf_isup_generic_name_type,
7381                         { "Type indicator",  "isup.isdn_generic_name_type",
7382                         FT_UINT8, BASE_DEC, VALS(isup_generic_name_type_value), HGF_8BIT_MASK,
7383                         "", HFILL }},
7384
7385                 { &hf_isup_generic_name_ia5,
7386                         { "Generic Name",  "isup.isdn_generic_name_ia5",
7387                         FT_STRING, BASE_NONE, NULL, 0x0,
7388                         "", HFILL }},
7389
7390                 { &hf_isup_called_party_nature_of_address_indicator,
7391                         { "Nature of address indicator",  "isup.called_party_nature_of_address_indicator",
7392                         FT_UINT8, BASE_DEC, VALS(isup_called_party_nature_of_address_ind_value), ISUP_NATURE_OF_ADDRESS_IND_MASK,
7393                         "", HFILL }},
7394
7395                 { &hf_isup_calling_party_nature_of_address_indicator,
7396                         { "Nature of address indicator",  "isup.calling_party_nature_of_address_indicator",
7397                         FT_UINT8, BASE_DEC, VALS(isup_calling_party_nature_of_address_ind_value), ISUP_NATURE_OF_ADDRESS_IND_MASK,
7398                         "", HFILL }},
7399
7400                 { &hf_isup_charge_number_nature_of_address_indicator,
7401                         { "Nature of address indicator",  "isup.charge_number_nature_of_address_indicator",
7402                         FT_UINT8, BASE_DEC, VALS(isup_charge_number_nature_of_address_ind_value), ISUP_NATURE_OF_ADDRESS_IND_MASK,
7403                         "", HFILL }},
7404
7405                 { &hf_isup_inn_indicator,
7406                         { "INN indicator",  "isup.inn_indicator",
7407                         FT_BOOLEAN, 8, TFS(&isup_INN_ind_value), ISUP_INN_MASK,
7408                         "", HFILL }},
7409
7410                 { &hf_isup_ni_indicator,
7411                         { "NI indicator",  "isup.ni_indicator",
7412                         FT_BOOLEAN, 8, TFS(&isup_NI_ind_value), ISUP_NI_MASK,
7413                         "", HFILL }},
7414
7415                 { &hf_isup_numbering_plan_indicator,
7416                         { "Numbering plan indicator",  "isup.numbering_plan_indicator",
7417                         FT_UINT8, BASE_DEC, VALS(isup_numbering_plan_ind_value), ISUP_NUMBERING_PLAN_IND_MASK,
7418                         "", HFILL }},
7419
7420                 { &hf_isup_address_presentation_restricted_indicator,
7421                         { "Address presentation restricted indicator",  "isup.address_presentation_restricted_indicator",
7422                         FT_UINT8, BASE_DEC, VALS(isup_address_presentation_restricted_ind_value), ISUP_ADDRESS_PRESENTATION_RESTR_IND_MASK,
7423                         "", HFILL }},
7424
7425                 { &hf_isup_screening_indicator,
7426                         { "Screening indicator",  "isup.screening_indicator",
7427                         FT_UINT8, BASE_DEC, VALS(isup_screening_ind_value), ISUP_SCREENING_IND_MASK,
7428                         "", HFILL }},
7429
7430                 { &hf_isup_screening_indicator_enhanced,
7431                         { "Screening indicator",  "isup.screening_indicator_enhanced",
7432                         FT_UINT8, BASE_DEC, VALS(isup_screening_ind_enhanced_value), ISUP_SCREENING_IND_MASK,
7433                         "", HFILL }},
7434
7435                 { &hf_isup_called_party_odd_address_signal_digit,
7436                         { "Address signal digit",  "isup.called_party_odd_address_signal_digit",
7437                         FT_UINT8, BASE_DEC, VALS(isup_called_party_address_digit_value), ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK,
7438                         "", HFILL }},
7439
7440                 { &hf_isup_calling_party_odd_address_signal_digit,
7441                         { "Address signal digit",  "isup.calling_party_odd_address_signal_digit",
7442                         FT_UINT8, BASE_DEC, VALS(isup_calling_party_address_digit_value), ISUP_ODD_ADDRESS_SIGNAL_DIGIT_MASK,
7443                         "", HFILL }},
7444
7445                 { &hf_isup_called_party_even_address_signal_digit,
7446                         { "Address signal digit",  "isup.called_party_even_address_signal_digit",
7447                         FT_UINT8, BASE_DEC, VALS(isup_called_party_address_digit_value), ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK,
7448                         "", HFILL }},
7449
7450                 { &hf_isup_calling_party_even_address_signal_digit,
7451                         { "Address signal digit",  "isup.calling_party_even_address_signal_digit",
7452                         FT_UINT8, BASE_DEC, VALS(isup_calling_party_address_digit_value), ISUP_EVEN_ADDRESS_SIGNAL_DIGIT_MASK,
7453                         "", HFILL }},
7454
7455                 { &hf_isup_calling_party_address_request_indicator,
7456                         { "Calling party address request indicator",  "isup.calling_party_address_request_indicator",
7457                         FT_BOOLEAN, 16, TFS(&isup_calling_party_address_request_ind_value), A_16BIT_MASK,
7458                         "", HFILL }},
7459
7460                 { &hf_isup_info_req_holding_indicator,
7461                         { "Holding indicator",  "isup.info_req_holding_indicator",
7462                         FT_BOOLEAN, 16, TFS(&isup_holding_ind_value), B_16BIT_MASK,
7463                         "", HFILL }},
7464
7465                 { &hf_isup_calling_partys_category_request_indicator,
7466                         { "Calling party's category request indicator",  "isup.calling_partys_category_request_indicator",
7467                         FT_BOOLEAN, 16, TFS(&isup_calling_partys_category_request_ind_value), D_16BIT_MASK,
7468                         "", HFILL }},
7469
7470                 { &hf_isup_charge_information_request_indicator,
7471                         { "Charge information request indicator",  "isup.charge_information_request_indicator",
7472                         FT_BOOLEAN, 16, TFS(&isup_charge_information_request_ind_value), E_16BIT_MASK,
7473                         "", HFILL }},
7474
7475                 { &hf_isup_malicious_call_identification_request_indicator,
7476                         { "Malicious call identification request indicator (ISUP'88)",  "isup.malicious_call_ident_request_indicator",
7477                         FT_BOOLEAN, 16, TFS(&isup_malicious_call_identification_request_ind_value), H_16BIT_MASK,
7478                         "", HFILL }},
7479
7480                 { &hf_isup_calling_party_address_response_indicator,
7481                         { "Calling party address response indicator",  "isup.calling_party_address_response_indicator",
7482                         FT_UINT16, BASE_HEX, VALS(isup_calling_party_address_response_ind_value), BA_16BIT_MASK,
7483                         "", HFILL }},
7484
7485                 { &hf_isup_OECD_inf_ind,
7486                         { "OECD information indicator",  "isup.OECD_inf_ind_vals",
7487                         FT_UINT8, BASE_HEX, VALS(OECD_inf_ind_vals), BA_8BIT_MASK,
7488                         "", HFILL }},
7489
7490                 { &hf_isup_IECD_inf_ind,
7491                         { "IECD information indicator",  "isup.IECD_inf_ind_vals",
7492                         FT_UINT8, BASE_HEX, VALS(IECD_inf_ind_vals), DC_8BIT_MASK,
7493                         "", HFILL }},
7494
7495                 { &hf_isup_OECD_req_ind,
7496                         { "OECD request indicator",  "isup.OECD_req_ind_vals",
7497                         FT_UINT8, BASE_HEX, VALS(OECD_req_ind_vals), FE_8BIT_MASK,
7498                         "", HFILL }},
7499
7500                 { &hf_isup_IECD_req_ind,
7501                         { "IECD request indicator",  "isup.IECD_req_ind_vals",
7502                         FT_UINT8, BASE_HEX, VALS(IECD_req_ind_vals), HG_8BIT_MASK,
7503                         "", HFILL }},
7504
7505                 { &hf_isup_hold_provided_indicator,
7506                         { "Hold provided indicator",  "isup.hold_provided_indicator",
7507                         FT_BOOLEAN, 16, TFS(&isup_hold_provided_ind_value), C_16BIT_MASK,
7508                         "", HFILL }},
7509
7510                 { &hf_isup_calling_partys_category_response_indicator,
7511                         { "Calling party's category response indicator",  "isup.calling_partys_category_response_indicator",
7512                         FT_BOOLEAN, 16, TFS(&isup_calling_partys_category_response_ind_value), F_16BIT_MASK,
7513                         "", HFILL }},
7514
7515                 { &hf_isup_charge_information_response_indicator,
7516                         { "Charge information response indicator",  "isup.charge_information_response_indicator",
7517                         FT_BOOLEAN, 16, TFS(&isup_charge_information_response_ind_value), G_16BIT_MASK,
7518                         "", HFILL }},
7519
7520                 { &hf_isup_solicited_indicator,
7521                         { "Solicited indicator",  "isup.solicided_indicator",
7522                         FT_BOOLEAN, 16, TFS(&isup_solicited_information_ind_value), H_16BIT_MASK,
7523                         "", HFILL }},
7524
7525                 { &hf_isup_continuity_indicator,
7526                         { "Continuity indicator",  "isup.continuity_indicator",
7527                         FT_BOOLEAN, 8, TFS(&isup_continuity_ind_value), A_8BIT_MASK,
7528                         "", HFILL }},
7529
7530                 { &hf_isup_backw_call_charge_ind,
7531                         { "Charge indicator",  "isup.charge_indicator",
7532                         FT_UINT16, BASE_HEX, VALS(isup_charge_ind_value), BA_16BIT_MASK,
7533                         "", HFILL }},
7534
7535                 { &hf_isup_backw_call_called_partys_status_ind,
7536                         { "Called party's status indicator",  "isup.called_partys_status_indicator",
7537                         FT_UINT16, BASE_HEX, VALS(isup_called_partys_status_ind_value), DC_16BIT_MASK,
7538                         "", HFILL }},
7539
7540                 { &hf_isup_backw_call_called_partys_category_ind,
7541                         { "Called party's category indicator",  "isup.called_partys_category_indicator",
7542                         FT_UINT16, BASE_HEX, VALS(isup_called_partys_category_ind_value), FE_16BIT_MASK,
7543                         "", HFILL }},
7544
7545                 { &hf_isup_backw_call_end_to_end_method_ind,
7546                         { "End-to-end method indicator",  "isup.backw_call_end_to_end_method_indicator",
7547                         FT_UINT16, BASE_HEX, VALS(isup_end_to_end_method_ind_value), HG_16BIT_MASK,
7548                         "", HFILL }},
7549
7550                 { &hf_isup_backw_call_interworking_ind,
7551                         { "Interworking indicator",  "isup.backw_call_interworking_indicator",
7552                         FT_BOOLEAN, 16, TFS(&isup_interworking_ind_value), I_16BIT_MASK,
7553                         "", HFILL }},
7554
7555                 { &hf_isup_backw_call_end_to_end_info_ind,
7556                         { "End-to-end information indicator",  "isup.backw_call_end_to_end_information_indicator",
7557                         FT_BOOLEAN, 16, TFS(&isup_end_to_end_info_ind_value), J_16BIT_MASK,
7558                         "", HFILL }},
7559
7560                 { &hf_isup_backw_call_isdn_user_part_ind,
7561                         { "ISDN user part indicator",  "isup.backw_call_isdn_user_part_indicator",
7562                         FT_BOOLEAN, 16, TFS(&isup_ISDN_user_part_ind_value), K_16BIT_MASK,
7563                         "", HFILL }},
7564
7565                 { &hf_isup_backw_call_holding_ind,
7566                         { "Holding indicator",  "isup.backw_call_holding_indicator",
7567                         FT_BOOLEAN, 16, TFS(&isup_holding_ind_value), L_16BIT_MASK,
7568                         "", HFILL }},
7569
7570                 { &hf_isup_backw_call_isdn_access_ind,
7571                         { "ISDN access indicator",  "isup.backw_call_isdn_access_indicator",
7572                         FT_BOOLEAN, 16, TFS(&isup_ISDN_terminating_access_ind_value), M_16BIT_MASK,
7573                         "", HFILL }},
7574
7575                 { &hf_isup_backw_call_echo_control_device_ind,
7576                         { "Echo Control Device Indicator",  "isup.backw_call_echo_control_device_indicator",
7577                         FT_BOOLEAN, 16, TFS(&isup_echo_control_device_ind_value), N_16BIT_MASK,
7578                         "", HFILL }},
7579
7580                 { &hf_isup_backw_call_sccp_method_ind,
7581                         { "SCCP method indicator",  "isup.backw_call_sccp_method_indicator",
7582                         FT_UINT16, BASE_HEX, VALS(isup_SCCP_method_ind_value), PO_16BIT_MASK,
7583                         "", HFILL }},
7584
7585                 { &hf_isup_cause_indicator,
7586                         { "Cause indicator",  "isup.cause_indicator",
7587                         FT_UINT8, BASE_DEC, VALS(q850_cause_code_vals), 0x7f,
7588                         "", HFILL }},
7589
7590                 { &hf_ansi_isup_cause_indicator,
7591                         { "Cause indicator",  "ansi_isup.cause_indicator",
7592                         FT_UINT8, BASE_DEC, VALS(ansi_isup_cause_code_vals), 0x7f,
7593                         "", HFILL }},
7594
7595                 { &hf_isup_suspend_resume_indicator,
7596                         { "Suspend/Resume indicator",  "isup.suspend_resume_indicator",
7597                         FT_BOOLEAN, 8, TFS(&isup_suspend_resume_ind_value), A_8BIT_MASK,
7598                         "", HFILL }},
7599
7600                 { &hf_isup_range_indicator,
7601                         { "Range indicator",  "isup.range_indicator",
7602                           FT_UINT8, BASE_DEC, NULL , 0x0,
7603                           "", HFILL }},
7604
7605                 { &hf_isup_cgs_message_type,
7606                         { "Circuit group supervision message type",  "isup.cgs_message_type",
7607                         FT_UINT8, BASE_DEC, VALS(isup_cgs_message_type_value), BA_8BIT_MASK,
7608                         "", HFILL }},
7609
7610                 { &hf_isup_mtc_blocking_state1,
7611                         { "Maintenance blocking state",  "isup.mtc_blocking_state",
7612                         FT_UINT8, BASE_DEC, VALS(isup_mtc_blocking_state_DC00_value), BA_8BIT_MASK,
7613                         "", HFILL }},
7614
7615                 { &hf_isup_mtc_blocking_state2,
7616                         { "Maintenance blocking state",  "isup.mtc_blocking_state",
7617                         FT_UINT8, BASE_DEC, VALS(isup_mtc_blocking_state_DCnot00_value), BA_8BIT_MASK,
7618                         "", HFILL }},
7619
7620                 { &hf_isup_call_proc_state,
7621                         { "Call processing state",  "isup.call_processing_state",
7622                         FT_UINT8, BASE_DEC, VALS(isup_call_processing_state_value), DC_8BIT_MASK,
7623                         "", HFILL }},
7624
7625                 { &hf_isup_hw_blocking_state,
7626                         { "HW blocking state",  "isup.hw_blocking_state",
7627                         FT_UINT8, BASE_DEC, VALS(isup_HW_blocking_state_value), FE_8BIT_MASK,
7628                         "", HFILL }},
7629
7630                 { &hf_isup_event_ind,
7631                         { "Event indicator",  "isup.event_ind",
7632                           FT_UINT8, BASE_DEC, VALS(isup_event_ind_value), GFEDCBA_8BIT_MASK,
7633                         "", HFILL }},
7634
7635                 { &hf_isup_event_presentation_restricted_ind,
7636                         { "Event presentation restricted indicator",  "isup.event_presentatiation_restr_ind",
7637                         FT_BOOLEAN, 8, TFS(&isup_event_presentation_restricted_ind_value), H_8BIT_MASK,
7638                         "", HFILL }},
7639
7640                 { &hf_isup_cug_call_ind,
7641                         { "Closed user group call indicator",  "isup.clg_call_ind",
7642                         FT_UINT8, BASE_DEC, VALS(isup_CUG_call_ind_value), BA_8BIT_MASK,
7643                         "", HFILL }},
7644
7645                 { &hf_isup_simple_segmentation_ind,
7646                         { "Simple segmentation indicator",  "isup.simple_segmentation_ind",
7647                         FT_BOOLEAN, 8, TFS(&isup_simple_segmentation_ind_value), C_8BIT_MASK,
7648                         "", HFILL }},
7649
7650                 { &hf_isup_connected_line_identity_request_ind,
7651                         { "Connected line identity request indicator",  "isup.connected_line_identity_request_ind",
7652                         FT_BOOLEAN, 8, TFS(&isup_connected_line_identity_request_ind_value), H_8BIT_MASK,
7653                         "", HFILL }},
7654
7655                 { &hf_isup_redirecting_ind,
7656                         { "Redirection indicator",  "isup.redirecting_ind",
7657                         FT_UINT16, BASE_DEC, VALS(isup_redirecting_ind_value), CBA_16BIT_MASK,
7658                         "", HFILL }},
7659
7660                 { &hf_isup_original_redirection_reason,
7661                         { "Original redirection reason",  "isup.original_redirection_reason",
7662                         FT_UINT16, BASE_DEC, VALS(isup_original_redirection_reason_value), HGFE_16BIT_MASK,
7663                         "", HFILL }},
7664
7665                 { &hf_isup_redirection_counter,
7666                         { "Redirection counter",  "isup.redirection_counter",
7667                         FT_UINT16, BASE_DEC, NULL, KJI_16BIT_MASK,
7668                         "", HFILL }},
7669
7670                 { &hf_isup_redirection_reason,
7671                         { "Redirection reason",  "isup.redirection_reason",
7672                         FT_UINT16, BASE_DEC, VALS(isup_redirection_reason_value), PONM_16BIT_MASK,
7673                         "", HFILL }},
7674
7675                 { &hf_isup_type_of_network_identification,
7676                         { "Type of network identification",  "isup.type_of_network_identification",
7677                         FT_UINT8, BASE_DEC, VALS(isup_type_of_network_identification_value), GFE_8BIT_MASK,
7678                         "", HFILL }},
7679
7680                 { &hf_isup_network_identification_plan,
7681                         { "Network identification plan",  "isup.network_identification_plan",
7682                         FT_UINT8, BASE_DEC, VALS(isup_network_identification_plan_value), DCBA_8BIT_MASK,
7683                         "", HFILL }},
7684
7685                 { &hf_isup_map_type,
7686                         { "Map Type",  "isup.map_type",
7687                         FT_UINT8, BASE_DEC, VALS(isup_map_type_value), FEDCBA_8BIT_MASK,
7688                         "", HFILL }},
7689
7690                 { &hf_isup_automatic_congestion_level,
7691                         { "Automatic congestion level",  "isup.automatic_congestion_level",
7692                         FT_UINT8, BASE_DEC, VALS(isup_auto_congestion_level_value), 0x0,
7693                         "", HFILL }},
7694
7695                 { &hf_isup_inband_information_ind,
7696                         { "In-band information indicator",  "isup.inband_information_ind",
7697                         FT_BOOLEAN, 8, TFS(&isup_inband_information_ind_value), A_8BIT_MASK,
7698                         "", HFILL }},
7699
7700                 { &hf_isup_call_diversion_may_occur_ind,
7701                         { "Call diversion may occur indicator",  "isup.call_diversion_may_occur_ind",
7702                         FT_BOOLEAN, 8, TFS(&isup_call_diversion_may_occur_ind_value), B_8BIT_MASK,
7703                         "", HFILL }},
7704
7705                 { &hf_isup_mlpp_user_ind,
7706                         { "MLPP user indicator",  "isup.mlpp_user",
7707                         FT_BOOLEAN, 8, TFS(&isup_MLPP_user_ind_value), D_8BIT_MASK,
7708                         "", HFILL }},
7709
7710                 { &hf_isup_UUI_type,
7711                         { "User-to-User indicator type",  "isup.UUI_type",
7712                         FT_BOOLEAN, 8, TFS(&isup_UUI_type_value), A_8BIT_MASK,
7713                         "", HFILL }},
7714
7715                 { &hf_isup_UUI_req_service1,
7716                         { "User-to-User indicator request service 1",  "isup.UUI_req_service1",
7717                         FT_UINT8, BASE_DEC, VALS(isup_UUI_request_service_values), CB_8BIT_MASK,
7718                         "", HFILL }},
7719
7720                 { &hf_isup_UUI_req_service2,
7721                         { "User-to-User indicator request service 2",  "isup.UUI_req_service2",
7722                         FT_UINT8, BASE_DEC, VALS(isup_UUI_request_service_values), ED_8BIT_MASK,
7723                         "", HFILL }},
7724
7725                 { &hf_isup_UUI_req_service3,
7726                         { "User-to-User indicator request service 3",  "isup.UUI_req_service3",
7727                         FT_UINT8, BASE_DEC, VALS(isup_UUI_request_service_values), GF_8BIT_MASK,
7728                         "", HFILL }},
7729
7730                 { &hf_isup_UUI_res_service1,
7731                         { "User-to-User indicator response service 1",  "isup.UUI_res_service1",
7732                         FT_UINT8, BASE_DEC, VALS(isup_UUI_response_service_values), CB_8BIT_MASK,
7733                         "", HFILL }},
7734
7735                 { &hf_isup_UUI_res_service2,
7736                         { "User-to-User indicator response service 2",  "isup.UUI_res_service2",
7737                         FT_UINT8, BASE_DEC, VALS(isup_UUI_response_service_values), ED_8BIT_MASK,
7738                         "", HFILL }},
7739
7740                 { &hf_isup_UUI_res_service3,
7741                         { "User-to-User response service 3",  "isup.UUI_res_service3",
7742                         FT_UINT8, BASE_DEC, VALS(isup_UUI_response_service_values), GF_8BIT_MASK,
7743                         "", HFILL }},
7744
7745                 { &hf_isup_UUI_network_discard_ind,
7746                         { "User-to-User indicator network discard indicator",  "isup.UUI_network_discard_ind",
7747                         FT_BOOLEAN, 8, TFS(&isup_UUI_network_discard_ind_value), H_8BIT_MASK,
7748                         "", HFILL }},
7749
7750                 { &hf_isup_access_delivery_ind,
7751                         { "Access delivery indicator",  "isup.access_delivery_ind",
7752                         FT_BOOLEAN, 8, TFS(&isup_access_delivery_ind_value), A_8BIT_MASK,
7753                         "", HFILL }},
7754
7755                 { &hf_isup_transmission_medium_requirement_prime,
7756                         { "Transmission medium requirement prime",  "isup.transmission_medium_requirement_prime",
7757                         FT_UINT8, BASE_DEC, VALS(isup_transmission_medium_requirement_prime_value), 0x0,
7758                         "", HFILL }},
7759
7760                 { &hf_isup_loop_prevention_response_ind,
7761                         { "Response indicator",  "isup.loop_prevention_response_ind",
7762                         FT_UINT8, BASE_DEC, VALS(isup_loop_prevention_response_ind_value), CB_8BIT_MASK,
7763                         "", HFILL }},
7764
7765                 { &hf_isup_temporary_alternative_routing_ind,
7766                         { "Temporary alternative routing indicator",  "isup.temporary_alternative_routing_ind",
7767                         FT_BOOLEAN, 8, TFS(&isup_temporary_alternative_routing_ind_value), A_8BIT_MASK,
7768                         "", HFILL }},
7769
7770                 { &hf_isup_extension_ind,
7771                         { "Extension indicator",  "isup.extension_ind",
7772                         FT_BOOLEAN, 8, TFS(&isup_extension_ind_value), H_8BIT_MASK,
7773                         "", HFILL }},
7774
7775                 { &hf_isup_call_to_be_diverted_ind,
7776                         { "Call to be diverted indicator",  "isup.call_to_be_diverted_ind",
7777                         FT_UINT8, BASE_DEC, VALS(isup_call_to_be_diverted_ind_value), BA_8BIT_MASK,
7778                         "", HFILL }},
7779
7780                 { &hf_isup_call_to_be_offered_ind,
7781                         { "Call to be offered indicator",  "isup.call_to_be_offered_ind",
7782                         FT_UINT8, BASE_DEC, VALS(isup_call_to_be_offered_ind_value), BA_8BIT_MASK,
7783                         "", HFILL }},
7784
7785                 { &hf_isup_conference_acceptance_ind,
7786                         { "Conference acceptance indicator",  "isup.conference_acceptance_ind",
7787                         FT_UINT8, BASE_DEC, VALS(isup_conference_acceptance_ind_value), BA_8BIT_MASK,
7788                         "", HFILL }},
7789
7790                 { &hf_isup_transit_at_intermediate_exchange_ind,
7791                         { "Transit at intermediate exchange indicator", "isup.transit_at_intermediate_exchange_ind",
7792                         FT_BOOLEAN, 8, TFS(&isup_transit_at_intermediate_exchange_ind_value), A_8BIT_MASK,
7793                         "", HFILL }},
7794
7795                 { &hf_isup_Release_call_ind,
7796                         { "Release call indicator", "isup.Release_call_ind",
7797                         FT_BOOLEAN, 8, TFS(&isup_Release_call_indicator_value), B_8BIT_MASK,
7798                         "", HFILL }},
7799
7800                 { &hf_isup_Send_notification_ind,
7801                         { "Send notification indicator", "isup.Send_notification_ind",
7802                         FT_BOOLEAN, 8, TFS(&isup_Send_notification_ind_value),C_8BIT_MASK,
7803                         "", HFILL }},
7804
7805                 { &hf_isup_Discard_message_ind_value,
7806                         { "Discard message indicator","isup.Discard_message_ind_value",
7807                         FT_BOOLEAN, 8, TFS(&isup_Discard_message_ind_value), D_8BIT_MASK,
7808                         "", HFILL }},
7809
7810                 { &hf_isup_Discard_parameter_ind,
7811                         { "Discard parameter indicator","isup.Discard_parameter_ind",
7812                         FT_BOOLEAN, 8, TFS(&isup_Discard_parameter_ind_value), E_8BIT_MASK,
7813                         "", HFILL }},
7814
7815                 { &hf_isup_Pass_on_not_possible_indicator,
7816                         { "Pass on not possible indicator",  "isup_Pass_on_not_possible_ind",
7817                         FT_UINT8, BASE_HEX, VALS(isup_Pass_on_not_possible_indicator_vals),GF_8BIT_MASK,
7818                         "", HFILL }},
7819
7820                 { &hf_isup_pass_on_not_possible_indicator2,
7821                         { "Pass on not possible indicator",  "isup_Pass_on_not_possible_val",
7822                         FT_BOOLEAN, 8, TFS(&isup_pass_on_not_possible_indicator_value),E_8BIT_MASK,
7823                         "", HFILL }},
7824
7825                 { &hf_isup_Broadband_narrowband_interworking_ind,
7826                         { "Broadband narrowband interworking indicator Bits JF",  "isup_broadband-narrowband_interworking_ind",
7827                         FT_UINT8, BASE_HEX, VALS(ISUP_Broadband_narrowband_interworking_indicator_vals),BA_8BIT_MASK,
7828                         "", HFILL }},
7829
7830                 { &hf_isup_Broadband_narrowband_interworking_ind2,
7831                         { "Broadband narrowband interworking indicator Bits GF",  "isup_broadband-narrowband_interworking_ind2",
7832                         FT_UINT8, BASE_HEX, VALS(ISUP_Broadband_narrowband_interworking_indicator_vals),GF_8BIT_MASK,
7833                         "", HFILL }},
7834
7835                 { &hf_isup_app_cont_ident,
7836                         { "Application context identifier",  "isup.app_context_identifier",
7837                         FT_UINT16, BASE_DEC, VALS(isup_application_transport_parameter_value),GFEDCBA_8BIT_MASK,
7838                         "", HFILL }},
7839
7840                 { &hf_isup_app_Release_call_ind,
7841                         { "Release call indicator (RCI)",  "isup.app_Release_call_indicator",
7842                         FT_BOOLEAN, 8, TFS(&isup_Release_call_indicator_value), A_8BIT_MASK,
7843                         "", HFILL }},
7844
7845                 { &hf_isup_app_Send_notification_ind,
7846                         { "Send notification indicator (SNI)",  "isup.app_Send_notification_ind",
7847                         FT_BOOLEAN, 8, TFS(&isup_Send_notification_ind_value), B_8BIT_MASK,
7848                         "", HFILL }},
7849
7850                 { &hf_isup_apm_segmentation_ind,
7851                         { "APM segmentation indicator",  "isup.apm_segmentation_ind",
7852                         FT_UINT8, BASE_DEC, VALS(isup_APM_segmentation_ind_value), FEDCBA_8BIT_MASK,
7853                         "", HFILL }},
7854
7855                 { &hf_isup_apm_si_ind,
7856                         { "Sequence indicator (SI)",  "isup.APM_Sequence_ind",
7857                         FT_BOOLEAN, 8, TFS(&isup_Sequence_ind_value), G_8BIT_MASK,
7858                         "", HFILL }},
7859
7860                 { &hf_isup_orig_addr_len,
7861                         { "Originating Address length",  "isup.orig_addr_len",
7862                         FT_UINT8, BASE_DEC, NULL, 0x0,
7863                         "Originating Address length", HFILL }},
7864
7865                 { &hf_isup_dest_addr_len,
7866                         { "Destination Address length",  "isup.orig_addr_len",
7867                         FT_UINT8, BASE_DEC, NULL, 0x0,
7868                         "Destination Address length", HFILL }},
7869
7870                 { &hf_isup_apm_slr,
7871                         { "Segmentation local reference (SLR)",  "isup.APM_slr",
7872                         FT_UINT8, BASE_DEC, NULL,GFEDCBA_8BIT_MASK,
7873                         "", HFILL }},
7874                 { &hf_isup_cause_location,
7875                         { "Cause location", "isup.cause_location",
7876                         FT_UINT8, BASE_DEC, VALS(q931_cause_location_vals), 0x0f,
7877                         "", HFILL }},
7878
7879                 { &hf_ansi_isup_coding_standard,
7880                   { "Coding standard", "ansi_isup.coding_standard", FT_UINT8, BASE_HEX,
7881                          VALS(ansi_isup_coding_standard_vals), 0x60,"", HFILL }},
7882
7883                 { &hf_bat_ase_identifier,
7884                         { "BAT ASE Identifiers",  "bicc.bat_ase_identifier",
7885                         FT_UINT8, BASE_HEX, VALS(bat_ase_list_of_Identifiers_vals),0x0,
7886                         "", HFILL }},
7887
7888                 { &hf_length_indicator,
7889                         { "BAT ASE Element length indicator",  "bicc.bat_ase_length_indicator",
7890                         FT_UINT16, BASE_DEC, NULL,0x0,
7891                         "", HFILL }},
7892
7893                 { &hf_Action_Indicator,
7894                         { "BAT ASE action indicator field",  "bicc.bat_ase_bat_ase_action_indicator_field",
7895                         FT_UINT8, BASE_HEX, VALS(bat_ase_action_indicator_field_vals),0x00,
7896                         "", HFILL }},
7897
7898                 { &hf_Instruction_ind_for_general_action,
7899                         { "BAT ASE Instruction indicator for general action",  "bicc.bat_ase_Instruction_ind_for_general_action",
7900                         FT_UINT8, BASE_HEX, VALS(Instruction_indicator_for_general_action_vals),0x03,
7901                         "", HFILL }},
7902
7903                 { &hf_Send_notification_ind_for_general_action,
7904                         { "Send notification indicator for general action",  "bicc.bat_ase_Send_notification_ind_for_general_action",
7905                         FT_BOOLEAN, 8, TFS(&isup_Send_notification_ind_value), 0x04,
7906                         "", HFILL }},
7907
7908                 { &hf_Instruction_ind_for_pass_on_not_possible,
7909                         { "Instruction ind for pass-on not possible",  "bicc.bat_ase_Instruction_ind_for_pass_on_not_possible",
7910                         FT_UINT8, BASE_HEX, VALS(Instruction_indicator_for_pass_on_not_possible_vals),0x30,
7911                         "", HFILL }},
7912
7913                 { &hf_Send_notification_ind_for_pass_on_not_possible,
7914                         { "Send notification indication for pass-on not possible",  "bicc.bat_ase_Send_notification_ind_for_pass_on_not_possible",
7915                         FT_BOOLEAN, 8, TFS(&isup_Send_notification_ind_value), 0x40,
7916                         "", HFILL }},
7917
7918                 { &hf_BCTP_Version_Indicator,
7919                         { "BCTP Version Indicator",  "bicc.bat_ase_BCTP_Version_Indicator",
7920                         FT_UINT8, BASE_DEC, NULL,0x1f,
7921                         "", HFILL }},
7922
7923                 { &hf_BVEI,
7924                         { "BVEI",  "bicc.bat_ase_BCTP_BVEI",
7925                         FT_BOOLEAN, 8, TFS(&BCTP_BVEI_value), 0x40,
7926                         "", HFILL }},
7927
7928                 { &hf_Tunnelled_Protocol_Indicator,
7929                         { "Tunnelled Protocol Indicator",  "bicc.bat_ase_BCTP_Tunnelled_Protocol_Indicator",
7930                         FT_UINT8, BASE_DEC, VALS(BCTP_Tunnelled_Protocol_Indicator_vals),0x3f,
7931                         "", HFILL }},
7932
7933                 { &hf_TPEI,
7934                         { "TPEI",  "bicc.bat_ase_BCTP_tpei",
7935                         FT_BOOLEAN, 8, TFS(&BCTP_TPEI_value), 0x40,
7936                         "", HFILL }},
7937
7938                 { &hf_bncid,
7939                         { "Backbone Network Connection Identifier (BNCId)", "bat_ase.bncid",
7940                         FT_UINT32, BASE_HEX, NULL, 0x0,
7941                           "", HFILL }},
7942
7943                 { &hf_bat_ase_biwfa,
7944                         { "Interworking Function Address( X.213 NSAP encoded)", "bat_ase_biwfa",
7945                         FT_BYTES, BASE_HEX, NULL, 0x0,
7946                           "", HFILL }},
7947
7948                 { &hf_afi,
7949                         { "X.213 Address Format Information ( AFI )",  "x213.afi",
7950                         FT_UINT8, BASE_HEX, VALS(x213_afi_value),0x0,
7951                         "", HFILL }},
7952
7953                 { &hf_bicc_nsap_dsp,
7954                         { "X.213 Address Format Information ( DSP )",  "x213.dsp",
7955                         FT_BYTES, BASE_HEX, NULL,0x0,
7956                         "", HFILL }},
7957                 { &hf_characteristics,
7958                         { "Backbone network connection characteristics", "bat_ase.char",
7959                         FT_UINT8, BASE_HEX, VALS(bearer_network_connection_characteristics_vals),0x0,
7960                           "", HFILL }},
7961
7962                 { &hf_Organization_Identifier,
7963                         { "Organization identifier subfield ",  "bat_ase.organization_identifier_subfield",
7964                         FT_UINT8, BASE_DEC, VALS(bat_ase_organization_identifier_subfield_vals),0x0,
7965                         "", HFILL }},
7966
7967                 { &hf_codec_type,
7968                         { "ITU-T codec type subfield",  "bat_ase.ITU_T_codec_type_subfield",
7969                         FT_UINT8, BASE_HEX, VALS(ITU_T_codec_type_subfield_vals),0x0,
7970                         "", HFILL }},
7971
7972                 { &hf_etsi_codec_type,
7973                         { "ETSI codec type subfield",  "bat_ase.ETSI_codec_type_subfield",
7974                         FT_UINT8, BASE_HEX, VALS(ETSI_codec_type_subfield_vals),0x0,
7975                         "", HFILL }},
7976
7977                 { &hf_active_code_set,
7978                         { "Active Code Set",  "bat_ase.acs",
7979                         FT_UINT8, BASE_HEX, NULL,0x0,
7980                         "", HFILL }},
7981
7982                 { &hf_active_code_set_12_2,
7983                         { "12.2 kbps rate",  "bat_ase.acs.12_2",
7984                         FT_UINT8, BASE_HEX, NULL,0x80,
7985                         "", HFILL }},
7986
7987                 { &hf_active_code_set_10_2,
7988                         { "10.2 kbps rate",  "bat_ase.acs.10_2",
7989                         FT_UINT8, BASE_HEX, NULL,0x40,
7990                         "", HFILL }},
7991
7992                 { &hf_active_code_set_7_95,
7993                         { "7.95 kbps rate",  "bat_ase.acs.7_95",
7994                         FT_UINT8, BASE_HEX, NULL,0x20,
7995                         "", HFILL }},
7996
7997                 { &hf_active_code_set_7_40,
7998                         { "7.40 kbps rate",  "bat_ase.acs.7_40",
7999                         FT_UINT8, BASE_HEX, NULL,0x10,
8000                         "", HFILL }},
8001
8002                 { &hf_active_code_set_6_70,
8003                         { "6.70 kbps rate",  "bat_ase.acs.6_70",
8004                         FT_UINT8, BASE_HEX, NULL,0x08,
8005                         "", HFILL }},
8006
8007                 { &hf_active_code_set_5_90,
8008                         { "5.90 kbps rate",  "bat_ase.acs.5_90",
8009                         FT_UINT8, BASE_HEX, NULL,0x04,
8010                         "", HFILL }},
8011
8012                 { &hf_active_code_set_5_15,
8013                         { "5.15 kbps rate",  "bat_ase.acs.5_15",
8014                         FT_UINT8, BASE_HEX, NULL,0x02,
8015                         "", HFILL }},
8016
8017                 { &hf_active_code_set_4_75,
8018                         { "4.75 kbps rate",  "bat_ase.acs.4_75",
8019                         FT_UINT8, BASE_HEX, NULL,0x01,
8020                         "", HFILL }},
8021
8022                 { &hf_supported_code_set,
8023                         { "Supported Code Set",  "bat_ase.scs",
8024                         FT_UINT8, BASE_HEX, NULL,0x0,
8025                         "", HFILL }},
8026
8027                 { &hf_supported_code_set_12_2,
8028                         { "12.2 kbps rate",  "bat_ase.scs.12_2",
8029                         FT_UINT8, BASE_HEX, NULL,0x80,
8030                         "", HFILL }},
8031
8032                 { &hf_supported_code_set_10_2,
8033                         { "10.2 kbps rate",  "bat_ase.scs.10_2",
8034                         FT_UINT8, BASE_HEX, NULL,0x40,
8035                         "", HFILL }},
8036
8037                 { &hf_supported_code_set_7_95,
8038                         { "7.95 kbps rate",  "bat_ase.scs.7_95",
8039                         FT_UINT8, BASE_HEX, NULL,0x20,
8040                         "", HFILL }},
8041
8042                 { &hf_supported_code_set_7_40,
8043                         { "7.40 kbps rate",  "bat_ase.scs.7_40",
8044                         FT_UINT8, BASE_HEX, NULL,0x10,
8045                         "", HFILL }},
8046
8047                 { &hf_supported_code_set_6_70,
8048                         { "6.70 kbps rate",  "bat_ase.scs.6_70",
8049                         FT_UINT8, BASE_HEX, NULL,0x08,
8050                         "", HFILL }},
8051
8052                 { &hf_supported_code_set_5_90,
8053                         { "5.90 kbps rate",  "bat_ase.scs.5_90",
8054                         FT_UINT8, BASE_HEX, NULL,0x04,
8055                         "", HFILL }},
8056
8057                 { &hf_supported_code_set_5_15,
8058                         { "5.15 kbps rate",  "bat_ase.scs.5_15",
8059                         FT_UINT8, BASE_HEX, NULL,0x02,
8060                         "", HFILL }},
8061
8062                 { &hf_supported_code_set_4_75,
8063                         { "4.75 kbps rate",  "bat_ase.scs.4_75",
8064                         FT_UINT8, BASE_HEX, NULL,0x01,
8065                         "", HFILL }},
8066
8067                 { &hf_optimisation_mode,
8068                         { "Optimisation Mode for ACS , OM",  "bat_ase.optimisation_mode",
8069                         FT_UINT8, BASE_HEX, VALS(optimisation_mode_vals),0x8,
8070                         "Optimisation Mode for ACS , OM", HFILL }},
8071
8072                 { &hf_max_codec_modes,
8073                         { "Maximal number of Codec Modes, MACS",  "bat_ase.macs",
8074                         FT_UINT8, BASE_DEC, NULL,0x07,
8075                         "Maximal number of Codec Modes, MACS", HFILL }},
8076
8077
8078                 { &hf_bearer_control_tunneling,
8079                         { "Bearer control tunneling",  "bat_ase.bearer_control_tunneling",
8080                         FT_BOOLEAN, 8, TFS(&Bearer_Control_Tunnelling_ind_value),0x01,
8081                         "", HFILL }},
8082
8083                 { &hf_BAT_ASE_Comp_Report_Reason,
8084                         { "Compabillity report reason",  "bat_ase.Comp_Report_Reason",
8085                         FT_UINT8, BASE_HEX, VALS(BAT_ASE_Report_Reason_vals),0x0,
8086                         "", HFILL }},
8087
8088
8089                 { &hf_BAT_ASE_Comp_Report_ident,
8090                         { "Bearer control tunneling",  "bat_ase.bearer_control_tunneling",
8091                         FT_UINT8, BASE_HEX, VALS(bat_ase_list_of_Identifiers_vals),0x0,
8092                         "", HFILL }},
8093
8094                 { &hf_BAT_ASE_Comp_Report_diagnostic,
8095                         { "Diagnostics",  "bat_ase.Comp_Report_diagnostic",
8096                         FT_UINT16, BASE_HEX, NULL,0x0,
8097                         "", HFILL }},
8098
8099                 { &hf_Local_BCU_ID,
8100                         { "Local BCU ID",  "bat_ase.Local_BCU_ID",
8101                         FT_UINT32, BASE_HEX, NULL, 0x0,
8102                           "", HFILL }},
8103
8104                 { &hf_late_cut_trough_cap_ind,
8105                         { "Late Cut-through capability indicator",  "bat_ase.late_cut_trough_cap_ind",
8106                         FT_BOOLEAN, 8, TFS(&late_cut_trough_cap_ind_value),0x01,
8107                         "", HFILL }},
8108
8109                 { &hf_bat_ase_signal,
8110                         { "Q.765.5 - Signal Type",  "bat_ase.signal_type",
8111                         FT_UINT8, BASE_HEX, VALS(BAt_ASE_Signal_Type_vals),0x0,
8112                         "", HFILL }},
8113
8114                 { &hf_bat_ase_duration,
8115                         { "Duration in ms",  "bat_ase.signal_type",
8116                         FT_UINT16, BASE_DEC, NULL,0x0,
8117                         "", HFILL }},
8118
8119                 { &hf_bat_ase_bearer_redir_ind,
8120                         { "Redirection Indicator",  "bat_ase.bearer_redir_ind",
8121                         FT_UINT8, BASE_HEX, VALS(Bearer_Redirection_Indicator_vals),0x0,
8122                         "", HFILL }},
8123
8124                 { &hf_nsap_ipv4_addr,
8125                         { "IWFA IPv4 Address", "nsap.ipv4_addr",
8126                         FT_IPv4, BASE_NONE, NULL, 0x0,
8127                         "IPv4 address", HFILL }},
8128
8129                 { &hf_nsap_ipv6_addr,
8130                         { "IWFA IPv6 Address", "nsap.ipv6_addr",
8131                         FT_IPv6, BASE_NONE, NULL, 0x0,
8132                         "IPv6 address", HFILL}},
8133
8134                 { &hf_iana_icp,
8135                         { "IANA ICP",  "nsap.iana_icp",
8136                         FT_UINT16, BASE_HEX, VALS(iana_icp_values),0x0,
8137                       "", HFILL }},
8138
8139               { &hf_isup_called,
8140                       { "ISUP Called Number",  "isup.called",
8141                       FT_STRING, BASE_NONE, NULL,0x0,
8142                       "", HFILL }},
8143
8144               { &hf_isup_calling,
8145                       { "ISUP Calling Number",  "isup.calling",
8146                       FT_STRING, BASE_NONE, NULL,0x0,
8147                       "", HFILL }},
8148
8149               { &hf_isup_redirecting,
8150                       { "ISUP Redirecting Number",  "isup.redirecting",
8151                       FT_STRING, BASE_NONE, NULL,0x0,
8152                         "", HFILL }},
8153                 {&hf_isup_apm_msg_fragments,
8154                         {"Message fragments", "isup_apm.msg.fragments",
8155                         FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL }
8156                 },
8157                 {&hf_isup_apm_msg_fragment,
8158                         {"Message fragment", "isup_apm.msg.fragment",
8159                         FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }
8160                 },
8161                 {&hf_isup_apm_msg_fragment_overlap,
8162                         {"Message fragment overlap", "isup_apm.msg.fragment.overlap",
8163                         FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
8164                 },
8165                 {&hf_isup_apm_msg_fragment_overlap_conflicts,
8166                         {"Message fragment overlapping with conflicting data","isup_apm.msg.fragment.overlap.conflicts",
8167                         FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
8168                 },
8169                 {&hf_isup_apm_msg_fragment_multiple_tails,
8170                         {"Message has multiple tail fragments", "isup_apm.msg.fragment.multiple_tails",
8171                         FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
8172                 },
8173                 {&hf_isup_apm_msg_fragment_too_long_fragment,
8174                         {"Message fragment too long", "isup_apm.msg.fragment.too_long_fragment",
8175                         FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
8176                 },
8177                 {&hf_isup_apm_msg_fragment_error,
8178                         {"Message defragmentation error", "isup_apm.msg.fragment.error",
8179                         FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }
8180                 },
8181                 {&hf_isup_apm_msg_reassembled_in,
8182                         {"Reassembled in", "isup_apm.msg.reassembled.in",
8183                         FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }
8184                 },
8185                 {&hf_isup_cvr_rsp_ind,
8186                  {"CVR Response Ind", "conn_rsp_ind",
8187                   FT_UINT8, BASE_DEC, VALS(isup_cvr_rsp_ind_value), BA_8BIT_MASK,
8188                   "", HFILL }},
8189                 {&hf_isup_cvr_cg_car_ind,
8190                  {"CVR Circuit Group Carrier","cg_carrier_ind",
8191                  FT_UINT8, BASE_HEX, VALS(isup_cvr_cg_car_ind_value), BA_8BIT_MASK,
8192                   "", HFILL }},
8193                 {&hf_isup_cvr_cg_double_seize,
8194                  {"Doube Seize Control", "cg_char_ind.doubleSeize",
8195                   FT_UINT8, BASE_HEX, VALS(isup_cvr_cg_double_seize_value), DC_8BIT_MASK,
8196                   "", HFILL }},
8197                 {&hf_isup_cvr_cg_alarm_car_ind,
8198                  {"Alarm Carrier Indicator", "cg_alarm_car_ind",
8199                   FT_UINT8, BASE_HEX, VALS(isup_cvr_alarm_car_ind_value), FE_8BIT_MASK,
8200                   "", HFILL }},
8201                 {&hf_isup_cvr_cont_chk_ind,
8202                  {"Continuity Check Indicator","cg_alarm_cnt_chk",
8203                   FT_UINT8, BASE_HEX, VALS(isup_cvr_cont_chk_ind_value), HG_8BIT_MASK,
8204                   "",HFILL }}
8205         };
8206
8207 /* Setup protocol subtree array */
8208         static gint *ett[] = {
8209                 &ett_isup,
8210                 &ett_isup_parameter,
8211                 &ett_isup_address_digits,
8212                 &ett_isup_pass_along_message,
8213                 &ett_isup_circuit_state_ind,
8214                 &ett_bat_ase,
8215                 &ett_bat_ase_element,
8216                 &ett_bat_ase_iwfa,
8217                 &ett_scs,
8218                 &ett_acs,
8219                 &ett_isup_apm_msg_fragment,
8220                 &ett_isup_apm_msg_fragments,
8221         };
8222
8223 /* Register the protocol name and description */
8224         proto_isup = proto_register_protocol("ISDN User Part",
8225             "ISUP", "isup");
8226
8227         register_dissector("isup", dissect_isup, proto_isup);
8228
8229 /* Required function calls to register the header fields and subtrees used */
8230         proto_register_field_array(proto_isup, hf, array_length(hf));
8231         proto_register_subtree_array(ett, array_length(ett));
8232
8233         isup_tap = register_tap("isup");
8234
8235         isup_module = prefs_register_protocol(proto_isup, NULL);
8236
8237
8238         prefs_register_bool_preference(isup_module, "show_cic_in_info", "Show CIC in Info column",
8239                                  "Show the CIC value (in addition to the message type) in the Info column",
8240                                  (gint *)&isup_show_cic_in_info);
8241
8242         prefs_register_bool_preference(isup_module, "defragment_apm",
8243                 "Reassemble APM messages",
8244                 "Whether APM messages datagrams should be reassembled",
8245                 &isup_apm_desegment);
8246
8247         /* Register the stats_tree */
8248         stats_tree_register("isup","isup_msg","ISUP Messages", msg_stats_tree_packet, msg_stats_tree_init, NULL );
8249 }
8250
8251
8252 /* ------------------------------------------------------------------ */
8253 /* Register isup with the sub-laying MTP L3 dissector */
8254 void
8255 proto_reg_handoff_isup(void)
8256 {
8257   dissector_handle_t isup_handle;
8258   dissector_handle_t application_isup_handle;
8259
8260   isup_handle = create_dissector_handle(dissect_isup, proto_isup);
8261   application_isup_handle = create_dissector_handle(dissect_application_isup, proto_isup);
8262   dissector_add("mtp3.service_indicator", MTP3_ISUP_SERVICE_INDICATOR, isup_handle);
8263   dissector_add_string("media_type","application/isup", application_isup_handle);
8264   dissector_add_string("tali.opcode", "isot", isup_handle);
8265
8266 }
8267
8268 void
8269 proto_register_bicc(void)
8270 {
8271 /* Setup list of header fields  See Section 1.6.1 for details*/
8272         static hf_register_info hf[] = {
8273                 { &hf_bicc_cic,
8274                         { "Call identification Code (CIC)",           "bicc.cic",
8275                         FT_UINT32, BASE_HEX, NULL, 0x0,
8276                           "", HFILL }},
8277         };
8278
8279 /* Setup protocol subtree array */
8280         static gint *ett[] = {
8281                 &ett_bicc
8282         };
8283         proto_bicc = proto_register_protocol("Bearer Independent Call Control ",
8284             "BICC", "bicc");
8285 /* Required function calls to register the header fields and subtrees used */
8286         proto_register_field_array(proto_bicc, hf, array_length(hf));
8287         proto_register_subtree_array(ett, array_length(ett));
8288
8289         register_init_routine(isup_apm_defragment_init);
8290 }
8291
8292 /* Register isup with the sub-laying MTP L3 dissector */
8293 void
8294 proto_reg_handoff_bicc(void)
8295 {
8296   dissector_handle_t bicc_handle;
8297   sdp_handle = find_dissector("sdp");
8298   q931_ie_handle = find_dissector("q931.ie");
8299
8300   bicc_handle = create_dissector_handle(dissect_bicc, proto_bicc);
8301   dissector_add("mtp3.service_indicator", MTP3_BICC_SERVICE_INDICATOR, bicc_handle);
8302   dissector_add("sctp.ppi", BICC_PAYLOAD_PROTOCOL_ID, bicc_handle);
8303 }