summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ua3g.c
blob: c8573e596e54627681f3d2418bc35ecc3277038a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
/* packet-ua3g.c
 * Routines for UA3G (Universal Alcatel) packet dissection.
 * Copyright 2012, Alcatel-Lucent Enterprise <lars.ruoff@alcatel-lucent.com>
 * Copyright 2017, Alcatel-Lucent Enterprise <nicolas.bertin@al-enterprise.com>
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#include "config.h"

#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/tfs.h>
#include <epan/unit_strings.h>

#include <wsutil/array.h>
#include "packet-rtp.h"
#include "packet-rtcp.h"

#include "packet-uaudp.h"

void proto_register_ua3g(void);
void proto_reg_handoff_ua3g(void);
/*-----------------------------------------------------------------------------
    Globals
    ---------------------------------------------------------------------------*/

#if 0
static dissector_table_t ua3g_opcode_dissector_table;
#endif

static int  proto_ua3g;
static int ett_ua3g;
static int ett_ua3g_body;
static int ett_ua3g_param;
static int ett_ua3g_param_sub;
static int ett_ua3g_option;
static int ett_ua3g_beep_beep_destination;
static int ett_ua3g_note;

static bool setup_conversations_enabled = true;

static int  hf_ua3g_length;
static int  hf_ua3g_opcode_sys;
static int  hf_ua3g_opcode_term;
static int  hf_ua3g_opcode_production_test;
static int  hf_ua3g_opcode_subservice_reset;
static int  hf_ua3g_opcode_are_you_there;
static int  hf_ua3g_opcode_set_speaker_vol;
static int  hf_ua3g_opcode_trace_on;
static int  hf_ua3g_ip;
static int  hf_ua3g_ip_cs;
static int  hf_ua3g_command_led;
static int  hf_ua3g_command_lcd_line;
static int  hf_ua3g_main_voice_mode;
static int  hf_ua3g_command_set_clck;
static int  hf_ua3g_external_ringing_command;
static int  hf_ua3g_lcd_cursor;
static int  hf_ua3g_command_beep;
static int  hf_ua3g_command_sidetone;
static int  hf_ua3g_command_mute;
static int  hf_ua3g_command_feedback;
static int  hf_ua3g_command_audio_config;
static int  hf_ua3g_command_key_release;
static int  hf_ua3g_command_amplified_handset;
static int  hf_ua3g_command_loudspeaker;
static int  hf_ua3g_command_announce;
static int  hf_ua3g_command_ring;
static int  hf_ua3g_command_ua_dwl_protocol;
static int  hf_ua3g_command_unsolicited_msg;
static int  hf_ua3g_ip_device_routing_stop_rtp_parameter;
static int  hf_ua3g_ip_device_routing_stop_rtp_parameter_length;
static int  hf_ua3g_ip_device_routing_stop_rtp_parameter_value_num;
static int  hf_ua3g_ip_device_routing_stop_rtp_parameter_value_bytes;
/* Generated from convert_proto_tree_add_text.pl */
static int hf_ua3g_ip_device_routing_start_tone_direction;
static int hf_ua3g_ip_device_routing_start_tone_num_entries;
static int hf_ua3g_ip_device_routing_def_tones_num_entries;
static int hf_ua3g_cs_ip_device_routing_cmd00_characteristic_number;
static int hf_ua3g_subdevice_msg_subdev_type;
static int hf_ua3g_unsolicited_msg_next_byte_of_bad_segment;
static int hf_ua3g_ip_device_routing_start_tone_identification;
static int hf_ua3g_ip_device_routing_def_tones_level_2;
static int hf_ua3g_r_w_peripheral_content;
static int hf_ua3g_subdevice_metastate_subchannel_address;
static int hf_ua3g_subdevice_parameter_bytes;
static int hf_ua3g_subdevice_msg_parameter_bytes;
static int hf_ua3g_set_clck_timer_pos_call_timer_column_number;
static int hf_ua3g_unsolicited_msg_segment_failure_s;
static int hf_ua3g_ip_device_routing_reset_parameter;
static int hf_ua3g_ip_device_routing_get_param_req_parameter;
static int hf_ua3g_set_lcd_contrast_driver_number;
static int hf_ua3g_dwl_special_char_character_number;
static int hf_ua3g_cs_ip_device_routing_cmd00_vta_type;
static int hf_ua3g_ua_dwl_protocol_cause;
static int hf_ua3g_audio_padded_path_emission_padded_level;
static int hf_ua3g_set_clck_timer_pos_clock_column_number;
static int hf_ua3g_segment_msg_num_remaining;
static int hf_ua3g_ip_device_routing_digit_value;
static int hf_ua3g_super_msg_data;
static int hf_ua3g_unsolicited_msg_hardware_version;
static int hf_ua3g_voice_channel_announce;
static int hf_ua3g_ring_silent;
static int hf_ua3g_audio_config_handsfree_return;
static int hf_ua3g_dwl_dtmf_clck_format_inter_digit_pause_time;
static int hf_ua3g_ip_device_routing_set_param_req_parameter_length;
static int hf_ua3g_unsolicited_msg_opcode_bad_segment;
static int hf_ua3g_unsolicited_msg_firmware_version_loader;
static int hf_ua3g_debug_in_line;
static int hf_ua3g_voice_channel_b_microphones;
static int hf_ua3g_beep_beep_number;
static int hf_ua3g_main_voice_mode_tune;
static int hf_ua3g_super_msg_length;
static int hf_ua3g_ip_device_routing_redirect_parameter;
static int hf_ua3g_unsolicited_msg_next_byte_of_bad_command;
static int hf_ua3g_unsolicited_msg_self_test_result;
static int hf_ua3g_beep_on_off;
static int hf_ua3g_ua_dwl_protocol_binary_length;
static int hf_ua3g_ring_speaker_level;
static int hf_ua3g_voice_channel_channel_mode;
static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_length;
static int hf_ua3g_ip_device_routing_start_rtp_parameter;
static int hf_ua3g_subdevice_metastate_new_metastate;
static int hf_ua3g_unsolicited_msg_other_information_2;
static int hf_ua3g_set_lcd_contrast_contrast_value;
static int hf_ua3g_unsolicited_msg_vta_type;
static int hf_ua3g_ua_dwl_protocol_packet_number;
static int hf_ua3g_unsolicited_msg_segment_failure_l;
static int hf_ua3g_voice_channel_b_ear_piece;
static int hf_ua3g_subdevice_msg_subdev_address;
static int hf_ua3g_ring_progressive;
static int hf_ua3g_ua_dwl_protocol_item_version;
static int hf_ua3g_ip_device_routing_reset_parameter_length;
static int hf_ua3g_dwl_dtmf_clck_format_minimum_on_time;
static int hf_ua3g_ring_melody;
static int hf_ua3g_ua_dwl_protocol_item_identifier;
static int hf_ua3g_main_voice_mode_speaker_volume;
static int hf_ua3g_ip_device_routing_listen_rtp_parameter_length;
static int hf_ua3g_ringing_cadence_length;
static int hf_ua3g_software_reset;
static int hf_ua3g_feedback_level;
static int hf_ua3g_ip_phone_warmstart;
static int hf_ua3g_subdevice_opcode;
static int hf_ua3g_unsolicited_msg_device_event;
static int hf_ua3g_segment_message_data;
static int hf_ua3g_main_voice_mode_sending_level;
static int hf_ua3g_subdevice_msg_subdevice_opcode;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter;
static int hf_ua3g_audio_padded_path_reception_padded_level;
static int hf_ua3g_ua_dwl_protocol_force_mode;
static int hf_ua3g_lcd_line_cmd_starting_column;
static int hf_ua3g_subdevice_address;
static int hf_ua3g_ip_device_routing_pause_restart_rtp_parameter;
static int hf_ua3g_audio_config_ignored;
static int hf_ua3g_lcd_line_cmd_lcd_options;
static int hf_ua3g_main_voice_mode_cadence;
static int hf_ua3g_segment_msg_length;
static int hf_ua3g_ua_dwl_protocol_acknowledge;
static int hf_ua3g_command_led_number;
static int hf_ua3g_set_clck_timer_pos_call_timer_line_number;
static int hf_ua3g_unsolicited_msg_segment_failure_t;
static int hf_ua3g_ip_device_routing_start_tone_duration;
static int hf_ua3g_unsolicited_msg_other_information_1;
static int hf_ua3g_unsolicited_msg_firmware_datas_patch_version;
static int hf_ua3g_ring_beep_number;
static int hf_ua3g_feedback_duration;
static int hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_length;
static int hf_ua3g_audio_config_law;
static int hf_ua3g_ua_dwl_protocol_checksum;
static int hf_ua3g_ip_device_routing_pause_restart_rtp_parameter_value;
static int hf_ua3g_audio_config_handsfree_handsfree;
static int hf_ua3g_ringing_cadence_cadence;
static int hf_ua3g_lcd_cursor_line_number;
static int hf_ua3g_ip_device_routing_def_tones_level_1;
static int hf_ua3g_unsolicited_msg_opcode_of_bad_command;
static int hf_ua3g_ua_dwl_protocol_download_ack_status;
static int hf_ua3g_voice_channel_main_voice;
static int hf_ua3g_ip_device_routing_pause_restart_rtp_parameter_length;
static int hf_ua3g_icon_cmd_segment;
static int hf_ua3g_cs_ip_device_routing_cmd01_incident_0;
static int hf_ua3g_beep_destination;
static int hf_ua3g_ip_device_routing_def_tones_frequency_1;
static int hf_ua3g_unsolicited_msg_datas_version;
static int hf_ua3g_dwl_dtmf_clck_format_dtmf_country_adaptation;
static int hf_ua3g_ringing_cadence_on_off;
static int hf_ua3g_audio_config_volume_level;
static int hf_ua3g_voice_channel_b_general;
static int hf_ua3g_beep_terminator;
static int hf_ua3g_cs_ip_device_routing_cmd02_parameter;
static int hf_ua3g_unsolicited_msg_firmware_version_bootloader;
static int hf_ua3g_ip_device_routing_set_param_req_parameter;
static int hf_ua3g_ip_device_routing_start_rtp_direction;
static int hf_ua3g_set_clck_timer_pos_clock_line_number;
static int hf_ua3g_voice_channel_b_loud_speaker;
static int hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter;
static int hf_ua3g_on_off_level_level_on_loudspeaker;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_length;
static int hf_ua3g_main_voice_mode_microphone_volume;
static int hf_ua3g_sidetone_level;
static int hf_ua3g_beep_number_of_notes;
static int hf_ua3g_unsolicited_msg_segment_failure_num;
static int hf_ua3g_dwl_special_char_byte;
static int hf_ua3g_ring_cadence;
static int hf_ua3g_unsolicited_msg_device_type;
static int hf_ua3g_voice_channel_codec;
static int hf_ua3g_ip_device_routing_redirect_parameter_length;
static int hf_ua3g_ip_device_routing_listen_rtp_parameter;
static int hf_ua3g_beep_cadence;
static int hf_ua3g_voice_channel_voice_channel;
static int hf_ua3g_unsolicited_msg_other_information;
static int hf_ua3g_ip_device_routing_def_tones_frequency_2;
static int hf_ua3g_digit_dialed_digit_value;
static int hf_ua3g_unsolicited_msg_subdevice_address;
static int hf_ua3g_ua_dwl_protocol_packet_download_end_ack_ok_status;
static int hf_ua3g_r_w_peripheral_address;
static int hf_ua3g_icon_cmd_icon_number;
static int hf_ua3g_dwl_dtmf_clck_format_clock_time_format;
static int hf_ua3g_ip_device_routing_start_rtp_parameter_length;
static int hf_ua3g_i_m_here_id_code;
static int hf_ua3g_ua_dwl_protocol_item_version_nc;
static int hf_ua3g_unsolicited_msg_firmware_version;
static int hf_ua3g_segment_msg_segment;
static int hf_ua3g_ip_device_routing_reset_parameter_noe_update;
static int hf_ua3g_ip_device_routing_reset_parameter_noe_update_bootloader;
static int hf_ua3g_ip_device_routing_reset_parameter_noe_update_data;
static int hf_ua3g_ip_device_routing_reset_parameter_noe_update_customization;
static int hf_ua3g_ip_device_routing_reset_parameter_noe_update_localization;
static int hf_ua3g_ip_device_routing_reset_parameter_noe_update_code;
static int hf_ua3g_ip_device_routing_reset_parameter_noe_update_sip;
static int hf_ua3g_ip_device_routing_reset_parameter_value;
static int hf_ua3g_ip_device_routing_reset_parameter_bad_sec_mode;
static int hf_ua3g_ip_device_routing_reset_parameter_cust_name;
static int hf_ua3g_ip_device_routing_reset_parameter_l10n_name;
static int hf_ua3g_ip_device_routing_reset_parameter_appl_mode;
static int hf_ua3g_ip_device_routing_reset_parameter_sip_name;
static int hf_ua3g_ip_device_routing_reset_parameter_reset_mac;
static int hf_ua3g_ip_device_routing_start_rtp_parameter_ip;
static int hf_ua3g_ip_device_routing_start_rtp_parameter_compressor;
static int hf_ua3g_ip_device_routing_start_rtp_parameter_value;
static int hf_ua3g_ip_device_routing_start_rtp_parameter_enabler;
static int hf_ua3g_ip_device_routing_start_rtp_parameter_send_qos;
static int hf_ua3g_ip_device_routing_start_rtp_parameter_dtmf_sending;
static int hf_ua3g_ip_device_routing_start_rtp_parameter_rfc2198;
static int hf_ua3g_ip_device_routing_start_rtp_parameter_srtp_encryption;
static int hf_ua3g_ip_device_routing_start_rtp_parameter_uint;
static int hf_ua3g_ip_device_routing_redirect_parameter_ip;
static int hf_ua3g_ip_device_routing_redirect_parameter_uint;
static int hf_ua3g_ip_device_routing_redirect_parameter_value;
static int hf_ua3g_ip_device_routing_listen_rtp_parameter_ip;
static int hf_ua3g_ip_device_routing_listen_rtp_parameter_port;
static int hf_ua3g_ip_device_routing_listen_rtp_parameter_value;
static int hf_ua3g_ip_device_routing_set_param_req_parameter_compressor;
static int hf_ua3g_ip_device_routing_set_param_req_parameter_err_string;
static int hf_ua3g_ip_device_routing_set_param_req_parameter_tftp_backup_ip;
static int hf_ua3g_ip_device_routing_set_param_req_parameter_set_pc_port_status;
static int hf_ua3g_ip_device_routing_set_param_req_parameter_record_rtp_auth;
static int hf_ua3g_ip_device_routing_set_param_req_parameter_security_flag_filter;
static int hf_ua3g_ip_device_routing_set_param_req_parameter_stable_mode;
static int hf_ua3g_ip_device_routing_set_param_req_parameter_skin_id;
static int hf_ua3g_ip_device_routing_set_param_req_parameter_language_id;
static int hf_ua3g_ip_device_routing_set_param_req_parameter_usb_boost;
static int hf_ua3g_ip_device_routing_set_param_req_parameter_als_device;
static int hf_ua3g_ip_device_routing_set_param_req_parameter_busy_light;
static int hf_ua3g_ip_device_routing_set_param_req_parameter_audio_env;
static int hf_ua3g_ip_device_routing_set_param_req_parameter_uint;
static int hf_ua3g_ip_device_routing_set_param_req_parameter_value;
static int hf_ua3g_ip_device_routing_pause_restart_rtp_parameter_uint;
static int hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_remote_ip;
static int hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_uint;
static int hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_value;
static int hf_ua3g_ip_device_routing_freeseating_parameter;
static int hf_ua3g_ip_device_routing_freeseating_parameter_length;
static int hf_ua3g_ip_device_routing_freeseating_parameter_mac;
static int hf_ua3g_ip_device_routing_freeseating_parameter_ip;
static int hf_ua3g_ip_device_routing_freeseating_parameter_ipv6;
static int hf_ua3g_ip_device_routing_freeseating_parameter_do_reset;
static int hf_ua3g_ip_device_routing_freeseating_parameter_uint;
static int hf_ua3g_ip_device_routing_freeseating_parameter_value;
static int hf_ua3g_ip_device_routing_appl_parameter;
static int hf_ua3g_ip_device_routing_appl_parameter_length;
static int hf_ua3g_ip_device_routing_appl_parameter_id;
static int hf_ua3g_ip_device_routing_appl_parameter_enable;
static int hf_ua3g_ip_device_routing_appl_parameter_url;
static int hf_ua3g_ip_device_routing_appl_parameter_uint;
static int hf_ua3g_ip_device_routing_appl_parameter_value;
static int hf_ua3g_main_voice_mode_handset_level;
static int hf_ua3g_main_voice_mode_headset_level;
static int hf_ua3g_main_voice_mode_handsfree_level;
static int hf_ua3g_audio_config_dpi_chan_ua_tx1;
static int hf_ua3g_audio_config_dpi_chan_ua_tx2;
static int hf_ua3g_audio_config_dpi_chan_gci_tx1;
static int hf_ua3g_audio_config_dpi_chan_gci_tx2;
static int hf_ua3g_audio_config_dpi_chan_cod_tx;
static int hf_ua3g_audio_config_audio_circuit_dth;
static int hf_ua3g_audio_config_audio_circuit_dtr;
static int hf_ua3g_audio_config_audio_circuit_dtf;
static int hf_ua3g_audio_config_audio_circuit_str;
static int hf_ua3g_audio_config_audio_circuit_ahp1;
static int hf_ua3g_audio_config_audio_circuit_ahp2;
static int hf_ua3g_audio_config_audio_circuit_ath;
static int hf_ua3g_audio_config_audio_circuit_atr;
static int hf_ua3g_audio_config_audio_circuit_atf;
static int hf_ua3g_audio_config_audio_circuit_alm;
static int hf_ua3g_audio_config_loudspeaker_aco_param_group_listen;
static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_attenuation;
static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_stay_in_send;
static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_shift_right_mtx;
static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_shift_right_mrc;
static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_idle_trans_threshold;
static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_low_trans_threshold;
static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_idle_recv_threshold;
static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_low_recv_threshold;
static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_med_recv_threshold;
static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_high_recv_threshold;
static int hf_ua3g_ua_dwl_protocol_files_inc_boot_binary;
static int hf_ua3g_ua_dwl_protocol_files_inc_loader_binary;
static int hf_ua3g_ua_dwl_protocol_files_inc_appli_binary;
static int hf_ua3g_ua_dwl_protocol_files_inc_data_binary;
static int hf_ua3g_ua_dwl_protocol_model_selection_a;
static int hf_ua3g_ua_dwl_protocol_model_selection_b;
static int hf_ua3g_ua_dwl_protocol_model_selection_c;
static int hf_ua3g_ua_dwl_protocol_model_selection_country_ver;
static int hf_ua3g_ua_dwl_protocol_hardware_selection_ivanoe1;
static int hf_ua3g_ua_dwl_protocol_hardware_selection_ivanoe2;
static int hf_ua3g_ua_dwl_protocol_memory_sizes_flash;
static int hf_ua3g_ua_dwl_protocol_memory_sizes_ext_ram;
static int hf_ua3g_unsolicited_msg_char_num_vta_subtype;
static int hf_ua3g_unsolicited_msg_char_num_generation;
static int hf_ua3g_unsolicited_msg_char_num_design;
static int hf_ua3g_unsolicited_msg_hardware_config_vta_type;
static int hf_ua3g_unsolicited_msg_hardware_config_design;
static int hf_ua3g_unsolicited_msg_hardware_config_subtype;
static int hf_ua3g_unsolicited_msg_hardware_config_hard_config_chip;
static int hf_ua3g_unsolicited_msg_hardware_config_hard_config_flash;
static int hf_ua3g_unsolicited_msg_hardware_config_config_ram;
static int hf_ua3g_unsolicited_msg_hardware_config;
static int hf_ua3g_unsolicited_msg_hardware_config_export_full;
static int hf_ua3g_unsolicited_msg_hardware_config_ethernet_hardware;
static int hf_ua3g_unsolicited_msg_hardware_config_extended_edition;
static int hf_ua3g_unsolicited_msg_hardware_config_wideband;
static int hf_ua3g_unsolicited_msg_hardware_config_3g_set;
static int hf_ua3g_unsolicited_msg_hardware_config_8082_set;
static int hf_ua3g_unsolicited_msg_hardware_config_super_wideband;
static int hf_ua3g_unsolicited_msg_hook_status;
static int hf_ua3g_unsolicited_msg_additional_vta_type;
static int hf_ua3g_unsolicited_msg_capability_info_bluetooth_supported;
static int hf_ua3g_unsolicited_msg_capability_info_vpn_encryption_status;
static int hf_ua3g_unsolicited_msg_capability_info_vpn;
static int hf_ua3g_unsolicited_msg_capability_info_ipsec;
static int hf_ua3g_unsolicited_msg_capability_info_dtls;
static int hf_ua3g_unsolicited_msg_capability_info_wlan_status;
static int hf_ua3g_unsolicited_msg_capability_info_reserved;
static int hf_ua3g_special_key_shift;
static int hf_ua3g_special_key_ctrl;
static int hf_ua3g_special_key_alt;
static int hf_ua3g_special_key_cmd;
static int hf_ua3g_special_key_shift_prime;
static int hf_ua3g_special_key_ctrl_prime;
static int hf_ua3g_special_key_alt_prime;
static int hf_ua3g_special_key_cmd_prime;
static int hf_ua3g_lcd_line_cmd_lcd_options_call_timer;
static int hf_ua3g_lcd_line_cmd_lcd_options_blink;
static int hf_ua3g_lcd_line_cmd_lcd_options_call_timer_control;
static int hf_ua3g_lcd_line_cmd_lcd_options_call_timer_display;
static int hf_ua3g_lcd_line_cmd_lcd_options_time_of_day_display;
static int hf_ua3g_lcd_line_cmd_lcd_options_suspend_display_refresh;
static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_firmware_version;
static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_tscip_version;
static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_ip;
static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_default_codec_uint;
static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_default_codec_bytes;
static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_mac_address;
static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_uint;
static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_value;
static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_lan_speed;
static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_lan_duplex;
static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_pc_speed;
static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_pc_duplex;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_type_of_equip;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_firmware_version;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_ip;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_string;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_codec;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_vad;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_ece;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_voice_mode;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_delay_distribution;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_consecutive_bfi;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_bfi_distribution;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_8021Q_used;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_8021P_priority;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_vlan_id;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_diffserv;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_bfi_distribution_200ms;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_consecutive_rtp_lost;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_uint;
static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_jitter_depth_distribution;
static int hf_ua3g_special_key_param_dtmf;
static int hf_ua3g_special_key_hookswitch_status;
static int hf_ua3g_subdevice_state;
static int hf_ua3g_cs_ip_device_routing_param_identifier;
static int hf_ua3g_key_number;
static int hf_ua3g_ua_dwl_protocol_binary_info;
static int hf_ua3g_lcd_line_cmd_unused;
static int hf_ua3g_lcd_line_cmd_ascii_char;
static int hf_ua3g_call_timer;
static int hf_ua3g_current_time;
static int hf_ua3g_beep_beep_destination_handset;
static int hf_ua3g_beep_beep_destination_headset;
static int hf_ua3g_beep_beep_destination_loudspeaker;
static int hf_ua3g_beep_beep_destination_announce_loudspeaker;
static int hf_ua3g_beep_beep_destination_handsfree;
static int hf_ua3g_beep_beep_destination;
static int hf_ua3g_beep_freq_sample;
static int hf_ua3g_beep_level;
static int hf_ua3g_beep_duration;
static int hf_ua3g_device_configuration;


/* Definition of opcodes */
/* System To Terminal */
#define SC_NOP                     0x00
#define SC_PRODUCTION_TEST         0x01    /* IP Phone */
#define SC_SUBDEVICE_ESCAPE        0x02    /* IP Phone */
#define SC_SOFT_RESET              0x03
#define SC_IP_PHONE_WARMSTART      0x04    /* IP Phone */
#define SC_HE_ROUTING              0x05    /* IP Phone - NOT EXPECTED */
#define SC_SUBDEVICE_RESET         0x06
#define SC_LOOPBACK_ON             0x07    /* IP Phone & UA NOE */
#define SC_LOOPBACK_OFF            0x08    /* IP Phone & UA NOE */
#define SC_VIDEO_ROUTING           0x09    /* IP Phone - NOT EXPECTED */
#define SC_SUPER_MSG               0x0B
#define SC_SEGMENT_MSG             0x0C
#define SC_REMOTE_UA_ROUTING       0x0D    /* IP Phone - NOT EXPECTED */
#define SC_VERY_REMOTE_UA_ROUTING  0x0E    /* IP Phone - NOT EXPECTED */
#define SC_OSI_ROUTING             0x0F    /* IP Phone - NOT EXPECTED */
#define SC_ABC_A_ROUTING           0x11    /* IP Phone - NOT EXPECTED */
#define SC_IBS_ROUTING             0x12    /* IP Phone - NOT EXPECTED */
#define SC_IP_DEVICE_ROUTING       0x13
#define SC_M_REFLEX_HUB_ROUTING    0x14    /* IP Phone - NOT EXPECTED */
#if 0
#define SC_NOE_CS_ROUTING          0x15    /* Decoded by packet-noe.c */
#define SC_NOE_PS_ROUTING          0x16    /* Decoded by packet-noe.c */
#endif
#define SC_SUPER_MSG_2             0x17
#define SC_DEBUG_IN_LINE           0x18
#define SC_LED_COMMAND             0x21    /* IP Phone */
#define SC_START_BUZZER            0x22    /* VTA */
#define SC_STOP_BUZZER             0x23    /* VTA */
#define SC_ENABLE_DTMF             0x24    /* Only IP NOE */
#define SC_DISABLE_DTMF            0x25    /* Only IP NOE */
#define SC_CLEAR_LCD_DISP          0x26    /* IP Phone */
#define SC_LCD_LINE_1_CMD          0x27    /* IP Phone */
#define SC_LCD_LINE_2_CMD          0x28    /* IP Phone */
#define SC_MAIN_VOICE_MODE         0x29
#define SC_VERSION_INQUIRY         0x2A
#define SC_ARE_YOU_THERE           0x2B    /* IP Phone & UA NOE */
#define SC_SUBDEVICE_METASTATE     0x2C
#define SC_VTA_STATUS_INQUIRY      0x2D    /* IP Phone */
#define SC_SUBDEVICE_STATE         0x2E
#define SC_DWL_DTMF_CLCK_FORMAT    0x30    /* IP Phone */
#define SC_SET_CLCK                0x31    /* IP Phone */
#define SC_VOICE_CHANNEL           0x32    /* IP Phone & UA NOE */
#define SC_EXTERNAL_RINGING        0x33
#define SC_LCD_CURSOR              0x35    /* IP Phone */
#define SC_DWL_SPECIAL_CHAR        0x36    /* IP Phone */
#define SC_SET_CLCK_TIMER_POS      0x38    /* IP Phone */
#define SC_SET_LCD_CONTRAST        0x39    /* IP Phone */
#define SC_AUDIO_IDLE              0x3A
#define SC_SET_SPEAKER_VOL         0x3B    /* IP Phone */
#define SC_BEEP                    0x3C
#define SC_SIDETONE                0x3D
#define SC_RINGING_CADENCE         0x3E
#define SC_MUTE                    0x3F
#define SC_FEEDBACK                0x40
#define SC_KEY_RELEASE             0x41    /* IP Phone */
#define SC_TRACE_ON                0x42    /* IP Phone - NOT EXPECTED */
#define SC_TRACE_OFF               0x43    /* IP Phone - NOT EXPECTED */
#define SC_READ_PERIPHERAL         0x44    /* IP Phone - NOT EXPECTED */
#define SC_WRITE_PERIPHERAL        0x45    /* IP Phone - NOT EXPECTED */
#define SC_ALL_ICONS_OFF           0x46    /* IP Phone */
#define SC_ICON_CMD                0x47    /* IP Phone */
#define SC_AMPLIFIED_HANDSET       0x48    /* IP Phone */
#define SC_AUDIO_CONFIG            0x49
#define SC_AUDIO_PADDED_PATH       0x4A    /* IP Phone */
#define SC_RELEASE_RADIO_LINK      0x4B    /* IP Phone - NOT EXPECTED */
#define SC_DECT_HANDOVER           0x4C    /* IP Phone - NOT EXPECTED */
#define SC_LOUDSPEAKER             0x4D
#define SC_ANNOUNCE                0x4E
#define SC_RING                    0x4F
#define SC_UA_DWL_PROTOCOL         0x50    /* Only UA NOE */

/* Terminal To System */
#define CS_NOP_ACK              0x00
#define CS_HANDSET_OFFHOOK      0x01    /* IP Phone */
#define CS_HANDSET_ONHOOK       0x02    /* IP Phone */
#define CS_DIGIT_DIALED         0x03    /* IP Phone */
#define CS_SUBDEVICE_MSG        0x04
#define CS_HE_ROUTING           0x05    /* IP Phone - NOT EXPECTED */
#define CS_LOOPBACK_ON          0x06    /* IP Phone & UA NOE */
#define CS_LOOPBACK_OFF         0x07    /* IP Phone & UA NOE */
#define CS_VIDEO_ROUTING        0x09    /* IP Phone - NOT EXPECTED */
#define CS_WARMSTART_ACK        0x0A    /* IP Phone */
#define CS_SUPER_MSG            0x0B    /* IP Phone - NOT EXPECTED */
#define CS_SEGMENT_MSG          0x0C
#define CS_REMOTE_UA_ROUTING    0x0D    /* IP Phone - NOT EXPECTED */
#define CS_VERY_REMOTE_UA_R     0x0E    /* IP Phone - NOT EXPECTED */
#define CS_OSI_ROUTING          0x0F    /* IP Phone - NOT EXPECTED */
#define CS_ABC_A_ROUTING        0x11    /* IP Phone - NOT EXPECTED */
#define CS_IBS_ROUTING          0x12    /* IP Phone - NOT EXPECTED */
#define CS_IP_DEVICE_ROUTING    0x13
#if 0
#define CS_NOE_CS_ROUTING       0x15    /* Decoded by packet-noe.c */
#define CS_NOE_PS_ROUTING       0x16    /* Decoded by packet-noe.c */
#endif
#define CS_SUPER_MSG_2          0x17
#define CS_DEBUG_IN_LINE        0x18
#define CS_NON_DIGIT_KEY_PUSHED 0x20    /* IP Phone */
#define CS_VERSION_RESPONSE     0x21
#define CS_I_M_HERE             0x22
#define CS_RSP_STATUS_INQUIRY   0x23    /* IP Phone */
#define CS_SUBDEVICE_STATE      0x24
#define CS_DIGIT_KEY_RELEASED   0x26    /* IP Phone */
#define CS_TRACE_ON_ACK         0x27    /* IP Phone */
#define CS_TRACE_OFF_ACK        0x28    /* IP Phone */
#define CS_SPECIAL_KEY_STATUS   0x29    /* IP Phone */
#define CS_KEY_RELEASED         0x2A    /* IP Phone */
#define CS_PERIPHERAL_CONTENT   0x2B    /* IP Phone */
#define CS_TM_KEY_PUSHED        0x2D    /* IP Phone */
#define CS_UA_DWL_PROTOCOL      0x50    /* Only UA NOE */
#define CS_UNSOLICITED_MSG      0x9F

/* System To Terminal Opcodes */
static const value_string opcodes_vals_sys[] =
{
    {SC_NOP                    , "NOP"},
    {SC_PRODUCTION_TEST        , "Production Test"},                     /* IP Phone */
    {SC_SUBDEVICE_ESCAPE       , "Subdevice Escape To Subdevice"},       /* IP Phone */
    {SC_SOFT_RESET             , "Software Reset"},
    {SC_IP_PHONE_WARMSTART     , "IP-Phone Warmstart"},                  /* IP Phone */
    {SC_HE_ROUTING             , "HE Routing Code"},                     /* IP Phone - NOT EXPECTED */
    {SC_SUBDEVICE_RESET        , "Subdevice Reset"},
    {SC_LOOPBACK_ON            , "Loopback On"},
    {SC_LOOPBACK_OFF           , "Loopback Off"},
    {SC_VIDEO_ROUTING          , "Video Routing Code"},                  /* IP Phone - NOT EXPECTED */
    {SC_SUPER_MSG              , "Super Message"},
    {SC_SEGMENT_MSG            , "Segment Message"},
    {SC_REMOTE_UA_ROUTING      , "Remote UA Routing Code"},              /* IP Phone - NOT EXPECTED */
    {SC_VERY_REMOTE_UA_ROUTING , "Very Remote UA Routing Code"},         /* IP Phone - NOT EXPECTED */
    {SC_OSI_ROUTING            , "OSI Routing Code"},                    /* IP Phone - NOT EXPECTED */
    {SC_ABC_A_ROUTING          , "ABC-A Routing Code"},                  /* IP Phone - NOT EXPECTED */
    {SC_IBS_ROUTING            , "IBS Routing Code"},                    /* IP Phone - NOT EXPECTED */
    {SC_IP_DEVICE_ROUTING      , "IP Device Routing"},
    {SC_M_REFLEX_HUB_ROUTING   , "Mutli-Reflex Hub Routing Code"},       /* IP Phone - NOT EXPECTED */
    {SC_SUPER_MSG_2            , "Super Message 2"},
    {SC_DEBUG_IN_LINE          , "Debug In Line"},
    {SC_LED_COMMAND            , "Led Command"},                         /* IP Phone */
    {SC_START_BUZZER           , "Start Buzzer"},                        /* VTA */
    {SC_STOP_BUZZER            , "Stop Buzzer"},                         /* VTA */
    {SC_ENABLE_DTMF            , "Enable DTMF"},
    {SC_DISABLE_DTMF           , "Disable DTMF"},
    {SC_CLEAR_LCD_DISP         , "Clear LCD Display"},                   /* IP Phone */
    {SC_LCD_LINE_1_CMD         , "LCD Line 1 Commands"},                 /* IP Phone */
    {SC_LCD_LINE_2_CMD         , "LCD Line 2 Commands"},                 /* IP Phone */
    {SC_MAIN_VOICE_MODE        , "Main Voice Mode"},
    {SC_VERSION_INQUIRY        , "Version Inquiry"},
    {SC_ARE_YOU_THERE          , "Are You There?"},
    {SC_SUBDEVICE_METASTATE    , "Subdevice Metastate"},
    {SC_VTA_STATUS_INQUIRY     , "VTA Status Inquiry"},                  /* IP Phone */
    {SC_SUBDEVICE_STATE        , "Subdevice State?"},
    {SC_DWL_DTMF_CLCK_FORMAT   , "Download DTMF & Clock Format"},        /* IP Phone */
    {SC_SET_CLCK               , "Set Clock"},                           /* IP Phone */
    {SC_VOICE_CHANNEL          , "Voice Channel"},                       /* IP Phone & UA NOE */
    {SC_EXTERNAL_RINGING       , "External Ringing"},
    {SC_LCD_CURSOR             , "LCD Cursor"},                          /* IP Phone */
    {SC_DWL_SPECIAL_CHAR       , "Download Special Character"},          /* IP Phone */
    {SC_SET_CLCK_TIMER_POS     , "Set Clock/Timer Position"},            /* IP Phone */
    {SC_SET_LCD_CONTRAST       , "Set LCD Contrast"},                    /* IP Phone */
    {SC_AUDIO_IDLE             , "Audio Idle"},
    {SC_SET_SPEAKER_VOL        , "Set Speaker Volume"},                  /* IP Phone */
    {SC_BEEP                   , "Beep"},
    {SC_SIDETONE               , "Sidetone"},
    {SC_RINGING_CADENCE        , "Set Programmable Ringing Cadence"},
    {SC_MUTE                   , "Mute"},
    {SC_FEEDBACK               , "Feedback"},
    {SC_KEY_RELEASE            , "Key Release"},                         /* IP Phone */
    {SC_TRACE_ON               , "Trace On"},                            /* IP Phone - NOT EXPECTED */
    {SC_TRACE_OFF              , "Trace Off"},                           /* IP Phone - NOT EXPECTED */
    {SC_READ_PERIPHERAL        , "Read Peripheral"},                     /* IP Phone - NOT EXPECTED */
    {SC_WRITE_PERIPHERAL       , "Write Peripheral"},                    /* IP Phone - NOT EXPECTED */
    {SC_ALL_ICONS_OFF          , "All Icons Off"},                       /* IP Phone */
    {SC_ICON_CMD               , "Icon Command"},                        /* IP Phone */
    {SC_AMPLIFIED_HANDSET      , "Amplified Handset (Boost)"},           /* IP Phone */
    {SC_AUDIO_CONFIG           , "Audio Config"},
    {SC_AUDIO_PADDED_PATH      , "Audio Padded Path"},                   /* IP Phone */
    {SC_RELEASE_RADIO_LINK     , "Release Radio Link"},                  /* IP Phone - NOT EXPECTED */
    {SC_DECT_HANDOVER          , "DECT External Handover Routing Code"}, /* IP Phone - NOT EXPECTED */
    {SC_LOUDSPEAKER            , "Loudspeaker"},
    {SC_ANNOUNCE               , "Announce"},
    {SC_RING                   , "Ring"},
    {SC_UA_DWL_PROTOCOL        , "UA Download Protocol"},
    {0, NULL}
};
static value_string_ext opcodes_vals_sys_ext = VALUE_STRING_EXT_INIT(opcodes_vals_sys);

/* Terminal To System Opcodes */
static const value_string opcodes_vals_term[] =
{
    {CS_NOP_ACK              , "NOP Acknowledge"},
    {CS_HANDSET_OFFHOOK      , "Handset Offhook"},                      /* IP Phone */
    {CS_HANDSET_ONHOOK       , "Handset Onhook"},                       /* IP Phone */
    {CS_DIGIT_DIALED         , "Digital Dialed"},                       /* IP Phone */
    {CS_SUBDEVICE_MSG        , "Subdevice Message"},
    {CS_HE_ROUTING           , "HE Routing Response Code"},             /* IP Phone - NOT EXPECTED */
    {CS_LOOPBACK_ON          , "Loopback On Acknowledge"},              /* Same as CS To Terminal */
    {CS_LOOPBACK_OFF         , "Loopback Off Acknowledge"},             /* Same as CS To Terminal */
    {CS_VIDEO_ROUTING        , "Video Routing Response Code"},          /* IP Phone - NOT EXPECTED */
    {CS_WARMSTART_ACK        , "Warmstart Acknowledge"},                /* IP Phone */
    {CS_SUPER_MSG            , "Super Message"},                        /* IP Phone - NOT EXPECTED */
    {CS_SEGMENT_MSG          , "Segment Message"},                      /* Same as CS To Terminal */
    {CS_REMOTE_UA_ROUTING    , "Remote UA Routing Response Code"},      /* IP Phone - NOT EXPECTED */
    {CS_VERY_REMOTE_UA_R     , "Very Remote UA Routing Response Code"}, /* IP Phone - NOT EXPECTED */
    {CS_OSI_ROUTING          , "OSI Response Code"},                    /* IP Phone - NOT EXPECTED */
    {CS_ABC_A_ROUTING        , "ABC-A Routing Response Code"},          /* IP Phone - NOT EXPECTED */
    {CS_IBS_ROUTING          , "IBS Routing Response Code"},            /* IP Phone - NOT EXPECTED */
    {CS_IP_DEVICE_ROUTING    , "IP Device Routing"},
    {CS_SUPER_MSG_2          , "Super Message 2"},                      /* Same as CS To Terminal */
    {CS_DEBUG_IN_LINE        , "Debug Message"},
    {CS_NON_DIGIT_KEY_PUSHED , "Non-Digit Key Pushed"},                 /* IP Phone */
    {CS_VERSION_RESPONSE     , "Version Information"},
    {CS_I_M_HERE             , "I'm Here Response"},
    {CS_RSP_STATUS_INQUIRY   , "Response To Status Inquiry"},           /* IP Phone */
    {CS_SUBDEVICE_STATE      , "Subdevice State Response"},
    {CS_DIGIT_KEY_RELEASED   , "Digit Key Released"},                   /* IP Phone */
    {CS_TRACE_ON_ACK         , "Trace On Acknowledge"},                 /* IP Phone - NOT EXPECTED */
    {CS_TRACE_OFF_ACK        , "Trace Off Acknowledge"},                /* IP Phone - NOT EXPECTED */
    {CS_SPECIAL_KEY_STATUS   , "Special Key Status"},                   /* IP Phone */
    {CS_KEY_RELEASED         , "Key Released"},                         /* IP Phone */
    {CS_PERIPHERAL_CONTENT   , "Peripheral Content"},                   /* IP Phone - NOT EXPECTED */
    {CS_TM_KEY_PUSHED        , "TM Key Pushed"},                        /* IP Phone - NOT EXPECTED */
    {CS_UA_DWL_PROTOCOL      , "Download Protocol"},
    {CS_UNSOLICITED_MSG      , "Unsolicited Message"},
    {0, NULL}
};
static value_string_ext opcodes_vals_term_ext = VALUE_STRING_EXT_INIT(opcodes_vals_term);

static const value_string str_digit[] = {
    { 0, "0"},
    { 1, "1"},
    { 2, "2"},
    { 3, "3"},
    { 4, "4"},
    { 5, "5"},
    { 6, "6"},
    { 7, "7"},
    { 8, "8"},
    { 9, "9"},
    {10, "*"},
    {11, "#"},
    {12, "A"},
    {13, "B"},
    {14, "C"},
    {15, "D"},
    {16, "Flash"},
    {0, NULL}
};
static value_string_ext str_digit_ext = VALUE_STRING_EXT_INIT(str_digit);

#define STR_ON_OFF(arg) ((arg) ? "On" : "Off")
#define STR_YES_NO(arg) ((arg) ? "Yes" : "No")

static const value_string str_yes_no[] = {
    { 0x0, "No" },
    { 0x1, "Yes"},
    { 0  , NULL }
};

static const value_string str_on_off[] = {
    { 0x0, "Off"},
    { 0x1, "On" },
    { 0  , NULL }
};

static const value_string str_device_type[] = {
    {0x00, "Voice Terminal Adaptor"},
    {0, NULL}
};


/*-----------------------------------------------------------------------------
    VERSION NUMBER COMPUTER - This function computes a version number (S.SZ.AB) from a 16 bits number
    ---------------------------------------------------------------------------*/
static void
version_number_computer( char *result, uint32_t hexa_version )
{
    int   release, vers, fix;

    release = (int)(hexa_version / 10000);
    vers    = (int)((hexa_version % 10000) / 100);
    fix     = (hexa_version % 10000) % 100;
    snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d.%02d", release, vers, fix);
}

static void
version_3bytes_computer(char *result, uint32_t hexa_version)
{
    int release, vers, fix;

    release = (hexa_version >> 16);
    vers    = ((hexa_version >> 8) & 0xff);
    fix     = (hexa_version & 0xff);
    snprintf(result, ITEM_LABEL_LENGTH, "%d.%02d.%02d", release, vers, fix);
}


/*-----------------------------------------------------------------------------
    Function for UA3G message with opcode and one parameter

    PRODUCTION TEST    - 01h (MESSAGE FROM THE SYSTEM)
    SUBDEVICE RESET    - 06h (MESSAGE FROM THE SYSTEM)
    ARE YOU THERE      - 2Bh - IPhone & UA NOE (MESSAGE FROM THE SYSTEM)
    SET SPEAKER VOLUME - 3Bh (MESSAGE FROM THE SYSTEM)
    TRACE ON           - 42h (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static void
decode_with_one_parameter(proto_tree *tree, tvbuff_t *tvb,
              packet_info *pinfo _U_, unsigned offset, unsigned length,
              int hf_opcode)
{
    if (length == 0)
        return;

    proto_tree_add_item(tree, hf_opcode, tvb, offset, 1, ENC_NA);
}


/*-----------------------------------------------------------------------------
    SUBDEVICE ESCAPE TO SUBDEVICE - 02h (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static void
decode_subdevice_escape(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_,
            unsigned offset, unsigned length)
{
    proto_tree_add_item(tree, hf_ua3g_subdevice_address, tvb, offset, 1, ENC_BIG_ENDIAN);
    proto_tree_add_item(tree, hf_ua3g_subdevice_opcode, tvb, offset+1, 1, ENC_BIG_ENDIAN);
    if (length > 2) {
        proto_tree_add_item(tree, hf_ua3g_subdevice_parameter_bytes, tvb, offset+2, length-2, ENC_NA);
    }
}


/*-----------------------------------------------------------------------------
    SOFTWARE RESET - 03h (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static const value_string software_reset_verswitch_vals[] = {
    {0x00, "Reset Without Version Switch"},
    {0x01, "Reset With Version Switch"},
    {0, NULL}
};

static void
decode_software_reset(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_,
                      unsigned offset, unsigned length)
{
    if (length == 0)
        return;

    proto_tree_add_item(tree, hf_ua3g_software_reset, tvb, offset, 1, ENC_BIG_ENDIAN);
}


/*-----------------------------------------------------------------------------
    IP-PHONE WARMSTART - 04h (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static const value_string str_command_ip_phone_warmstart[] = {
    {0x00, "Run In UA2G Emulation Mode"},
    {0x01, "Run In Full UA3G Mode"},
    {0, NULL}
};

static void
decode_ip_phone_warmstart(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_,
              unsigned offset, unsigned length)
{
    if (length == 0)
        return;

    proto_tree_add_item(tree, hf_ua3g_ip_phone_warmstart, tvb, offset, 1, ENC_BIG_ENDIAN);
}


/*-----------------------------------------------------------------------------
    SUPER MESSAGE - 0Bh (MESSAGE FROM THE SYSTEM)
    SUPER MESSAGE 2 - 17h (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static void
decode_super_msg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_,
         unsigned offset, unsigned length, uint8_t opcode)
{
    proto_tree *ua3g_body_tree = tree;
    int         j = 0, parameter_length;

    if (!ua3g_body_tree)
        return;

    while (length > 0) {
        if (opcode == 0x17) {
            parameter_length = tvb_get_ntohs(tvb, offset);
            proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_super_msg_length, tvb, offset, 2,
                parameter_length, "Length %d: %d", j++, parameter_length);
            offset += 2;
            length -= 2;
        } else {
            parameter_length = tvb_get_uint8(tvb, offset);
            proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_super_msg_length, tvb, offset, 1,
                parameter_length, "Length %d: %d", j++, parameter_length);
            offset++;
            length--;
        }

        if (parameter_length > 0) {
            proto_tree_add_item(ua3g_body_tree, hf_ua3g_super_msg_data, tvb, offset, parameter_length, ENC_NA);
            offset += parameter_length;
            length -= parameter_length;
        }
    }
}


/*-----------------------------------------------------------------------------
    SEGMENT MESSAGE - 0Ch (MESSAGE FROM THE TERMINAL AND FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static const true_false_string tfs_segment_msg_segment = { "First Segment", "Subsequent Segment" };

static void
decode_segment_msg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_,
           unsigned offset, unsigned length)
{
    uint8_t     val;

    if (!tree)
        return;

    val = tvb_get_uint8(tvb, offset);
    proto_tree_add_item(tree, hf_ua3g_segment_msg_segment, tvb, offset, 1, ENC_NA);
    proto_tree_add_item(tree, hf_ua3g_segment_msg_num_remaining, tvb, offset, 1, ENC_BIG_ENDIAN);
    offset++;
    length--;

    if (val & 0x80) {
        proto_tree_add_item(tree, hf_ua3g_segment_msg_length, tvb, offset, 2, ENC_BIG_ENDIAN);
        offset += 2;
        length -= 2;
    }

    if (length > 0) {
        proto_tree_add_item(tree, hf_ua3g_segment_message_data, tvb, offset, length, ENC_NA);
    }
}


/*-----------------------------------------------------------------------------
    IP DEVICE ROUTING - 13h (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static const value_string str_command_ip_device_routing[] = {
    {0x00, "Reset"},
    {0x01, "Start RTP"},
    {0x02, "Stop RTP"},
    {0x03, "Redirect"},
    {0x04, "Tone Definition"},
    {0x05, "Start Tone"},
    {0x06, "Stop Tone"},
    {0x07, "Start Listen RTP"},
    {0x08, "Stop Listen RTP"},
    {0x09, "Get Parameters Value"},
    {0x0A, "Set Parameters Value"},
    {0x0B, "Send Digit"},
    {0x0C, "Pause RTP"},
    {0x0D, "Restart RTP"},
    {0x0E, "Start Record RTP"},
    {0x0F, "Stop Record RTP"},
    {0x10, "Set SIP Parameters"},
    {0x11, "Free Seating"},
    {0x14, "Application Parameters"},
    {0, NULL}
};

static const value_string ip_device_routing_cmd_reset_vals[] = {
    {0x00, "Update Mode"},
    {0x01, "Bad Sec Mode"},
    {0x02, "Customization Name"},
    {0x03, "Localization Name"},
    {0, NULL}
};

static const value_string reset_param_bad_sec_mode[] = {
    {0x01, "Binary is full, CS is secured, but terminal running in clear mode"},
    {0, NULL}
};

static const value_string start_rtp_str_direction[] = {
    {0x00, "Terminal Input"},
    {0x01, "Terminal Output"},
    {0x02, "Terminal Input/Output (Both Directions)"},
    {0, NULL}
};

static const value_string ip_device_routing_cmd_start_rtp_vals[] = {
    {0x00, "Local UDP Port"},
    {0x01, "Remote IP Address"},
    {0x02, "Remote UDP Port"},
    {0x03, "Type Of Service"},
    {0x04, "Compressor"},
    {0x05, "Payload Concatenation (ms)"},
    {0x06, "Echo Cancellation Enabler"},
    {0x07, "Silence Suppression Enabler"},
    {0x08, "802.1 Q User Priority"},
    {0x09, "Reserved"},
    {0x0a, "Post Filtering Enabler"},
    {0x0b, "High Pass Filtering Enabler"},
    {0x0c, "Remote SSRC"},
    {0x0d, "Must Send QOS Tickets"},
    {0x0e, "Local Identifier"},
    {0x0f, "Distant Identifier"},
    {0x10, "Destination For RTCP Sender Reports - Port Number"},
    {0x11, "Destination For RTCP Sender Reports - IP Address"},
    {0x12, "Destination For RTCP Receiver Reports - Port Number"},
    {0x13, "Destination For RTCP Receiver Reports - IP Address"},
    {0x14, "Channel Number"},
    {0x15, "DTMF Sending"},
    {0x16, "Payload Type Of Redundancy"},
    {0x17, "Payload Type Of DTMF Events"},
    {0x18, "Enable / Disable RFC 2198"},
    {0x31, "SRTP Encryption Enable For This Communication"},
    {0x32, "Master Key For SRTP Session"},
    {0x33, "Master Salt Key For SRTP Session"},
    {0x34, "Master key for output stream of SRTP session"},
    {0x35, "Master salt key for output stream of SRTP session"},
    {0x36, "Integrity checking enabled for this communication"},
    {0x37, "MKI value for SRTP packets in input stream"},
    {0x38, "MKI value for SRTP packets in output stream"},
    {0x39, "Integrity method of Thales component"},
    {0x50, "MD5 Authentication"},
    {0, NULL}
};
static value_string_ext ip_device_routing_cmd_start_rtp_vals_ext = VALUE_STRING_EXT_INIT(ip_device_routing_cmd_start_rtp_vals);

static const val64_string str_compressor_vals[] = {
    {0x00, "G.711 A-law"},
    {0x01, "G.711 mu-law"},
    {0x0F, "G.723.1 5.3kbps"},
    {0x10, "G.723.1 6.3kbps"},
    {0x11, "G.729A 8kbps"},
    {0x1B, "G.722 64kbps"},
    {0x1C, "G.722 56kbps"},
    {0x1D, "G.722 48kbps"},
    {0x1E, "Opus"},
    {0, NULL}
};

static const value_string ip_device_routing_cmd_stop_rtp_vals[] = {
    {0x0E, "Local Identifier"},
    {0x0F, "Distant Identifier"},
    {0x14, "Canal Identifier"},
    {0, NULL}
};

static const value_string ip_device_routing_cmd_redirect_vals[] = {
    {0x00, "Remote MainCPU Server IP Address"},
    {0x01, "Remote MainCPU Server Port"},
    {0, NULL}
};

static const value_string ip_device_routing_cmd_listen_rtp_vals[] = {
    {0x00, "Remote IP Address    "},
    {0x01, "Remote UDP Port In   "},
    {0x02, "Remote UDP Port Out  "},
    {0x03, "Remote IP Address Out"},
    {0x04, "Canal Number"},
    {0, NULL}
};

static const value_string ip_device_routing_cmd_set_param_req_vals[] = {
    {0x00   , "QOS IP TOS"},
    {0x01   , "QOS 8021 VLID"},
    {0x02   , "QOS 8021 PRI"},
    {0x03   , "SNMP MIB2 SysContact"},
    {0x04   , "SNMP MIB2 SysName"},
    {0x05   , "SNMP MIB2 SysLocation"},
    {0x06   , "Default Compressor"},
    {0x07   , "Error String Net Down"},
    {0x08   , "Error String Cable PB"},
    {0x09   , "Error String Try Connect"},
    {0x0A   , "Error String Connected"},
    {0x0B   , "Error String Reset"},
    {0x0C   , "Error String Duplicate IP Address"},
    {0x0D   , "SNMP MIB Community"},
    {0x0E   , "TFTP Backup Sec Mode"},
    {0x0F   , "TFTP Backup IP Address"},
    {0x10   , "Set MMI Password"},
    {0x11   , "Set PC Port Status"},
    {0x12   , "Record RTP Authorization"},
    {0x13   , "Security Flags"},
    {0x14   , "ARP Spoofing"},
    {0x15   , "Session Param"},
    {0x16   , "Stable Mode"},
    {0x17   , "DTMF Level"},
    {0x18   , "Keep Talking"},
    {0x19   , "BT Radio"},
    {0x1A   , "Transparent Reboot"},
    {0x1B   , "Set Skin Identifier"},
    {0x1C   , "Set Language Identifier"},
    {0x1D   , "Set Dialpad Rotation"},
    {0x1E   , "Set USB Boost Charging"},
    {0x1F   , "Set SSH Password"},
    {0x20   , "DHCP Survivability"},
    {0x21   , "USB Devices"},
    {0x22   , "ALS Device"},
    {0x23   , "Busy Light"},
    {0x24   , "Audio Environment"},
    {0x25   , "EEE Configuration"},
    {0x26   , "LLDP Configuration"},
    {0x30   , "MD5 Authentication"},
    {0, NULL}
};
static value_string_ext ip_device_routing_cmd_set_param_req_vals_ext = VALUE_STRING_EXT_INIT(ip_device_routing_cmd_set_param_req_vals);

static const value_string set_param_req_stable_mode[] = {
    {0x00   , "Full-Duplex Preference"},
    {0x01   , "Echo Robustness Preference"},
    {0, NULL}
};

static const value_string set_param_req_skin_id[] = {
    {0x00   , "Managed By Terminal"},
    {0x01   , "Classical or Arcturus"},
    {0x02   , "Rainbow"},
    {0x03   , "Crystal or Green"},
    {0x04   , "Luxury"},
    {0x05   , "Arcturus or Classical or Century"},
    {0, NULL}
};

static const value_string set_param_req_usb_boost[] = {
    {0x00   , "Disable"},
    {0x01   , "Enable"},
    {0x02   , "Auto-Negotiation"},
    {0, NULL}
};

static const value_string set_param_req_local_device[] = {
    {0x00   , "Managed By Terminal"},
    {0x01   , "Enable"},
    {0x02   , "Disable"},
    {0, NULL}
};

static const value_string set_param_req_audio_env[] = {
    {0x00   , "Managed By Terminal"},
    {0x01   , "Standard"},
    {0x02   , "Open Space"},
    {0x03   , "Meeting Room"},
    {0x04   , "Noisy"},
    {0, NULL}
};

static const value_string ip_device_routing_cmd_pause_restart_vals[] = {
    {0x14, "Canal Identifier"},
    {0, NULL}
};

static const value_string ip_device_routing_cmd_record_rtp_vals[] = {
    {0x00   , "Recorder Index"},
    {0x01   , "Remote IP Address"},
    {0x02   , "Remote UDP Port In"},
    {0x03   , "Remote UDP Port Out"},
    {0x04   , "Remote IP Address Out"},
    {0x05   , "Local UDP Port In"},
    {0x06   , "Local UDP Port Out"},
    {0x07   , "Type Of Service"},
    {0x08   , "Master Key For SRTP Session"},
    {0x09   , "Master Salt Key For SRTP Session"},
    {0x10   , "Integrity checking enabled for this communication"},
    {0x11   , "Integrity method of Thales component"},
    {0x30   , "MD5 Authentication"},
    {0, NULL}
};

static const value_string ip_device_routing_cmd_freeseating_vals[] = {
    {0x00   , "Pseudo MAC Address"},
    {0x01   , "Maincpu1"},
    {0x02   , "Maincpu2"},
    {0x03   , "Restart application"},
    {0, NULL}
};

static const value_string ip_device_routing_cmd_appl_vals[] = {
    {0x00   , "Identifier"},
    {0x01   , "Enable"},
    {0x02   , "URL"},
    {0, NULL}
};

static const value_string ip_device_routing_tone_direction_vals[] = {
    {0x00, "On The Phone"},
    {0x01, "To The Network"},
    {0x02, "On The Phone and To The Network"},
    {0, NULL}
};

static const value_string ip_device_routing_cmd_get_param_req_vals[] = {
    {0x00   , "Firmware Version"},
    {0x01   , "Firmware Version"},
    {0x02   , "DHCP IP Address"},
    {0x03   , "Local IP Address"},
    {0x04   , "Subnetwork Mask"},
    {0x05   , "Router IP Address"},
    {0x06   , "TFTP IP Address"},
    {0x07   , "MainCPU IP Address"},
    {0x08   , "Default Codec"},
    {0x09   , "Ethernet Drivers Config"},
    {0x0A   , "MAC Address"},
    {0x0B   , "Pseudo MAC Address"},
    {0, NULL}
};

static const value_string str_set_pc_port_status[] = {
    {0x00, "No PC Port Security"},
    {0x01, "Block PC Port"},
    {0x02, "Filter VLAN"},
    {0, NULL}
};

static const value_string str_enable_feature[] = {
    {0x00, "Disable Feature"},
    {0x01, "Enable Feature"},
    {0   , NULL}
};

static const value_string str_ethernet_speed_vals[] = {
    {0   , "No Link"},
    {1   , "10 Mbps"},
    {2   , "100 Mbps"},
    {3   , "1000 Mbps"},
    {10  , "10 Mbps"},
    {100 , "100 Mbps"},
    {0   , NULL}
};

static const value_string str_wlan_status[] = {
    {0, "Not Connected"},
    {1, "Connected"},
    {0, NULL}
};

static void
decode_ip_device_routing(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
             unsigned offset, unsigned length)
{
    uint8_t        command;
    proto_tree    *ua3g_body_tree = tree, *ua3g_param_tree, *ua3g_param_subtree;
    proto_item    *ua3g_param_item;
    int parameter_length, parameter_id;

    command = tvb_get_uint8(tvb, offset);

    /* add text to the frame "INFO" column */
    col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_command_ip_device_routing, "Unknown"));

    if (!ua3g_body_tree)
        return;

    proto_tree_add_item(ua3g_body_tree, hf_ua3g_ip, tvb, offset, 1, ENC_BIG_ENDIAN);
    offset++;
    length--;

    switch (command) {
    case 0x00: /* RESET */
        {
            if (length > 0) {
                parameter_id     = tvb_get_uint8(tvb, offset);
                parameter_length = tvb_get_uint8(tvb, offset + 1);

                ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_ip_device_routing_stop_rtp_parameter, tvb, offset,
                    parameter_length + 2, parameter_id, "%s",
                    val_to_str_const(parameter_id, ip_device_routing_cmd_reset_vals, "Unknown"));
                ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param);

                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_reset_parameter, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                length--;

                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_reset_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                length--;

                if (parameter_length > 0) {
                    uint8_t param;
                    switch (parameter_id) {
                    case 0x00: /* Update Mode */

                        param = tvb_get_uint8(tvb, offset);
                        if ((param & 0x80) == 0x00) {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_reset_parameter_noe_update, tvb, offset, 1, ENC_BIG_ENDIAN);
                            ua3g_param_subtree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param_sub);

                            proto_tree_add_item(ua3g_param_subtree, hf_ua3g_ip_device_routing_reset_parameter_noe_update_bootloader, tvb, offset, 1, ENC_NA);
                            proto_tree_add_item(ua3g_param_subtree, hf_ua3g_ip_device_routing_reset_parameter_noe_update_data, tvb, offset, 1, ENC_NA);
                            proto_tree_add_item(ua3g_param_subtree, hf_ua3g_ip_device_routing_reset_parameter_noe_update_customization, tvb, offset, 1, ENC_NA);
                            proto_tree_add_item(ua3g_param_subtree, hf_ua3g_ip_device_routing_reset_parameter_noe_update_localization, tvb, offset, 1, ENC_NA);
                            proto_tree_add_item(ua3g_param_subtree, hf_ua3g_ip_device_routing_reset_parameter_noe_update_code, tvb, offset, 1, ENC_NA);
                            proto_tree_add_item(ua3g_param_subtree, hf_ua3g_ip_device_routing_reset_parameter_noe_update_sip, tvb, offset, 1, ENC_NA);

                        } else {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_reset_parameter_value, tvb, offset, parameter_length, ENC_NA);
                        }

                        break;
                    case 0x01: /* Bad_Sec_Mode */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_reset_parameter_bad_sec_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;
                    case 0x02: /* Cust_Name */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_reset_parameter_cust_name, tvb, offset, parameter_length, ENC_NA|ENC_ASCII);
                        break;
                    case 0x03: /* L10N_Name */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_reset_parameter_l10n_name, tvb, offset, parameter_length, ENC_NA|ENC_ASCII);
                        break;
                    case 0x04: /* Appl_Mode */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_reset_parameter_appl_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;
                    case 0x05: /* SIP_Name */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_reset_parameter_sip_name, tvb, offset, parameter_length, ENC_NA|ENC_ASCII);
                        break;
                    case 0x06: /* Appl_Mode */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_reset_parameter_reset_mac, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;
                    default:
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_reset_parameter_value, tvb, offset, parameter_length, ENC_NA);
                        break;
                    }

                    /*offset += parameter_length;
                    length -= parameter_length;*/
                }
            }
            break;
        }
    case 0x01: /* START RTP */
        {
            address remote_rtp_addr = ADDRESS_INIT_NONE;
            uint32_t remote_rtp_port = 0;

            proto_tree_add_item(ua3g_body_tree, hf_ua3g_ip_device_routing_start_rtp_direction, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            while (length > 0) {
                parameter_id     = tvb_get_uint8(tvb, offset);
                parameter_length = tvb_get_uint8(tvb, offset + 1);

                ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_ip_device_routing_start_rtp_parameter, tvb, offset,
                        parameter_length + 2, parameter_id, "%s",
                        val_to_str_ext_const(parameter_id, &ip_device_routing_cmd_start_rtp_vals_ext, "Unknown"));

                ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param);
                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                length--;

                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                length--;

                if (parameter_length > 0) {
                    switch (parameter_id) {
                    case 0x01: /* Remote IP Address */
                    case 0x11: /* Destination For RTCP Sender Reports - IP Address */
                    case 0x13: /* Destination For RTCP Receiver Reports - IP Address */
                        if (parameter_id == 0x01)
                           set_address_tvb(&remote_rtp_addr, AT_IPv4, 4, tvb, offset);
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
                        break;
                    case 0x04: /* Compressor */
                        if (parameter_length <= 8) {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_compressor, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                        } else {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_value, tvb, offset, parameter_length, ENC_NA);
                        }
                        break;
                    case 0x06: /* Echo Cancellation Enabler */
                    case 0x07: /* Silence Suppression Enabler */
                    case 0x0A: /* Post Filtering Enabler */
                    case 0x0B: /* High Pass Filtering Enabler */
                        if (parameter_length <= 8) {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_enabler, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                        } else {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_value, tvb, offset, parameter_length, ENC_NA);
                        }
                        break;
                    case 0x0D: /* Must Send QOS Tickets */
                        if (parameter_length <= 8) {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_send_qos, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                        } else {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_value, tvb, offset, parameter_length, ENC_NA);
                        }
                        break;
                    case 0x0E: /* Local Identifier */
                    case 0x0F: /* Distant Identifier */
                        break;
                    case 0x15: /* DTMF Sending */
                        if (parameter_length <= 8) {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_dtmf_sending, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                        } else {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_value, tvb, offset, parameter_length, ENC_NA);
                        }
                        break;
                    case 0x18: /* Enable / Disable RFC 2198 */
                        if (parameter_length <= 8) {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_rfc2198, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                        } else {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_value, tvb, offset, parameter_length, ENC_NA);
                        }
                        break;
                    case 0x31: /* SRTP Encryption Enable For This Communication */
                        if (parameter_length <= 8) {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_srtp_encryption, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                        } else {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_value, tvb, offset, parameter_length, ENC_NA);
                        }
                        break;
                    case 0x00: /* Local UDP Port */
                    case 0x02: /* Remote UDP Port */
                    case 0x03: /* Type Of Service */
                    case 0x05: /* Payload Concatenation */
                    case 0x08: /* 802.1 Q User Priority */
                    case 0x09: /* Reserved */
                    case 0x0C: /* Remote SSRC */
                    case 0x10: /* Destination For RTCP Sender Reports - Port Number */
                    case 0x12: /* Destination For RTCP Receiver Reports - Port Number */
                    case 0x14: /* Channel Number */
                    case 0x16: /* Payload Type For Redundancy */
                    case 0x17: /* Payload Type For DTMF Events */
                    case 0x32: /* Master Key For SRTP Session */
                    case 0x33: /* Master Salt Key For SRTP Session */
                    case 0x34: /* Master key for output stream of SRTP session */
                    case 0x35: /* Master salt key for output stream of SRTP session */
                    case 0x36: /* Integrity checking enabled for this communication */
                    case 0x37: /* MKI value for SRTP packets in input stream */
                    case 0x38: /* MKI value for SRTP packets in output stream */
                    case 0x39: /* Integrity method of Thales component */
                    case 0x50: /* MD5 Authentication */
                    default:
                        if (parameter_id == 0x02)
                            remote_rtp_port = tvb_get_ntohs(tvb, offset);
                        if (parameter_length <= 8) {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_uint, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                        } else {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_value, tvb, offset, parameter_length, ENC_NA);
                        }
                        break;
                    }

                    offset += parameter_length;
                    length -= parameter_length;
                }
            }

            if (setup_conversations_enabled)
            {
                if ((remote_rtp_addr.data != NULL) && (remote_rtp_port != 0))
                {
                    rtp_add_address(pinfo, PT_UDP, &remote_rtp_addr, remote_rtp_port, 0, "UA3G", pinfo->num, 0, NULL);
                    rtcp_add_address(pinfo, &remote_rtp_addr, remote_rtp_port+1, 0, "UA3G", pinfo->num);
                }
            }
            break;
        }
    case 0x02: /* STOP_RTP */
        while (length > 0) {
            parameter_id     = tvb_get_uint8(tvb, offset);
            parameter_length = tvb_get_uint8(tvb, offset + 1);

            ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_ip_device_routing_stop_rtp_parameter, tvb, offset,
                parameter_length + 2, parameter_id, "%s",
                val_to_str_const(parameter_id, ip_device_routing_cmd_stop_rtp_vals, "Unknown"));
            ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param);

            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_stop_rtp_parameter, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_stop_rtp_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            if (parameter_length > 0) {
                if (parameter_length <= 8) {
                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_stop_rtp_parameter_value_num, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                } else {
                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_stop_rtp_parameter_value_bytes, tvb, offset, parameter_length, ENC_NA);
                }

                offset += parameter_length;
                length -= parameter_length;
            }
        }
        break;
    case 0x03: /* REDIRECT */
        while (length > 0) {
            parameter_id = tvb_get_uint8(tvb, offset);
            parameter_length = tvb_get_uint8(tvb, offset + 1);

            ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_ip_device_routing_redirect_parameter,
                    tvb, offset, parameter_length + 2, parameter_id,
                    "%s", val_to_str_const(parameter_id, ip_device_routing_cmd_redirect_vals, "Unknown"));
            ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param);

            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_redirect_parameter, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_redirect_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;


            if (parameter_length > 0) {
                switch (parameter_id) {
                case 0x00: /* Remote MainCPU Server IP Address */
                case 0x02: /* Remote Redundant MainCPU Server IP Address */
                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_redirect_parameter_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
                    break;
                case 0x01: /* Remote MainCPU Server Port */
                default:
                    if (parameter_length <= 8) {
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_redirect_parameter_uint, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                    } else {
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_redirect_parameter_value, tvb, offset, parameter_length, ENC_NA);
                    }
                    break;
                }

                offset += parameter_length;
                length -= parameter_length;
            }
        }
        break;
    case 0x04: /* DEF_TONES */
        {
            int         i, tone_nb_entries;
            uint16_t    frequency_1, frequency_2;
            signed char level_1, level_2;

            tone_nb_entries = tvb_get_uint8(tvb, offset);

            proto_tree_add_item(ua3g_body_tree, hf_ua3g_ip_device_routing_def_tones_num_entries, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            while (length > 0 && tone_nb_entries) {
                for (i = 1; i <= tone_nb_entries; i++) {
                    frequency_1 = tvb_get_ntohs(tvb, offset);
                    level_1 = (signed char)(tvb_get_uint8(tvb, offset + 2)) / 2;
                    frequency_2 = tvb_get_ntohs(tvb, offset + 3);
                    level_2 = (signed char)(tvb_get_uint8(tvb, offset + 5)) / 2;

                    ua3g_param_tree = proto_tree_add_subtree_format(ua3g_body_tree, tvb, offset, 6,
                        ett_ua3g_param, NULL, "Tone Pair %d: %d Hz at %d dB / %d Hz at %d dB",
                        i, frequency_1, level_1, frequency_2, level_2);

                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_def_tones_frequency_1, tvb, offset, 2, ENC_BIG_ENDIAN);
                    offset += 2;
                    length -= 2;

                    proto_tree_add_int(ua3g_param_tree, hf_ua3g_ip_device_routing_def_tones_level_1, tvb, offset, 1, level_1);
                    offset++;
                    length--;

                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_def_tones_frequency_2, tvb, offset, 2, ENC_BIG_ENDIAN);
                    offset += 2;
                    length -= 2;

                    proto_tree_add_int(ua3g_param_tree, hf_ua3g_ip_device_routing_def_tones_level_2, tvb, offset, 1, level_2);
                    offset++;
                    length--;
                }
            }
            break;
        }
    case 0x05: /* START TONE */
        {
            uint8_t ii;
            uint32_t tone_nb_entries;

            proto_tree_add_item(ua3g_body_tree, hf_ua3g_ip_device_routing_start_tone_direction, tvb, offset, 1, ENC_BIG_ENDIAN);
            proto_tree_add_item_ret_uint(ua3g_body_tree, hf_ua3g_ip_device_routing_start_tone_num_entries, tvb, offset, 1, ENC_BIG_ENDIAN, &tone_nb_entries);
            offset++;
            length--;

            for (ii = 0; ii < tone_nb_entries; ii++) {
                uint8_t tone_id = tvb_get_uint8(tvb, offset);
                int tone_duration = tvb_get_ntohs(tvb, offset + 1);

                ua3g_param_tree = proto_tree_add_subtree_format(ua3g_body_tree, tvb, offset, 3,
                    ett_ua3g_param, NULL, "Tone Pair %d: Id: %d, Duration: %d ms",
                    ii+1, tone_id, tone_duration);

                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_tone_identification, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                length--;

                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_tone_duration, tvb, offset, 2, ENC_BIG_ENDIAN);
                offset += 2;
                length -= 2;
            }
            break;
        }
    case 0x07: /* START LISTEN RTP */
    case 0x08: /* STOP LISTEN RTP */
        while (length > 0) {
            parameter_id     = tvb_get_uint8(tvb, offset);
            parameter_length = tvb_get_uint8(tvb, offset + 1);

            ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_ip_device_routing_listen_rtp_parameter, tvb, offset,
                parameter_length + 2, parameter_id, "%s",
                val_to_str_const(parameter_id, ip_device_routing_cmd_listen_rtp_vals, "Unknown"));
            ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param);

            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_listen_rtp_parameter, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_listen_rtp_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            if (parameter_length > 0) {
                switch (parameter_id) {
                case 0x00: /* Remote IP Address - Not for start listening rtp */
                case 0x03: /* Remote IP Address Out - Not for start listening rtp */
                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_listen_rtp_parameter_ip, tvb, offset, 1, ENC_NA);
                    break;
                case 0x01: /* Remote UDP Port In - Not for start listening rtp */
                case 0x02: /* Remote UDP Port Out - Not for start listening rtp */
                case 0x04: /* Canal Number */
                default:
                    if (parameter_length <= 8) {
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_listen_rtp_parameter_port, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                    } else {
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_listen_rtp_parameter_value, tvb, offset, parameter_length, ENC_NA);
                    }
                    break;
                }

                offset += parameter_length;
                length -= parameter_length;
            }
        }
        break;
    case 0x09: /* GET_PARAM_REQ */
        while (length > 0) {
            proto_tree_add_item(ua3g_body_tree, hf_ua3g_ip_device_routing_get_param_req_parameter, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;
        }
        break;

    case 0x0A: /* SET_PARAM_REQ */
        {
            while (length > 0) {
                parameter_id     = tvb_get_uint8(tvb, offset);
                parameter_length = tvb_get_uint8(tvb, offset + 1);

                ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_ip_device_routing_set_param_req_parameter, tvb, offset,
                    parameter_length + 2, parameter_id, "%s",
                    val_to_str_ext_const(parameter_id, &ip_device_routing_cmd_set_param_req_vals_ext, "Unknown"));
                ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param);

                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                length--;

                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                length--;

                if (parameter_length > 0) {
                    switch (parameter_id) {
                    case 0x06: /* Compressor */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_compressor, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;
                    case 0x07: /* ERR STRING NET DOWN */
                    case 0x08: /* ERR STRING CABLE PB */
                    case 0x09: /* ERR STRING TRY CONNECT */
                    case 0x0A: /* ERR STRING CONNECTED */
                    case 0x0B: /* ERR STRING RESET */
                    case 0x0C: /* ERR STRING DUPLICATE IP ADDRESS */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_err_string, tvb, offset, parameter_length, ENC_NA|ENC_ASCII);
                        break;
                    case 0x0F: /* TFTP BACKUP IP ADDR */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_tftp_backup_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
                        break;
                    case 0x11: /* Set PC Port status */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_set_pc_port_status, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;
                    case 0x12: /* Record RTP Authorization */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_record_rtp_auth, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;
                    case 0x13: /* Security Flags */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_security_flag_filter, tvb, offset, 1, ENC_NA);
                        break;
                    case 0x16: /* Stable Mode */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_stable_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;
                    case 0x1B: /* Set Skin Identifier */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_skin_id, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;
                    case 0x1C: /* Set Language Identifier */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_language_id, tvb, offset, 2, ENC_NA|ENC_ASCII);
                        break;
                    case 0x1E: /* USB Boost */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_usb_boost, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;
                    case 0x22: /* ALS Device */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_als_device, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;
                    case 0x23: /* Busy Light */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_busy_light, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;
                    case 0x24: /* Audio Environment */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_audio_env, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;
                    case 0x00: /* QOS IP TOS */
                    case 0x01: /* QOS 8021 VLID */
                    case 0x02: /* QOS 8021 PRI */
                    case 0x03: /* SNMP MIB2 SYSCONTACT */
                    case 0x04: /* SNMP MIB2 SYSNAME */
                    case 0x05: /* SNMP MIB2 SYSLOCATION */
                    case 0x0D: /* SNMP MIB COMMUNITY */
                    case 0x0E: /* TFTP BACKUP SEC MODE */
                    case 0x10: /* SET MMI PASSWORD */
                    case 0x14: /* ARP Spoofing */
                    case 0x15: /* Session Param */
                    case 0x17: /* DTMF Level */
                    case 0x18: /* Keep Talking */
                    case 0x19: /* BT Radio */
                    case 0x1A: /* Transparent Reboot */
                    case 0x1D: /* Dialpad Rotation */
                    case 0x1F: /* Set SSH Password */
                    case 0x20: /* DHCP Survivability */
                    case 0x21: /* USB Devices */
                    case 0x25: /* EEE Configuration */
                    case 0x26: /* LLDP Configuration */
                    case 0x30: /* MD5 Authentication */
                    default:
                        if ((parameter_length > 0) && (parameter_length <= 8)) {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_uint, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                        } else if (parameter_length > 8) {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_value, tvb, offset, parameter_length, ENC_NA);
                        }
                        break;
                    }

                    offset += parameter_length;
                    length -= parameter_length;
                }
            }
            break;
        }
    case 0x0B: /* SEND_DIGIT */
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_ip_device_routing_digit_value, tvb, offset, 1, ENC_BIG_ENDIAN);
        break;

    case 0x0C: /* PAUSE_RTP */
    case 0x0D: /* RESTART_RTP */
        while (length > 0) {
            parameter_id     = tvb_get_uint8(tvb, offset);
            parameter_length = tvb_get_uint8(tvb, offset + 1);

            ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_ip_device_routing_pause_restart_rtp_parameter, tvb, offset,
                parameter_length + 2, parameter_id, "%s",
                val_to_str_const(parameter_id, ip_device_routing_cmd_pause_restart_vals, "Unknown"));
            ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param);

            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_pause_restart_rtp_parameter, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_pause_restart_rtp_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            if (parameter_length > 0) {
                if (parameter_length <= 8) {
                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_pause_restart_rtp_parameter_uint, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                } else {
                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_pause_restart_rtp_parameter_value, tvb, offset, parameter_length, ENC_NA);
                }

                offset += parameter_length;
                length -= parameter_length;
            }
        }
        break;
    case 0x0E: /* START_RECORD_RTP */
    case 0x0F: /* STOP RECORD RTP */
    {
        address remote_rtp_addr = ADDRESS_INIT_NONE;
        uint32_t remote_rtp_port_in = 0;
        uint32_t remote_rtp_port_out = 0;

        while (length > 0) {

            parameter_id     = tvb_get_uint8(tvb, offset);
            parameter_length = tvb_get_uint8(tvb, offset + 1);

            ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter, tvb, offset,
                parameter_length + 2, parameter_id, "%s",
                val_to_str_const(parameter_id, ip_device_routing_cmd_record_rtp_vals, "Unknown"));
            ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param);

            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            if (parameter_length > 0) {
                switch (parameter_id) {
                case 0x01: /* Remote IP Address */
                case 0x04: /* Remote IP Address Out */
                    if (parameter_id == 0x01)
                        set_address_tvb(&remote_rtp_addr, AT_IPv4, 4, tvb, offset);
                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_remote_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
                    break;
                case 0x00: /* Recorder Index */
                case 0x02: /* Remote UDP Port In */
                case 0x03: /* Remote UDP Port Out */
                case 0x05: /* Local UDP Port In */
                case 0x06: /* Local UDP Port Out */
                case 0x07: /* Type Of Service */
                case 0x08: /* Master Key For SRTP Session */
                case 0x09: /* Master Salt Key For SRTP Session */
                case 0x10: /* Integrity checking enabled for this communication */
                case 0x11: /* Integrity method of Thales component */
                case 0x30: /* MD5 Authentication */
                default:
                    if (parameter_length <= 8) {
                        if (parameter_id == 0x02)
                            remote_rtp_port_in = tvb_get_ntohs(tvb, offset);
                        if (parameter_id == 0x03)
                            remote_rtp_port_out = tvb_get_ntohs(tvb, offset);
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_uint, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                    } else {
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_value, tvb, offset, parameter_length, ENC_NA);
                    }
                    break;
                }

                offset += parameter_length;
                length -= parameter_length;
            }
        }

        if (setup_conversations_enabled)
        {
            if (remote_rtp_addr.data != NULL)
            {
                if (remote_rtp_port_in != 0)
                {
                    rtp_add_address(pinfo, PT_UDP, &remote_rtp_addr, remote_rtp_port_in, 0, "UA3G", pinfo->num, 0, NULL);
                    rtcp_add_address(pinfo, &remote_rtp_addr, remote_rtp_port_in+1, 0, "UA3G", pinfo->num);
                }
                if (remote_rtp_port_out != 0)
                {
                    rtp_add_address(pinfo, PT_UDP, &remote_rtp_addr, remote_rtp_port_out, 0, "UA3G", pinfo->num, 0, NULL);
                    rtcp_add_address(pinfo, &remote_rtp_addr, remote_rtp_port_out+1, 0, "UA3G", pinfo->num);
                }
            }
        }

        break;
    }
    case 0x10: /* Set SIP Parameters */
        break;
    case 0x11: /* Free Seating */
        while (length > 0) {
            parameter_id     = tvb_get_uint8(tvb, offset);
            parameter_length = tvb_get_uint8(tvb, offset + 1);

            ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_ip_device_routing_freeseating_parameter, tvb, offset,
                parameter_length + 2, parameter_id, "%s",
                val_to_str_const(parameter_id, ip_device_routing_cmd_freeseating_vals, "Unknown"));
            ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param);

            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_freeseating_parameter, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_freeseating_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            if (parameter_length > 0) {
                switch (parameter_id) {
                case 0x00: /* Pseudo Mac Address */
                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_freeseating_parameter_mac, tvb, offset, 6, ENC_NA);
                    break;
                case 0x01: /* Maincpu1 */
                case 0x02: /* Maincpu2 */
                {
                    int hf = -1;

                    if (parameter_length == FT_IPv4_LEN)
                        hf = hf_ua3g_ip_device_routing_freeseating_parameter_ip;
                    else
                    if (parameter_length == FT_IPv6_LEN)
                        hf = hf_ua3g_ip_device_routing_freeseating_parameter_ipv6;

                    if (hf != -1)
                        proto_tree_add_item(ua3g_param_tree, hf, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                    else
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_freeseating_parameter_value, tvb, offset, parameter_length, ENC_NA);
                    break;
                }
                case 0x03: /* Restart application */
                {
                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_freeseating_parameter_do_reset, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                    break;
                }
                default:
                    if (parameter_length <= 8) {
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_freeseating_parameter_uint, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                    } else {
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_freeseating_parameter_value, tvb, offset, parameter_length, ENC_NA);
                    }
                    break;
                }
                offset += parameter_length;
                length -= parameter_length;
            }
        }
        break;
    case 0x14: /* Set Appl Param */
        while (length > 0) {
            parameter_id     = tvb_get_uint8(tvb, offset);
            parameter_length = tvb_get_uint8(tvb, offset + 1);

            ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_ip_device_routing_appl_parameter, tvb, offset,
                parameter_length + 2, parameter_id, "%s", val_to_str_const(parameter_id, ip_device_routing_cmd_appl_vals, "Unknown"));
            ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param);

            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_appl_parameter, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_appl_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            if (parameter_length > 0) {
                switch (parameter_id) {
                case 0x00: /* Identifier */
                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_appl_parameter_id, tvb, offset, parameter_length, ENC_STRING);
                    break;
                case 0x01: /* Enable */
                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_appl_parameter_enable, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                    break;
                case 0x02: /* URL */
                {
                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_appl_parameter_url, tvb, offset, parameter_length, ENC_STRING);
                    break;
                }
                default:
                    if (parameter_length <= 8) {
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_appl_parameter_uint, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                    } else {
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_appl_parameter_value, tvb, offset, parameter_length, ENC_NA);
                    }
                    break;
                }
                offset += parameter_length;
                length -= parameter_length;
            }
        }
        break;
    case 0x06: /* STOP TONE */
    default:
        {
            break;
        }
    }
}


/*-----------------------------------------------------------------------------
    DEBUG IN LINE - 18h (MESSAGE FROM THE TERMINAL AND FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static void
decode_debug_in_line(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_,
             unsigned offset, unsigned length)
{
    proto_tree_add_item(tree, hf_ua3g_debug_in_line, tvb, offset, length, ENC_NA|ENC_ASCII);
}


/*-----------------------------------------------------------------------------
    LED COMMAND - 21h (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static const value_string str_command_led[] = {
    {0x00, "Led Off"},
    {0x01, "Led On"},
    {0x02, "Red Led Fast Flash"},
    {0x03, "Red Led Slow Flash"},
    {0x04, "Green Led On"},
    {0x05, "Green Led Fast Flash"},
    {0x06, "Green Led Slow Flash"},
    {0x07, "All Led Off"},
    {0, NULL}
};

static void
decode_led_command(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
           unsigned offset)
{
    int         command;

    command = tvb_get_uint8(tvb, offset);

    /* add text to the frame "INFO" column */
    col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_command_led, "Unknown"));

    if (!tree)
        return;

    proto_tree_add_item(tree, hf_ua3g_command_led, tvb, offset, 1, ENC_BIG_ENDIAN);

    if ((command >= 0) && (command < 7)) {
        proto_tree_add_item(tree, hf_ua3g_command_led_number, tvb, offset+1, 1, ENC_BIG_ENDIAN);
    }
}


/*-----------------------------------------------------------------------------
    LCD LINE 1 COMMANDS - 27h (MESSAGE FROM THE SYSTEM)
    LCD LINE 2 COMMANDS - 28h (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static const value_string str_command_lcd_line[] = {
    {0, "Clear Line & Write From Column"},
    {1, "Write From Column"},
    {2, "Append To Current Line"},
    {0, NULL}
};

static const value_string str_call_timer_ctrl[] = {
    {0x00, "Call Timer Status Not Changed"},
    {0x01, "Stop Call Timer"},
    {0x02, "Start Call Timer From Current Value"},
    {0x03, "Initialize And Call Timer"},
    {0, NULL}
};

static void
decode_lcd_line_cmd(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
            unsigned offset, unsigned length)
{
    uint8_t        command, column_n;
    const char*  command_str;
    proto_tree    *ua3g_body_tree = tree, *ua3g_param_tree, *ua3g_option_tree;
    proto_item    *ua3g_option_item;
    wmem_strbuf_t *strbuf;

    command     = tvb_get_uint8(tvb, offset) & 0x03;
    column_n    = tvb_get_uint8(tvb, offset + 1);
    command_str = val_to_str_const(command, str_command_lcd_line, "Unknown");

    /* add text to the frame "INFO" column */
    col_append_fstr(pinfo->cinfo, COL_INFO, ": %s %d", command_str, column_n);

    if (!ua3g_body_tree)
        return;

    strbuf  = wmem_strbuf_create(pinfo->pool);

    wmem_strbuf_append_printf(strbuf, "\"%s\"", tvb_format_text(pinfo->pool, tvb, offset + 2, length - 2));

    ua3g_param_tree = proto_tree_add_subtree_format(ua3g_body_tree, tvb, offset,
        length, ett_ua3g_param, NULL, "%s %d: %s",
        command_str, column_n, wmem_strbuf_get_str(strbuf));

    proto_tree_add_item(ua3g_body_tree, hf_ua3g_command_lcd_line, tvb, offset, 1, ENC_BIG_ENDIAN);
    ua3g_option_item = proto_tree_add_item(ua3g_param_tree, hf_ua3g_lcd_line_cmd_lcd_options, tvb, offset, 1, ENC_BIG_ENDIAN);
    ua3g_option_tree = proto_item_add_subtree(ua3g_option_item, ett_ua3g_option);

    proto_tree_add_item(ua3g_option_tree, hf_ua3g_lcd_line_cmd_lcd_options_call_timer, tvb, offset, 1, ENC_BIG_ENDIAN);
    proto_tree_add_item(ua3g_option_tree, hf_ua3g_lcd_line_cmd_lcd_options_blink, tvb, offset, 1, ENC_NA);
    proto_tree_add_item(ua3g_option_tree, hf_ua3g_lcd_line_cmd_lcd_options_call_timer_control, tvb, offset, 1, ENC_NA);
    proto_tree_add_item(ua3g_option_tree, hf_ua3g_lcd_line_cmd_lcd_options_call_timer_display, tvb, offset, 1, ENC_NA);
    proto_tree_add_item(ua3g_option_tree, hf_ua3g_lcd_line_cmd_lcd_options_time_of_day_display, tvb, offset, 1, ENC_NA);
    proto_tree_add_item(ua3g_option_tree, hf_ua3g_lcd_line_cmd_lcd_options_suspend_display_refresh, tvb, offset, 1, ENC_NA);

    offset++;
    length--;

    if (command != 3)
        proto_tree_add_item(ua3g_param_tree, hf_ua3g_lcd_line_cmd_starting_column, tvb, offset, 1, ENC_BIG_ENDIAN);
    else
        proto_tree_add_item(ua3g_param_tree, hf_ua3g_lcd_line_cmd_unused, tvb, offset, 1, ENC_NA);

    offset++;
    length--;
    proto_tree_add_string(ua3g_param_tree, hf_ua3g_lcd_line_cmd_ascii_char, tvb, offset, length, wmem_strbuf_get_str(strbuf));
}


/*-----------------------------------------------------------------------------
    MAIN VOICE MODE - 29h (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static const value_string str_main_voice_mode[] = {
    {0x00, "Idle"},
    {0x01, "Handset"},
    {0x02, "Group Listening"},
    {0x03, "On Hook Dial"},
    {0x04, "Handsfree"},
    {0x05, "Announce Loudspeaker"},
    {0x06, "Ringing"},
    {0x10, "Idle"},
    {0x11, "Handset"},
    {0x12, "Headset"},
    {0x13, "Handsfree"},
    {0, NULL}
};

static const value_string str_cadence[] = {
    {0x00, "Standard Ringing"},
    {0x01, "Double Burst"},
    {0x02, "Triple Burst"},
    {0x03, "Continuous Ringing"},
    {0x04, "Priority Attendant Ringing"},
    {0x05, "Regular Attendant Ringing"},
    {0x06, "Programmable Cadence"},
    {0x07, "Programmable Cadence"},
    {0, NULL}
};

static void
decode_main_voice_mode(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
               unsigned offset, unsigned length)
{
    uint8_t     mode;
    proto_tree *ua3g_body_tree = tree;

    mode  = tvb_get_uint8(tvb, offset);

    /* add text to the frame "INFO" column */
    col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(mode, str_main_voice_mode, "Unknown"));

    if (!ua3g_body_tree)
        return;

    proto_tree_add_item(ua3g_body_tree, hf_ua3g_main_voice_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
    offset++;
    length--;

    switch (mode) {
    case 0x06: /* Ringing */
        {
            proto_tree_add_item(ua3g_body_tree, hf_ua3g_main_voice_mode_tune, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            proto_tree_add_item(ua3g_body_tree, hf_ua3g_main_voice_mode_cadence, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;
        }
        /* FALLTHROUGH */
    case 0x02: /* Group Listening */
    case 0x03: /* On Hook Dial */
    case 0x04: /* Handsfree */
    case 0x05: /* Announce Loudspeaker */
        {
            proto_tree_add_item(ua3g_body_tree, hf_ua3g_main_voice_mode_speaker_volume, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            if (length > 0) {
                proto_tree_add_item(ua3g_body_tree, hf_ua3g_main_voice_mode_microphone_volume, tvb, offset, 1, ENC_BIG_ENDIAN);
            }
            break;
        }
    case 0x11: /* Handset */
        {
            signed char level;

            level = (signed char)(tvb_get_uint8(tvb, offset)) / 2;
            proto_tree_add_int(ua3g_body_tree, hf_ua3g_main_voice_mode_handset_level, tvb, offset, 1, level);

            level = (signed char)(tvb_get_uint8(tvb, offset+1)) / 2;
            proto_tree_add_int(ua3g_body_tree, hf_ua3g_main_voice_mode_sending_level, tvb, offset+1, 1, level);
            break;
        }
    case 0x12: /* Headset */
        {
            signed char level;

            level = (signed char)(tvb_get_uint8(tvb, offset)) / 2;
            proto_tree_add_int(ua3g_body_tree, hf_ua3g_main_voice_mode_headset_level, tvb, offset, 1, level);

            level = (signed char)(tvb_get_uint8(tvb, offset+1)) / 2;
            proto_tree_add_int(ua3g_body_tree, hf_ua3g_main_voice_mode_sending_level, tvb, offset+1, 1, level);
            break;
        }
    case 0x13: /* Handsfree */
        {
            signed char level;

            level = (signed char)(tvb_get_uint8(tvb, offset)) / 2;
            proto_tree_add_int(ua3g_body_tree, hf_ua3g_main_voice_mode_handsfree_level, tvb, offset, 1, level);

            level = (signed char)(tvb_get_uint8(tvb, offset+1)) / 2;
            proto_tree_add_int(ua3g_body_tree, hf_ua3g_main_voice_mode_sending_level, tvb, offset+1, 1, level);
            break;
        }
    case 0x00: /* Idle */
    case 0x01: /* Handset */
    case 0x10: /* Idle */
    default:
        {
            break;
        }
    }
}


/*-----------------------------------------------------------------------------
    SUBDEVICE METASTATE - 2Ch (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static const value_string str_new_metastate[] = {
    {0x00, "Disable"},
    {0x01, "Active"},
    {0x02, "Wake Up"},
    {0, NULL}
};

static void
decode_subdevice_metastate(proto_tree *tree, tvbuff_t *tvb,
               packet_info *pinfo _U_, unsigned offset)
{
    proto_tree_add_item(tree, hf_ua3g_subdevice_metastate_subchannel_address, tvb, offset, 1, ENC_BIG_ENDIAN);
    proto_tree_add_item(tree, hf_ua3g_subdevice_metastate_new_metastate, tvb, offset+1, 1, ENC_BIG_ENDIAN);
}


/*-----------------------------------------------------------------------------
    Download DTMF & CLOCK FORMAT - 30h (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static const value_string str_clock_format[] = {
    {0, "Europe"},
    {1, "US"},
    {0, NULL}
};

static void
decode_dwl_dtmf_clck_format(proto_tree *tree, tvbuff_t *tvb,
                packet_info *pinfo _U_, unsigned offset, unsigned length)
{
    proto_tree_add_item(tree, hf_ua3g_dwl_dtmf_clck_format_minimum_on_time, tvb, offset, 1, ENC_BIG_ENDIAN);
    proto_tree_add_item(tree, hf_ua3g_dwl_dtmf_clck_format_inter_digit_pause_time, tvb, offset+1, 1, ENC_BIG_ENDIAN);
    proto_tree_add_item(tree, hf_ua3g_dwl_dtmf_clck_format_clock_time_format, tvb, offset+2, 1, ENC_BIG_ENDIAN);

    if (length > 2)
        proto_tree_add_item(tree, hf_ua3g_dwl_dtmf_clck_format_dtmf_country_adaptation, tvb, offset+3, 1, ENC_BIG_ENDIAN);
}


/*-----------------------------------------------------------------------------
    SET CLOCK - 31h (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static const value_string str_command_set_clck[] = {
    {0x00, "Set Current Time/Call Timer"},
    {0x01, "Set Current Time"},
    {0x02, "Set Call Timer"},
    {0, NULL}
};

static void
decode_set_clck(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
        unsigned offset, unsigned length)
{
    uint8_t     command;
    int         hour, minute, second, call_timer;

    command  = tvb_get_uint8(tvb, offset);

    /* add text to the frame "INFO" column */
    col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_command_set_clck, "Unknown"));

    proto_tree_add_item(tree, hf_ua3g_command_set_clck, tvb, offset, 1, ENC_BIG_ENDIAN);
    offset++;
    length--;
    call_timer = 0;

    switch (command) {
    case 0x02: /* Timer Form */
        {
            call_timer = 1;
        }
        /* FALLTHROUGH */
    case 0x00: /* Set Current Time/Call Timer */
    case 0x01: /* Set Current Time */
        {
            while (length > 0) {
                hour   = tvb_get_uint8(tvb, offset);
                minute = tvb_get_uint8(tvb, offset + 1);
                second = tvb_get_uint8(tvb, offset + 2);

                proto_tree_add_uint_format_value(tree, (call_timer == 1) ? hf_ua3g_call_timer : hf_ua3g_current_time, tvb, offset, 3,
                    tvb_get_ntoh24(tvb, offset), "%d:%d:%d", hour, minute, second);
                offset += 3;
                length -= 3;

                call_timer = 1;
            }
        }
    default:
        {
            break;
        }
    }

}


/*-----------------------------------------------------------------------------
    VOICE CHANNEL - 32h - (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static const value_string str_voice_channel[] = {
    {0x00, "No"},
    {0x01, "B1"},
    {0x02, "B2"},
    {0x03, "B3"},
    {0, NULL}
};

static const true_false_string tfs_voice_channel_channel_mode = { "Write 00 to Voice Channel", "Normal Voice Channel Mode" };
static const true_false_string tfs_voice_channel_codec = { "Write Quiet To Codec", "Normal Codec Operation" };
static const true_false_string tfs_voice_channel_voice_channel = { "Use B3 As Voice Channel", "Use B1 As Voice Channel" };

static void
decode_voice_channel(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_,
             unsigned offset, unsigned length)
{
    if (length == 1) {
        proto_tree_add_item(tree, hf_ua3g_voice_channel_channel_mode, tvb, offset, 1, ENC_NA);
        proto_tree_add_item(tree, hf_ua3g_voice_channel_codec, tvb, offset, 1, ENC_NA);
        proto_tree_add_item(tree, hf_ua3g_voice_channel_voice_channel, tvb, offset, 1, ENC_NA);
    } else if (length == 2) {
        proto_tree_add_item(tree, hf_ua3g_voice_channel_main_voice, tvb, offset, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(tree, hf_ua3g_voice_channel_announce, tvb, offset+1, 1, ENC_BIG_ENDIAN);
    } else if (length == 4) {
        proto_tree_add_item(tree, hf_ua3g_voice_channel_b_general, tvb, offset, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(tree, hf_ua3g_voice_channel_b_loud_speaker, tvb, offset+1, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(tree, hf_ua3g_voice_channel_b_ear_piece, tvb, offset+2, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(tree, hf_ua3g_voice_channel_b_microphones, tvb, offset+3, 1, ENC_BIG_ENDIAN);
    }
}


/*-----------------------------------------------------------------------------
    EXTERNAL RINGING - 33h (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static const value_string str_ext_ring_cmd[] = {
    {0x00, "Turn Off"},
    {0x01, "Turn On"},
    {0x02, "Follow The Normal Ringing"},
    {0, NULL}
};

static void
decode_external_ringing(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
            unsigned offset)
{
    uint8_t     command;

    command = tvb_get_uint8(tvb, offset);

    /* add text to the frame "INFO" column */
    col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_ext_ring_cmd, "Unknown"));

    proto_tree_add_item(tree, hf_ua3g_external_ringing_command, tvb, offset, 1, ENC_BIG_ENDIAN);
}


/*-----------------------------------------------------------------------------
    LCD CURSOR - 35h - (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static void
decode_lcd_cursor(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, unsigned offset)
{
    const char* str_on_off_val = STR_ON_OFF(tvb_get_uint8(tvb, offset + 1) & 0x02);

    /* add text to the frame "INFO" column */
    col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", str_on_off_val);

    proto_tree_add_item(tree, hf_ua3g_lcd_cursor_line_number, tvb, offset, 1, ENC_BIG_ENDIAN);
    proto_tree_add_item(tree, hf_ua3g_lcd_cursor, tvb, offset+1, 1, ENC_NA);
}


/*-----------------------------------------------------------------------------
    DOWNLOAD SPECIAL CHARACTER - 36h - (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static void
decode_dwl_special_char(proto_tree *tree, tvbuff_t *tvb,
            packet_info *pinfo _U_, unsigned offset, unsigned length)
{
    int            i;

    while (length > 0) {
        proto_tree_add_item(tree, hf_ua3g_dwl_special_char_character_number, tvb, offset, 1, ENC_BIG_ENDIAN);
        offset++;
        length--;
        for (i = 1; i <= 8; i++) {
            proto_tree_add_item(tree, hf_ua3g_dwl_special_char_byte, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;
        }
    }
}


/*-----------------------------------------------------------------------------
    SET CLOCK/TIMER POSITION - 38h - (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static void
decode_set_clck_timer_pos(proto_tree *tree, tvbuff_t *tvb,
              packet_info *pinfo _U_, unsigned offset)
{
    if (!tree)
        return;

    proto_tree_add_item(tree, hf_ua3g_set_clck_timer_pos_clock_line_number, tvb, offset, 1, ENC_BIG_ENDIAN);
    proto_tree_add_item(tree, hf_ua3g_set_clck_timer_pos_clock_column_number, tvb, offset+1, 1, ENC_BIG_ENDIAN);
    proto_tree_add_item(tree, hf_ua3g_set_clck_timer_pos_call_timer_line_number, tvb, offset+2, 1, ENC_BIG_ENDIAN);
    proto_tree_add_item(tree, hf_ua3g_set_clck_timer_pos_call_timer_column_number, tvb, offset+3, 1, ENC_BIG_ENDIAN);
}


/*-----------------------------------------------------------------------------
    SET LCD CONTRAST - 39h - (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static const value_string str_driver_number[] = {
    {0x00, "Display"},
    {0x01, "Icon"},
    {0, NULL}
};

static void
decode_set_lcd_contrast(proto_tree *tree, tvbuff_t *tvb,
            packet_info *pinfo _U_, unsigned offset)
{
    proto_tree_add_item(tree, hf_ua3g_set_lcd_contrast_driver_number, tvb, offset, 1, ENC_BIG_ENDIAN);
    proto_tree_add_item(tree, hf_ua3g_set_lcd_contrast_contrast_value, tvb, offset+1, 1, ENC_BIG_ENDIAN);
}


/*-----------------------------------------------------------------------------
    BEEP - 3Ch (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static const value_string str_command_beep[] = {
    {0x01, "Beep Once"},
    {0x02, "Beep Start"},
    {0x03, "Stop Beep"},
    {0x04, "Start Beep"},
    {0x05, "Define Beep"},
    {0, NULL}
};

static const value_string str_beep_start_destination[] = {
    {0x01, "Ear-Piece"},
    {0x02, "Loudspeaker"},
    {0x03, "Ear-Piece and Loudspeaker"},
    {0, NULL}
};

static const value_string str_beep_freq_sample_nb[] = {
    {0x00, "Frequency"},
    {0xFF, "Audio Sample Number"},
    {0, NULL}
};
static const value_string str_beep_duration[] = {
    {0x00, "Duration "},
    {0xFF, "Duration (Ignored)"},
    {0, NULL}
};
static const value_string str_beep_terminator[] = {
    {0xFD, "Stop"},
    {0xFE, "Loop"},
    {0xFF, "Infinite"},
    {0, NULL}
};

static void
decode_beep(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
        unsigned offset, unsigned length)
{
    if (length > 0) { /* All cases except classical beep */
        uint8_t     command;
        proto_tree *ua3g_body_tree = tree;

        command = tvb_get_uint8(tvb, offset);

        /* add text to the frame "INFO" column */
        col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_command_beep, "Unknown"));

        proto_tree_add_item(ua3g_body_tree, hf_ua3g_command_beep, tvb, offset, 1, ENC_BIG_ENDIAN);
        offset++;
        length--;

        switch (command) {
        case 0x01: /* Beep Once */
        case 0x02: /* Beep Start */
            {
                int i =  0;

                proto_tree_add_item(ua3g_body_tree, hf_ua3g_beep_destination, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                length--;

                while (length > 0) {
                    uint8_t val;

                    i++;
                    val = (tvb_get_uint8(tvb, offset) & 0x7F) * 10;
                    proto_tree_add_item(ua3g_body_tree, hf_ua3g_beep_on_off, tvb, offset, 1, ENC_NA);
                    proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_beep_cadence, tvb, offset, 1, val,
                        "Cadence T%d: %d ms", i, val);
                    offset++;
                    length--;
                }
                break;
            }
        case 0x04: /* Start Beep */
            {
                static int * const destinations[] = {
                    &hf_ua3g_beep_beep_destination_handset,
                    &hf_ua3g_beep_beep_destination_headset,
                    &hf_ua3g_beep_beep_destination_loudspeaker,
                    &hf_ua3g_beep_beep_destination_announce_loudspeaker,
                    &hf_ua3g_beep_beep_destination_handsfree,
                    NULL
                };

                proto_tree_add_bitmask(ua3g_body_tree, tvb, offset, hf_ua3g_beep_beep_destination,
                        ett_ua3g_beep_beep_destination, destinations, ENC_NA);
                offset++;

                proto_tree_add_item(ua3g_body_tree, hf_ua3g_beep_beep_number, tvb, offset, 1, ENC_BIG_ENDIAN);
                break;
            }
        case 0x05:
            {
                int i, nb_of_notes, beep_number;
                proto_tree* note_tree;

                beep_number = tvb_get_uint8(tvb, offset);
                proto_tree_add_item(ua3g_body_tree, hf_ua3g_beep_beep_number, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                length--;

                if (beep_number <= 0x44)
                    beep_number = 0x00;
                else
                    beep_number = 0xFF;

                nb_of_notes = tvb_get_uint8(tvb, offset);
                proto_tree_add_item(ua3g_body_tree, hf_ua3g_beep_number_of_notes, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                length--;

                while (length > 0) {
                    for (i = 1; i <= nb_of_notes; i++) {
                        note_tree = proto_tree_add_subtree_format(ua3g_body_tree, tvb, offset, 3,
                                        ett_ua3g_note, NULL, "Note %d", i);
                        proto_tree_add_uint_format(note_tree, hf_ua3g_beep_freq_sample, tvb, offset, 1, tvb_get_uint8(tvb, offset),
                            "%s: %d", val_to_str_const(beep_number, str_beep_freq_sample_nb, "Unknown"),
                            tvb_get_uint8(tvb, offset));
                        offset++;
                        length--;
                        proto_tree_add_item(note_tree, hf_ua3g_beep_level, tvb, offset, 1, ENC_NA);
                        offset++;
                        length--;
                        proto_tree_add_uint_format(note_tree, hf_ua3g_beep_duration, tvb, offset, 1, tvb_get_uint8(tvb, offset),
                            "%s: %x", val_to_str_const(beep_number, str_beep_duration, "Unknown"),
                            tvb_get_uint8(tvb, offset));
                        offset++;
                        length--;
                    }
                    proto_tree_add_item(ua3g_body_tree, hf_ua3g_beep_terminator, tvb, offset, 1, ENC_BIG_ENDIAN);
                    offset++;
                    length--;
                }
                break;
            }
        case 0x03: /* Stop Beep */
        default:
            {
                break;
            }
        }
    } else { /* Classical Beep */
        /* add text to the frame "INFO" column */
        col_append_str(pinfo->cinfo, COL_INFO, ": Classical Beep");
    }
}


/*-----------------------------------------------------------------------------
    SIDETONE ON / OFF - 3Dh (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static void
decode_sidetone(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, unsigned offset)
{
    uint8_t     command;
    const char* command_str;

    command = tvb_get_uint8(tvb, offset);
    command_str = STR_ON_OFF(command);

    /* add text to the frame "INFO" column */
    col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", command_str);

    proto_tree_add_item(tree, hf_ua3g_command_sidetone, tvb, offset, 1, ENC_NA);

    if (command == 0x01) {
        proto_tree_add_int(tree, hf_ua3g_sidetone_level, tvb, offset+1, 1,
            (signed char)(tvb_get_uint8(tvb, offset+1) / 2));
    }
}


/*-----------------------------------------------------------------------------
    SET PROGRAMMABLE RINGING CADENCE - 3Eh (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static void
decode_ringing_cadence(proto_tree *tree, tvbuff_t *tvb,
               packet_info *pinfo _U_, unsigned offset, unsigned length)
{
    int         i = 0;
    uint16_t    cadence_length;

    if (!tree)
        return;

    proto_tree_add_item(tree, hf_ua3g_ringing_cadence_cadence, tvb, offset, 1, ENC_BIG_ENDIAN);
    offset++;
    length--;

    while (length > 0) {
        i++;
        proto_tree_add_item(tree, hf_ua3g_ringing_cadence_on_off, tvb, offset, 1, ENC_NA);
        cadence_length = ((tvb_get_uint8(tvb, offset) & 0x7F) * 10);
        proto_tree_add_uint_format(tree, hf_ua3g_ringing_cadence_length, tvb, offset, 1, cadence_length,
            "Length %d : %d ms", i, cadence_length);
        offset++;
        length--;
    }
}


/*-----------------------------------------------------------------------------
    MUTE ON / OFF - 3Fh (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static const value_string str_mute[] = {
    {0x00, "Microphone Disable"},
    {0x01, "Microphone Enable"},
    {0, NULL}
};

static void
decode_mute(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, unsigned offset)
{
    uint8_t     command;

    command = tvb_get_uint8(tvb, offset);

    /* add text to the frame "INFO" column */
    col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_mute, "Unknown"));

    proto_tree_add_item(tree, hf_ua3g_command_mute, tvb, offset, 1, ENC_NA);
}


/*-----------------------------------------------------------------------------
    FEEDBACK ON / OFF - 40h (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static void
decode_feedback(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
        unsigned offset, unsigned length)
{
    uint8_t     command;
    const char* command_str;

    command = tvb_get_uint8(tvb, offset);
    command_str = STR_ON_OFF(command);

    /* add text to the frame "INFO" column */
    col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", command_str);

    if (!tree)
        return;

    proto_tree_add_item(tree, hf_ua3g_command_feedback, tvb, offset, 1, ENC_NA);
    offset++;
    length--;

    if (command == 0x01) {
        proto_tree_add_int(tree, hf_ua3g_feedback_level, tvb, offset, 1,
            (signed char)(tvb_get_uint8(tvb, offset) / 2));
        offset++;
        length--;

        if (length > 0) {
            proto_tree_add_uint_format_value(tree, hf_ua3g_feedback_duration, tvb, offset, 1,
                tvb_get_uint8(tvb, offset) * 10, "%d ms", tvb_get_uint8(tvb, offset) * 10);
        }
    }
}


/*-----------------------------------------------------------------------------
    READ PERIPHERAL - 44h (MESSAGE FROM THE SYSTEM)
    WRITE PERIPHERAL - 45h (MESSAGE FROM THE SYSTEM)
    PERIPHERAL CONTENT - 2Bh (MESSAGE FROM THE TERMINAL)
    ---------------------------------------------------------------------------*/
static void
decode_r_w_peripheral(proto_tree *tree, tvbuff_t *tvb,
              packet_info *pinfo _U_, unsigned offset, unsigned length)
{
    proto_tree_add_item(tree, hf_ua3g_r_w_peripheral_address, tvb, offset, 2, ENC_BIG_ENDIAN);

    if (length > 2) {
        proto_tree_add_item(tree, hf_ua3g_r_w_peripheral_content, tvb, offset+2, 1, ENC_BIG_ENDIAN);
    }
}


/*-----------------------------------------------------------------------------
    ICON COMMAND - 47h (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static const value_string str_icon_cmd_state[] = {
    {0x00, "Off"},
    {0x01, "Slow Flash"},
    {0x02, "Not Used"},
    {0x03, "Steady On"},
    {0, NULL}
};

static void
decode_icon_cmd(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, unsigned offset)
{
    uint8_t byte0, byte1, bytex;
    int i;

    if (!tree)
        return;

    proto_tree_add_item(tree, hf_ua3g_icon_cmd_icon_number, tvb, offset, 1, ENC_BIG_ENDIAN);

    byte0 = tvb_get_uint8(tvb, offset+1);
    byte1 = tvb_get_uint8(tvb, offset+2);

    for (i = 0; i < 8; i++) {
        bytex =
            ((byte0 >> i) & 0x01) * 2 +
            ((byte1 >> i) & 0x01);
        proto_tree_add_uint_format(tree, hf_ua3g_icon_cmd_segment, tvb, offset+1, 2, bytex,
                            "Segment %d: %s (%d)", i, val_to_str_const(bytex, str_icon_cmd_state, "Unknown"), bytex);
    }
}


/*-----------------------------------------------------------------------------
    AUDIO CONFIGURATION - 49h (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static const value_string str_command_audio_config[] = {
    {0x00, "Audio Coding"},
    {0x01, "DPI Channel Allocations"},
    {0x02, "Loudspeaker Volume Adjust"},
    {0x03, "Audio Circuit Configuration"},
    {0x04, "Handsfree Parameters"},
    {0x05, "Loudspeaker Acoustic Parameters"},
    {0x06, "Device Configuration"},
    {0, NULL}
};

static const value_string str_audio_coding_law[] = {
    {0x00, "A Law"},
    {0x01, "m Law"},
    {0, NULL}
};

static const value_string str_device_configuration[] = {
    { 0, "Handset Device             "},
    { 1, "Headset Device             "},
    { 2, "Loudspeaker Device         "},
    { 3, "Announce Loudspeaker Device"},
    { 4, "Handsfree Device           "},
    { 0, NULL }
};

static const true_false_string tfs_audio_config_handsfree_return = { "Return Loss Active", "Return Loss Normal" };
static const true_false_string tfs_audio_config_handsfree_handsfree = { "More Full Duplex", "Handsfree Normal" };

static void
decode_audio_config(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
            unsigned offset, unsigned length)
{
    uint8_t     command;
    proto_tree *ua3g_body_tree = tree;

    command = tvb_get_uint8(tvb, offset);

    /* add text to the frame "INFO" column */
    col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_command_audio_config, "Unknown"));

    if (!ua3g_body_tree)
        return;

    proto_tree_add_item(ua3g_body_tree, hf_ua3g_command_audio_config, tvb, offset, 1, ENC_BIG_ENDIAN);
    offset++;
    length--;

    switch (command) {
    case 0x00: /* Audio Coding */
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_ignored, tvb, offset, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_law, tvb, offset+1, 1, ENC_BIG_ENDIAN);
        break;
    case 0x01: /* DPI Channel Allocations */

        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_dpi_chan_ua_tx1, tvb, offset, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_dpi_chan_ua_tx2, tvb, offset+1, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_dpi_chan_gci_tx1, tvb, offset+2, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_dpi_chan_gci_tx2, tvb, offset+3, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_dpi_chan_cod_tx, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        break;
    case 0x02: /* Loudspeaker Volume Adjust */
        {
            int i;
            for (i = 1; i < 8; i++) {
                proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_audio_config_volume_level, tvb, offset,
                    1, tvb_get_uint8(tvb, offset), "Volume Level %d: %d",
                    i, tvb_get_uint8(tvb, offset));
                offset++;
                length--;
            }
            break;
        }
    case 0x03: /* Audio Circuit Configuration */

        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_dth, tvb, offset, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_dtr, tvb, offset+1, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_dtf, tvb, offset+2, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_str, tvb, offset+3, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_ahp1, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_ahp2, tvb, offset+5, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_ath, tvb, offset+6, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_atr, tvb, offset+7, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_atf, tvb, offset+8, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_alm, tvb, offset+9, 1, ENC_BIG_ENDIAN);
        break;
    case 0x04: /* Handsfree Parameters */
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_handsfree_return, tvb, offset, 1, ENC_NA);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_handsfree_handsfree, tvb, offset, 1, ENC_NA);
        break;
    case 0x05: /* Loudspeaker Acoustic Parameters */
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_group_listen, tvb, offset, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_attenuation, tvb, offset+1, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_stay_in_send, tvb, offset+2, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_shift_right_mtx, tvb, offset+3, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_shift_right_mrc, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_idle_trans_threshold, tvb, offset+5, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_low_trans_threshold, tvb, offset+6, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_idle_recv_threshold, tvb, offset+7, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_low_recv_threshold, tvb, offset+8, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_med_recv_threshold, tvb, offset+9, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_high_recv_threshold, tvb, offset+10, 1, ENC_BIG_ENDIAN);
        break;
    case 0x06: /* Device Configuration */
        {
            static const char *str_device_values[] = {
                " Internal",
                " Rj9 Plug",
                " Jack Plug",
                " Bluetooth Link",
                " USB Link"
            };
            wmem_strbuf_t *strbuf;
            uint8_t device_values;
            int j;
            int device_index = 0;

            strbuf = wmem_strbuf_create(pinfo->pool);

            while (length > 0) {

                device_values = tvb_get_uint8(tvb, offset);

                wmem_strbuf_truncate(strbuf, 0);

                if (device_values != 0) {
                    for (j = 0; j < 5; j++) {
                        if (device_values & (0x01 << j)) {
                            wmem_strbuf_append(strbuf, str_device_values[j]);
                        }
                    }
                } else {
                    wmem_strbuf_append(strbuf, " None");
                }

                proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_device_configuration, tvb, offset, 1,
                                    device_values, "%s:%s",
                                    val_to_str_const(device_index, str_device_configuration, "Unknown"),
                                    wmem_strbuf_get_str(strbuf));
                offset++;
                length--;
                device_index++;
            }
            break;
        }
    default:
        {
            break;
        }
    }
}


/*-----------------------------------------------------------------------------
    AUDIO PADDED PATH - 4Ah (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static void
decode_audio_padded_path(proto_tree *tree, tvbuff_t *tvb,
             packet_info *pinfo _U_, unsigned offset)
{
    proto_tree_add_item(tree, hf_ua3g_audio_padded_path_emission_padded_level, tvb, offset, 1, ENC_BIG_ENDIAN);
    proto_tree_add_item(tree, hf_ua3g_audio_padded_path_reception_padded_level, tvb, offset+1, 1, ENC_BIG_ENDIAN);
}


/*-----------------------------------------------------------------------------
    KEY RELEASE ON / OFF - 41h (MESSAGE FROM THE SYSTEM)
    AMPLIFIED HANDSET (BOOST) - 48h (MESSAGE FROM THE SYSTEM)
    LOUDSPEAKER ON / OFF - 4Dh (MESSAGE FROM THE SYSTEM)
    ANNOUNCE ON / OFF - 4Eh (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static void
decode_on_off_level(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
            unsigned offset, unsigned length, int hf_opcode)
{
    uint8_t     command;
    const char* command_str;

    command = tvb_get_uint8(tvb, offset);
    command_str = STR_ON_OFF(command);

    /* add text to the frame "INFO" column */
    col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", command_str);

    proto_tree_add_item(tree, hf_opcode, tvb, offset, 1, ENC_NA);

    if (length > 1) {
        if (command == 0x01) {
            proto_tree_add_item(tree, hf_ua3g_on_off_level_level_on_loudspeaker, tvb, offset+1, 1, ENC_BIG_ENDIAN);
        }
    }
}


/*-----------------------------------------------------------------------------
    RING ON / OFF - 4Fh (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static void
decode_ring(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, unsigned offset)
{
    uint8_t     command;
    const char* command_str;

    command = tvb_get_uint8(tvb, offset);
    command_str = STR_ON_OFF(command);

    /* add text to the frame "INFO" column */
    col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", command_str);

    if (!tree)
        return;

    proto_tree_add_item(tree, hf_ua3g_command_ring, tvb, offset, 1, ENC_NA);

    if (command == 0x01) {
        proto_tree_add_item(tree, hf_ua3g_ring_melody, tvb, offset+1, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(tree, hf_ua3g_ring_cadence, tvb, offset+2, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(tree, hf_ua3g_ring_speaker_level, tvb, offset+3, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(tree, hf_ua3g_ring_beep_number, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(tree, hf_ua3g_ring_silent, tvb, offset+5, 1, ENC_NA);
        proto_tree_add_item(tree, hf_ua3g_ring_progressive, tvb, offset+5, 1, ENC_BIG_ENDIAN);
    }
}


/*-----------------------------------------------------------------------------
    UA DOWNLOAD PROTOCOL - 50h - Only for UA NOE (MESSAGE FROM THE TERMINAL AND FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static const value_string str_command_ua_dwl_protocol[] = {
    {0x00, "Downloading Suggest"},
    {0x01, "Downloading Request"},
    {0x02, "Downloading Acknowledge"},
    {0x03, "Downloading Data"},
    {0x04, "Downloading End"},
    {0x05, "Downloading End Acknowledge"},
    {0x06, "Downloading ISO Checksum"},
    {0x07, "Downloading ISO Checksum Acknowledge"},
    {0, NULL}
};

static const value_string str_download_req_force_mode[] = {
    {0x00, "System Accept All Refusals"},
    {0x01, "Force Software Lock"},
    {0, NULL}
};
#if 0
static const value_string str_download_req_item_id[] = {
    {0x00, "Patches File"},
    {0x01, "Application Binary"},
    {0x02, "Datas Binary"},
    {0, NULL}
};
#endif
static const value_string str_download_req_mode_selection_country[] = {
    {0x00, "No Check"},
    {0x01, "For All Countries Except Chinese"},
    {0x02, "For Chinese"},
    {0, NULL}
};

static const value_string str_download_ack_status[] = {
    {0x00, "Ok (Binary Item Downloading In \"Normal\" Progress)"},
    {0x01, "Hardware Failure: Flash Failure"},
    {0x02, "Not Enough Place To Store The Downloaded Binary"},
    {0x03, "Wrong Seq Number On Latest Received Download_Data Message"},
    {0x04, "Wrong Packet Number On Latest Received Download_Data Message"},
    {0x05, "Download Refusal Terminal (Validation Purpose)"},
    {0x06, "Download Refusal Terminal (Development Purpose)"},
    {0x10, "Download Refusal: Hardware Cause (Unknown Flash Device, Incompatible Hardware)"},
    {0x11, "Download Refusal: No Loader Available Into The Terminal"},
    {0x12, "Download Refusal: Software Lock"},
    {0x13, "Download Refusal: Wrong Parameter Into Download Request"},
    {0x20, "Wrong Packet Number On Latest Received Downloading_Data Message"},
    {0x21, "Compress Header Invalid"},
    {0x22, "Decompress Error"},
    {0x23, "Binary Header Invalid"},
    {0x24, "Binary Check Error: Flash Write Error Or Binary Is Invalid"},
    {0x25, "Error Already Signaled - No More Data Accepted"},
    {0x26, "No Downloading In Progress"},
    {0x27, "Too Many Bytes Received (More Than Size Given Into The Download_Req Message)"},
    {0xFF, "Undefined Error"},
    {0, NULL}
};
static value_string_ext str_download_ack_status_ext = VALUE_STRING_EXT_INIT(str_download_ack_status);

static const value_string str_download_end_ack_ok[] = {
    {0x00, "Ok"},
    {0x01, "Hardware Failure: Flash Problems"},
    {0x02, "Not Enough Place To Store The Downloaded Binary"},
    {0, NULL}
};

static const value_string str_iso_checksum_ack_status[] = {
    {0x00, "The Checksum Matches"},
    {0x25, "Error Detected And Already Signaled"},
    {0x30, "Checksum Error (All Bytes Received)"},
    {0x31, "Checksum Error (Bytes Missing)"},
    {0, NULL}
};

static const value_string str_mem_size[] = {
    {0x00, "No Check"},
    {0x01, "128 Kbytes"},
    {0x02, "256 Kbytes"},
    {0x03, "512 Kbytes"},
    {0x04, "1 Mbytes"},
    {0x05, "2 Mbytes"},
    {0x06, "4 Mbytes"},
    {0x07, "8 Mbytes"},
    {0, NULL}
};

static const true_false_string tfs_bin_info = { "LZO Compressed Binary", "Uncompressed Binary" };

static void
decode_ua_dwl_protocol(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
               unsigned offset, unsigned length)
{
    uint8_t     command;
    proto_tree    *ua3g_body_tree = tree, *ua3g_param_tree;

    command = tvb_get_uint8(tvb, offset);

    /* add text to the frame "INFO" column */
    col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_command_ua_dwl_protocol, "Unknown"));

    proto_tree_add_item(ua3g_body_tree, hf_ua3g_command_ua_dwl_protocol, tvb, offset, 1, ENC_BIG_ENDIAN);
    offset++;
    length--;

    switch (command) {
    case 0x00:  /* Downloading Suggest (MESSAGE FROM THE TERMINAL) */
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_item_identifier, tvb, offset, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_item_version_nc, tvb, offset+1, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_cause, tvb, offset+3, 1, ENC_BIG_ENDIAN);
        break;
    case 0x01:  /* Downloading Request (MESSAGE FROM THE SYSTEM) */
        {
            if (length > 7) { /* Not R1 */
                proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_force_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                length--;
            }

            proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_item_identifier, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_item_version, tvb, offset, 2, ENC_BIG_ENDIAN);
            offset += 2;
            length -= 2;

            if (length > 2) { /* Not R1 */
                ua3g_param_tree = proto_tree_add_subtree(ua3g_body_tree, tvb, offset, 1, ett_ua3g_param, NULL, "Files Included");
                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_files_inc_boot_binary,
                        tvb, offset, 1, ENC_NA);
                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_files_inc_loader_binary,
                        tvb, offset, 1, ENC_NA);
                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_files_inc_appli_binary,
                        tvb, offset, 1, ENC_NA);
                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_files_inc_data_binary,
                        tvb, offset, 1, ENC_NA);
                offset++;
                length--;

                ua3g_param_tree = proto_tree_add_subtree(ua3g_body_tree, tvb, offset, 1, ett_ua3g_param, NULL, "Model Selection");
                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_model_selection_a,
                        tvb, offset, 1, ENC_NA);
                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_model_selection_b,
                        tvb, offset, 1, ENC_NA);
                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_model_selection_c,
                        tvb, offset, 1, ENC_NA);
                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_model_selection_country_ver,
                        tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                length--;
                ua3g_param_tree = proto_tree_add_subtree(ua3g_body_tree, tvb, offset, 1, ett_ua3g_param, NULL, "Hardware Selection");
                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_hardware_selection_ivanoe1,
                        tvb, offset, 1, ENC_NA);
                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_hardware_selection_ivanoe2,
                        tvb, offset, 1, ENC_NA);
                offset++;
                length--;

                ua3g_param_tree = proto_tree_add_subtree(ua3g_body_tree, tvb, offset, 1, ett_ua3g_param, NULL, "Memory Sizes Required");
                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_memory_sizes_flash,
                        tvb, offset, 1, ENC_BIG_ENDIAN);
                proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_memory_sizes_ext_ram,
                        tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                length--;
            } else { /* R1 */
                proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_binary_info, tvb, offset, 1, ENC_NA);
                offset++;
                length--;
            }

            proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_binary_length, tvb, offset, 3, ENC_BIG_ENDIAN);
            break;
        }
    case 0x02:  /* Downloading Acknowledge (MESSAGE FROM THE TERMINAL) */
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_packet_number, tvb, offset, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_download_ack_status, tvb, offset+2, 1, ENC_BIG_ENDIAN);
        break;
    case 0x03:  /* Downloading Data (MESSAGE FROM THE SYSTEM) */
        {
            int i = 1;

            proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_packet_number, tvb, offset, 2, ENC_BIG_ENDIAN);
            offset += 2;
            length -= 2;

            while (length > 0) {
                proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_packet_number, tvb, offset, 1,
                    tvb_get_uint8(tvb, offset), "Packet Number %3d: %d", i, tvb_get_uint8(tvb, offset));
                offset++;
                length--;
                i++;
            }
            break;
        }
    case 0x05:  /* Downloading End Acknowledge (MESSAGE FROM THE TERMINAL) */
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_packet_download_end_ack_ok_status, tvb, offset, 1, ENC_BIG_ENDIAN);
        break;
    case 0x06:  /* Downloading Iso Checksum (MESSAGE FROM THE SYSTEM) */
        proto_tree_add_checksum(ua3g_body_tree, tvb, offset, hf_ua3g_ua_dwl_protocol_checksum, -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS);
        break;
    case 0x07:  /* Downloading ISO Checksum Acknowledge (MESSAGE FROM THE TERMINAL) */
        proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_acknowledge, tvb, offset, 1, ENC_BIG_ENDIAN);
        break;
    case 0x04:  /* Downloading End (MESSAGE FROM THE SYSTEM) */
    default:
        break;
    }
}


/*-----------------------------------------------------------------------------
    DIGIT DIALED - 03h (MESSAGE FROM THE SYSTEM)
    ---------------------------------------------------------------------------*/
static void
decode_digit_dialed(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, unsigned offset)
{
    proto_tree_add_item(tree, hf_ua3g_digit_dialed_digit_value, tvb, offset, 1, ENC_BIG_ENDIAN);
}


/*-----------------------------------------------------------------------------
    SUBDEVICE_MSG - 04h (MESSAGE FROM THE TERMINAL)
    ---------------------------------------------------------------------------*/
static void
decode_subdevice_msg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_,
             unsigned offset, unsigned length)
{
    if (!tree)
        return;

    proto_tree_add_item(tree, hf_ua3g_subdevice_msg_subdev_type, tvb, offset, 1, ENC_BIG_ENDIAN);
    proto_tree_add_item(tree, hf_ua3g_subdevice_msg_subdev_address, tvb, offset, 1, ENC_BIG_ENDIAN);

    proto_tree_add_item(tree, hf_ua3g_subdevice_msg_subdevice_opcode, tvb, offset+1, 1, ENC_BIG_ENDIAN);

    if (length > 2) {
        proto_tree_add_item(tree, hf_ua3g_subdevice_msg_parameter_bytes, tvb, offset+2, length-2, ENC_NA);
    }
}


/*-----------------------------------------------------------------------------
    IP DEVICE ROUTING - 13h (MESSAGE FROM THE TERMINAL)
    ---------------------------------------------------------------------------*/
static const value_string str_command_cs_ip_device_routing[] = {
    {0x00, "Init"},
    {0x01, "Incident"},
    {0x02, "Get Parameters Value Response"},
    {0x03, "QOS Ticket RSP"},
    {0, NULL}
};

static const value_string str_vta_type[] = {
    {0x03, "4035"},
    {0x04, "4020"},
    {0x05, "4010"},
    {0x20, "4018"},
    {0x21, "4028/8008/8008G/8028/8028S/8058S"},
    {0x22, "4038/8038"},
    {0x23, "4068/8068/8082/8068S"},
    {0x24, "mipt"},
    {0x25, "4008"},
    {0x32, "8058S"},
    {0x34, "8078S"},
    {0x35, "8088"},
    {0, NULL}
};

static const value_string str_additional_vta_type[] = {
    {0x00, "Not Applicable"},
    {0x30, "8018"},
    {0x31, "8028S"},
    {0x32, "8058S"},
    {0x33, "4068S"},
    {0x34, "8078S"},
    {0x35, "8088"},
    {0x36, "8008/8008G"},
    {0, NULL}
};

static const value_string str_cs_ip_device_routing_0F_compressor[] = {
    {0x00, "G.711 A-law"},
    {0x01, "G.711 mu-law"},
    {0x02, "G.723.1 5.3kbps"},
    {0x03, "G.723.1 6.3kbps"},
    {0x04, "G.729A 8kbps"},
    {0x05, "G.722 64kbps"},
    {0x06, "G.722 56kbps"},
    {0x07, "G.722 48kbps"},
    {0x08, "Opus"},
    {0, NULL}
};

static const value_string cs_ip_device_routing_03_parameter_id_vals[] = {
    {0x01, "Date Of End Of Communication"},
    {0x02, "Node Number"},
    {0x03, "Ticket Protocol Version"},
    {0x06, "Equipment Type"},
    {0x08, "Local IP Address"},
    {0x09, "Distant IP Address"},
    {0x0A, "Local ID"},
    {0x0B, "Distant ID"},
    {0x0C, "Call Duration (second)"},
    {0x0D, "Local SSRC"},
    {0x0E, "Distant SSRC"},
    {0x0F, "Codec"},
    {0x10, "VAD"},
    {0x11, "ECE"},
    {0x12, "Voice Mode"},
    {0x13, "Transmitted Framing (ms)"},
    {0x14, "Received Framing (ms)"},
    {0x15, "Framing Changes"},
    {0x16, "Number Of RTP Packets Received"},
    {0x17, "Number Of RTP Packets Sent"},
    {0x18, "Number Of RTP Packets Lost"},
    {0x19, "Total Silence Detected (second)"},
    {0x1A, "Number Of SID Received"},
    {0x1B, "Delay Distribution"},
    {0x1C, "Maximum Delay (ms)"},
    {0x1D, "Number Of DTMF Received"},
    {0x1E, "Consecutive BFI"},
    {0x1F, "BFI Distribution"},
    {0x20, "Jitter Depth Distribution"},
    {0x21, "Number Of ICMP Host Unreachable"},
    {0x26, "Firmware Version"},
    {0x29, "DSP Framing (ms)"},
    {0x2A, "Transmitter SID"},
    {0x2D, "Minimum Delay (ms)"},
    {0x2E, "802.1 Q Used"},
    {0x2F, "802.1p Priority"},
    {0x30, "VLAN Id"},
    {0x31, "DiffServ"},
    {0x37, "Encryption"},
    {0x3D, "200 ms BFI Distribution"},
    {0x3E, "Consecutive RTP Lost"},
    {0, NULL}
};
static value_string_ext cs_ip_device_routing_03_parameter_id_vals_ext = VALUE_STRING_EXT_INIT(cs_ip_device_routing_03_parameter_id_vals);

static const value_string cs_ip_device_routing_cmd03_type_of_equip_vals[] = {
    {0x0101, "IP-Phone V2"},
    {0x0102, "NOE-IP"},
    {0x0200, "4980 Softphone (PCMM2)"},
    {0x0201, "WebSoftphoneIP"},
    {0x0300, "INTIP"},
    {0x0301, "GD/GA"},
    {0x0302, "4645"},
    {0x0303, "INTIP3"},
    {0x0304, "GD3/GA3"},
    {0x0305, "OXE MS"},
    {0x0306, "INTIP3-RTPproxy"},
    {0x0307, "GD3/GA3-RTPproxy"},
    {0x0308, "MS-RTPproxy"},
    {0x0400, "OXO"},
    {0, NULL}
};

static const value_string cs_ip_device_routing_cmd03_voice_mode_vals[] = {
    {0x50, "Idle"},
    {0x51, "Handset"},
    {0x52, "Group Listening"},
    {0x53, "On Hook Dial"},
    {0x54, "Handsfree"},
    {0x55, "Headset"},
    {0, NULL}
};

static const value_string cs_ip_device_routing_delay_distribution_range_vals[] = {
    {0, "0-40     "},
    {1, "40-80    "},
    {2, "80-150   "},
    {3, "150-250  "},
    {4, "250 and +"},
    {0, NULL}
};

static const value_string cs_ip_device_routing_0_9_range_vals[] = {
    {0, "0      "},
    {1, "1      "},
    {2, "2      "},
    {3, "3      "},
    {4, "4      "},
    {5, "5      "},
    {6, "5      "},
    {7, "7      "},
    {8, "8      "},
    {9, "9 and +"},
    {0, NULL}
};

static const value_string cs_ip_device_routing_bfi_distribution_range_vals[] = {
    {0, "0      "},
    {1, "0-1    "},
    {2, "1-2    "},
    {3, "2-3    "},
    {4, "3 and +"},
    {0, NULL}
};

static const value_string cs_ip_device_routing_200ms_bfi_distribution_range_vals[] = {
    {0, "< 10% "},
    {1, "< 20% "},
    {2, "< 40% "},
    {3, "< 60% "},
    {4, ">= 60%"},
    {0, NULL}
};

static const value_string cs_ip_device_routing_consecutive_rtp_lost_range_vals[] = {
    {0, "1      "},
    {1, "2      "},
    {2, "3      "},
    {3, "4      "},
    {4, "5 and +"},
    {0, NULL}
};

static void
decode_cs_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb,
                packet_info *pinfo, unsigned offset, unsigned length)
{
    uint8_t command;
    proto_tree *ua3g_body_tree = tree, *ua3g_param_tree;
    proto_item *ua3g_param_item;
    int i, parameter_id, parameter_length;

    command = tvb_get_uint8(tvb, offset);

    /* add text to the frame "INFO" column */
    col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_command_cs_ip_device_routing, "Unknown"));

    if (!ua3g_body_tree)
        return;

    proto_tree_add_item(ua3g_body_tree, hf_ua3g_ip_cs, tvb, offset, 1, ENC_BIG_ENDIAN);
    offset++;
    length--;

    switch (command) {
        case 0x00:
            proto_tree_add_item(ua3g_body_tree, hf_ua3g_cs_ip_device_routing_cmd00_vta_type, tvb, offset, 1, ENC_BIG_ENDIAN);
            proto_tree_add_item(ua3g_body_tree, hf_ua3g_cs_ip_device_routing_cmd00_characteristic_number, tvb, offset+1, 1, ENC_BIG_ENDIAN);
            break;
        case 0x01:
            {
                int j = 0;
                if (length == 1) {
                    proto_tree_add_item(ua3g_body_tree, hf_ua3g_cs_ip_device_routing_cmd01_incident_0, tvb, offset, 1, ENC_BIG_ENDIAN);
                } else {
                    while (length >0) {
                        j++;
                        proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_cs_ip_device_routing_param_identifier, tvb, offset, 1,
                            tvb_get_uint8(tvb, offset), "Parameter %d Identifier: %d",
                            j, tvb_get_uint8(tvb, offset));
                        offset++;
                        length--;
                    }
                }
                break;
            }
        case 0x02:
            while (length > 0) {
                parameter_id = tvb_get_uint8(tvb, offset);
                parameter_length = tvb_get_uint8(tvb, offset + 1);

                ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter, tvb, offset,
                    parameter_length + 2, parameter_id,
                    "%s", val_to_str_const(parameter_id, ip_device_routing_cmd_get_param_req_vals, "Unknown"));
                ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param);

                proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                length--;

                proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                length--;

                if (parameter_length > 0) {
                    switch (parameter_id) {
                    case 0x00: /* Firmware Version */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_firmware_version, tvb, offset, 2, ENC_BIG_ENDIAN);
                        break;
                    case 0x01: /* Firmware Version (same as above, different format) */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_tscip_version, tvb, offset, 3, ENC_BIG_ENDIAN);
                        break;
                    case 0x02: /* DHCP IP Address */
                    case 0x03: /* Local IP Address */
                    case 0x04: /* Subnetwork Mask */
                    case 0x05: /* Router IP Address */
                    case 0x06: /* TFTP IP Address */
                    case 0x07: /* Main CPU Address */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
                        break;
                    case 0x08: /* Default Codec */
                        {
                            if (parameter_length <= 8) {
                                proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_default_codec_uint, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                            } else {
                                proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_default_codec_bytes, tvb, offset, parameter_length, ENC_NA);
                            }
                            break;
                        }
                    case 0x09: /* Ethernet Drivers Config */
                        {
                            if (parameter_length == 2) {
                                proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_lan_speed, tvb, offset, 1, ENC_BIG_ENDIAN);
                                proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_lan_duplex, tvb, offset+1, 1, ENC_NA|ENC_ASCII);
                            } else if (parameter_length == 4) {
                                proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_lan_speed, tvb, offset, 1, ENC_BIG_ENDIAN);
                                proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_lan_duplex, tvb, offset+1, 1, ENC_NA|ENC_ASCII);
                                proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_pc_speed, tvb, offset+2, 1, ENC_BIG_ENDIAN);
                                proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_pc_duplex, tvb, offset+3, 1, ENC_NA|ENC_ASCII);
                            } else {
                                proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_value, tvb, offset, parameter_length, ENC_NA);
                            }
                            break;
                        }
                    case 0x0A: /* MAC Address */
                    case 0x0B: /* Pseudo MAC Address */
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_mac_address, tvb, offset, 6, ENC_NA);
                        break;
                    default:
                        if (parameter_length <= 8) {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_uint, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                        } else {
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_value, tvb, offset, parameter_length, ENC_NA);
                        }
                        break;
                    }

                    offset += parameter_length;
                    length -= parameter_length;
                }
            }
            break;
        case 0x03:
            {
                while (length > 0) {
                    parameter_id     = tvb_get_uint8(tvb, offset);
                    parameter_length = tvb_get_ntohs(tvb, offset + 1);

                    ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter, tvb, offset,
                        parameter_length+3, parameter_id, "%s",
                        val_to_str_const(parameter_id, cs_ip_device_routing_03_parameter_id_vals, "Unknown"));
                    ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param);

                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter, tvb, offset, 1, ENC_BIG_ENDIAN);
                    offset++;
                    length--;

                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_length, tvb, offset, 2, ENC_BIG_ENDIAN);
                    offset += 2;
                    length -= 2;

                    if (parameter_length > 0) {
                        switch (parameter_id) {
                        case 0x06: /* Type Of Equipment */
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_type_of_equip, tvb, offset, 2, ENC_BIG_ENDIAN);
                            break;
                        case 0x08: /* Local IP Address */
                        case 0x09: /* Distant IP Address */
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
                            break;
                        case 0x0A: /* Local ID */
                        case 0x0B: /* Remote ID */
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_string, tvb, offset, parameter_length, ENC_NA|ENC_ASCII);
                            break;
                        case 0x0F: /* Codec */
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_codec, tvb, offset, 1, ENC_BIG_ENDIAN);
                            break;
                        case 0x10: /* VAD */
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_vad, tvb, offset, 1, ENC_NA);
                            break;
                        case 0x11: /* ECE */
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_ece, tvb, offset, 1, ENC_NA);
                            break;
                        case 0x12: /* Voice Mode */
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_voice_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
                            break;
                        case 0x1B: /* Delay Distribution */
                            for (i = 0; i < parameter_length/2; i++) {
                                unsigned   off = (offset + (i*2));
                                uint16_t val = tvb_get_ntohs(tvb, off);
                                proto_tree_add_uint_format_value(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_delay_distribution, tvb, off,
                                    2, val, "%s: %d", val_to_str_const(i, cs_ip_device_routing_delay_distribution_range_vals, "Unknown"), val);
                            }
                            break;
                        case 0x1E: /* Consecutive BFI */
                            for (i = 0; i < parameter_length/2; i++) {
                                unsigned   off = (offset + (i*2));
                                uint16_t val = tvb_get_ntohs(tvb, off);
                                proto_tree_add_uint_format_value(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_consecutive_bfi, tvb, off,
                                    2, val, "%s: %d", val_to_str_const(i, cs_ip_device_routing_0_9_range_vals, "Unknown"), val);
                            }
                            break;
                        case 0x1F: /* BFI Distribution */
                            for (i = 0; i < parameter_length/2; i++) {
                                unsigned   off = (offset + (i*2));
                                uint16_t val = tvb_get_ntohs(tvb, off);
                                proto_tree_add_uint_format_value(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_bfi_distribution, tvb, off,
                                    2, val, "%s: %d", val_to_str_const(i, cs_ip_device_routing_bfi_distribution_range_vals, "Unknown"), val);
                            }
                            break;
                        case 0x20: /* Jitter Depth Distribution */
                            for (i = 0; i < parameter_length/4; i++) {
                                unsigned   off = (offset + (i*4));
                                uint32_t val = tvb_get_ntohs(tvb, off);
                                proto_tree_add_uint_format_value(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_jitter_depth_distribution, tvb, off,
                                    2, val, "%s: %d", val_to_str_const(i, cs_ip_device_routing_0_9_range_vals, "Unknown"), val);
                            }
                            break;
                        case 0x26: /* Firmware Version */
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_firmware_version, tvb, offset, 2, ENC_BIG_ENDIAN);
                            break;
                        case 0x2E: /* 802.1 Q Used */
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_8021Q_used, tvb, offset, 1, ENC_NA);
                            break;
                        case 0x2F: /* 802.1p Priority */
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_8021P_priority, tvb, offset, 1, ENC_BIG_ENDIAN);
                            break;
                        case 0x30: /* VLAN Id */
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_vlan_id, tvb, offset, 2, ENC_BIG_ENDIAN);
                            break;
                        case 0x31: /* DiffServ */
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_diffserv, tvb, offset, 1, ENC_BIG_ENDIAN);
                            break;
                        case 0x3D: /* 200 ms BFI Distribution */
                            for (i = 0; i < parameter_length/2; i++) {
                                unsigned   off = (offset + (i*2));
                                uint16_t val = tvb_get_ntohs(tvb, off);
                                proto_tree_add_uint_format_value(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_bfi_distribution_200ms, tvb, off,
                                    2, val, "%s: %d", val_to_str_const(i, cs_ip_device_routing_200ms_bfi_distribution_range_vals, "Unknown"), val);
                            }
                            break;
                        case 0x3E: /* Consecutive RTP Lost */
                            for (i = 0; i < parameter_length/2; i++) {
                                unsigned   off = (offset + (i*2));
                                uint16_t val = tvb_get_ntohs(tvb, off);
                                proto_tree_add_uint_format_value(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_consecutive_rtp_lost, tvb, off,
                                    2, val, "%s: %d", val_to_str_const(i, cs_ip_device_routing_consecutive_rtp_lost_range_vals, "Unknown"), val);
                            }
                            break;
                        case 0x01: /* Date Of End Of Communication */
                        case 0x02: /* Node Number */
                        case 0x03: /* Ticket Protocol Version */
                        case 0x0C: /* Call Duration (second) */
                        case 0x0D: /* Local SSRC */
                        case 0x0E: /* Distant SSRC */
                        case 0x13: /* Transmitted Framing (ms) */
                        case 0x14: /* Received Framing (ms) */
                        case 0x15: /* Framing Changes */
                        case 0x16: /* Number Of RTP Packets Received */
                        case 0x17: /* Number Of RTP Packets Sent */
                        case 0x18: /* Number Of RTP Packets Lost */
                        case 0x19: /* Total Silence Detected (second) */
                        case 0x1A: /* Number Of SID Received */
                        case 0x1C: /* Maximum Delay (ms) */
                        case 0x1D: /* Number Of DTMF Received */
                        case 0x21: /* Number Of ICMP Host Unreachable */
                        case 0x29: /* DSP Framing (ms) */
                        case 0x2A: /* Transmitter SID */
                        case 0x2D: /* Minimum Delay (ms) */
                        case 0x37: /* Encryption */
                        default:
                            proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_uint, tvb, offset, parameter_length, ENC_BIG_ENDIAN);
                            break;
                        }

                        offset += parameter_length;
                        length -= parameter_length;
                    }
                }
                break;
            }
        default:
            break;
    }
}


/*-----------------------------------------------------------------------------
    UNSOLICITED MESSAGE - 9Fh/1Fh (MESSAGE FROM THE TERMINAL)
    VERSION RESPONSE - 21h (MESSAGE FROM THE TERMINAL)
    ---------------------------------------------------------------------------*/
static const value_string str_command_unsolicited_msg[] = {
    {0x00, "Hardware Reset Acknowledge"},
    {0x01, "Software Reset Acknowledge"},
    {0x02, "Illegal Command Received"},
    {0x05, "Subdevice Down"},
    {0x06, "Segment Failure"},
    {0x07, "UA Device Event"},
    {0, NULL}
};
static const value_string str_unsolicited_msg_other_info_1[] = {
    {0x00, "Link Is TDM"},
    {0x01, "Link Is IP"},
    {0, NULL}
};
static const value_string str_unsolicited_msg_other_info_2[] = {
    {0x00, "Download Allowed"},
    {0x01, "Download Refused"},
    {0, NULL}
};
static const true_false_string tfs_export_full = {
    "Full (Thales)",
    "Export (No Thales)"
};
static const true_false_string tfs_fast_gigabit = {
    "Gigabit",
    "Fast"
};
static const true_false_string tfs_2g_3g = {
    "3G/80x8",
    "2G/40x8"
};
static const value_string str_unsolicited_msg_hard_config_chip[] = {
    {0x01, "Ivanoe 1"},
    {0x02, "Ivanoe 2"},
    {0x03, "Reserved"},
    {0, NULL}
};
static const value_string str_unsolicited_msg_hard_config_flash[] = {
    {0x00, "No Flash"},
    {0x01, "128 Kbytes"},
    {0x02, "256 Kbytes"},
    {0x03, "512 Kbytes"},
    {0x04, "1 Mbytes"},
    {0x05, "2 Mbytes"},
    {0x06, "4 Mbytes"},
    {0x07, "8 Mbytes"},
    {0, NULL}
};
static const value_string str_unsolicited_msg_hard_config_ram[] = {
    {0x00, "No External RAM"},
    {0x01, "128 Kbytes"},
    {0x02, "256 Kbytes"},
    {0x03, "512 Kbytes"},
    {0x04, "1 Mbytes"},
    {0x05, "2 Mbytes"},
    {0x06, "4 Mbytes"},
    {0x07, "8 Mbytes"},
    {0, NULL}
};

/* TODO: these values are clearly wrong - needs to fit into 2 bits */
static const value_string str_unsolicited_msg_subtype[] = {
    {0x03, "2x40"},
    {0x04, "1x20"},
    {0x05, "1x20"},
    {0, NULL}
};
static const value_string str_unsolicited_msg_generation[] = {
    {0x02, "3"},
    {0, NULL}
};
static const value_string str_unsolicited_msg_design[] = {
    {0x00, "Alpha"},
    {0, NULL}
};
static const value_string str_unsolicited_msg_hard_vta_type[] = {
    {0x03, "MR2 (4035)"},
    {0x05, "VLE (4010)"},
    {0x07, "LE (4020)"},
    {0, NULL}
};
static const value_string str_unsolicited_msg_hard_design[] = {
    {0x06, "Alpha"},
    {0, NULL}
};

/* TODO: these values are clearly wrong - needs to fit into 2 bits */
static const value_string str_unsolicited_msg_hard_subtype[] = {
    {0x06, "2x40"},
    {0x07, "1x20"},
    {0x08, "1x20"},
    {0, NULL}
};

static void
decode_unsolicited_msg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
               unsigned offset, unsigned length, uint8_t opcode)
{
    uint8_t     command;
    proto_tree *ua3g_body_tree = tree, *ua3g_param_tree;

    command = tvb_get_uint8(tvb, offset);

    if (opcode != 0x21) {
        /* add text to the frame "INFO" column */
        col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_command_unsolicited_msg, "Unknown"));

        proto_tree_add_item(ua3g_body_tree, hf_ua3g_command_unsolicited_msg, tvb, offset, 1, ENC_BIG_ENDIAN);
        offset++;
        length--;
    } else {
        command = 0xFF; /* Opcode = 0x21 */
    }

    switch (command)
    {
    case 0x00: /* Hardware Reset Acknowledge */
    case 0x01: /* Software Reset Acknowledge */
    case 0xFF: /* Opcode = 0x21 : Version Response */
        {
            int link, vta_type;

            proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_device_type, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_firmware_version, tvb, offset, 2, ENC_BIG_ENDIAN);
            offset += 2;
            length -= 2;

            if (opcode != 0x21) {
                proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_self_test_result, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                length--;
            }

            vta_type = tvb_get_uint8(tvb, offset);

            proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_vta_type, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            length--;

            switch (vta_type)
            {
            case 0x03:
            case 0x04:
            case 0x05:
                {
                    ua3g_param_tree = proto_tree_add_subtree(ua3g_body_tree, tvb, offset, 1, ett_ua3g_param, NULL, "Characteristic Number");
                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_unsolicited_msg_char_num_vta_subtype,
                            tvb, offset, 1, ENC_BIG_ENDIAN);
                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_unsolicited_msg_char_num_generation,
                            tvb, offset, 1, ENC_BIG_ENDIAN);
                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_unsolicited_msg_char_num_design,
                            tvb, offset, 1, ENC_BIG_ENDIAN);
                    offset++;
                    length--;
                    proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_other_information, tvb, offset, 1, ENC_BIG_ENDIAN);
                    offset++;
                    length--;

                    ua3g_param_tree = proto_tree_add_subtree(ua3g_body_tree, tvb, offset, 1, ett_ua3g_param, NULL, "Hardware Configuration");
                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_unsolicited_msg_hardware_config_vta_type,
                            tvb, offset, 1, ENC_BIG_ENDIAN);
                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_unsolicited_msg_hardware_config_design,
                            tvb, offset, 1, ENC_BIG_ENDIAN);
                    proto_tree_add_item(ua3g_param_tree, hf_ua3g_unsolicited_msg_hardware_config_subtype,
                            tvb, offset, 1, ENC_BIG_ENDIAN);
                    offset++;
                    length--;

                    if (opcode != 0x21) {
                        proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_hook_status, tvb, offset, 1, ENC_NA);
                        offset++;
                        length--;
                    }
                    break;
                }
            default:
                {
                    link = tvb_get_uint8(tvb, offset);
                    proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_other_information_1, tvb, offset, 1, ENC_BIG_ENDIAN);
                    offset++;
                    length--;

                    if (link == 0x00) {
                        proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_hardware_version, tvb, offset, 1, ENC_BIG_ENDIAN);
                        offset++;
                        length--;

                        ua3g_param_tree = proto_tree_add_subtree(ua3g_body_tree, tvb, offset, 1, ett_ua3g_param, NULL, "Hardware Configuration");
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_unsolicited_msg_hardware_config_hard_config_chip,
                                tvb, offset, 1, ENC_BIG_ENDIAN);
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_unsolicited_msg_hardware_config_hard_config_flash,
                                tvb, offset, 1, ENC_BIG_ENDIAN);
                        proto_tree_add_item(ua3g_param_tree, hf_ua3g_unsolicited_msg_hardware_config_config_ram,
                                tvb, offset, 1, ENC_BIG_ENDIAN);
                        offset++;
                        length--;
                    } else {
                        static int * const hardware_config[] = {
                            &hf_ua3g_unsolicited_msg_hardware_config_export_full,
                            &hf_ua3g_unsolicited_msg_hardware_config_ethernet_hardware,
                            &hf_ua3g_unsolicited_msg_hardware_config_extended_edition,
                            &hf_ua3g_unsolicited_msg_hardware_config_wideband,
                            &hf_ua3g_unsolicited_msg_hardware_config_3g_set,
                            &hf_ua3g_unsolicited_msg_hardware_config_8082_set,
                            &hf_ua3g_unsolicited_msg_hardware_config_super_wideband,
                            NULL
                        };

                        proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_other_information_2, tvb, offset, 1, ENC_BIG_ENDIAN);
                        offset++;
                        length--;

                        proto_tree_add_bitmask(ua3g_body_tree, tvb, offset, hf_ua3g_unsolicited_msg_hardware_config, ett_ua3g_param, hardware_config, ENC_NA);
                        offset++;
                        length--;
                    }

                    if (opcode != 0x21) {
                        proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_hook_status,
                                tvb, offset, 1, ENC_NA);
                        offset++;
                        length--;

                        if (length > 0) {
                            if (link == 0x00) {
                                proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_firmware_datas_patch_version,
                                                    tvb, offset, 2, ENC_BIG_ENDIAN);
                                if (length > 2) {
                                    proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_firmware_version_loader, tvb,
                                                         offset+2, 2, ENC_BIG_ENDIAN);
                                }
                            } else {
                                proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_datas_version, tvb, offset, 2, ENC_BIG_ENDIAN);
                                offset += 2;
                                length -= 2;

                                proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_firmware_version_bootloader, tvb, offset, 2, ENC_BIG_ENDIAN);
                                offset += 2;
                                length -= 2;

                                if (length >= 1) {
                                    proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_additional_vta_type, tvb, offset, 1, ENC_BIG_ENDIAN);
                                    offset++;
                                    length--;
                                }

                                if (length >= 1) {
                                    proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_capability_info_bluetooth_supported, tvb, offset, 1, ENC_BIG_ENDIAN);
                                    offset++;
                                    length--;
                                }

                                if (length >= 1) {
                                    static int * const capability_info[] = {
                                        &hf_ua3g_unsolicited_msg_capability_info_vpn,
                                        &hf_ua3g_unsolicited_msg_capability_info_ipsec,
                                        &hf_ua3g_unsolicited_msg_capability_info_dtls,
                                        NULL
                                    };
                                    proto_tree_add_bitmask(ua3g_body_tree, tvb, offset, hf_ua3g_unsolicited_msg_capability_info_vpn_encryption_status, ett_ua3g_param, capability_info, ENC_NA);
                                    offset++;
                                    length--;
                                }

                                if (length >= 1) {
                                    proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_capability_info_wlan_status, tvb, offset, 1, ENC_BIG_ENDIAN);
                                    offset++;
                                    length--;
                                }

                                while(length > 0) {
                                    proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_capability_info_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
                                    offset++;
                                    length--;
                                }
                            }
                        }
                    }
                    break;
                }
            }
            break;
        }
    case 0x02: /* Illegal Command Received */
        {
            proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_opcode_of_bad_command, tvb, offset, 1, ENC_BIG_ENDIAN);

            if (length > 1) {
                proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_next_byte_of_bad_command, tvb, offset+1, length-1, ENC_NA);
            }
            break;
        }
    case 0x05: /* Subdevice Down */
        {
            proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_subdevice_address, tvb, offset, 1, ENC_BIG_ENDIAN);
            break;
        }
    case 0x06: /* Segment Failure */
        {
            proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_segment_failure_t, tvb, offset, 1, ENC_NA);
            proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_segment_failure_num, tvb, offset, 1, ENC_NA);
            proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_segment_failure_s, tvb, offset, 1, ENC_NA);
            proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_segment_failure_l, tvb, offset, 1, ENC_NA);
            proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_opcode_bad_segment, tvb, offset+1, 1, ENC_BIG_ENDIAN);
            proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_next_byte_of_bad_segment, tvb, offset+2, 1, ENC_BIG_ENDIAN);
            break;
        }
    case 0x07: /* UA Device Event */
        {
            proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_device_event, tvb, offset, 1, ENC_BIG_ENDIAN);
            break;
        }
    default:
        {
            break;
        }
    }
}


/*-----------------------------------------------------------------------------
    NON-DIGIT KEY PUSHED - 20h (MESSAGE FROM THE TERMINAL)
    DIGIT KEY RELEASED - 26h (MESSAGE FROM THE TERMINAL)
    KEY RELEASED - 2Ah (MESSAGE FROM THE TERMINAL)
    TM KEY PUSHED - 2Dh (MESSAGE FROM THE TERMINAL)
    ---------------------------------------------------------------------------*/
static void
decode_key_number(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_,
          unsigned offset, unsigned length)
{
#if 0
    proto_tree *ua3g_body_tree;
    static const value_string str_first_parameter[] = {
        {0x01, "Production Test Command"},
        {0x06, "Reserved For Compatibility"},
        {0x3B, "Volume"},
        {0x42, "Subdevice Address"},
        {0, NULL}
    };
#endif

    if (!tree)
        return;

    if (length > 0) {
        proto_tree_add_uint_format_value(tree, hf_ua3g_key_number, tvb, offset, 1,
            tvb_get_uint8(tvb, offset), "Row %d, Column %d",
            (tvb_get_uint8(tvb, offset) & 0xF0), (tvb_get_uint8(tvb, offset) & 0x0F));
    }
}


/*-----------------------------------------------------------------------------
    I'M HERE - 22h - Only for UA NOE (MESSAGE FROM THE TERMINAL)
    ---------------------------------------------------------------------------*/
static void
decode_i_m_here(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, unsigned offset)
{
    proto_tree_add_item(tree, hf_ua3g_i_m_here_id_code, tvb, offset, 1, ENC_BIG_ENDIAN);
}


/*-----------------------------------------------------------------------------
    RESPONSE STATUS INQUIRY - 23h (MESSAGE FROM THE TERMINAL)
    SPECIAL KEY STATUS - 29h (MESSAGE FROM THE TERMINAL)
    ---------------------------------------------------------------------------*/
static const true_false_string tfs_special_key_parameters = { "Not Received Default In Effect", "Downloaded Values In Effect" };
static const true_false_string tfs_hookswitch_status = {"On Hook", "Off Hook"};
static const true_false_string tfs_released_pressed = { "Released", "Pressed" };

static void
decode_special_key(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_,
           unsigned offset, uint8_t opcode)
{
    static int * const special_keys[] = {
        &hf_ua3g_special_key_shift,
        &hf_ua3g_special_key_ctrl,
        &hf_ua3g_special_key_alt,
        &hf_ua3g_special_key_cmd,
        &hf_ua3g_special_key_shift_prime,
        &hf_ua3g_special_key_ctrl_prime,
        &hf_ua3g_special_key_alt_prime,
        &hf_ua3g_special_key_cmd_prime,
        NULL
    };

    if (opcode == 0x23) {
        proto_tree_add_item(tree, hf_ua3g_special_key_param_dtmf, tvb, offset, 1, ENC_NA);
        proto_tree_add_item(tree, hf_ua3g_special_key_hookswitch_status, tvb, offset, 1, ENC_NA);
        offset++;
    }

    proto_tree_add_bitmask_list(tree, tvb, offset, 1, special_keys, ENC_NA);
}


/*-----------------------------------------------------------------------------
    SUBDEVICE STATE ENQUIRY - 24h (MESSAGE FROM THE TERMINAL)
    ---------------------------------------------------------------------------*/
static void
decode_subdevice_state(proto_tree *tree, tvbuff_t *tvb,
               packet_info *pinfo _U_, unsigned offset)
{
    uint8_t     info;
    int         i;

    for (i = 0; i <= 7; i++) {
        info = tvb_get_uint8(tvb, offset);
        proto_tree_add_uint_format(tree, hf_ua3g_subdevice_state, tvb, offset, 1,
            info & 0x0F, "Subdevice %d State: %d",
            i, info & 0x0F);
        i++;
        proto_tree_add_uint_format(tree, hf_ua3g_subdevice_state, tvb, offset, 1,
            (info & 0xF0) >> 4, "Subdevice %d State: %d",
            i, (info & 0xF0) >> 4);
        offset++;
    }
}


/*-----------------------------------------------------------------------------
    UA3G DISSECTOR
    ---------------------------------------------------------------------------*/
static int
dissect_ua3g(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
    int               offset         = 0;
    proto_item       *ua3g_item;
    proto_tree       *ua3g_tree, *ua3g_body_tree;
    int               length;
    uint8_t           opcode;
    const char*      opcode_str;
    e_ua_direction   *message_direction;

    /* Reject the packet if data is NULL */
    if (data == NULL)
        return 0;
    message_direction = (e_ua_direction *)data;

    ua3g_item = proto_tree_add_item(tree, proto_ua3g, tvb, 0, -1, ENC_NA);
    ua3g_tree = proto_item_add_subtree(ua3g_item, ett_ua3g);

    /* Length of the UA Message */
    length = tvb_get_letohs(tvb, offset);

    /* add text to the frame "INFO" column */
    col_append_str(pinfo->cinfo, COL_INFO, " - UA3G Message:");

    proto_tree_add_uint(ua3g_tree, hf_ua3g_length, tvb, offset, 2, length);
    offset += 2;

    /* Opcode of the UA Message */
    opcode = tvb_get_uint8(tvb, offset);
    if (opcode != 0x9f)
        opcode = (opcode & 0x7f);

    /* Useful for a research in wireshark */
    if (*message_direction == SYS_TO_TERM) {
        proto_tree_add_uint(ua3g_tree, hf_ua3g_opcode_sys, tvb, offset, 1, opcode);
        opcode_str = val_to_str_ext_const(opcode, &opcodes_vals_sys_ext, "Unknown");
    } else {
        proto_tree_add_uint(ua3g_tree, hf_ua3g_opcode_term, tvb, offset, 1, opcode);
        opcode_str = val_to_str_ext_const(opcode, &opcodes_vals_term_ext, "Unknown");
    }

    offset++;
    length--;

    /* add text to the frame "INFO" column */
    col_append_fstr(pinfo->cinfo, COL_INFO, " %s", opcode_str);

    proto_item_append_text(ua3g_item, ", %s", opcode_str);

    ua3g_body_tree = proto_tree_add_subtree(ua3g_tree, tvb, offset, length, ett_ua3g_body, NULL, "UA3G Body");

    if (*message_direction == SYS_TO_TERM) {
        switch (opcode) {
        case SC_PRODUCTION_TEST: /* 0x01 */
            {
                decode_with_one_parameter(ua3g_body_tree, tvb, pinfo, offset, length, hf_ua3g_opcode_production_test);
                break;
            }
        case SC_SUBDEVICE_RESET: /* 0x06 */
            {
                decode_with_one_parameter(ua3g_body_tree, tvb, pinfo, offset, length, hf_ua3g_opcode_subservice_reset);
                break;
            }
        case SC_ARE_YOU_THERE:   /* 0x2B */
            {
                decode_with_one_parameter(ua3g_body_tree, tvb, pinfo, offset, length, hf_ua3g_opcode_are_you_there);
                break;
            }
        case SC_SET_SPEAKER_VOL: /* 0x3B */
            {
                decode_with_one_parameter(ua3g_body_tree, tvb, pinfo, offset, length, hf_ua3g_opcode_set_speaker_vol);
                break;
            }
        case SC_TRACE_ON:        /* 0x42 */
            {
                decode_with_one_parameter(ua3g_body_tree, tvb, pinfo, offset, length, hf_ua3g_opcode_trace_on);
                break;
            }
        case SC_SUBDEVICE_ESCAPE: /* 0x02 */
            {
                decode_subdevice_escape(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case SC_SOFT_RESET: /* 0x03 */
            {
                decode_software_reset(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case SC_IP_PHONE_WARMSTART: /* 0x04 */
            {
                decode_ip_phone_warmstart(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case SC_SUPER_MSG:   /* 0x0B */
        case SC_SUPER_MSG_2: /* 0x17 */
            {
                decode_super_msg(ua3g_body_tree, tvb, pinfo, offset, length, opcode);
                break;
            }
        case SC_SEGMENT_MSG: /* 0x0C */
            {
                decode_segment_msg(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case SC_IP_DEVICE_ROUTING: /* 0x13 */
            {
            decode_ip_device_routing(ua3g_body_tree, tvb, pinfo, offset, length);
            break;
            }
        case SC_DEBUG_IN_LINE: /* 0x18 */
            {
                decode_debug_in_line(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case SC_LED_COMMAND: /* 0x21 */
            {
                decode_led_command(ua3g_body_tree, tvb, pinfo, offset);
                break;
            }
        case SC_LCD_LINE_1_CMD: /* 0x27 */
        case SC_LCD_LINE_2_CMD: /* 0x28 */
            {
                decode_lcd_line_cmd(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case SC_MAIN_VOICE_MODE: /* 0x29 */
            {
                decode_main_voice_mode(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case SC_SUBDEVICE_METASTATE: /* 0x2C */
            {
                decode_subdevice_metastate(ua3g_body_tree, tvb, pinfo, offset);
                break;
            }
        case SC_DWL_DTMF_CLCK_FORMAT: /* 0x30 */
            {
                decode_dwl_dtmf_clck_format(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case SC_SET_CLCK: /* 0x31 */
            {
                decode_set_clck(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case SC_VOICE_CHANNEL: /* 0x32 */
            {
                decode_voice_channel(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case SC_EXTERNAL_RINGING: /* 0x33 */
            {
                decode_external_ringing(ua3g_body_tree, tvb, pinfo, offset);
                break;
            }
        case SC_LCD_CURSOR: /* 0x35 */
            {
                decode_lcd_cursor(ua3g_body_tree, tvb, pinfo, offset);
                break;
            }
        case SC_DWL_SPECIAL_CHAR: /* 0x36 */
            {
                decode_dwl_special_char(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case SC_SET_CLCK_TIMER_POS: /* 0x38 */
            {
                decode_set_clck_timer_pos(ua3g_body_tree, tvb, pinfo, offset);
                break;
            }
        case SC_SET_LCD_CONTRAST: /* 0x39 */
            {
                decode_set_lcd_contrast(ua3g_body_tree, tvb, pinfo, offset);
                break;
            }
        case SC_BEEP: /* 0x3C */
            {
                decode_beep(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case SC_SIDETONE: /* 0x3D */
            {
                decode_sidetone(ua3g_body_tree, tvb, pinfo, offset);
                break;
            }
        case SC_RINGING_CADENCE: /* 0x3E */
            {
                decode_ringing_cadence(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case SC_MUTE: /* 0x3F */
            {
                decode_mute(ua3g_body_tree, tvb, pinfo, offset);
                break;
            }
        case SC_FEEDBACK: /* 0x40 */
            {
                decode_feedback(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case SC_READ_PERIPHERAL:  /* 0x44 */
        case SC_WRITE_PERIPHERAL: /* 0x45 */
            {
            decode_r_w_peripheral(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case SC_ICON_CMD: /* 0x47 */
            {
                decode_icon_cmd(ua3g_body_tree, tvb, pinfo, offset);
                break;
            }
        case SC_AUDIO_CONFIG: /* 0x49 */
            {
                decode_audio_config(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case SC_AUDIO_PADDED_PATH: /* 0x4A */
            {
                decode_audio_padded_path(ua3g_body_tree, tvb, pinfo, offset);
                break;
            }
        case SC_KEY_RELEASE:       /* 0x41 */
            {
                decode_on_off_level(ua3g_body_tree, tvb, pinfo, offset, length, hf_ua3g_command_key_release);
                break;
            }
        case SC_AMPLIFIED_HANDSET: /* 0x48 */
            {
                decode_on_off_level(ua3g_body_tree, tvb, pinfo, offset, length, hf_ua3g_command_amplified_handset);
                break;
            }
        case SC_LOUDSPEAKER:       /* 0x4D */
            {
                decode_on_off_level(ua3g_body_tree, tvb, pinfo, offset, length, hf_ua3g_command_loudspeaker);
                break;
            }
        case SC_ANNOUNCE:          /* 0x4E */
            {
                decode_on_off_level(ua3g_body_tree, tvb, pinfo, offset, length, hf_ua3g_command_announce);
                break;
            }
        case SC_RING: /* 0x4F */
            {
                decode_ring(ua3g_body_tree, tvb, pinfo, offset);
                break;
            }
        case SC_UA_DWL_PROTOCOL: /* 0x50 */
            {
                decode_ua_dwl_protocol(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        /* Case for UA3G message with only opcode (No body) */
        case SC_NOP:                    /* 0x00 */
        case SC_HE_ROUTING:             /* 0x05 NOT DECODED - No description in 3AK 29000 0556 DSZZA */
        case SC_LOOPBACK_ON:            /* 0x07 */
        case SC_LOOPBACK_OFF:           /* 0x08 */
        case SC_VIDEO_ROUTING:          /* 0x09 NOT DECODED - No description in 3AK 29000 0556 DSZZA */
        case SC_REMOTE_UA_ROUTING:      /* 0x0D NOT DECODED - No description in 3AK 29000 0556 DSZZA */
        case SC_VERY_REMOTE_UA_ROUTING: /* 0x0E NOT DECODED - No description in 3AK 29000 0556 DSZZA */
        case SC_OSI_ROUTING:            /* 0x0F NOT DECODED - No description in 3AK 29000 0556 DSZZA */
        case SC_ABC_A_ROUTING:          /* 0x11 NOT DECODED - No description in 3AK 29000 0556 DSZZA */
        case SC_IBS_ROUTING:            /* 0x12 NOT DECODED - No description in 3AK 29000 0556 DSZZA */
        case SC_M_REFLEX_HUB_ROUTING:   /* 0x14 NOT DECODED - No description in 3AK 29000 0556 DSZZA */
        case SC_START_BUZZER:           /* 0x22 */
        case SC_STOP_BUZZER:            /* 0x23 */
        case SC_ENABLE_DTMF:            /* 0x24 */
        case SC_DISABLE_DTMF:           /* 0x25 */
        case SC_CLEAR_LCD_DISP:         /* 0x26 */
        case SC_VERSION_INQUIRY:        /* 0x2A */
        case SC_VTA_STATUS_INQUIRY:     /* 0x2D */
        case SC_SUBDEVICE_STATE:        /* 0x2E */
        case SC_AUDIO_IDLE:             /* 0x3A */
        case SC_TRACE_OFF:              /* 0x43 */
        case SC_ALL_ICONS_OFF:          /* 0x46 */
        case SC_RELEASE_RADIO_LINK:     /* 0x4B */
        case SC_DECT_HANDOVER:          /* 0x4C NOT DECODED - No description in 3AK 29000 0556 DSZZA */
        default:
            {
                break;
            }
        }
    }
    if (*message_direction == TERM_TO_SYS) {
        switch (opcode) {
        case CS_DIGIT_DIALED: /* 0x03 */
            {
                decode_digit_dialed(ua3g_body_tree, tvb, pinfo, offset);
                break;
            }
        case CS_SUBDEVICE_MSG: /* 0x04 */
            {
                decode_subdevice_msg(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case CS_SUPER_MSG:   /* 0x0B */
        case CS_SUPER_MSG_2: /* 0x17 */
            {
                decode_super_msg(ua3g_body_tree, tvb, pinfo, offset, length, opcode);
                break;
            }
        case CS_SEGMENT_MSG: /* 0x0C */
            {
            decode_segment_msg(ua3g_body_tree, tvb, pinfo, offset, length);
            break;
            }
        case CS_IP_DEVICE_ROUTING: /* 0x13 */
            {
                decode_cs_ip_device_routing(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case CS_DEBUG_IN_LINE: /* 0x18 */
            {
                decode_debug_in_line(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case CS_NON_DIGIT_KEY_PUSHED: /* 0x20 Key translation not sure */
        case CS_DIGIT_KEY_RELEASED:   /* 0x26 Key translation not sure */
        case CS_KEY_RELEASED:         /* 0x2A */
        case CS_TM_KEY_PUSHED:        /* 0x2D Key translation not sure */
            {
                decode_key_number(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case CS_UNSOLICITED_MSG: /* 0x9F (0x1F) */
        case CS_VERSION_RESPONSE: /* 0x21 */
            {
                decode_unsolicited_msg(ua3g_body_tree, tvb, pinfo, offset, length, opcode);
                break;
            }
        case CS_I_M_HERE: /* 0x22 */
            {
                decode_i_m_here(ua3g_body_tree, tvb, pinfo, offset);
                break;
            }
        case CS_RSP_STATUS_INQUIRY: /* 0x23 */
        case CS_SPECIAL_KEY_STATUS: /* 0x29 */
            {
                decode_special_key(ua3g_body_tree, tvb, pinfo, offset, opcode);
                break;
            }
        case CS_SUBDEVICE_STATE: /* 0x24 */
            {
                decode_subdevice_state(ua3g_body_tree, tvb, pinfo, offset);
                break;
            }
        case CS_PERIPHERAL_CONTENT: /* 0x2B */
            {
                decode_r_w_peripheral(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        case CS_UA_DWL_PROTOCOL: /* 0x50 */
            {
                decode_ua_dwl_protocol(ua3g_body_tree, tvb, pinfo, offset, length);
                break;
            }
        /* Case for UA3G message with only opcode (No body) */
        case CS_NOP_ACK:           /* 0x00 */
        case CS_HANDSET_OFFHOOK:   /* 0x01 */
        case CS_HANDSET_ONHOOK:    /* 0x02 */
        case CS_HE_ROUTING:        /* 0x05 NOT DECODED - No description in 3AK 29000 0556 DSZZA */
        case CS_LOOPBACK_ON:       /* 0x06 */
        case CS_LOOPBACK_OFF:      /* 0x07 */
        case CS_VIDEO_ROUTING:     /* 0x09 NOT DECODED - No description in 3AK 29000 0556 DSZZA */
        case CS_WARMSTART_ACK:     /* 0x0A */
        case CS_REMOTE_UA_ROUTING: /* 0x0D NOT DECODED - No description in 3AK 29000 0556 DSZZA */
        case CS_VERY_REMOTE_UA_R:  /* 0x0E NOT DECODED - No description in 3AK 29000 0556 DSZZA */
        case CS_OSI_ROUTING:       /* 0x0F NOT DECODED - No description in 3AK 29000 0556 DSZZA */
        case CS_ABC_A_ROUTING:     /* 0x11 NOT DECODED - No description in 3AK 29000 0556 DSZZA */
        case CS_IBS_ROUTING:       /* 0x12 NOT DECODED - No description in 3AK 29000 0556 DSZZA */
        case CS_TRACE_ON_ACK:      /* 0x27 */
        case CS_TRACE_OFF_ACK:     /* 0x28 */
        default:
            {
                break;
            }
        }
    }

    return tvb_captured_length(tvb);
}


/*-----------------------------------------------------------------------------
    DISSECTORS REGISTRATION FUNCTIONS
    ---------------------------------------------------------------------------*/
void
proto_register_ua3g(void)
{
    static hf_register_info hf[] =
    {
        { &hf_ua3g_length,
            { "Length", "ua3g.length",
            FT_UINT16, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_opcode_sys,
            { "Opcode", "ua3g.opcode",
            FT_UINT8, BASE_HEX|BASE_EXT_STRING, &opcodes_vals_sys_ext, 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_opcode_term,
            { "Opcode", "ua3g.opcode",
            FT_UINT8, BASE_HEX|BASE_EXT_STRING, &opcodes_vals_term_ext, 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_opcode_production_test,
            { "Production Test Command", "ua3g.production_test",
            FT_UINT8, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_opcode_subservice_reset,
            { "Reserved For Compatibility", "ua3g.subservice_reset",
            FT_UINT8, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_opcode_are_you_there,
            { "Temporization", "ua3g.are_you_there",
            FT_UINT8, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_opcode_set_speaker_vol,
            { "Volume", "ua3g.set_speaker_vol",
            FT_UINT8, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_opcode_trace_on,
            { "Subdevice Address", "ua3g.trace_on",
            FT_UINT8, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_ip,
            { "IP Device Routing", "ua3g.ip",
            FT_UINT8, BASE_HEX, VALS(str_command_ip_device_routing), 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_ip_cs,
            { "IP Device Routing", "ua3g.ip.cs",
            FT_UINT8, BASE_HEX, VALS(str_command_cs_ip_device_routing), 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_command_led,
            { "Led Command", "ua3g.command.led",
            FT_UINT8, BASE_HEX, VALS(str_command_led), 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_command_lcd_line,
            { "LCD Line Command", "ua3g.command.lcd_line",
            FT_UINT8, BASE_HEX, VALS(str_command_lcd_line), 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_main_voice_mode,
            { "Voice Mode", "ua3g.command.main_voice_mode",
            FT_UINT8, BASE_HEX, VALS(str_main_voice_mode), 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_command_set_clck,
            { "Set Clock", "ua3g.command.set_clck",
            FT_UINT8, BASE_HEX, VALS(str_command_set_clck), 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_external_ringing_command,
            { "External Ringing Command", "ua3g.command.external_ringing",
            FT_UINT8, BASE_HEX, VALS(str_ext_ring_cmd), 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_lcd_cursor,
            { "Cursor", "ua3g.lcd_cursor",
            FT_BOOLEAN, 8, TFS(&tfs_on_off), 0x02,
            NULL, HFILL }
        },
        { &hf_ua3g_command_beep,
            { "Beep", "ua3g.command.beep",
            FT_UINT8, BASE_HEX, VALS(str_command_beep), 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_command_sidetone,
            { "Sidetone", "ua3g.command.sidetone",
            FT_BOOLEAN, BASE_NONE, TFS(&tfs_on_off), 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_command_mute,
            { "Microphone", "ua3g.command.mute",
            FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
            NULL, HFILL }
        },
        { &hf_ua3g_command_feedback,
            { "Feedback", "ua3g.command.feedback",
            FT_BOOLEAN, BASE_NONE, TFS(&tfs_on_off), 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_command_audio_config,
            { "Audio Config", "ua3g.command.audio_config",
            FT_UINT8, BASE_HEX, VALS(str_command_audio_config), 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_command_key_release,
            { "Key Release", "ua3g.command.key_release",
            FT_BOOLEAN, BASE_NONE, TFS(&tfs_on_off), 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_command_amplified_handset,
            { "Amplified Handset (Boost)", "ua3g.command.amplified_handset",
            FT_BOOLEAN, BASE_NONE, TFS(&tfs_on_off), 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_command_loudspeaker,
            { "Loudspeaker", "ua3g.command.loudspeaker",
            FT_BOOLEAN, BASE_NONE, TFS(&tfs_on_off), 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_command_announce,
            { "Announce", "ua3g.command.announce",
            FT_BOOLEAN, BASE_NONE, TFS(&tfs_on_off), 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_command_ring,
            { "Ring", "ua3g.command.ring",
            FT_BOOLEAN, BASE_NONE, TFS(&tfs_on_off), 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_command_ua_dwl_protocol,
            { "UA Download Protocol", "ua3g.command.ua_dwl_protocol",
            FT_UINT8, BASE_HEX, VALS(str_command_ua_dwl_protocol), 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_command_unsolicited_msg,
            { "Unsolicited Message", "ua3g.command.unsolicited_msg",
            FT_UINT8, BASE_HEX, VALS(str_command_unsolicited_msg), 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_ip_device_routing_stop_rtp_parameter,
            { "Parameter", "ua3g.ip.stop_rtp.parameter",
            FT_UINT8, BASE_HEX, VALS(ip_device_routing_cmd_stop_rtp_vals), 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_ip_device_routing_stop_rtp_parameter_length,
            { "Length", "ua3g.ip.stop_rtp.parameter.length",
            FT_UINT8, BASE_DEC, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_ip_device_routing_stop_rtp_parameter_value_num,
            { "Value", "ua3g.ip.stop_rtp.parameter.value.num",
            FT_UINT64, BASE_HEX, NULL, 0x00,
            NULL, HFILL }
        },
        { &hf_ua3g_ip_device_routing_stop_rtp_parameter_value_bytes,
            { "Value", "ua3g.ip.stop_rtp.parameter.value.bytes",
            FT_BYTES, BASE_NONE, NULL, 0x00,
            NULL, HFILL }
        },
        /* Generated from convert_proto_tree_add_text.pl */
        { &hf_ua3g_subdevice_address, { "Subdevice Address", "ua3g.subdevice.address", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL }},
        { &hf_ua3g_subdevice_opcode, { "Subdevice Opcode", "ua3g.subdevice.opcode", FT_UINT8, BASE_HEX, NULL, 0x7F, NULL, HFILL }},
        { &hf_ua3g_subdevice_parameter_bytes, { "Parameter Bytes", "ua3g.subdevice.parameter_bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_software_reset, { "Software Reset", "ua3g.software_reset", FT_UINT8, BASE_DEC, VALS(software_reset_verswitch_vals), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_phone_warmstart, { "IP Phone Warmstart", "ua3g.ip_phone_warmstart", FT_UINT8, BASE_DEC, VALS(str_command_ip_phone_warmstart), 0x0, NULL, HFILL }},
        { &hf_ua3g_super_msg_length, { "Length", "ua3g.super_msg.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_super_msg_data, { "Data", "ua3g.super_msg.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_segment_msg_num_remaining, { "Number Of Remaining Segments", "ua3g.segment_msg.num_remaining", FT_UINT8, BASE_DEC, NULL, 0x7F, NULL, HFILL }},
        { &hf_ua3g_segment_msg_length, { "Length", "ua3g.segment_msg.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_segment_message_data, { "Segment Message Data", "ua3g.segment_message.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_reset_parameter, { "Parameter", "ua3g.ip.reset.parameter", FT_UINT8, BASE_DEC, VALS(ip_device_routing_cmd_reset_vals), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_reset_parameter_length, { "Length", "ua3g.ip.reset.parameter.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_rtp_direction, { "Direction", "ua3g.ip.start_rtp.direction", FT_UINT8, BASE_DEC, VALS(start_rtp_str_direction), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_rtp_parameter, { "Parameter", "ua3g.ip.start_rtp.parameter", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ip_device_routing_cmd_start_rtp_vals_ext, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_rtp_parameter_length, { "Length", "ua3g.ip.start_rtp.parameter.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_redirect_parameter, { "Parameter", "ua3g.ip.redirect.parameter", FT_UINT8, BASE_HEX, VALS(ip_device_routing_cmd_redirect_vals), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_redirect_parameter_length, { "Length", "ua3g.ip.redirect.parameter.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_def_tones_num_entries, { "Number Of Entries", "ua3g.ip.def_tones.num_entries", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_def_tones_frequency_1, { "Frequency 1 (Hz)", "ua3g.ip.def_tones.frequency_1", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_def_tones_level_1, { "Level 1 (dB)", "ua3g.ip.def_tones.level_1", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_def_tones_frequency_2, { "Frequency 2 (Hz)", "ua3g.ip.def_tones.frequency_2", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_def_tones_level_2, { "Level 2 (dB)", "ua3g.ip.def_tones.level_2", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_tone_direction, { "Direction", "ua3g.ip.start_tone.direction", FT_UINT8, BASE_DEC, VALS(ip_device_routing_tone_direction_vals), 0xC0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_tone_num_entries, { "Number of entries", "ua3g.ip.start_tone.num_entries", FT_UINT8, BASE_DEC, NULL, 0x3f, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_tone_identification, { "Identification", "ua3g.ip.start_tone.identification", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_tone_duration, { "Duration (ms)", "ua3g.ip.start_tone.duration", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_listen_rtp_parameter, { "Parameter", "ua3g.ip.listen_rtp.parameter", FT_UINT8, BASE_HEX, VALS(ip_device_routing_cmd_listen_rtp_vals), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_listen_rtp_parameter_length, { "Length", "ua3g.ip.listen_rtp.parameter.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_get_param_req_parameter, { "Parameter", "ua3g.ip.get_param_req.parameter", FT_UINT8, BASE_DEC, VALS(ip_device_routing_cmd_get_param_req_vals), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_set_param_req_parameter, { "Parameter", "ua3g.ip.set_param_req.parameter", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ip_device_routing_cmd_set_param_req_vals_ext, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_set_param_req_parameter_length, { "Length", "ua3g.ip.set_param_req.parameter.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_digit_value, { "Digit Value", "ua3g.ip.digit_value", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &str_digit_ext, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_pause_restart_rtp_parameter, { "Parameter", "ua3g.ip.pause_restart_rtp.parameter", FT_UINT8, BASE_HEX, VALS(ip_device_routing_cmd_pause_restart_vals), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_pause_restart_rtp_parameter_length, { "Length", "ua3g.ip.pause_restart_rtp.parameter.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_pause_restart_rtp_parameter_value, { "Value", "ua3g.ip.pause_restart_rtp.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter, { "Parameter", "ua3g.ip.start_stop_record_rtp.parameter", FT_UINT8, BASE_HEX, VALS(ip_device_routing_cmd_record_rtp_vals), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_length, { "Length", "ua3g.ip.start_stop_record_rtp.parameter.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_debug_in_line, { "Text String With Debug", "ua3g.debug_in_line", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_command_led_number, { "Led Number", "ua3g.command.led.number", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_lcd_line_cmd_lcd_options, { "LCD Options", "ua3g.command.lcd_line.lcd_options", FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL }},
        { &hf_ua3g_lcd_line_cmd_starting_column, { "Starting Column", "ua3g.command.lcd_line.starting_column", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_main_voice_mode_tune, { "Tune", "ua3g.main_voice_mode.tune", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_main_voice_mode_cadence, { "Cadence", "ua3g.main_voice_mode.cadence", FT_UINT8, BASE_DEC, VALS(str_cadence), 0x0, NULL, HFILL }},
        { &hf_ua3g_main_voice_mode_speaker_volume, { "Speaker Volume", "ua3g.main_voice_mode.speaker_volume", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_main_voice_mode_microphone_volume, { "Microphone Volume", "ua3g.main_voice_mode.microphone_volume", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_main_voice_mode_sending_level, { "Sending Level (dB)", "ua3g.main_voice_mode.sending_level", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_main_voice_mode_handset_level, { "Receiving Level (dB)", "ua3g.main_voice_mode.handset_level", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_main_voice_mode_headset_level, { "Receiving Level (dB)", "ua3g.main_voice_mode.headset_level", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_main_voice_mode_handsfree_level, { "Sending Level (dB)", "ua3g.main_voice_mode.handsfree_level", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_subdevice_metastate_subchannel_address, { "Subchannel Address", "ua3g.subdevice_metastate.subchannel_address", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_subdevice_metastate_new_metastate, { "New Metastate", "ua3g.subdevice_metastate.new_metastate", FT_UINT8, BASE_DEC, VALS(str_new_metastate), 0x0, NULL, HFILL }},
        { &hf_ua3g_dwl_dtmf_clck_format_minimum_on_time, { "Minimum 'ON' Time (ms)", "ua3g.dwl_dtmf_clck_format.minimum_on_time", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_dwl_dtmf_clck_format_inter_digit_pause_time, { "Inter-Digit Pause Time (ms)", "ua3g.dwl_dtmf_clck_format.inter_digit_pause_time", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_dwl_dtmf_clck_format_clock_time_format, { "Clock Time Format", "ua3g.dwl_dtmf_clck_format.clock_time_format", FT_UINT8, BASE_DEC, VALS(str_clock_format), 0x0, NULL, HFILL }},
        { &hf_ua3g_dwl_dtmf_clck_format_dtmf_country_adaptation, { "DTMF Country Adaptation", "ua3g.dwl_dtmf_clck_format.dtmf_country_adaptation", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_voice_channel_channel_mode, { "Channel Mode", "ua3g.voice_channel.channel_mode", FT_BOOLEAN, 8, TFS(&tfs_voice_channel_channel_mode), 0x01, NULL, HFILL }},
        { &hf_ua3g_voice_channel_codec, { "Codec", "ua3g.voice_channel.codec", FT_BOOLEAN, 8, TFS(&tfs_voice_channel_codec), 0x02, NULL, HFILL }},
        { &hf_ua3g_voice_channel_voice_channel, { "Voice Channel", "ua3g.voice_channel.voice_channel", FT_BOOLEAN, 8, TFS(&tfs_voice_channel_voice_channel), 0x04, NULL, HFILL }},
        { &hf_ua3g_voice_channel_main_voice, { "Main Voice", "ua3g.voice_channel.main_voice", FT_UINT8, BASE_DEC, VALS(str_voice_channel), 0x0, NULL, HFILL }},
        { &hf_ua3g_voice_channel_announce, { "Announce", "ua3g.voice_channel.announce", FT_UINT8, BASE_DEC, VALS(str_voice_channel), 0x0, NULL, HFILL }},
        { &hf_ua3g_voice_channel_b_general, { "B General", "ua3g.voice_channel.b_general", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_voice_channel_b_loud_speaker, { "B Loud Speaker", "ua3g.voice_channel.b_loud_speaker", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_voice_channel_b_ear_piece, { "B Ear Piece", "ua3g.voice_channel.b_ear_piece", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_voice_channel_b_microphones, { "B Microphones", "ua3g.voice_channel.b_microphones", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_lcd_cursor_line_number, { "Line Number", "ua3g.lcd_cursor.line_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_dwl_special_char_character_number, { "Character Number", "ua3g.dwl_special_char.character_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_dwl_special_char_byte, { "Byte", "ua3g.dwl_special_char.byte", FT_UINT8, BASE_DEC, NULL, 0xFF, NULL, HFILL }},
        { &hf_ua3g_set_clck_timer_pos_clock_line_number, { "Clock Line Number", "ua3g.set_clck_timer_pos.clock_line_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_set_clck_timer_pos_clock_column_number, { "Clock Column Number", "ua3g.set_clck_timer_pos.clock_column_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_set_clck_timer_pos_call_timer_line_number, { "Call Timer Line Number", "ua3g.set_clck_timer_pos.call_timer_line_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_set_clck_timer_pos_call_timer_column_number, { "Call Timer Column Number", "ua3g.set_clck_timer_pos.call_timer_column_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_set_lcd_contrast_driver_number, { "Driver Number", "ua3g.set_lcd_contrast.driver_number", FT_UINT8, BASE_DEC, VALS(str_driver_number), 0x0, NULL, HFILL }},
        { &hf_ua3g_set_lcd_contrast_contrast_value, { "Contrast Value", "ua3g.set_lcd_contrast.contrast_value", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_beep_destination, { "Destination", "ua3g.command.beep.destination", FT_UINT8, BASE_DEC, VALS(str_beep_start_destination), 0x0, NULL, HFILL }},
        { &hf_ua3g_beep_on_off, { "On / Off", "ua3g.command.beep.on_off", FT_BOOLEAN, 8, TFS(&tfs_on_off), 0x80, NULL, HFILL }},
        { &hf_ua3g_beep_cadence, { "Cadence", "ua3g.command.beep.cadence", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_beep_beep_number, { "Beep Number", "ua3g.command.beep.beep_number", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_beep_number_of_notes, { "Number Of Notes", "ua3g.command.beep.number_of_notes", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_beep_terminator, { "Terminator", "ua3g.command.beep.terminator", FT_UINT8, BASE_DEC, VALS(str_beep_terminator), 0x0, NULL, HFILL }},
        { &hf_ua3g_sidetone_level, { "Level", "ua3g.command.sidetone.level", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ringing_cadence_cadence, { "Cadence", "ua3g.ringing_cadence.cadence", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ringing_cadence_on_off, { "On / Off", "ua3g.ringing_cadence.on_off", FT_BOOLEAN, 8, TFS(&tfs_on_off), 0x80, NULL, HFILL }},
        { &hf_ua3g_ringing_cadence_length, { "Length (ms)", "ua3g.ringing_cadence.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_feedback_level, { "Level (dB)", "ua3g.command.feedback.level", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_feedback_duration, { "Duration", "ua3g.command.feedback.duration", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_milliseconds), 0x0, NULL, HFILL }},
        { &hf_ua3g_r_w_peripheral_address, { "Address", "ua3g.r_w_peripheral.address", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_r_w_peripheral_content, { "Content", "ua3g.r_w_peripheral.content", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_icon_cmd_icon_number, { "Icon Number", "ua3g.icon_cmd.icon_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_icon_cmd_segment, { "Segment", "ua3g.icon_cmd.segment", FT_UINT16, BASE_DEC, VALS(str_icon_cmd_state), 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_ignored, { "Ignored", "ua3g.command.audio_config.ignored", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_law, { "Law", "ua3g.command.audio_config.law", FT_UINT8, BASE_DEC, VALS(str_audio_coding_law), 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_volume_level, { "Volume Level", "ua3g.command.audio_config.volume_level", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_handsfree_return, { "Return", "ua3g.command.audio_config.handsfree_return", FT_BOOLEAN, 8, TFS(&tfs_audio_config_handsfree_return), 0x01, NULL, HFILL }},
        { &hf_ua3g_audio_config_handsfree_handsfree, { "Handsfree", "ua3g.command.audio_config.handsfree", FT_BOOLEAN, 8, TFS(&tfs_audio_config_handsfree_handsfree), 0x02, NULL, HFILL }},
        { &hf_ua3g_audio_padded_path_emission_padded_level, { "Emission Padded Level", "ua3g.audio_padded_path.emission_padded_level", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_padded_path_reception_padded_level, { "Reception Padded Level", "ua3g.audio_padded_path.reception_padded_level", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_on_off_level_level_on_loudspeaker, { "Level on Loudspeaker (dB)", "ua3g.on_off_level.level_on_loudspeaker", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ring_melody, { "Melody", "ua3g.command.ring.melody", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ring_cadence, { "Cadence", "ua3g.command.ring.cadence", FT_UINT8, BASE_DEC, VALS(str_cadence), 0x0, NULL, HFILL }},
        { &hf_ua3g_ring_speaker_level, { "Speaker level (dB)", "ua3g.command.ring.speaker_level", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ring_beep_number, { "Beep number", "ua3g.command.ring.beep_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ring_silent, { "Silent", "ua3g.command.ring.silent", FT_BOOLEAN, 8, TFS(&tfs_on_off), 0x80, NULL, HFILL }},
        { &hf_ua3g_ring_progressive, { "Progressive", "ua3g.command.ring.progressive", FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_item_identifier, { "Item Identifier", "ua3g.ua_dwl_protocol.item_identifier", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_cause, { "Cause", "ua3g.ua_dwl_protocol.cause", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_force_mode, { "Force Mode", "ua3g.ua_dwl_protocol.force_mode", FT_UINT8, BASE_DEC, VALS(str_download_req_force_mode), 0x0, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_item_version, { "Item Version", "ua3g.ua_dwl_protocol.item_version", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_item_version_nc, { "Item Version", "ua3g.ua_dwl_protocol.item_version", FT_UINT16, BASE_CUSTOM, CF_FUNC(version_number_computer), 0x0, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_binary_length, { "Binary Length", "ua3g.ua_dwl_protocol.binary_length", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_packet_number, { "Packet Number", "ua3g.ua_dwl_protocol.packet_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_download_ack_status, { "Status", "ua3g.ua_dwl_protocol.download_ack_status", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &str_download_ack_status_ext, 0x0, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_packet_download_end_ack_ok_status, { "Status", "ua3g.ua_dwl_protocol_packet.download_end_ack_ok_status", FT_UINT8, BASE_DEC, VALS(str_download_end_ack_ok), 0x0, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_checksum, { "Checksum", "ua3g.ua_dwl_protocol.checksum", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_acknowledge, { "Acknowledge", "ua3g.ua_dwl_protocol.acknowledge", FT_UINT8, BASE_DEC, VALS(str_iso_checksum_ack_status), 0x0, NULL, HFILL }},
        { &hf_ua3g_digit_dialed_digit_value, { "Digit Value", "ua3g.digit_dialed.digit_value", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &str_digit_ext, 0x0, NULL, HFILL }},
        { &hf_ua3g_subdevice_msg_subdev_type, { "Subdev Type", "ua3g.subdevice_msg.subdev_type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_subdevice_msg_subdev_address, { "Subdev Address", "ua3g.subdevice_msg.subdev_address", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_subdevice_msg_subdevice_opcode, { "Subdevice Opcode", "ua3g.subdevice_msg.subdevice_opcode", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_subdevice_msg_parameter_bytes, { "Parameter Bytes", "ua3g.subdevice_msg.parameter_bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd00_vta_type, { "VTA Type", "ua3g.ip.cs.cmd00.vta_type", FT_UINT8, BASE_HEX, VALS(str_vta_type), 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd00_characteristic_number, { "Characteristic Number", "ua3g.ip.cs.cmd00.characteristic_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd01_incident_0, { "Incident 0", "ua3g.ip.cs.cmd01.incident_0", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd02_parameter, { "Parameter", "ua3g.ip.cs.cmd02.parameter", FT_UINT8, BASE_HEX, VALS(ip_device_routing_cmd_get_param_req_vals), 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_length, { "Length", "ua3g.ip.cs.cmd02.parameter.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter, { "Parameter", "ua3g.ip.cs.cmd03.parameter", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &cs_ip_device_routing_03_parameter_id_vals_ext, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_length, { "Length", "ua3g.ip.cs.cmd03.parameter.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_device_type, { "Device Type", "ua3g.unsolicited_msg.device_type", FT_UINT8, BASE_DEC, VALS(str_device_type), 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_self_test_result, { "Self-Test Result", "ua3g.unsolicited_msg.self_test_result", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_vta_type, { "VTA Type", "ua3g.unsolicited_msg.vta_type", FT_UINT8, BASE_HEX, VALS(str_vta_type), 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_other_information, { "Other Information", "ua3g.unsolicited_msg.other_information", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_other_info_2), 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_other_information_1, { "Other Information 1", "ua3g.unsolicited_msg.other_information_1", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_other_info_1), 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_hardware_version, { "Hardware Version", "ua3g.unsolicited_msg.hardware_version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_other_information_2, { "Other Information 2", "ua3g.unsolicited_msg.other_information_2", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_other_info_2), 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_firmware_datas_patch_version, { "Firmware Datas Patch Version", "ua3g.unsolicited_msg.firmware_datas_patch_version", FT_UINT16, BASE_CUSTOM, CF_FUNC(version_number_computer), 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_firmware_version_loader, { "Firmware Version (Loader)", "ua3g.unsolicited_msg.firmware_version_loader", FT_UINT16, BASE_CUSTOM, CF_FUNC(version_number_computer), 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_firmware_version, { "Firmware Version", "ua3g.unsolicited_msg.firmware_version", FT_UINT16, BASE_CUSTOM, CF_FUNC(version_number_computer), 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_datas_version, { "Datas Version", "ua3g.unsolicited_msg.datas_version", FT_UINT16, BASE_CUSTOM, CF_FUNC(version_number_computer), 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_firmware_version_bootloader, { "Firmware Version (Bootloader)", "ua3g.unsolicited_msg.firmware_version_bootloader", FT_UINT16, BASE_CUSTOM, CF_FUNC(version_number_computer), 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_opcode_of_bad_command, { "Opcode Of Bad Command", "ua3g.unsolicited_msg.opcode_of_bad_command", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_next_byte_of_bad_command, { "Next Byte Of Bad Command", "ua3g.unsolicited_msg.next_byte_of_bad_command", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_subdevice_address, { "Subdevice Address", "ua3g.unsolicited_msg.subdevice_address", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_segment_failure_t, { "T", "ua3g.unsolicited_msg.segment_failure.t", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_segment_failure_num, { "Num", "ua3g.unsolicited_msg.segment_failurenum", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_segment_failure_s, { "/S", "ua3g.unsolicited_msg.segment_failure.s", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_segment_failure_l, { "L", "ua3g.unsolicited_msg.segment_failure.l", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_opcode_bad_segment, { "Opcode Bad Segment", "ua3g.unsolicited_msg.opcode_bad_segment", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_next_byte_of_bad_segment, { "Next Byte Of Bad Segment", "ua3g.unsolicited_msg.next_byte_of_bad_segment", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_device_event, { "Device Event", "ua3g.unsolicited_msg.device_event", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_i_m_here_id_code, { "Id Code", "ua3g.i_m_here.id_code", FT_UINT8, BASE_DEC, VALS(str_device_type), 0x0, NULL, HFILL }},
        { &hf_ua3g_segment_msg_segment, { "F/S", "ua3g.segment_msg.segment", FT_BOOLEAN, 8, TFS(&tfs_segment_msg_segment), 0x80, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_reset_parameter_noe_update, { "NOE Update Mode", "ua3g.ip.reset.parameter.noe_update", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_reset_parameter_noe_update_bootloader, { "Bootloader", "ua3g.ip.reset.parameter.noe_update.bootloader", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_reset_parameter_noe_update_data, { "Data", "ua3g.ip.reset.parameter.noe_update.data", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_reset_parameter_noe_update_customization, { "Customization", "ua3g.ip.reset.parameter.noe_update.customization", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_reset_parameter_noe_update_localization, { "Localization", "ua3g.ip.reset.parameter.noe_update.localization", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_reset_parameter_noe_update_code, { "Code", "ua3g.ip.reset.parameter.noe_update.code", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_reset_parameter_noe_update_sip, { "SIP", "ua3g.ip.reset.parameter.noe_update.sip", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_reset_parameter_bad_sec_mode, { "Bad Sec Mode", "ua3g.ip.reset.parameter.bad_sec_mode", FT_UINT8, BASE_DEC, VALS(reset_param_bad_sec_mode), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_reset_parameter_value, { "Value", "ua3g.ip.reset.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_reset_parameter_cust_name, { "Cust_Name", "ua3g.ip.reset.parameter.cust_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_reset_parameter_l10n_name, { "L10N_Name", "ua3g.ip.reset.parameter.l10n_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_reset_parameter_appl_mode, { "Appl_Mode", "ua3g.ip.reset.parameter.appl_mode", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_reset_parameter_sip_name, { "SIP_Name", "ua3g.ip.reset.parameter.sip_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_reset_parameter_reset_mac, { "Reset Mac", "ua3g.ip.reset.parameter.reset_mac", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_rtp_parameter_value, { "Value", "ua3g.ip.start_rtp.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_rtp_parameter_ip, { "IP", "ua3g.ip.start_rtp.parameter.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_rtp_parameter_compressor, { "Compressor", "ua3g.ip.start_rtp.parameter.compressor", FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS64(str_compressor_vals), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_rtp_parameter_enabler, { "Enabler", "ua3g.ip.start_rtp.parameter.enabler", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_rtp_parameter_send_qos, { "Must Send QOS Tickets", "ua3g.ip.start_rtp.parameter.send_qos", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_rtp_parameter_uint, { "Value", "ua3g.ip.start_rtp.parameter.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_rtp_parameter_dtmf_sending, { "Send DTMF", "ua3g.ip.start_rtp.parameter.dtmf_sending", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_rtp_parameter_rfc2198, { "Enable RFC 2198", "ua3g.ip.start_rtp.parameter.rfc2198", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_rtp_parameter_srtp_encryption, { "Enable SRTP Encryption", "ua3g.ip.start_rtp.parameter.srtp_encryption", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_redirect_parameter_value, { "Value", "ua3g.ip.redirect.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_redirect_parameter_ip, { "IP", "ua3g.ip.redirect.parameter.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_redirect_parameter_uint, { "Value", "ua3g.ip.redirect.parameter.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_listen_rtp_parameter_value, { "Value", "ua3g.ip.listen_rtp.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_listen_rtp_parameter_ip, { "IP", "ua3g.ip.listen_rtp.parameter.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_listen_rtp_parameter_port, { "Port", "ua3g.ip.listen_rtp.parameter.port", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_set_param_req_parameter_value, { "Value", "ua3g.ip.set_param_req.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_set_param_req_parameter_tftp_backup_ip, { "TFTP Backup IP", "ua3g.ip.set_param_req.parameter.tftp_backup_ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_set_param_req_parameter_uint, { "Value", "ua3g.ip.set_param_req.parameter.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_set_param_req_parameter_err_string, { "Value", "ua3g.ip.set_param_req.parameter.err_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_set_param_req_parameter_compressor, { "Compressor", "ua3g.ip.set_param_req.parameter.compressor", FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS64(str_compressor_vals), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_set_param_req_parameter_set_pc_port_status, { "Set PC Port status", "ua3g.ip.set_param_req.parameter.set_pc_port_status", FT_UINT8, BASE_DEC, VALS(str_set_pc_port_status), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_set_param_req_parameter_record_rtp_auth, { "Record RTP Authorization", "ua3g.ip.set_param_req.parameter.record_rtp_auth", FT_UINT8, BASE_DEC, VALS(str_enable_feature), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_set_param_req_parameter_security_flag_filter, { "Filtering", "ua3g.ip.set_param_req.parameter.security_flag.filter", FT_BOOLEAN, 8, TFS(&tfs_active_inactive), 0x01, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_set_param_req_parameter_stable_mode, { "Stable Mode", "ua3g.ip.set_param_req.parameter.stable_mode", FT_UINT8, BASE_DEC, VALS(set_param_req_stable_mode), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_set_param_req_parameter_skin_id, { "Skin Identifier", "ua3g.ip.set_param_req.parameter.skin_id", FT_UINT8, BASE_DEC, VALS(set_param_req_skin_id), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_set_param_req_parameter_language_id, { "Language Identifier", "ua3g.ip.set_param_req.parameter.language_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_set_param_req_parameter_usb_boost, { "USB Boost", "ua3g.ip.set_param_req.parameter.usb_boost", FT_UINT8, BASE_DEC, VALS(set_param_req_usb_boost), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_set_param_req_parameter_als_device, { "ALS Device", "ua3g.ip.set_param_req.parameter.als_device", FT_UINT8, BASE_DEC, VALS(set_param_req_local_device), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_set_param_req_parameter_busy_light, { "Busy Light", "ua3g.ip.set_param_req.parameter.busy_light", FT_UINT8, BASE_DEC, VALS(set_param_req_local_device), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_set_param_req_parameter_audio_env, { "Audio Env.", "ua3g.ip.set_param_req.parameter.audio_env", FT_UINT8, BASE_DEC, VALS(set_param_req_audio_env), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_pause_restart_rtp_parameter_uint, { "Value", "ua3g.ip.pause_restart_rtp.parameter.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_value, { "Value", "ua3g.ip.start_stop_record_rtp.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_remote_ip, { "Remote IP", "ua3g.ip.start_stop_record_rtp.parameter.remote_ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_uint, { "Value", "ua3g.ip.start_stop_record_rtp.parameter.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_freeseating_parameter, { "Parameter", "ua3g.ip.freeseating.parameter", FT_UINT8, BASE_HEX, VALS(ip_device_routing_cmd_freeseating_vals), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_freeseating_parameter_length, { "Length", "ua3g.ip.freeseating.parameter.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_freeseating_parameter_value, { "Value", "ua3g.ip.freeseating.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_freeseating_parameter_uint, { "Value", "ua3g.ip.freeseating.parameter.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_freeseating_parameter_mac, { "Value", "ua3g.ip.freeseating.parameter.mac", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_freeseating_parameter_ip, { "Value", "ua3g.ip.freeseating.parameter.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_freeseating_parameter_ipv6, { "Value", "ua3g.ip.freeseating.parameter.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_freeseating_parameter_do_reset, { "Value", "ua3g.ip.freeseating.parameter.do_reset", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_appl_parameter, { "Parameter", "ua3g.ip.appl.parameter", FT_UINT8, BASE_HEX, VALS(ip_device_routing_cmd_appl_vals), 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_appl_parameter_length, { "Length", "ua3g.ip.appl.parameter.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_appl_parameter_value, { "Value", "ua3g.ip.appl.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_appl_parameter_uint, { "Value", "ua3g.ip.appl.parameter.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_appl_parameter_id, { "Value", "ua3g.ip.appl.parameter.id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_appl_parameter_enable, { "Value", "ua3g.ip.appl.parameter.enable", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ip_device_routing_appl_parameter_url, { "Value", "ua3g.ip.appl.parameter.url", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_dpi_chan_ua_tx1, { "UA Channel UA-TX1", "ua3g.command.audio_config.dpi_chan.ua_tx1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_dpi_chan_ua_tx2, { "UA Channel UA-TX2", "ua3g.command.audio_config.dpi_chan.ua_tx2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_dpi_chan_gci_tx1, { "GCI Channel GCI-TX1", "ua3g.command.audio_config.dpi_chan.gci_tx1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_dpi_chan_gci_tx2, { "GCI Channel GCI-TX2", "ua3g.command.audio_config.dpi_chan.gci_tx2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_dpi_chan_cod_tx, { "Codec Channel COD-TX", "ua3g.command.audio_config.dpi_chan.cod_tx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_audio_circuit_dth, { "Anti-Distortion Coeff 1(DTH)", "ua3g.command.audio_config.audio_circuit.dth", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_audio_circuit_dtr, { "Anti-Distortion Coeff 2(DTR)", "ua3g.command.audio_config.audio_circuit.dtr", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_audio_circuit_dtf, { "Anti-Distortion Coeff 3(DTF)", "ua3g.command.audio_config.audio_circuit.dtf", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_audio_circuit_str, { "Sidetone Attenuation (STR)", "ua3g.command.audio_config.audio_circuit.str", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_audio_circuit_ahp1, { "Anti-Larsen Coeff 1 (AHP1)", "ua3g.command.audio_config.audio_circuit.ahp1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_audio_circuit_ahp2, { "Anti-Larsen Coeff 2 (AHP2)", "ua3g.command.audio_config.audio_circuit.ahp2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_audio_circuit_ath, { "Anti-Larsen Coeff 3 (ATH)", "ua3g.command.audio_config.audio_circuit.ath", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_audio_circuit_atr, { "Anti-Larsen Coeff 4 (ATR)", "ua3g.command.audio_config.audio_circuit.atr", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_audio_circuit_atf, { "Anti-Larsen Coeff 5 (ATF)", "ua3g.command.audio_config.audio_circuit.atf", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_audio_circuit_alm, { "Anti-Larsen Coeff 6 (ALM)", "ua3g.command.audio_config.audio_circuit.alm", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_loudspeaker_aco_param_group_listen, { "Group Listening Attenuation Constant", "ua3g.command.audio_config.loudspeaker_aco_param.group_listen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_attenuation, { "Handsfree Attenuation Constant", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_attenuation", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_stay_in_send, { "Handsfree Number Of ms To Stay In Send State Before Going To Another State", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_stay_in_send", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_shift_right_mtx, { "Handsfree Number Of Positions To Shift Right MTx", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_shift_right_mtx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_shift_right_mrc, { "Handsfree Number Of Positions To Shift Right MRc", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_shift_right_mrc", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_idle_trans_threshold, { "Handsfree Idle Transmission Threshold", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_idle_trans_threshold", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_low_trans_threshold, { "Handsfree Low Transmission Threshold", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_low_trans_threshold", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_idle_recv_threshold, { "Handsfree Idle Reception Threshold", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_idle_recv_threshold", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_low_recv_threshold, { "Handsfree Low Reception Threshold", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_low_recv_threshold", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_med_recv_threshold, { "Handsfree Medium Reception Threshold", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_med_recv_threshold", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_high_recv_threshold, { "Handsfree High Reception Threshold", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_high_recv_threshold", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_files_inc_boot_binary, { "Boot Binary Included", "ua3g.ua_dwl_protocol.files_inc.boot_binary", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_files_inc_loader_binary, { "Loader Binary Included", "ua3g.ua_dwl_protocol.files_inc.loader_binary", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_files_inc_appli_binary, { "Appli Binary Included", "ua3g.ua_dwl_protocol.files_inc.appli_binary", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_files_inc_data_binary, { "Datas Binary Included", "ua3g.ua_dwl_protocol.files_inc.data_binary", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_model_selection_a, { "For A Model", "ua3g.ua_dwl_protocol.model_selection.a", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_model_selection_b, { "For B Model", "ua3g.ua_dwl_protocol.model_selection.b", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_model_selection_c, { "For C Model", "ua3g.ua_dwl_protocol.model_selection.c", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_model_selection_country_ver, { "Country Version", "ua3g.ua_dwl_protocol.model_selection.country_ver", FT_UINT8, BASE_DEC, VALS(str_download_req_mode_selection_country), 0xE0, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_hardware_selection_ivanoe1, { "For Ivanoe 1", "ua3g.ua_dwl_protocol.hardware_selection.ivanoe1", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_hardware_selection_ivanoe2, { "For Ivanoe 2", "ua3g.ua_dwl_protocol.hardware_selection.ivanoe2", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_memory_sizes_flash, { "Flash Min Size", "ua3g.ua_dwl_protocol.memory_sizes.flash", FT_UINT8, BASE_DEC, VALS(str_mem_size), 0x07, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_memory_sizes_ext_ram, { "External Ram Min Size", "ua3g.ua_dwl_protocol.memory_sizes.ext_ram", FT_UINT8, BASE_DEC, VALS(str_mem_size), 0x38, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_char_num_vta_subtype, { "VTA SubType", "ua3g.unsolicited_msg.char_num.vta_subtype", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_subtype), 0xC0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_char_num_generation, { "Generation", "ua3g.unsolicited_msg.char_num.generation", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_generation), 0x38, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_char_num_design, { "Design", "ua3g.unsolicited_msg.char_num.design", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_design), 0x07, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_hardware_config_vta_type, { "VTA Type", "ua3g.unsolicited_msg.hardware_config.vta_type", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_hard_vta_type), 0xE0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_hardware_config_design, { "Design", "ua3g.unsolicited_msg.hardware_config.design", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_hard_design), 0x1C, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_hardware_config_subtype, { "VTA SubType", "ua3g.unsolicited_msg.hardware_config.subtype", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_hard_subtype), 0x03, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_hardware_config_hard_config_chip, { "Chip Id", "ua3g.unsolicited_msg.hardware_config.hard_config_chip", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_hard_config_chip), 0x03, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_hardware_config_hard_config_flash, { "Flash Size", "ua3g.unsolicited_msg.hardware_config.hard_config_flash", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_hard_config_flash), 0x1C, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_hardware_config_config_ram, { "External RAM Size", "ua3g.unsolicited_msg.hardware_config.config_ram", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_hard_config_ram), 0xE0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_hardware_config, { "Hardware Configuration", "ua3g.unsolicited_msg.hardware_config", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_hardware_config_export_full, { "Binary Type", "ua3g.unsolicited_msg.hardware_config.export_full", FT_BOOLEAN, 8, TFS(&tfs_export_full), 0x01, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_hardware_config_ethernet_hardware, { "Ethernet Hardware", "ua3g.unsolicited_msg.hardware_config.ethernet_hardware", FT_BOOLEAN, 8, TFS(&tfs_fast_gigabit), 0x02, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_hardware_config_extended_edition, { "Extended Hardware", "ua3g.unsolicited_msg.hardware_config.extended_edition", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_hardware_config_wideband, { "Wideband Support", "ua3g.unsolicited_msg.hardware_config.wideband", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_hardware_config_3g_set, { "Hardware Generation", "ua3g.unsolicited_msg.hardware_config.3g_set", FT_BOOLEAN, 8, TFS(&tfs_2g_3g), 0x10, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_hardware_config_8082_set, { "8082 Hardware", "ua3g.unsolicited_msg.hardware_config.8082_set", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_hardware_config_super_wideband, { "Super Wideband Support", "ua3g.unsolicited_msg.hardware_config.super_wideband", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x40, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_hook_status, { "Hook Status", "ua3g.unsolicited_msg.hook_status", FT_UINT8, BASE_DEC, VALS(str_on_off), 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_additional_vta_type, { "Additional VTA Type", "ua3g.unsolicited_msg.additional_vta_type", FT_UINT8, BASE_HEX, VALS(str_additional_vta_type), 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_capability_info_bluetooth_supported, { "Bluetooth Supported", "ua3g.unsolicited_msg.capability_info.bluetooth_supported", FT_UINT8, BASE_DEC, VALS(str_yes_no), 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_capability_info_vpn_encryption_status, { "VPN and Encryption Status", "ua3g.unsolicited_msg.capability_info.vpn_encryption_status", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_capability_info_vpn, { "VPN", "ua3g.unsolicited_msg.capability_info.vpn", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_capability_info_ipsec, { "IPSec", "ua3g.unsolicited_msg.capability_info.ipsec", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_capability_info_dtls, { "DTLS", "ua3g.unsolicited_msg.capability_info.dtls", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x4, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_capability_info_wlan_status, { "WLAN Status", "ua3g.unsolicited_msg.capability_info.wlan_status", FT_UINT8, BASE_DEC, VALS(str_wlan_status), 0x0, NULL, HFILL }},
        { &hf_ua3g_unsolicited_msg_capability_info_reserved, { "Reserved", "ua3g.unsolicited_msg.capability_info.reserved", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_special_key_shift, { "Shift", "ua3g.special_key.shift", FT_BOOLEAN, 8, TFS(&tfs_released_pressed), 0x01, NULL, HFILL }},
        { &hf_ua3g_special_key_ctrl, { "Ctrl", "ua3g.special_key.ctrl", FT_BOOLEAN, 8, TFS(&tfs_released_pressed), 0x02, NULL, HFILL }},
        { &hf_ua3g_special_key_alt, { "Alt", "ua3g.special_key.alt", FT_BOOLEAN, 8, TFS(&tfs_released_pressed), 0x04, NULL, HFILL }},
        { &hf_ua3g_special_key_cmd, { "Cmd", "ua3g.special_key.cmd", FT_BOOLEAN, 8, TFS(&tfs_released_pressed), 0x08, NULL, HFILL }},
        { &hf_ua3g_special_key_shift_prime, { "Shift'", "ua3g.special_key.shift_prime", FT_BOOLEAN, 8, TFS(&tfs_released_pressed), 0x10, NULL, HFILL }},
        { &hf_ua3g_special_key_ctrl_prime, { "Ctrl'", "ua3g.special_key.ctrl_prime", FT_BOOLEAN, 8, TFS(&tfs_released_pressed), 0x20, NULL, HFILL }},
        { &hf_ua3g_special_key_alt_prime, { "Alt'", "ua3g.special_key.alt_prime", FT_BOOLEAN, 8, TFS(&tfs_released_pressed), 0x40, NULL, HFILL }},
        { &hf_ua3g_special_key_cmd_prime, { "Cmd'", "ua3g.special_key.cmd_prime", FT_BOOLEAN, 8, TFS(&tfs_released_pressed), 0x80, NULL, HFILL }},
        { &hf_ua3g_lcd_line_cmd_lcd_options_call_timer, { "Call Timer", "ua3g.lcd_line_cmd.lcd_options.call_timer", FT_UINT8, BASE_DEC, VALS(str_call_timer_ctrl), 0x03, NULL, HFILL }},
        { &hf_ua3g_lcd_line_cmd_lcd_options_blink, { "Blink", "ua3g.lcd_line_cmd.lcd_options.blink", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04, NULL, HFILL }},
        { &hf_ua3g_lcd_line_cmd_lcd_options_call_timer_control, { "Call Timer Control", "ua3g.lcd_line_cmd.lcd_options.call_timer_control", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10, NULL, HFILL }},
        { &hf_ua3g_lcd_line_cmd_lcd_options_call_timer_display, { "Call Timer Display", "ua3g.lcd_line_cmd.lcd_options.call_timer_display", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20, NULL, HFILL }},
        { &hf_ua3g_lcd_line_cmd_lcd_options_time_of_day_display, { "Time Of Day Display", "ua3g.lcd_line_cmd.lcd_options.time_of_day_display", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x40, NULL, HFILL }},
        { &hf_ua3g_lcd_line_cmd_lcd_options_suspend_display_refresh, { "Suspend Display Refresh", "ua3g.lcd_line_cmd.lcd_options.suspend_display_refresh", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_value, { "Value", "ua3g.ip.cs.cmd02.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_ip, { "IP", "ua3g.ip.cs.cmd02.parameter.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_mac_address, { "MAC Address", "ua3g.ip.cs.cmd02.parameter.mac_address", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_uint, { "Value", "ua3g.ip.cs.cmd02.parameter.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_default_codec_bytes, { "Default Codec", "ua3g.ip.cs.cmd02.parameter.default_codec.bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_default_codec_uint, { "Default Codec", "ua3g.ip.cs.cmd02.parameter.default_codec.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_firmware_version, { "Firmware Version", "ua3g.ip.cs.cmd02.parameter.firmware_version", FT_UINT16, BASE_CUSTOM, CF_FUNC(version_number_computer), 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_tscip_version, { "Firmware Version", "ua3g.ip.cs.cmd02.parameter.tscip_version", FT_UINT24, BASE_CUSTOM, CF_FUNC(version_3bytes_computer), 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_lan_speed, { "Port Lan Speed", "ua3g.ip.cs.cmd02.parameter.eth_driver_config.port_lan_speed", FT_UINT8, BASE_DEC, VALS(str_ethernet_speed_vals), 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_lan_duplex, { "Port Lan Duplex", "ua3g.ip.cs.cmd02.parameter.eth_driver_config.port_lan_duplex", FT_CHAR, BASE_HEX, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_pc_speed, { "Port PC Speed", "ua3g.ip.cs.cmd02.parameter.eth_driver_config.port_pc_speed", FT_UINT8, BASE_DEC, VALS(str_ethernet_speed_vals), 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_pc_duplex, { "Port PC Duplex", "ua3g.ip.cs.cmd02.parameter.eth_driver_config.port_pc_duplex", FT_CHAR, BASE_HEX, NULL, 0x0, NULL, HFILL }},

        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_ip, { "IP", "ua3g.ip.cs.cmd03.parameter.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_string, { "IP", "ua3g.ip.cs.cmd03.parameter.string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_type_of_equip, { "Type Of Equipment", "ua3g.ip.cs.cmd03.parameter.type_of_equip", FT_UINT16, BASE_HEX, VALS(cs_ip_device_routing_cmd03_type_of_equip_vals), 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_firmware_version, { "Firmware Version", "ua3g.ip.cs.cmd03.parameter.firmware_version", FT_UINT16, BASE_CUSTOM, CF_FUNC(version_number_computer), 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_codec, { "Codec", "ua3g.ip.cs.cmd03.parameter.codec", FT_UINT8, BASE_HEX, VALS(str_cs_ip_device_routing_0F_compressor), 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_vad, { "VAD", "ua3g.ip.cs.cmd03.parameter.vad", FT_BOOLEAN, BASE_NONE, TFS(&tfs_on_off), 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_ece, { "ECE", "ua3g.ip.cs.cmd03.parameter.ece", FT_BOOLEAN, BASE_NONE, TFS(&tfs_on_off), 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_voice_mode, { "Voice Mode", "ua3g.ip.cs.cmd03.parameter.voice_mode", FT_UINT8, BASE_HEX, VALS(cs_ip_device_routing_cmd03_voice_mode_vals), 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_delay_distribution, { "Delay Distribution", "ua3g.ip.cs.cmd03.parameter.delay_distribution", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_consecutive_bfi, { "Consecutive BFI", "ua3g.ip.cs.cmd03.parameter.consecutive_bfi", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_bfi_distribution, { "BFI Distribution", "ua3g.ip.cs.cmd03.parameter.bfi_distribution", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_8021Q_used, { "802.1 Q Used", "ua3g.ip.cs.cmd03.parameter.8021Q_used", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_8021P_priority, { "802.1p Priority", "ua3g.ip.cs.cmd03.parameter.8021P_priority", FT_UINT8, BASE_DEC, NULL, 0x07, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_vlan_id, { "VLAN Id", "ua3g.ip.cs.cmd03.parameter.vlan_id", FT_UINT16, BASE_DEC, NULL, 0x0FFF, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_diffserv, { "DiffServ", "ua3g.ip.cs.cmd03.parameter.diffserv", FT_UINT8, BASE_DEC, NULL, 0xFC, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_bfi_distribution_200ms, { "200 ms BFI Distribution", "ua3g.ip.cs.cmd03.parameter.bfi_distribution_200ms", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_uint, { "Value", "ua3g.ip.cs.cmd03.parameter.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_consecutive_rtp_lost, { "Consecutive RTP Lost", "ua3g.ip.cs.cmd03.parameter.consecutive_rtp_lost", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_jitter_depth_distribution, { "Jitter Depth Distribution", "ua3g.ip.cs.cmd03.parameter.jitter_depth_distribution", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_subdevice_state, { "Subdevice State", "ua3g.subdevice_state", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_special_key_param_dtmf, { "Parameters Received for DTMF", "ua3g.special_key.param_dtmf", FT_BOOLEAN, 8, TFS(&tfs_special_key_parameters), 0x02, NULL, HFILL }},
        { &hf_ua3g_special_key_hookswitch_status, { "Hookswitch Status", "ua3g.special_key.hookswitch_status", FT_BOOLEAN, 8, TFS(&tfs_hookswitch_status), 0x01, NULL, HFILL }},
        { &hf_ua3g_cs_ip_device_routing_param_identifier, { "Parameter Identifier", "ua3g.ip.cs.param_identifier", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_key_number, { "Key Number", "ua3g.key_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_ua_dwl_protocol_binary_info, { "Binary information", "ua3g.ua_dwl_protocol.binary_info", FT_BOOLEAN, 8, TFS(&tfs_bin_info), 0x01, NULL, HFILL }},
        { &hf_ua3g_lcd_line_cmd_unused, { "Unused", "ua3g.command.lcd_line.unused", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_lcd_line_cmd_ascii_char, { "ASCII Char", "ua3g.command.lcd_line.ascii_char", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_call_timer, { "Call Timer", "ua3g.command.call_timer", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_current_time, { "Current Timer", "ua3g.command.current_time", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_beep_beep_destination, { "Destination", "ua3g.command.beep.destination", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_beep_beep_destination_handset, { "Handset", "ua3g.command.beep.destination.handset", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
        { &hf_ua3g_beep_beep_destination_headset, { "Headset", "ua3g.command.beep.destination.headset", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
        { &hf_ua3g_beep_beep_destination_loudspeaker, { "Loudspeaker", "ua3g.command.beep.destination.loudspeaker", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
        { &hf_ua3g_beep_beep_destination_announce_loudspeaker, { "Announce Loudspeaker", "ua3g.command.beep.destination.announce_loudspeaker", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
        { &hf_ua3g_beep_beep_destination_handsfree, { "Handsfree", "ua3g.command.beep.destination.handsfree", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
        { &hf_ua3g_beep_freq_sample, { "Freq sample", "ua3g.command.beep.note.freq_sample", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_beep_level, { "Level", "ua3g.command.beep.note.level", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_beep_duration, { "Duration", "ua3g.command.beep.note.duration", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
        { &hf_ua3g_device_configuration, { "Device Configuration", "ua3g.device_configuration", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
    };

    static int *ett[] =
    {
        &ett_ua3g,
        &ett_ua3g_body,
        &ett_ua3g_param,
        &ett_ua3g_param_sub,
        &ett_ua3g_option,
        &ett_ua3g_beep_beep_destination,
        &ett_ua3g_note,
    };

    module_t *ua3g_module;

    /* UA3G dissector registration */
    proto_ua3g = proto_register_protocol("UA3G Message", "UA3G", "ua3g");

    /* Register preferences */
    ua3g_module = prefs_register_protocol(proto_ua3g, NULL);

    prefs_register_bool_preference(ua3g_module, "setup_conversations",
        "Setup RTP/RTCP conversations on Start/Record RTP",
        "Setup RTP/RTCP conversations when parsing Start/Record RTP messages",
        &setup_conversations_enabled);

    proto_register_field_array(proto_ua3g, hf, array_length(hf));

    register_dissector("ua3g", dissect_ua3g, proto_ua3g);

    /* Common subtree array registration */
    proto_register_subtree_array(ett, array_length(ett));
}

void proto_reg_handoff_ua3g(void)
{
#if 0 /* Future */
    dissector_handle_t handle_ua3g = find_dissector("ua3g");

    /* hooking of UA3G on UA */

    dissector_add_uint("ua.opcode", 0x15, handle_ua3g);
#endif
}

/*
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
 *
 * Local variables:
 * c-basic-offset: 4
 * tab-width: 8
 * indent-tabs-mode: nil
 * End:
 *
 * vi: set shiftwidth=4 tabstop=8 expandtab:
 * :indentSize=4:tabSize=8:noTabs=true:
 */