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
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
|
Network Working Group F. Cuervo
Request for Comments: 2885 N. Greene
Category: Standards Track Nortel Networks
C. Huitema
Microsoft Corporation
A. Rayhan
Nortel Networks
B. Rosen
Marconi
J. Segers
Lucent Technologies
August 2000
Megaco Protocol version 0.8
Status of this Memo
This document specifies an Internet standards track protocol for the
Internet community, and requests discussion and suggestions for
improvements. Please refer to the current edition of the "Internet
Official Protocol Standards" (STD 1) for the standardization state
and status of this protocol. Distribution of this memo is unlimited.
Copyright Notice
Copyright (C) The Internet Society (2000). All Rights Reserved.
Abstract
This document is common text with Recommendation H.248 as
redetermined in Geneva, February 2000. It must be read in
conjunction with the Megaco Errata, RFC 2886. A merged document
presenting the Megaco protocol with the Errata incorporated will be
available shortly.
The protocol presented in this document meets the requirements for a
media gateway control protocol as presented in RFC 2805.
Cuervo, et al. Standards Track [Page 1]
^L
RFC 2885 Megaco Protocol August 2000
TABLE OF CONTENTS
1. SCOPE..........................................................6
2. REFERENCES.....................................................6
2.1 Normative references..........................................6
2.2 Informative references........................................8
3. DEFINITIONS....................................................9
4. ABBREVIATIONS.................................................10
5. CONVENTIONS...................................................11
6. CONNECTION MODEL..............................................11
6.1 Contexts.....................................................14
6.1.1 Context Attributes and Descriptors....................15
6.1.2 Creating, Deleting and Modifying Contexts.............15
6.2 Terminations.................................................15
6.2.1 Termination Dynamics..................................16
6.2.2 TerminationIDs........................................17
6.2.3 Packages..............................................17
6.2.4 Termination Properties and Descriptors................18
6.2.5 Root Termination......................................20
7. COMMANDS......................................................20
7.1 Descriptors..................................................21
7.1.1 Specifying Parameters.................................21
7.1.2 Modem Descriptor......................................22
7.1.3 Multiplex Descriptor..................................22
7.1.4 Media Descriptor......................................23
7.1.5 Termination State Descriptor..........................23
7.1.6 Stream Descriptor.....................................24
7.1.7 LocalControl Descriptor...............................24
7.1.8 Local and Remote Descriptors..........................25
7.1.9 Events Descriptor.....................................28
7.1.10 EventBuffer Descriptor...............................31
7.1.11 Signals Descriptor...................................31
7.1.12 Audit Descriptor.....................................32
7.1.13 ServiceChange Descriptor.............................33
7.1.14 DigitMap Descriptor..................................33
7.1.15 Statistics Descriptor................................38
7.1.16 Packages Descriptor..................................39
7.1.17 ObservedEvents Descriptor............................39
7.1.18 Topology Descriptor.................................39
7.2 Command Application Programming Interface....................42
7.2.1 Add...................................................43
7.2.2 Modify................................................44
7.2.3 Subtract..............................................45
7.2.4 Move..................................................46
7.2.5 AuditValue............................................47
7.2.6 AuditCapabilities.....................................48
7.2.7 Notify................................................49
7.2.8 ServiceChange.........................................50
Cuervo, et al. Standards Track [Page 2]
^L
RFC 2885 Megaco Protocol August 2000
7.2.9 Manipulating and Auditing Context Attributes..........54
7.2.10 Generic Command Syntax...............................54
7.3 Command Error Codes..........................................55
8. TRANSACTIONS..................................................56
8.1 Common Parameters............................................58
8.1.1 Transaction Identifiers...............................58
8.1.2 Context Identifiers...................................58
8.2 Transaction Application Programming Interface................58
8.2.1 TransactionRequest....................................59
8.2.2 TransactionReply......................................59
8.2.3 TransactionPending....................................60
8.3 Messages.....................................................61
9. TRANSPORT.....................................................61
9.1 Ordering of Commands.........................................62
9.2 Protection against Restart Avalanche.........................63
10. SECURITY CONSIDERATIONS......................................64
10.1 Protection of Protocol Connections..........................64
10.2 Interim AH scheme...........................................65
10.3 Protection of Media Connections.............................66
11. MG-MGC CONTROL INTERFACE....................................66
11.1 Multiple Virtual MGs........................................67
11.2 Cold Start..................................................68
11.3 Negotiation of Protocol Version.............................68
11.4 Failure of an MG............................................69
11.5 Failure of an MGC...........................................69
12. PACKAGE DEFINITION...........................................70
12.1 Guidelines for defining packages............................71
12.1.1 Package..............................................71
12.1.2 Properties...........................................72
12.1.3 Events...............................................72
12.1.4 Signals..............................................73
12.1.5 Statistics...........................................73
12.1.6 Procedures...........................................73
12.2 Guidelines to defining Properties, Statistics and Parameters
to Events and Signals.......................................73
12.3 Lists.......................................................74
12.4 Identifiers.................................................74
12.5 Package Registration........................................74
13. IANA CONSIDERATIONS.........................................74
13.1 Packages....................................................74
13.2 Error Codes.................................................75
13.3 ServiceChange Reasons.......................................76
ANNEX A: BINARY ENCODING OF THE PROTOCOL (NORMATIVE).............77
A.1 Coding of wildcards..........................................77
A.2 ASN.1 syntax specification...................................78
A.3 Digit maps and path names....................................94
ANNEX B TEXT ENCODING OF THE PROTOCOL (NORMATIVE)................95
B.1 Coding of wildcards..........................................95
Cuervo, et al. Standards Track [Page 3]
^L
RFC 2885 Megaco Protocol August 2000
B.2 ABNF specification...........................................95
ANNEX C TAGS FOR MEDIA STREAM PROPERTIES (NORMATIVE)............107
C.1 General Media Attributes....................................107
C.2 Mux Properties..............................................108
C.3 General bearer properties...................................109
C.4 General ATM properties......................................109
C.5 Frame Relay.................................................112
C.6 IP..........................................................113
C.7 ATM AAL2....................................................113
C.8 ATM AAL1....................................................114
C.9 Bearer Capabilities.........................................116
C.10 AAL5 Properties............................................123
C.11 SDP Equivalents............................................124
C.12 H.245......................................................124
ANNEX D TRANSPORT OVER IP (NORMATIVE)...........................125
D.1 Transport over IP/UDP using Application Level Framing.......125
D.1.1 Providing At-Most-Once Functionality.................125
D.1.2 Transaction identifiers and three-way handshake......126
D.1.2.1 Transaction identifiers....................126
D.1.2.2 Three-way handshake........................126
D.1.3 Computing retransmission timers......................127
D.1.4 Provisional responses................................128
D.1.5 Repeating Requests, Responses and Acknowledgements...128
D.2 using TCP..................................................130
D.2.1 Providing the At-Most-Once functionality..........130
D.2.2 Transaction identifiers and three way handshake...130
D.2.3 Computing retransmission timers...................131
D.2.4 Provisional responses.............................131
D.2.5 Ordering of commands..............................131
ANNEX E BASIC PACKAGES..........................................131
E.1 Generic.....................................................131
E.1.1 Properties...........................................132
E.1.2 Events...............................................132
E.1.3 Signals..............................................133
E.1.4 Statistics...........................................133
E.2 Base Root Package...........................................133
E.2.1 Properties...........................................134
E.2.2 Events...............................................135
E.2.3 Signals..............................................135
E.2.4 Statistics...........................................135
E.2.5 Procedures...........................................135
E.3 Tone Generator Package......................................135
E.3.1 Properties...........................................135
E.3.2 Events...............................................136
E.3.3 Signals..............................................136
E.3.4 Statistics...........................................136
E.3.5 Procedures...........................................136
E.4 Tone Detection Package......................................137
Cuervo, et al. Standards Track [Page 4]
^L
RFC 2885 Megaco Protocol August 2000
E.4.1 Properties...........................................137
E.4.2 Events...............................................137
E.4.3 Signals..............................................139
E.4.4 Statistics...........................................139
E.4.5 Procedures...........................................139
E.5 Basic DTMF Generator Package................................140
E.5.1 Properties...........................................140
E.5.2 Events...............................................140
E.5.3 Signals..............................................140
E.5.4 Statistics...........................................141
E.5.5 Procedures...........................................141
E.6 DTMF detection Package......................................141
E.6.1 Properties...........................................142
E.6.2 Events...............................................142
E.6.3 Signals..............................................143
E.6.4 Statistics...........................................143
E.6.5 Procedures...........................................143
E.7 Call Progress Tones Generator Package.......................143
E.7.1 Properties...........................................144
E.7.2 Events...............................................144
E.7.3 Signals..............................................144
E.7.4 Statistics...........................................145
E.7.5 Procedures...........................................145
E.8 Call Progress Tones Detection Package.......................145
E.8.1 Properties...........................................145
E.8.2 Events...............................................145
E.8.3 Signals..............................................145
E.8.4 Statistics...........................................145
E.8.5 Procedures...........................................146
E.9 Analog Line Supervision Package.............................146
E.9.1 Properties...........................................146
E.9.2 Events...............................................146
E.9.3 Signals..............................................147
E.9.4 Statistics...........................................148
E.9.5 Procedures...........................................148
E.10 Basic Continuity Package...................................148
E.10.1 Properties..........................................148
E.10.2 Events..............................................148
E.10.3 Signals.............................................149
E.10.4 Statistics..........................................150
E.10.5 Procedures..........................................150
E.11 Network Package............................................150
E.11.1 Properties..........................................150
E.11.2 Events..............................................151
E.11.3 Signals.............................................152
E.11.4 Statistics..........................................152
E.11.5 Procedures..........................................153
E.12 RTP Package...............................................153
Cuervo, et al. Standards Track [Page 5]
^L
RFC 2885 Megaco Protocol August 2000
E.12.1 Properties..........................................153
E.12.2 Events..............................................153
E.12.3 Signals.............................................153
E.12.4 Statistics..........................................153
E.12.5 Procedures..........................................154
E.13 TDM Circuit Package........................................154
E.13.1 Properties..........................................155
E.13.2 Events..............................................155
E.13.3 Signals.............................................155
E.13.4 Statistics..........................................156
E.13.5 Procedures..........................................156
APPENDIX A EXAMPLE CALL FLOWS (INFORMATIVE).....................157
A.1 Residential Gateway to Residential Gateway Call.............157
A.1.1 Programming Residential GW Analog Line Terminations for
Idle Behavior..............................................157
A.1.2 Collecting Originator Digits and Initiating Termination
...........................................................159
Authors' Addresses..............................................168
Full Copyright Statement........................................170
1. SCOPE
This document defines the protocol used between elements of a
physically decomposed multimedia gateway. There are no functional
differences from a system view between a decomposed gateway, with
distributed sub-components potentially on more than one physical
device, and a monolithic gateway such as described in H.246. This
recommendation does not define how gateways, multipoint control units
or integrated voice response units (IVRs) work. Instead it creates a
general framework that is suitable for these applications. Packet
network interfaces may include IP, ATM or possibly others. The
interfaces will support a variety of SCN signalling systems,
including tone signalling, ISDN, ISUP, QSIG, and GSM. National
variants of these signalling systems will be supported where
applicable.
The protocol definition in this document is common text with ITU-T
Recommendation H.248. It meets the requirements documented in RFC
2805.
2. REFERENCES
2.1 Normative references
ITU-T Recommendation H.225.0 (1998): "Call Signalling Protocols and
Media Stream Packetization for Packet Based Multimedia Communications
Systems".
Cuervo, et al. Standards Track [Page 6]
^L
RFC 2885 Megaco Protocol August 2000
ITU-T Recommendation H.235 (02/98): "Security and encryption for
H-Series (H.323 and other H.245-based) multimedia terminals".
ITU-T Recommendation H.245 (1998): "Control Protocol for Multimedia
Communication".
ITU-T Recommendation H.323 (1998): "Packet Based Multimedia
Communication Systems".
ITU-T Recommendation I.363.1 (08/96), "B-ISDN ATM Adaptation Layer
specification: Type 1 AAL".
ITU-T Recommendation I.363.2 (09/97), "B-ISDN ATM Adaptation Layer
specification: Type 2 AAL".
ITU-T Recommendation I.363.5 (08/96), "B-ISDN ATM Adaptation Layer
specification: Type 5 AAL".
ITU-T Recommendation I.366.1 (06/98), "Segmentation and Reassembly
Service Specific Convergence Sublayer for the AAL type 2".
ITU-T Recommendation I.366.2 (02/99), "AAL type 2 service specific
convergence sublayer for trunking".
ITU-T Recommendation I.371 (08/96), "Traffic control and congestion
control in B-ISDN".
ITU-T Recommendation Q.763 (09/97), "Signalling System No. 7 - ISDN
user part formats and codes".
ITU-T Recommendation Q.765, "Signalling System No. 7 - Application
transport mechanism".
ITU-T Recommendation Q.931 (05/98): "Digital Subscriber Signalling
System No. 1 (DSS 1) - ISDN User-Network Interface Layer 3
Specification for Basic Call Control".
ITU-T Recommendation Q.2630.1 (1999), "AAL Type 2 Signalling Protocol
(Capability Set 1)".
ITU-T Recommendation Q.2931 (10/95), "Broadband Integrated Services
Digital Network (B-ISDN) - Digital Subscriber Signalling System No.
2 (DSS 2) - User-Network Interface (UNI) - Layer 3 specification for
basic call/connection control".
ITU-T Recommendation Q.2941.1 (09/97), "Digital Subscriber Signalling
System No. 2 - Generic Identifier Transport".
Cuervo, et al. Standards Track [Page 7]
^L
RFC 2885 Megaco Protocol August 2000
ITU-T Recommendation Q.2961 (10/95), "Broadband integrated services
digital network (B-ISDN) - Digital subscriber signalling system no.2
(DSS 2) - additional traffic parameters".
ITU-T Recommendation Q.2961.2 (06/97), "Digital subscriber signalling
system No. 2 - Additional traffic parameters: Support of ATM transfer
capability in the broadband bearer capability information element."
ITU-T Recommendation X.213 (11/1995), "Information technology - Open
System Interconnection - Network service definition plus Amendment 1
(08/1997), Addition of the Internet protocol address format
identifier".
ITU-T Recommendation V.76 (08/96), "Generic multiplexer using V.42
LAPM-based procedures".
ITU-T Recommendation X.680 (1997): "Information technology-Abstract
Syntax Notation One (ASN.1): Specification of basic notation".
ITU-T Recommendation H.246 (1998), "Interworking of H-series
multimedia terminals with H-series multimedia terminals and
voice/voiceband terminals on GSTN and ISDN".
Rose, M. and D. Cass, "ISO Transport Service on top of the TCP,
Version 3", RFC 1006, May 1987.
Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications:
ABNF", RFC 2234, November 1997.
Handley, M. and V. Jacobson, "SDP: Session Description Protocol",
RFC 2327, April 1998.
Kent, S. and R. Atkinson, "IP Authentication Header", RFC 2402,
November 1998.
Kent, S. and R. Atkinson, "IP Encapsulating Security Payload (ESP)",
RFC 2406, November 1998.
2.2 Informative references
ITU-T Recommendation E.180/Q.35 (1998): "Technical characteristics of
tones for the telephone service".
CCITT Recommendation G.711 (1988), "Pulse Code Modulation (PCM) of
voice frequencies".
ITU-T Recommendation H.221 (05/99),"Frame structure for a 64 to 1920
kbit/s channel in audiovisual teleservices".
Cuervo, et al. Standards Track [Page 8]
^L
RFC 2885 Megaco Protocol August 2000
ITU-T Recommendation H.223 (1996), "Multiplexing protocol for low bit
rate multimedia communication".
ITU-T Recommendation Q.724 (1988): "Signalling procedures".
Postel, J., "User Datagram Protocol", STD 6, RFC 768, August 1980.
Postel, J., "Internet protocol", STD 5, RFC 791, September 1981.
Postel, J., "TRANSMISSION CONTROL PROTOCOL", STD 7, RFC 793,
September 1981.
Simpson, W., "The Point-to-Point Protocol", STD 51, RFC 1661, July
1994.
Schulzrinne, H., Casner, S., Frederick, R. and V. Jacobson, "RTP: A
Transport Protocol for Real-Time Applications", RFC 1889, January
1996.
Schulzrinne, H., "RTP Profile for Audio and Video Conferences with
Minimal Control", RFC 1890, January 1996.
Kent, S. and R. Atkinson, "Security Architecture for the Internet
Protocol", RFC 2401, November 1998.
Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6)
Specification", RFC 2460, December 1998.
Handley, M., Schulzrinne, H., Schooler, E. and J. Rosenberg, "SIP:
Session Initiation Protocol", RFC 2543, March 1999.
Greene, N., Ramalho, M. and B. Rosen, "Media Gateway control protocol
architecture and requirements", RFC 2805, April 1999.
3. DEFINITIONS
Access Gateway: A type of gateway that provides a User to Network
Interface (UNI) such as ISDN.
Descriptor: A syntactic element of the protocol that groups related
properties. For instance, the properties of a media flow on the MG
can be set by the MGC by including the appropriate descriptor in a
command.
Media Gateway (MG): The media gateway converts media provided in one
type of network to the format required in another type of network.
For example, a MG could terminate bearer channels from a switched
circuit network (e.g., DS0s) and media streams from a packet network
Cuervo, et al. Standards Track [Page 9]
^L
RFC 2885 Megaco Protocol August 2000
(e.g., RTP streams in an IP network). This gateway may be capable of
processing audio, video and T.120 alone or in any combination, and
will be capable of full duplex media translations. The MG may also
play audio/video messages and performs other IVR functions, or may
perform media conferencing.
Media Gateway Controller (MGC): Controls the parts of the call state
that pertain to connection control for media channels in a MG.
Multipoint Control Unit (MCU): An entity that controls the setup and
coordination of a multi-user conference that typically includes
processing of audio, video and data.
Residential Gateway: A gateway that interworks an analogue line to a
packet network. A residential gateway typically contains one or two
analogue lines and is located at the customer premises.
SCN FAS Signalling Gateway: This function contains the SCN Signalling
Interface that terminates SS7, ISDN or other signalling links where
the call control channel and bearer channels are collocated in the
same physical span.
SCN NFAS Signalling Gateway: This function contains the SCN
Signalling Interface that terminates SS7 or other signalling links
where the call control channels are separated from bearer channels.
Stream: Bidirectional media or control flow received/sent by a media
gateway as part of a call or conference.
Trunk: A communication channel between two switching systems such as
a DS0 on a T1 or E1 line.
Trunking Gateway: A gateway between SCN network and packet network
that typically terminates a large number of digital circuits.
4. ABBREVIATIONS
This recommendation defines the following terms.
ATM Asynchronous Transfer Mode
BRI Basic Rate Interface
CAS Channel Associated Signalling
DTMF Dual Tone Multi-Frequency
FAS Facility Associated Signalling
GW GateWay
IANA Internet Assigned Numbers Authority
IP Internet Protocol
ISUP ISDN User Part
Cuervo, et al. Standards Track [Page 10]
^L
RFC 2885 Megaco Protocol August 2000
MG Media Gateway
MGC Media Gateway Controller
NFAS Non-Facility Associated Signalling
PRI Primary Rate Interface
PSTN Public Switched Telephone Network
QoS Quality of Service
RTP Real-time Transport Protocol
SCN Switched Circuit Network
SG Signalling Gateway
SS7 Signalling System No. 7
5. CONVENTIONS
In this recommendation, "shall" refers to a mandatory requirement,
while "should" refers to a suggested but optional feature or
procedure. The term "may" refers to an optional course of action
without expressing a preference.
6. CONNECTION MODEL
The connection model for the protocol describes the logical entities,
or objects, within the Media Gateway that can be controlled by the
Media Gateway Controller. The main abstractions used in the
connection model are Terminations and Contexts.
A Termination sources and/or sinks one or more streams. In a
multimedia conference, a Termination can be multimedia and sources or
sinks multiple media streams. The media stream parameters, as well
as modem, and bearer parameters are encapsulated within the
Termination.
A Context is an association between a collection of Terminations.
There is a special type of Context, the null Context, which contains
all Terminations that are not associated to any other Termination.
For instance, in a decomposed access gateway, all idle lines are
represented by Terminations in the null Context.
Cuervo, et al. Standards Track [Page 11]
^L
RFC 2885 Megaco Protocol August 2000
+------------------------------------------------------+
|Media Gateway |
| +-------------------------------------------------+ |
| |Context +-------------+ | |
| | | Termination | | |
| | |-------------| | |
| | +-------------+ +->| SCN Bearer |<---+->
| | | Termination | +-----+ | | Channel | | |
| | |-------------| | |---+ +-------------+ | |
<-+--->| RTP Stream |---| * | | |
| | | | | |---+ +-------------+ | |
| | +-------------+ +-----+ | | Termination | | |
| | | |-------------| | |
| | +->| SCN Bearer |<---+->
| | | Channel | | |
| | +-------------+ | |
| +-------------------------------------------------+ |
| |
| |
| +------------------------------+ |
| |Context | |
| +-------------+ | +-------------+ | |
| | Termination | | +-----+ | Termination | | |
| |-------------| | | | |-------------| | |
<-+->| SCN Bearer | | | * |------| SCN Bearer |<---+->
| | Channel | | | | | Channel | | |
| +-------------+ | +-----+ +-------------+ | |
| +------------------------------+ |
| |
| |
| +-------------------------------------------------+ |
| |Context | |
| | +-------------+ +-------------+ | |
| | | Termination | +-----+ | Termination | | |
| | |-------------| | | |-------------| | |
<-+--->| SCN Bearer |---| * |------| SCN Bearer |<---+->
| | | Channel | | | | Channel | | |
| | +-------------+ +-----+ +-------------+ | |
| +-------------------------------------------------+ |
| ___________________________________________________ |
+------------------------------------------------------+
Figure 1: Example of H.248 Connection Model
Cuervo, et al. Standards Track [Page 12]
^L
RFC 2885 Megaco Protocol August 2000
Figure 1 is a graphical depiction of these concepts. The diagram of
Figure 1 gives several examples and is not meant to be an all-
inclusive illustration. The asterisk box in each of the Contexts
represents the logical association of Terminations implied by the
Context.
The example below shows an example of one way to accomplish a call-
waiting scenario in a decomposed access gateway, illustrating the
relocation of a Termination between Contexts. Terminations T1 and
T2 belong to Context C1 in a two-way audio call. A second audio call
is waiting for T1 from Termination T3. T3 is alone in Context C2.
T1 accepts the call from T3, placing T2 on hold. This action results
in T1 moving into Context C2, as shown below.
+------------------------------------------------------+
|Media Gateway |
| +-------------------------------------------------+ |
| |Context C1 | |
| | +-------------+ +-------------+ | |
| | | Term. T2 | +-----+ | Term. T1 | | |
| | |-------------| | | |-------------| | |
<-+--->| RTP Stream |---| * |------| SCN Bearer |<---+->
| | | | | | | Channel | | |
| | +-------------+ +-----+ +-------------+ | |
| +-------------------------------------------------+ |
| |
| +-------------------------------------------------+ |
| |Context C2 | |
| | +-------------+ | |
| | +-----+ | Term. T3 | | |
| | | | |-------------| | |
| | | * |------| SCN Bearer |<---+->
| | | | | Channel | | |
| | +-----+ +-------------+ | |
| +-------------------------------------------------+ |
+------------------------------------------------------+
Figure 2: Example Call Waiting Scenario / Alerting Applied to T1
Cuervo, et al. Standards Track [Page 13]
^L
RFC 2885 Megaco Protocol August 2000
+------------------------------------------------------+
|Media Gateway |
| +-------------------------------------------------+ |
| |Context C1 | |
| | +-------------+ | |
| | | Term. T2 | +-----+ | |
| | |-------------| | | | |
<-+--->| RTP Stream |---| * | | |
| | | | | | | |
| | +-------------+ +-----+ | |
| +-------------------------------------------------+ |
| |
| +-------------------------------------------------+ |
| |Context C2 | |
| | +-------------+ +-------------+ | |
| | | Term. T1 | +-----+ | Term. T3 | | |
| | |-------------| | | |-------------| | |
<-+--->| SCN Bearer |---| * |------| SCN Bearer |<---+->
| | | Channel | | | | Channel | | |
| | +-------------+ +-----+ +-------------+ | |
| +-------------------------------------------------+ |
+------------------------------------------------------+
Figure 3. Example Call Waiting Scenario / Answer by T1
6.1 Contexts
A Context is an association between a number of Terminations. The
Context describes the topology (who hears/sees whom) and the media
mixing and/or switching parameters if more than two Terminations are
involved in the association.
There is a special Context called the null Context. It contains
Terminations that are not associated to any other Termination.
Terminations in the null Context can have their parameters examined
or modified, and may have events detected on them.
In general, an Add command is used to add Terminations to Contexts.
If the MGC does not specify an existing Context to which the
Termination is to be added, the MG creates a new Context. A
Termination may be removed from a Context with a Subtract command,
and a Termination may be moved from one Context to another with a
Move command. A Termination SHALL exist in only one Context at a
time.
Cuervo, et al. Standards Track [Page 14]
^L
RFC 2885 Megaco Protocol August 2000
The maximum number of Terminations in a Context is a MG property.
Media gateways that offer only point-to-point connectivity might
allow at most two Terminations per Context. Media gateways that
support multipoint conferences might allow three or more terminations
per Context.
6.1.1 Context Attributes and Descriptors
The attributes of Contexts are:
. ContextID.
. The topology (who hears/sees whom). The topology of a Context
describes the flow of media between the Terminations within a
Context. In contrast, the mode of a Termination (send/receive/_)
describes the flow of the media at the ingress/egress of the
media gateway.
. The priority is used for a context in order to provide the MG
with information about a certain precedence handling for a
context. The MGC can also use the priority to control
autonomously the traffic precedence in the MG in a smooth way in
certain situations (e.g. restart), when a lot of contexts must
be handled simultaneously.
. An indicator for an emergency call is also provided to allow a
preference handling in the MG.
6.1.2 Creating, Deleting and Modifying Contexts
The protocol can be used to (implicitly) create Contexts and modify
the parameter values of existing Contexts. The protocol has commands
to add Terminations to Contexts, subtract them from Contexts, and to
move Terminations between Contexts. Contexts are deleted implicitly
when the last remaining Termination is subtracted or moved out.
6.2 Terminations
A Termination is a logical entity on a MG that sources and/or sinks
media and/or control streams. A Termination is described by a number
of characterizing Properties, which are grouped in a set of
Descriptors that are included in commands. Terminations have unique
identities (TerminationIDs), assigned by the MG at the time of their
creation.
Terminations representing physical entities have a semi-permanent
existence. For example, a Termination representing a TDM channel
might exist for as long as it is provisioned in the gateway.
Cuervo, et al. Standards Track [Page 15]
^L
RFC 2885 Megaco Protocol August 2000
Terminations representing ephemeral information flows, such as RTP
flows, would usually exist only for the duration of their use.
Ephemeral Terminations are created by means of an Add command. They
are destroyed by means of a Subtract command. In contrast, when a
physical Termination is Added to or Subtracted from a Context, it is
taken from or to the null Context, respectively.
Terminations may have signals applied to them. Signals are MG
generated media streams such as tones and announcements as well as
line signals such as hookswitch. Terminations may be programmed to
detect Events, the occurrence of which can trigger notification
messages to the MGC, or action by the MG. Statistics may be
accumulated on a Termination. Statistics are reported to the MGC
upon request (by means of the AuditValue command, see section 7.2.5)
and when the Termination is taken out of the call it is in.
Multimedia gateways may process multiplexed media streams. For
example, Recommendation H.221 describes a frame structure for
multiple media streams multiplexed on a number of digital 64 kbit/s
channels. Such a case is handled in the connection model in the
following way. For every bearer channel that carries part of the
multiplexed streams, there is a Termination. The Terminations that
source/sink the digital channels are connected to a separate
Termination called the multiplexing Termination. This Termination
describes the multiplex used (e.g. how the H.221 frames are carried
over the digital channels used). The MuxDescriptor is used to this
end. If multiple media are carried, this Termination contains
multiple StreamDescriptors. The media streams can be associated with
streams sourced/sunk by other Terminations in the Context.
Terminations may be created which represent multiplexed bearers, such
as an ATM AAL2. When a new multiplexed bearer is to be created, an
ephemeral termination is created in a context established for this
purpose. When the termination is subtracted, the multiplexed bearer
is destroyed.
6.2.1 Termination Dynamics
The protocol can be used to create new Terminations and to modify
property values of existing Terminations. These modifications
include the possibility of adding or removing events and/or signals.
The Termination properties, and events and signals are described in
the ensuing sections. An MGC can only release/modify terminations and
the resources that the termination represents which it has previously
seized via, e.g., the Add command.
Cuervo, et al. Standards Track [Page 16]
^L
RFC 2885 Megaco Protocol August 2000
6.2.2 TerminationIDs
Terminations are referenced by a TerminationID, which is an arbitrary
schema chosen by the MG.
TerminationIDs of physical Terminations are provisioned in the Media
Gateway. The TerminationIDs may be chosen to have structure. For
instance, a TerminationID may consist of trunk group and a trunk
within the group.
A wildcarding mechanism using two types of wildcards can be used with
TerminationIDs. The two wildcards are ALL and CHOOSE. The former is
used to address multiple Terminations at once, while the latter is
used to indicate to a media gateway that it must select a Termination
satisfying the partially specified TerminationID. This allows, for
instance, that a MGC instructs a MG to choose a circuit within a
trunk group.
When ALL is used in the TerminationID of a command, the effect is
identical to repeating the command with each of the matching
TerminationIDs. Since each of these commands may generate a
response, the size of the entire response may be large. If
individual responses are not required, a wildcard response may be
requested. In such a case, a single response is generated, which
contains the UNION of all of the individual responses which otherwise
would have been generated, with duplicate values suppressed.
Wildcard response may be particularly useful in the Audit commands.
The encoding of the wildcarding mechanism is detailed in Annexes A
and B.
6.2.3 Packages
Different types of gateways may implement Terminations that have
widely differing characteristics. Variations in Terminations are
accommodated in the protocol by allowing Terminations to have
optional Properties, Events, Signals and Statistics implemented by
MGs.
In order to achieve MG/MGC interoperability, such options are grouped
into Packages, and a Termination realizes a set of such Packages.
More information on definition of packages can be found in section
12. An MGC can audit a Termination to determine which Packages it
realizes.
Properties, Events, Signals and Statistics defined in Packages, as
well as parameters to them, are referenced by identifiers (Ids).
Identifiers are scoped. For each package, PropertyIds, EventIds,
Cuervo, et al. Standards Track [Page 17]
^L
RFC 2885 Megaco Protocol August 2000
SignalIds, StatisticsIds and ParameterIds have unique name spaces and
the same identifier may be used in each of them. Two PropertyIds in
different packages may also have the same identifier, etc.
6.2.4 Termination Properties and Descriptors
Terminations have properties. The properties have unique
PropertyIDs. Most properties have default values. When a
Termination is created, properties get their default values, unless
the controller specifically sets a different value. The default
value of a property of a physical Termination can be changed by
setting it to a different value when the Termination is in the null
Context. Every time such a Termination returns to the null Context,
the values of its properties are reset to this default value.
There are a number of common properties for Terminations and
properties specific to media streams. The common properties are also
called the termination state properties. For each media stream,
there are local properties and properties of the received and
transmitted flows.
Properties not included in the base protocol are defined in Packages.
These properties are referred to by a name consisting of the
PackageName and a PropertyId. Most properties have default values
described in the Package description. Properties may be read- only or
read/write. The possible values of a property may be audited, as can
their current values. For properties that are read/write, the MGC
can set their values. A property may be declared as "Global" which
has a single value shared by all terminations realizing the package.
Related properties are grouped into descriptors for convenience.
When a Termination is Added to a Context, the value of its read/write
properties can be set by including the appropriate descriptors as
parameters to the Add command. Properties not mentioned in the
command retain their prior values. Similarly, a property of a
Termination in a Context may have its value changed by the Modify
command. Properties not mentioned in the Modify command retain their
prior values. Properties may also have their values changed when a
Termination is moved from one Context to another as a result of a
Move command. In some cases, descriptors are returned as output from
a command.
The following table lists all of the possible Descriptors and their
use. Not all descriptors are legal as input or output parameters to
every command.
Cuervo, et al. Standards Track [Page 18]
^L
RFC 2885 Megaco Protocol August 2000
Descriptor Name Description
Modem Identifies modem type and properties when
applicable.
Mux Describes multiplex type for multimedia
terminations (e.g. H.221, H.223, H.225.0)
and Terminations forming the input mux.
Media A list of media stream specifications (see
7.1.4).
TerminationState Properties of a Termination (which can be
defined in Packages) that are not stream
specific.
Stream A list of remote/local/localControl
descriptors for a single stream.
Local Contains properties that specify the media
flows that the MG receives from the remote
entity.
Remote Contains properties that specify the media
flows that the MG sends to the remote
entity.
LocalControl Contains properties (which can be defined
in packages) that are of interest between
the MG and the MGC.
Events Describes events to be detected by the MG
and what to do when an event is detected.
EventBuffer Describes events to be detected by the MG
when Event Buffering is active.
Signals Describes signals and/or actions to be
applied (e.g. Busy Tone) to the
Terminations.
Audit In Audit commands, identifies which
information is desired.
Packages In AuditValue, returns a list of Packages
realized by Termination.
DigitMap Instructions for handling DTMF tones at
the MG.
ServiceChange In ServiceChange, what, why service change
occurred, etc.
ObservedEvents In Notify or AuditValue, report of events
observed.
Statistics In Subtract and Audit, Report of
Statistics kept on a Termination.
Cuervo, et al. Standards Track [Page 19]
^L
RFC 2885 Megaco Protocol August 2000
6.2.5 Root Termination
Occasionally, a command must refer to the entire gateway, rather than
a termination within it. A special TerminationID, "Root" is reserved
for this purpose. Packages may be defined on Root. Root thus may
have properties and events (signals are not appropriate for root).
Accordingly, the root TerminationID may appear in:
. a Modify command - to change a property or set an event
. a Notify command - to report an event
. an AuditValue return - to examine the values of properties
implemented on root
. an AuditCapability - to determine what properties of root are
implemented
. a ServiceChange - to declare the gateway in or out of service.
Any other use of the root TerminationID is an error.
7. COMMANDS
The protocol provides commands for manipulating the logical entities
of the protocol connection model, Contexts and Terminations.
Commands provide control at the finest level of granularity supported
by the protocol. For example, Commands exist to add Terminations to
a Context, modify Terminations, subtract Terminations from a Context,
and audit properties of Contexts or Terminations. Commands provide
for complete control of the properties of Contexts and Terminations.
This includes specifying which events a Termination is to report,
which signals/actions are to be applied to a Termination and
specifying the topology of a Context (who hears/sees whom).
Most commands are for the specific use of the Media Gateway
Controller as command initiator in controlling Media Gateways as
command responders. The exceptions are the Notify and ServiceChange
commands: Notify is sent from Media Gateway to Media Gateway
Controller, and ServiceChange may be sent by either entity. Below is
an overview of the commands; they are explained in more detail in
section 7.2.
1. Add. The Add command adds a termination to a context. The Add
command on the first Termination in a Context is used to create a
Context.
2. Modify. The Modify command modifies the properties, events and
signals of a termination.
Cuervo, et al. Standards Track [Page 20]
^L
RFC 2885 Megaco Protocol August 2000
3. Subtract. The Subtract command disconnects a Termination from its
Context and returns statistics on the Termination's participation
in the Context. The Subtract command on the last Termination in a
Context deletes the Context.
4. Move. The Move command atomically moves a Termination to another
context.
5. AuditValue. The AuditValue command returns the current state of
properties, events, signals and statistics of Terminations.
6. AuditCapabilities. The AuditCapabilities command returns all the
possible values for Termination properties, events and signals
allowed by the Media Gateway.
7. Notify. The Notify command allows the Media Gateway to inform the
Media Gateway Controller of the occurrence of events in the Media
Gateway.
8. ServiceChange. The ServiceChange Command allows the Media Gateway
to notify the Media Gateway Controller that a Termination or group
of Terminations is about to be taken out of service or has just
been returned to service. ServiceChange is also used by the MG
to announce its availability to an MGC (registration), and to
notify the MGC of impending or completed restart of the MG. The
MGC may announce a handover to the MG by sending it a
ServiceChange command. The MGC may also use ServiceChange to
instruct the MG to take a Termination or group of Terminations in
or out of service.
These commands are detailed in sections 7.2.1 through 7.2.8
7.1 Descriptors
The parameters to a command are termed Descriptors. A Descriptor
consists of a name and a list of items. Some items may have values.
Many Commands share common Descriptors. This subsection enumerates
these Descriptors. Descriptors may be returned as output from a
command. Parameters and parameter usage specific to a given Command
type are described in the subsection that describes the Command.
7.1.1 Specifying Parameters
Command parameters are structured into a number of descriptors. In
general, the text format of descriptors is
DescriptorName=<someID>{parm=value, parm=value_.}.
Cuervo, et al. Standards Track [Page 21]
^L
RFC 2885 Megaco Protocol August 2000
Parameters may be fully specified, over-specified or under-specified:
1. Fully specified parameters have a single, unambiguous value that
the command initiator is instructing the command responder to use
for the specified parameter.
2. Under-specified parameters, using the CHOOSE value, allow the
command responder to choose any value it can support.
3. Over-specified parameters have a list of potential values. The
list order specifies the command initiator's order of preference
of selection. The command responder chooses one value from the
offered list and returns that value to the command initiator.
Unspecified mandatory parameters (i.e. mandatory parameters not
specified in a descriptor) result in the command responder retaining
the previous value for that parameter. Unspecified optional
parameters result in the command responder using the default value of
the parameter. Whenever a parameter is underspecified or
overspecified, the descriptor containing the value chosen by the
responder is included as output from the command.
Each command specifies the TerminationId the command operates on.
This TerminationId may be "wildcarded". When the TerminationId of a
command is wildcarded, the effect shall be as if the command was
repeated with each of the TerminationIds matched.
7.1.2 Modem Descriptor
The Modem descriptor specifies the modem type and parameters, if any,
required for use in e.g. H.324 and text conversation. The descriptor
includes the following modem types: V.18, V.22, V.22bis, V.32,
V.32bis, V.34, V.90, V.91, Synchronous ISDN, and allows for
extensions. By default, no modem descriptor is present in a
Termination.
7.1.3 Multiplex Descriptor
In multimedia calls, a number of media streams are carried on a
(possibly different) number of bearers. The multiplex descriptor
associates the media and the bearers. The descriptor includes the
multiplex type:
. H.221
. H.223,
. H.226,
. V.76,
. Possible Extensions
Cuervo, et al. Standards Track [Page 22]
^L
RFC 2885 Megaco Protocol August 2000
and a set of TerminationIDs representing the multiplexed inputs, in
order. For example:
Mux = H.221{ MyT3/1/2, MyT3/2/13, MyT3/3/6, MyT3/21/22}
7.1.4 Media Descriptor
The Media Descriptor specifies the parameters for all the media
streams. These parameters are structured into two descriptors, a
Termination State Descriptor, which specifies the properties of a
termination that are not stream dependent, and one or more Stream
Descriptors each of which describes a single media stream.
A stream is identified by a StreamID. The StreamID is used to link
the streams in a Context that belong together. Multiple streams
exiting a termination shall be synchronized with each other. Within
the Stream Descriptor, there are up to three subsidiary descriptors,
LocalControl, Local, and Remote. The relationship between these
descriptors is thus:
Media Descriptor
TerminationStateDescriptor
Stream Descriptor
LocalControl Descriptor
Local Descriptor
Remote Descriptor
As a convenience a LocalControl, Local, or Remote descriptor may be
included in the Media Descriptor without an enclosing Stream
descriptor. In this case, the StreamID is assumed to be 1.
7.1.5 Termination State Descriptor
The Termination State Descriptor contains the ServiceStates property,
the EventBufferControl property and properties of a termination
(defined in Packages) that are not stream specific.
The ServiceStates property describes the overall state of the
termination (not stream-specific). A Termination can be in one of
the following states: "test", "out of service", or "in service". The
"test" state indicates that the termination is being tested. The
state "out of service" indicates that the termination cannot be used
for traffic. The state "in service" indicates that a termination can
be used or is being used for normal traffic. "in service" is the
default state.
Cuervo, et al. Standards Track [Page 23]
^L
RFC 2885 Megaco Protocol August 2000
Values assigned to Properties may be simple values
(integer/string/enumeration) or may be underspecified, where more
than one value is supplied and the MG may make a choice:
. Alternative Values: multiple values in a list, one of which must
be selected
. Ranges: minimum and maximum values, any value between min and max
must be selected, boundary values included
. Greater Than/Less Than: value must be greater/less than specified
value
. CHOOSE Wildcard: the MG chooses from the allowed values for the
property
The EventBufferControl property specifies whether events are
buffered following detection of an event in the Events Descriptor, or
processed immediately. See section 7.1.9 for details.
7.1.6 Stream Descriptor
A Stream descriptor specifies the parameters of a single bi-
directional stream. These parameters are structured into three
descriptors: one that contains termination properties specific to a
stream and one each for local and remote flows. The Stream Descriptor
includes a StreamID which identifies the stream. Streams are created
by specifying a new StreamID on one of the terminations in a Context.
A stream is deleted by setting empty Local and Remote descriptors for
the stream with ReserveGroup and ReserveValue in LocalControl set to
"false" on all terminations in the context that previously supported
that stream.
StreamIDs are of local significance between MGC and MG and they are
assigned by the MGC. Within a context, StreamID is a means by which
to indicate which media flows are interconnected: streams with the
same StreamID are connected.
If a termination is moved from one context to another, the effect on
the context to which the termination is moved is the same as in the
case that a new termination were added with the same StreamIDs as the
moved termination.
7.1.7 LocalControl Descriptor
The LocalControl Descriptor contains the Mode property, the
ReserveGroup and ReserveValue properties and properties of a
termination (defined in Packages) that are stream specific, and are
of interest between the MG and the MGC. Values of properties may be
underspecified as in section 7.1.1.
Cuervo, et al. Standards Track [Page 24]
^L
RFC 2885 Megaco Protocol August 2000
The allowed values for the mode property are send-only, receive-only,
send/receive, inactive and loop-back. "Send" and "receive" are with
respect to the exterior of the context, so that, for example, a
stream set to mode=sendonly does not pass received media into the
context. Signals and Events are not affected by mode.
The boolean-valued Reserve properties, ReserveValue and ReserveGroup,
of a Termination indicate what the MG is expected to do when it
receives a local and/or remote descriptor.
If the value of a Reserve property is True, the MG SHALL reserve
resources for all alternatives specified in the local and/or remote
descriptors for which it currently has resources available. It SHALL
respond with the alternatives for which it reserves resources. If it
cannot not support any of the alternatives, it SHALL respond with a
reply to the MGC that contains empty local and/or remote descriptors.
If the value of a Reserve property is False, the MG SHALL choose one
of the alternatives specified in the local descriptor (if present)
and one of the alternatives specified in the remote descriptor (if
present). If the MG has not yet reserved resources to support the
selected alternative, it SHALL reserve the resources. If, on the
other hand, it already reserved resources for the Termination
addressed (because of a prior exchange with ReserveValue and/or
ReserveGroup equal to True), it SHALL release any excess resources it
reserved previously. Finally, the MG shall send a reply to the MGC
containing the alternatives for the local and/or remote descriptor
that it selected. If the MG does not have sufficient resources to
support any of the alternatives specified, is SHALL respond with
error 510 (insufficient resources).
The default value of ReserveValue and ReserveGroup is False.
A new setting of the LocalControl Descriptor completely replaces the
previous setting of that descriptor in the MG. Thus to retain
information from the previous setting the MGC must include that
information in the new setting. If the MGC wishes to delete some
information from the existing descriptor, it merely resends the
descriptor (in a Modify command) with the unwanted information
stripped out.
7.1.8 Local and Remote Descriptors
The MGC uses Local and Remote descriptors to reserve and commit MG
resources for media decoding and encoding for the given Stream(s) and
Termination to which they apply. The MG includes these descriptors
in its response to indicate what it is actually prepared to support.
The MG SHALL include additional properties and their values in its
Cuervo, et al. Standards Track [Page 25]
^L
RFC 2885 Megaco Protocol August 2000
response if these properties are mandatory yet not present in the
requests made by the MGC (e.g., by specifying detailed video encoding
parameters where the MGC only specified the payload type).
Local refers to the media received by the MG and Remote refers to the
media sent by the MG.
When text encoding the protocol, the descriptors consist of session
descriptions as defined in SDP (RFC2327). In session descriptions
sent from the MGC to the MG, the following exceptions to the syntax
of RFC 2327 are allowed:
. the "s=", "t=" and "o=" lines are optional,
. the use of CHOOSE is allowed in place of a single parameter
value, and
. the use of alternatives is allowed in place of a single parameter
value.
When multiple session descriptions are provided in one descriptor,
the "v=" lines are required as delimiters; otherwise they are
optional in session descriptions sent to the MG. Implementations
shall accept session descriptions that are fully conformant to
RFC2327. When binary encoding the protocol the descriptor consists of
groups of properties (tag-value pairs) as specified in Annex C. Each
such group may contain the parameters of a session description.
Below, the semantics of the local and remote descriptors are
specified in detail. The specification consists of two parts. The
first part specifies the interpretation of the contents of the
descriptor. The second part specifies the actions the MG must take
upon receiving the local and remote descriptors. The actions to be
taken by the MG depend on the values of the ReserveValue and
ReserveGroup properties of the LocalControl descriptor.
Either the local or the remote descriptor or both may be
. unspecified (i.e., absent),
. empty,
. underspecified through use of CHOOSE in a property value,
. fully specified, or
. overspecified through presentation of multiple groups of
properties and possibly multiple property values in one or more
of these groups.
Where the descriptors have been passed from the MGC to the MG, they
are interpreted according to the rules given in section 7.1.1, with
the following additional comments for clarification:
Cuervo, et al. Standards Track [Page 26]
^L
RFC 2885 Megaco Protocol August 2000
(a) An unspecified Local or Remote descriptor is considered to be a
missing mandatory parameter. It requires the MG to use whatever was
last specified for that descriptor. It is possible that there was no
previously-specified value, in which case the descriptor concerned is
ignored in further processing of the command.
(b) An empty Local (Remote) descriptor in a message from the MGC
signifies a request to release any resources reserved for the media
flow received (sent).
(c) If multiple groups of properties are present in a Local or Remote
descriptor or multiple values within a group, the order of preference
is descending.
(d) Underspecified or overspecified properties within a group of
properties sent by the MGC are requests for the MG to choose one or
more values which it can support for each of those properties. In
case of an overspecified property, the list of values is in
descending order of preference.
Subject to the above rules, subsequent action depends on the values
of the ReserveValue and ReserveGroup properties in LocalControl.
If ReserveGroup is true, the MG reserves the resources required to
support any of the requested property group alternatives that it can
currently support. If ReserveValue is true, the MG reserves the
resources required to support any of the requested property value
alternatives that it can currently support.
NOTE - If a Local or Remote descriptor contains multiple groups of
properties, and ReserveGroup is true, then the MG is requested to
reserve resources so that it can decode or encode the media stream
according to any of the alternatives. For instance, if the Local
descriptor contains two groups of properties, one specifying
packetized G.711 A-law audio and the other G.723.1 audio, the MG
reserves resources so that it can decode one audio stream encoded in
either G.711 A-law format or G.723.1 format. The MG does not have to
reserve resources to decode two audio streams simultaneously, one
encoded in G.711 A-law and one in G.723.1. The intention for the use
of ReserveValue is analogous.
If ReserveGroup is true or ReserveValue is true, then the following
rules apply.
. If the MG has insufficient resources to support all alternatives
requested by the MGC and the MGC requested resources in both
Local and Remote, the MG should reserve resources to support at
least one alternative each within Local and Remote.
Cuervo, et al. Standards Track [Page 27]
^L
RFC 2885 Megaco Protocol August 2000
. If the MG has insufficient resources to support at least one
alternative within a Local (Remote) descriptor received from
the MGC, it shall return an empty Local (Remote) in response.
. In its response to the MGC, when the MGC included Local and
Remote descriptors, the MG SHALL include Local and Remote
descriptors for all groups of properties and property values it
reserved resources for. If the MG is incapable of supporting at
least one of the alternatives within the Local (Remote)
descriptor received from the MGC, it SHALL return an empty Local
(Remote) descriptor.
. If the Mode property of the LocalControl descriptor is RecvOnly
or SendRecv, the MG must be prepared to receive media encoded
according to any of the alternatives included in its response to
the MGC.
. If ReserveGroup is False and ReserveValue is false, then the MG
SHOULD apply the following rules to resolve Local and Remote to a
single alternative each:
. The MG chooses the first alternative in Local for which it is
able to support at least one alternative in Remote.
. If the MG is unable to support at least one Local and one Remote
alternative, it returns Error 510 (Insufficient Resources).
. The MG returns its selected alternative in each of Local and
Remote.
A new setting of a Local or Remote Descriptor completely replaces the
previous setting of that descriptor in the MG. Thus to retain
information from the previous setting the MGC must include that
information in the new setting. If the MGC wishes to delete some
information from the existing descriptor, it merely resends the
descriptor (in a Modify command) with the unwanted information
stripped out.
7.1.9 Events Descriptor
The EventsDescriptor parameter contains a RequestIdentifier and a
list of events that the Media Gateway is requested to detect and
report. The RequestIdentifier is used to correlate the request with
the notifications that it may trigger. Requested events include, for
example, fax tones, continuity test results, and on-hook and off-hook
transitions.
Cuervo, et al. Standards Track [Page 28]
^L
RFC 2885 Megaco Protocol August 2000
Each event in the descriptor contains the Event name, an optional
streamID, an optional KeepActive flag, and optional parameters. The
Event name consists of a Package Name (where the event is defined)
and an EventID. The ALL wildcard may be used for the EventID,
indicating that all events from the specified package have to be
detected. The default streamID is 0, indicating that the event to be
detected is not related to a particular media stream. Events can
have parameters. This allows a single event description to have some
variation in meaning without creating large numbers of individual
events. Further event parameters are defined in the package.
The default action of the MG, when it detects an event in the Events
Descriptor, is to send a Notify command to the MG. Any other action
is for further study.
If the value of the EventBufferControl property equals LockStep,
following detection of such an event, normal handling of events is
suspended. Any event which is subsequently detected and occurs in the
EventBuffer Descriptor is added to the end of the EventBuffer (a FIFO
queue), along with the time that it was detected. The MG SHALL wait
for a new EventsDescriptor to be loaded. A new EventsDescriptor can
be loaded either as the result of receiving a command with a new
EventsDescriptor, or by activating an embedded EventsDescriptor.
If EventBufferControl equals Off, the MG continues processing based
on the active EventsDescriptor.
In the case that an embedded EventsDescriptor being activated, the MG
continues event processing based on the newly activated
EventsDescriptor (Note - for purposes of EventBuffer handling,
activation of an embedded EventsDescriptor is equivalent to receipt
of a new EventsDescriptor).
When the MG receives a command with a new EventsDescriptor, one or
more events may have been buffered in the EventBuffer in the MG. The
value of EventBufferControl then determines how the MG treats such
buffered events.
Case 1
If EventBufferControl = LockStep and the MG receives a new
EventsDescriptor it will check the FIFO EventBuffer and take the
following actions:
1. If the EventBuffer is empty, the MG waits for detection of events
based on the new EventsDescriptor.
Cuervo, et al. Standards Track [Page 29]
^L
RFC 2885 Megaco Protocol August 2000
2. If the EventBuffer is non-empty, the MG processes the FIFO queue
starting with the first event:
a) If the event in the queue is in the events listed in the new
EventsDescriptor, the default action of the MG is to send a
Notify command to the MGC and remove the event from the
EventBuffer. Any other action is for further study. The time
stamp of the Notify shall be the time the event was actually
detected. The MG then waits for a new EventsDescriptor. While
waiting for a new EventsDescriptor, any events matching the
EventsBufferDescriptor will be placed in the EventBuffer and
the event processing will repeat from step 1.
b) If the event is not in the new EventsDescriptor, the MG
SHALL discard the event and repeat from step 1.
Case 2
If EventBufferControl equals Off and the MG receives a new
EventsDescriptor, it processes new events with the new
EventsDescriptor.
If the MG receives a command instructing it to set the value of
EventBufferControl to Off, all events in the EventBuffer SHALL be
discarded.
The MG may report several events in a single Transaction as long as
this does not unnecessarily delay the reporting of individual events.
For procedures regarding transmitting the Notify command, refer to
the appropriate annex for specific transport considerations.
The default value of EventBufferControl is Off.
Note - Since the EventBufferControl property is in the
TerminationStateDescriptor, the MG might receive a command that
changes the EventBufferControl property and does not include an
EventsDescriptor.
Normally, detection of an event shall cause any active signals to
stop. When KeepActive is specified in the event, the MG shall not
interrupt any signals active on the Termination on which the event is
detected.
An event can include an Embedded Signals descriptor and/or an
Embedded Events Descriptor which, if present, replaces the current
Signals/Events descriptor when the event is detected. It is
possible, for example, to specify that the dial-tone Signal be
Cuervo, et al. Standards Track [Page 30]
^L
RFC 2885 Megaco Protocol August 2000
generated when an off-hook Event is detected, or that the dial-tone
Signal be stopped when a digit is detected. A media gateway
controller shall not send EventsDescriptors with an event both marked
KeepActive and containing an embedded SignalsDescriptor.
Only one level of embedding is permitted. An embedded
EventsDescriptor SHALL NOT contain another embedded EventsDescriptor;
an embedded EventsDescriptor may contain an embedded
SignalsDescriptor.
An EventsDescriptor received by a media gateway replaces any previous
Events Descriptor. Event notification in process shall complete, and
events detected after the command containing the new EventsDescriptor
executes, shall be processed according to the new EventsDescriptor.
7.1.10 EventBuffer Descriptor
The EventBuffer Descriptor contains a list of events, with their
parameters if any, that the MG is requested to detect and buffer when
EventBufferControl equals LockStep (see 7.1.9).
7.1.11 Signals Descriptor
A SignalsDescriptor is a parameter that contains the set of signals
that the Media Gateway is asked to apply to a Termination. A
SignalsDescriptor contains a number of signals and/or sequential
signal lists. A SignalsDescriptor may contain zero signals and
sequential signal lists. Support of sequential signal lists is
optional.
Signals are defined in packages. Signals shall be named with a
Package name (in which the signal is defined) and a SignalID. No
wildcard shall be used in the SignalID. Signals that occur in a
SignalsDescriptor have an optional StreamID parameter (default is 0,
to indicate that the signal is not related to a particular media
stream), an optional signal type (see below), an optional duration
and possibly parameters defined in the package that defines the
signal. This allows a single signal to have some variation in
meaning, obviating the need to create large numbers of individual
signals. Finally, the optional parameter "notifyCompletion" allows a
MGC to indicate that it wishes to be notified when the signal
finishes playout. When the MGC enables the signal completion event
(see section E.1.2) in an Events Descriptor, that event is detected
whenever a signal terminates and "notifyCompletion" for that signal
is set to TRUE. The signal completion event of section E.1.2 has a
parameter that indicates how the signal terminated: it played to
Cuervo, et al. Standards Track [Page 31]
^L
RFC 2885 Megaco Protocol August 2000
completion, it was interrupted by an event, it was halted because a
new SignalsDescriptor arrived, or the signal did not complete for
some other reason.
The duration is an integer value that is expressed in hundredths of a
second.
There are three types of signals:
. on/off - the signal lasts until it is turned off,
. timeout - the signal lasts until it is turned off or a specific
period of time elapses,
. brief - the signal duration is so short that it will stop on its
own unless a new signal is applied that causes it to stop; no
timeout value is needed.
If the signal type is specified in a SignalsDescriptor, it overrides
the default signal type (see Section 12.1.4). If duration is
specified for an on/off signal, it SHALL be ignored.
A sequential signal list consists of a signal list identifier, a
sequence of signals to be played sequentially, and a signal type.
Only the trailing element of the sequence of signals in a sequential
signal list may be an on/off signal. If the trailing element of the
sequence is an on/off signal, the signal type of the sequential
signal list shall be on/off as well. If the sequence of signals in a
sequential signal list contains signals of type timeout and the
trailing element is not of type on/off, the type of the sequential
signal list SHALL be set to timeout. The duration of a sequential
signal list with type timeout is the sum of the durations of the
signals it contains. If the sequence of signals in a sequential
signal list contains only signals of type brief, the type of the
sequential signal list SHALL be set to brief. A signal list is
treated as a single signal of the specified type when played out.
Multiple signals and sequential signal lists in the same
SignalsDescriptor shall be played simultaneously.
Signals are defined as proceeding from the termination towards the
exterior of the Context unless otherwise specified in a package.
When the same Signal is applied to multiple Terminations within one
Transaction, the MG should consider using the same resource to
generate these Signals.
Production of a Signal on a Termination is stopped by application of
a new SignalsDescriptor, or detection of an Event on the Termination
(see section 7.1.9).
Cuervo, et al. Standards Track [Page 32]
^L
RFC 2885 Megaco Protocol August 2000
A new SignalsDescriptor replaces any existing SignalsDescriptor. Any
signals applied to the Termination not in the replacement descriptor
shall be stopped, and new signals are applied, except as follows.
Signals present in the replacement descriptor and containing the
KeepActive flagshall be continued if they are currently playing and
have not already completed. If a replacement signal descriptor
contains a signal that is not currently playing and contains the
KeepActive flag, that signal SHALL be ignored. If the replacement
descriptor contains a sequential signal list with the same identifier
as the existing descriptor, then
. the signal type and sequence of signals in the sequential signal
list in the replacement descriptor shall be ignored, and
. the playing of the signals in the sequential signal list in the
existing descriptor shall not be interrupted.
7.1.12 Audit Descriptor
The Audit Descriptor specifies what information is to be audited.
The Audit Descriptor specifies the list of descriptors to be
returned. Audit may be used in any command to force the return of a
descriptor even if the descriptor in the command was not present, or
had no underspecified parameters. Possible items in the Audit
Descriptor are:
Modem
Mux
Events
Media
Signals
ObservedEvents
DigitMap
Statistics
Packages
EventBuffer
Audit may be empty, in which case, no descriptors are returned. This
is useful in Subtract, to inhibit return of statistics, especially
when using wildcard.
7.1.13 ServiceChange Descriptor
The ServiceChangeDescriptor contains the following parameters:
. ServiceChangeMethod
. ServiceChangeReason
. ServiceChangeAddress
Cuervo, et al. Standards Track [Page 33]
^L
RFC 2885 Megaco Protocol August 2000
. ServiceChangeDelay
. ServiceChangeProfile
. ServiceChangeVersion
. ServiceChangeMGCId
. TimeStamp
See section 7.2.8.
7.1.14 DigitMap Descriptor
A DigitMap is a dialing plan resident in the Media Gateway used for
detecting and reporting digit events received on a Termination. The
DigitMap Descriptor contains a DigitMap name and the DigitMap to be
assigned. A digit map may be preloaded into the MG by management
action and referenced by name in an EventsDescriptor, may be defined
dynamically and subsequently referenced by name, or the actual
digitmap itself may be specified in the EventsDescriptor. It is
permissible for a digit map completion event within an Events
Descriptor to refer by name to a DigitMap which is defined by a
DigitMap Descriptor within the same command, regardless of the
transmitted order of the respective descriptors.
DigitMaps defined in a DigitMapDescriptor can occur in any of the
standard Termination manipulation Commands of the protocol. A
DigitMap, once defined, can be used on all Terminations specified by
the (possibly wildcarded) TerminationID in such a command. DigitMaps
defined on the root Termination are global and can be used on every
Termination in the MG, provided that a DigitMap with the same name
has not been defined on the given Termination. When a DigitMap is
defined dynamically in a DigitMap Descriptor:
. A new DigitMap is created by specifying a name that is not yet
defined. The value shall be present.
. A DigitMap value is updated by supplying a new value for a name
that is already defined. Terminations presently using the
digitmap shall continue to use the old definition; subsequent
EventsDescriptors specifying the name, including any
EventsDescriptor in the command containing the DigitMap
descriptor, shall use the new one.
. A DigitMap is deleted by supplying an empty value for a name that
is already defined. Terminations presently using the digitmap
shall continue to use the old definition.
The collection of digits according to a DigitMap may be protected by
three timers, viz. a start timer (T), short timer (S), and long timer
(L).
Cuervo, et al. Standards Track [Page 34]
^L
RFC 2885 Megaco Protocol August 2000
1. The start timer (T) is used prior to any digits having been
dialed.
2. If the Media Gateway can determine that at least one more digit is
needed for a digit string to match any of the allowed patterns in
the digit map, then the interdigit timer value should be set to a
long (L) duration (e.g. 16 seconds).
3. If the digit string has matched one of the patterns in a digit
map, but it is possible that more digits could be received which
would cause a match with a different pattern, then instead of
reporting the match immediately, the MG must apply the short timer
(S) and wait for more digits.
The timers are configurable parameters to a DigitMap. The Start
timer is started at the beginning of every digit map use, but can be
overridden.
The formal syntax of the digit map is described by the DigitMap rule
in the formal syntax description of the protocol (see Annex A and
Annex B). A DigitMap, according to this syntax, is defined either by
a string or by a list of strings. Each string in the list is an
alternative event sequence, specified either as a sequence of digit
map symbols or as a regular expression of digit map symbols. These
digit map symbols, the digits "0" through "9" and letters "A" through
a maximum value depending on the signalling system concerned, but
never exceeding "K", correspond to specified events within a package
which has been designated in the Events Descriptor on the termination
to which the digit map is being applied. (The mapping between events
and digit map symbols is defined in the documentation for packages
associated with channel-associated signalling systems such as DTMF,
MF, or R2. Digits "0" through "9" MUST be mapped to the
corresponding digit events within the signalling system concerned.
Letters should be allocated in logical fashion, facilitating the use
of range notation for alternative events.)
The letter "x" is used as a wildcard, designating any event
corresponding to symbols in the range "0"-"9". The string may also
contain explicit ranges and, more generally, explicit sets of
symbols, designating alternative events any one of which satisfies
that position of the digit map. Finally, the dot symbol "." stands
for zero or more repetitions of the event selector (event, range of
events, set of alternative events, or wildcard) that precedes it. As
a consequence of the third timing rule above, inter-event timing
while matching the dot symbol uses the short timer by default.
In addition to these event symbols, the string may contain "S" and
"L" inter-event timing specifiers and the "Z" duration modifier. "S"
Cuervo, et al. Standards Track [Page 35]
^L
RFC 2885 Megaco Protocol August 2000
and "L" respectively indicate that the MG should use the short (S)
timer or the long (L) timer for subsequent events, over-riding the
timing rules described above. A timer specifier following a dot
specifies inter-event timing for all events matching the dot as well
as for subsequent events. If an explicit timing specifier is in
effect in one alternative event sequence, but none is given in any
other candidate alternative, the timer value set by the explicit
timing specifier must be used. If all sequences with explicit timing
controls are dropped from the candidate set, timing reverts to the
default rules given above. Finally, if conflicting timing specifiers
are in effect in different alternative sequences, the results are
undefined.
A "Z" designates a long duration event: placed in front of the
symbol(s) designating the event(s) which satisfy a given digit
position, it indicates that that position is satisfied only if the
duration of the event exceeds the long-duration threshold. The value
of this threshold is assumed to be provisioned in the MG.
A digit map is active while the events descriptor which invoked it is
active and it has not completed. A digit map completes when:
. a timer has expired, or
. an alternative event sequence has been matched and no other
alternative event sequence in the digit map could be matched
through detection of an additional event (unambiguous match), or
. an event has been detected such that a match to a complete
alternative event sequence of the digit map will be impossible no
matter what additional events are received.
Upon completion, a digit map completion event as defined in the
package providing the events being mapped into the digit map shall be
generated. At that point the digit map is deactivated. Subsequent
events in the package are processed as per the currently active event
processing mechanisms.
Pending completion, successive events shall be processed according to
the following rules:
1. The "current dial string", an internal variable, is initially
empty. The set of candidate alternative event sequences includes
all of the alternatives specified in the digit map.
2. At each step, a timer is set to wait for the next event, based
either on the default timing rules given above or on explicit
timing specified in one or more alternative event sequences. If
Cuervo, et al. Standards Track [Page 36]
^L
RFC 2885 Megaco Protocol August 2000
the timer expires and a member of the candidate set of
alternatives is fully satisfied, a timeout completion with full
match is reported. If the timer expires and part or none of any
candidate alternative is satisfied, a timeout completion with
partial match is reported.
3. If an event is detected before the timer expires, it is mapped to
a digit string symbol and provisionally added to the end of the
current dial string. The duration of the event (long or not long)
is noted if and only if this is relevant in the current symbol
position (because at least one of the candidate alternative event
sequences includes the "Z" modifier at this position in the
sequence).
4. The current dial string is compared to the candidate alternative
event sequences. If and only if a sequence expecting a long-
duration event at this position is matched (i.e. the event had
long duration and met the specification for this position), then
any alternative event sequences not specifying a long duration
event at this position are discarded, and the current dial string
is modified by inserting a "Z" in front of the symbol representing
the latest event. Any sequence expecting a long-duration event at
this position but not matching the observed event is discarded
from the candidate set. If alternative event sequences not
specifying a long duration event in the given position remain in
the candidate set after application of the above rules, the
observed event duration is treated as irrelevant in assessing
matches to them.
5. If exactly one candidate remains, a completion event is generated
indicating an unambiguous match. If no candidates remain, the
latest event is removed from the current dial string and a
completion event is generated indicating full match if one of the
candidates from the previous step was fully satisfied before the
latest event was detected, or partial match otherwise. The event
removed from the current dial string will then be reported as per
the currently active event processing mechanisms.
6. If no completion event is reported out of step 5 (because the
candidate set still contains more than one alternative event
sequence), processing returns to step 2.
A digit map is activated whenever a new event descriptor is applied
to the termination or embedded event descriptor is activated, and
that event descriptor contains a digit map completion event which
itself contains a digit map parameter. Each new activation of a
digit map begins at step 1 of the above procedure, with a clear
current dial string. Any previous contents of the current dial
Cuervo, et al. Standards Track [Page 37]
^L
RFC 2885 Megaco Protocol August 2000
string from an earlier activation are lost. While the digit map is
activated, detection is enabled for all events defined in the package
containing the specified digit map completion event. Normal event
behaviour (e.g. stopping of signals unless the digit completion event
has the KeepActive flag enabled) continues to apply for each such
event detected, except that the events in the package containing the
specified digit map completion event other than the completion event
itself are not individually notified.
Note that if a package contains a digit map completion event, then an
event specification consisting of the package name with a wildcarded
ItemID (Property Name) will activate a digit map if the event
includes a digit map parameter. Regardless of whether a digit map is
activated, this form of event specification will cause the individual
events to be reported to the MGC as they are detected.
As an example, consider the following dial plan:
0 Local operator
00 Long distance operator
xxxx Local extension number
(starts with 1-7)
8xxxxxxx Local number
#xxxxxxx Off-site extension
*xx Star services
91xxxxxxxxxx Long distance number
9011 + up to 15 digits International number
If the DTMF detection package described in Annex E (section E.6) is
used to collect the dialled digits, then the dialling plan shown
above results in the following digit map:
(0| 00|[1-7]xxx|8xxxxxxx|Fxxxxxxx|Exx|91xxxxxxxxxx|9011x.)
7.1.15 Statistics Descriptor
The Statistics parameter provides information describing the status
and usage of a Termination during its existence within a specific
Context. There is a set of standard statistics kept for each
termination where appropriate (number of octets sent and received for
example). The particular statistical properties that are reported
for a given Termination are determined by the Packages realized by
the Termination. By default, statistics are reported when the
Termination is Subtracted from the Context. This behavior can be
overridden by including an empty AuditDescriptor in the Subtract
command. Statistics may also be returned from the AuditValue
command, or any Add/Move/Modify command using the Audit descriptor.
Cuervo, et al. Standards Track [Page 38]
^L
RFC 2885 Megaco Protocol August 2000
Statistics are cumulative; reporting Statistics does not reset them.
Statistics are reset when a Termination is Subtracted from a Context.
7.1.16 Packages Descriptor
Used only with the AuditValue command, the PackageDescriptor returns
a list of Packages realized by the Termination.
7.1.17 ObservedEvents Descriptor
ObservedEvents is supplied with the Notify command to inform the MGC
of which event(s) were detected. Used with the AuditValue command,
the ObservedEventsDescriptor returns events in the event buffer which
have not been Notified. ObservedEvents contains the RequestIdentifier
of the EventsDescriptor that triggered the notification, the event(s)
detected and the detection time(s). Detection times are reported
with a precision of hundredths of a second. Time is expressed in
UTC.
7.1.18 Topology Descriptor
A topology descriptor is used to specify flow directions between
terminations in a Context. Contrary to the descriptors in previous
sections, the topology descriptor applies to a Context instead of a
Termination. The default topology of a Context is that each
termination's transmission is received by all other terminations.
The Topology Descriptor is optional to implement.
The Topology Descriptor occurs before the commands in an action. It
is possible to have an action containing only a Topology Descriptor,
provided that the context to which the action applies already exists.
A topology descriptor consists of a sequence of triples of the form
(T1, T2, association). T1 and T2 specify Terminations within the
Context, possibly using the ALL or CHOOSE wildcard. The association
specifies how media flows between these two Terminations as follows.
. (T1, T2, isolate) means that the Terminations matching T2 do not
receive media from the Terminations matching T1, nor vice versa.
. (T1, T2, oneway) means that the Terminations that match T2
receive media from the Terminations matching T1, but not vice
versa. In this case use of the ALL wildcard such that there are
Terminations that match both T1 and T2 is not allowed.
. (T1, T2, bothway) means that the Terminations matching T2 receive
media from the Terminations matching T1, and vice versa. In this
case it is allowed to use wildcards such that there are
Cuervo, et al. Standards Track [Page 39]
^L
RFC 2885 Megaco Protocol August 2000
Terminations that match both T1 and T2. However, if there is a
Termination that matches both, no loopback is introduced;
loopbacks are created by setting the TerminationMode. CHOOSE
wildcards may be used in T1 and T2 as well, under the following
restrictions:
. the action (see section 8) of which the topology descriptor is
part contains an Add command in which a CHOOSE wildcard is used;
. if a CHOOSE wildcard occurs in T1 or T2, then a partial name
SHALL NOT be specified.
The CHOOSE wildcard in a topology descriptor matches the
TerminationID that the MG assigns in the first Add command that uses
a CHOOSE wildcard in the same action. An existing Termination that
matches T1 or T2 in the Context to which a Termination is added, is
connected to the newly added Termination as specified by the topology
descriptor. The default association when a termination is not
mentioned in the Topology descriptor is bothway (if T3 is added to a
context with T1 and T2 with topology (T3,T1,oneway) it will be
connected bothway to T2).
Cuervo, et al. Standards Track [Page 40]
^L
RFC 2885 Megaco Protocol August 2000
The figure below and the table following it show some examples of the
effect of including topology descriptors in actions. In these
examples it is assumed that the topology descriptors are applied in
sequence.
Context 1 Context 2 Context 3
+------------------+ +------------------+ +------------------+
| +----+ | | +----+ | | +----+ |
| | T2 | | | | T2 | | | | T2 | |
| +----+ | | +----+ | | +----+ |
| ^ ^ | | ^ | | ^ |
| | | | | | | | | |
| +--+ +--+ | | +---+ | | +--+ |
| | | | | | | | | |
| v v | | v | | | |
| +----+ +----+ | | +----+ +----+ | | +----+ +----+ |
| | T1 |<-->| T3 | | | | T1 |<-->| T3 | | | | T1 |<-->| T3 | |
| +----+ +----+ | | +----+ +----+ | | +----+ +----+ |
+------------------+ +------------------+ +------------------+
1. No Topology Desc. 2. T1, T2 Isolate 3. T3, T2 oneway
Context 1 Context 2 Context 3
+------------------+ +------------------+ +------------------+
| +----+ | | +----+ | | +----+ |
| | T2 | | | | T2 | | | | T2 | |
| +----+ | | +----+ | | +----+ |
| | | | ^ | | ^ ^ |
| | | | | | | | | |
| +--+ | | +---+ | | +--+ +--+ |
| | | | | | | | | |
| v | | v | | v v |
| +----+ +----+ | | +----+ +----+ | | +----+ +----+ |
| | T1 |<-->| T3 | | | | T1 |<-->| T3 | | | | T1 |<-->| T3 | |
| +----+ +----+ | | +----+ +----+ | | +----+ +----+ |
+------------------+ +------------------+ +------------------+
4. T2, T3 oneway 5. T2, T3 bothway 6. T1, T2 bothway
Figure 4: A Sequence Of Example Topologies
Cuervo, et al. Standards Track [Page 41]
^L
RFC 2885 Megaco Protocol August 2000
Topology Description
1 No topology descriptors
When no topology descriptors are included, all
terminations have a both way connection to all
other terminations.
2 T1, T2, Isolate
Removes the connection between T1 and T2.
T3 has a both way connection with both T1 and
T2. T1 and T2 have bothway connection to T3.
3 T3, T2, oneway
A oneway connection from T3 to T2 (i.e. T2
receives media flow from T3). A bothway
connection between T1 and T3.
4 T2, T3, oneway
A oneway connection between T2 to T3.
T1 and T3 remain bothway connected
5 T2, T3 bothway
T2 is bothway connected to T3. This results in
the same as 2.
6 T1, T2 bothway (T2, T3 bothway
and T1,T3 bothway may be implied
or explicit).
All terminations have a bothway connection to
all other terminations.
A oneway connection must implemented in such a way that the other
Terminations in the Context are not aware of the change in topology.
7.2 Command Application Programming Interface
Following is an Application Programming Interface (API) describing
the Commands of the protocol. This API is shown to illustrate the
Commands and their parameters and is not intended to specify
implementation (e.g. via use of blocking function calls). It
describes the input parameters in parentheses after the command name
and the return values in front of the Command. This is only for
descriptive purposes; the actual Command syntax and encoding are
specified in later subsections. All parameters enclosed by square
brackets ([. . . ]) are considered optional.
Cuervo, et al. Standards Track [Page 42]
^L
RFC 2885 Megaco Protocol August 2000
7.2.1 Add
The Add Command adds a Termination to a Context.
TerminationID
[,MediaDescriptor]
[,ModemDescriptor]
[,MuxDescriptor]
[,EventsDescriptor]
[,SignalsDescriptor]
[,DigitMapDescriptor]
[,ObservedEventsDescriptor]
[,EventBufferDescriptor]
[,StatisticsDescriptor]
[,PackagesDescriptor]
Add( TerminationID
[, MediaDescriptor]
[, ModemDescriptor]
[, MuxDescriptor]
[, EventsDescriptor]
[, SignalsDescriptor]
[, DigitMapDescriptor]
[, AuditDescriptor]
)
The TerminationID specifies the termination to be added to the
Context. The Termination is either created, or taken from the null
Context. For an existing Termination, the TerminationID would be
specific. For a Termination that does not yet exist, the
TerminationID is specified as CHOOSE in the command. The new
TerminationID will be returned. Wildcards may be used in an Add, but
such usage would be unusual. If the wildcard matches more than one
TerminationID, all possible matches are attempted, with results
reported for each one. The order of attempts when multiple
TerminationIDs match is not specified.
The optional MediaDescriptor describes all media streams.
The optional ModemDescriptor and MuxDescriptor specify a modem and
multiplexer if applicable. For convenience, if a Multiplex Descriptor
is present in an Add command and lists any Terminations that are not
currently in the Context, such Terminations are added to the context
as if individual Add commands listing the Terminations were invoked.
If an error occurs on such an implied Add, error 471 - Implied Add
for Multiplex failure shall be returned and further processing of the
command shall cease.
Cuervo, et al. Standards Track [Page 43]
^L
RFC 2885 Megaco Protocol August 2000
The EventsDescriptor parameter is optional. If present, it provides
the list of events that should be detected on the Termination.
The SignalsDescriptor parameter is optional. If present, it provides
the list of signals that should be applied to the Termination.
The DigitMapDescriptor parameter is optional. If present, defines a
DigitMap definition that may be used in an EventsDescriptor.
The AuditDescriptor is optional. If present, the command will return
descriptors as specified in the AuditDescriptor.
All descriptors that can be modified could be returned by MG if a
parameter was underspecified or overspecified. ObservedEvents,
Statistics, and Packages, and the EventBuffer Descriptors are
returned only if requested in the AuditDescriptor. Add SHALL NOT be
used on a Termination with a serviceState of "OutofService".
7.2.2 Modify
The Modify Command modifies the properties of a Termination.
TerminationID
[,MediaDescriptor]
[,ModemDescriptor]
[,MuxDescriptor]
[,EventsDescriptor]
[,SignalsDescriptor]
[,DigitMapDescriptor]
[,ObservedEventsDescriptor]
[,EventBufferDescriptor]
[,StatisticsDescriptor]
[,PackagesDescriptor]
Modify( TerminationID
[, MediaDescriptor]
[, ModemDescriptor]
[, MuxDescriptor]
[, EventsDescriptor]
[, SignalsDescriptor]
[, DigitMapDescriptor]
[, AuditDescriptor]
)
The TerminationID may be specific if a single Termination in the
Context is to be modified. Use of wildcards in the TerminationID may
be appropriate for some operations. If the wildcard matches more than
one TerminationID, all possible matches are attempted, with results
reported for each one. The order of attempts when multiple
Cuervo, et al. Standards Track [Page 44]
^L
RFC 2885 Megaco Protocol August 2000
TerminationIDs match is not specified. The CHOOSE option is an error,
as the Modify command may only be used on existing Terminations.
The remaining parameters to Modify are the same as those to Add.
Possible return values are the same as those to Add.
7.2.3 Subtract
The Subtract Command disconnects a Termination from its Context and
returns statistics on the Termination's participation in the Context.
TerminationID
[,MediaDescriptor]
[,ModemDescriptor]
[,MuxDescriptor]
[,EventsDescriptor]
[,SignalsDescriptor]
[,DigitMapDescriptor]
[,ObservedEventsDescriptor]
[,EventBufferDescriptor]
[,StatisticsDescriptor]
[,PackagesDescriptor]
Subtract(TerminationID
[, AuditDescriptor]
)
TerminationID in the input parameters represents the Termination that
is being subtracted. The TerminationID may be specific or may be a
wildcard value indicating that all (or a set of related) Terminations
in the Context of the Subtract Command are to be subtracted. If the
wildcard matches more than one TerminationID, all possible matches
are attempted, with results reported for each one. The order of
attempts when multiple TerminationIDs match is not specified. The
CHOOSE option is an error, as the Subtract command may only be used
on existing Terminations. ALL may be used as the ContextID as well
as the TerminationId in a Subtract, which would have the effect of
deleting all contexts, deleting all ephemeral terminations, and
returning all physical terminations to Null context.
By default, the Statistics parameter is returned to report
information collected on the Termination or Terminations specified in
the Command. The information reported applies to the Termination's
or Terminations' existence in the Context from which it or they are
being subtracted.
The AuditDescriptor is optional. If present, the command will return
descriptors as specified in the AuditDescriptor. Possible return
values are the same as those to Add.
Cuervo, et al. Standards Track [Page 45]
^L
RFC 2885 Megaco Protocol August 2000
When a provisioned Termination is Subtracted from a context, its
property values shall revert to:
. the default value, if specified for the property and not
overridden by provisioning,
. otherwise, the provisioned value.
7.2.4 Move
The Move Command moves a Termination to another Context from its
current Context in one atomic operation. The Move command is the
only command that refers to a Termination in a Context different from
that to which the command is applied. The Move command shall not be
used to move Terminations to or from the null Context.
TerminationID
[,MediaDescriptor]
[,ModemDescriptor]
[,MuxDescriptor]
[,EventsDescriptor]
[,SignalsDescriptor]
[,DigitMapDescriptor]
[,ObservedEventsDescriptor]
[,EventBufferDescriptor]
[,StatisticsDescriptor]
[,PackagesDescriptor]
Move( TerminationID
[, MediaDescriptor]
[, ModemDescriptor]
[, MuxDescriptor]
[, EventsDescriptor]
[, SignalsDescriptor]
[, DigitMapDescriptor]
[, AuditDescriptor]
)
The TerminationID specifies the Termination to be moved. It may be
wildcarded. If the wildcard matches more than one TerminationID, all
possible matches are attempted, with results reported for each one.
The order of attempts when multiple TerminationIDs match is not
specified. By convention, the Termination is subtracted from its
previous Context. The Context to which the Termination is moved is
indicated by the target ContextId in the Action. If the last
remaining Termination is moved out of a Context, the Context is
deleted.
Cuervo, et al. Standards Track [Page 46]
^L
RFC 2885 Megaco Protocol August 2000
The remaining descriptors are processed as in the Modify Command.
The AuditDescriptor with the Statistics option, for example, would
return statistics on the Termination just prior to the Move.
Possible descriptors returned from Move are the same as for Add.
Move SHALL NOT be used on a Termination with a serviceState of
"OutofService".
7.2.5 AuditValue
The AuditValue Command returns the current values of properties,
events, signals and statistics associated with Terminations.
TerminationID
[,MediaDescriptor]
[,ModemDescriptor]
[,MuxDescriptor]
[,EventsDescriptor]
[,SignalsDescriptor]
[,DigitMapDescriptor]
[,ObservedEventsDescriptor]
[,EventBufferDescriptor]
[,StatisticsDescriptor]
[,PackagesDescriptor]
AuditValue(TerminationID,
AuditDescriptor
)
TerminationID may be specific or wildcarded. If the wildcard matches
more than one TerminationID, all possible matches are attempted, with
results reported for each one. The order of attempts when multiple
TerminationIDs match is not specified. If a wildcarded response is
requested, only one command return is generated, with the contents
containing the union of the values of all Terminations matching the
wildcard. This convention may reduce the volume of data required to
audit a group of Terminations. Use of CHOOSE is an error.
The appropriate descriptors, with the current values for the
Termination, are returned from AuditValue. Values appearing in
multiple instances of a descriptor are defined to be alternate values
supported, with each parameter in a descriptor considered
independent.
ObservedEvents returns a list of events in the EventBuffer,
PackagesDescriptor returns a list of packages realized by the
Termination. DigitMapDescriptor returns the name or value of the
current DigitMap for the Termination. DigitMap requested in an
AuditValue command with TerminationID ALL returns all DigitMaps in
the gateway. Statistics returns the current values of all statistics
Cuervo, et al. Standards Track [Page 47]
^L
RFC 2885 Megaco Protocol August 2000
being kept on the Termination. Specifying an empty Audit Descriptor
results in only the TerminationID being returned. This may be useful
to get a list of TerminationIDs when used with wildcard.
AuditValue results depend on the Context, viz. specific, null, or
wildcarded. The TerminationID may be specific, or wildcarded. The
following illustrates other information that can be obtained with the
Audit Command:
ContextID TerminationID Information Obtained
Specific wildcard Audit of matching
Terminations in a Context
Specific specific Audit of a single
Termination in a Context
Null Root Audit of Media Gateway state
and events
Null wildcard Audit of all matching
Terminations in the Null
Context
Null specific Audit of a single
Termination outside of any
Context
All wildcard Audit of all matching
Terminations and the Context
to which they are associated
All Root List of all ContextIds
7.2.6 AuditCapabilities
The AuditCapabilities Command returns the possible values of
properties, events, signals and statistics associated with
Terminations.
TerminationID
[,MediaDescriptor]
[,ModemDescriptor]
[,MuxDescriptor]
[,EventsDescriptor]
[,SignalsDescriptor]
[,ObservedEventsDescriptor]
[,EventBufferDescriptor]
Cuervo, et al. Standards Track [Page 48]
^L
RFC 2885 Megaco Protocol August 2000
[,StatisticsDescriptor]
AuditCapabilities(TerminationID,
AuditDescriptor
)
The appropriate descriptors, with the possible values for the
Termination are returned from AuditCapabilities. Descriptors may be
repeated where there are multiple possible values. If a wildcarded
response is requested, only one command return is generated, with the
contents containing the union of the values of all Terminations
matching the wildcard. This convention may reduce the volume of data
required to audit a group of Terminations.
Interpretation of what capabilities are requested for various values
of ContextID and TerminationID is the same as in AuditValue.
The EventsDescriptor returns the list of possible events on the
Termination together with the list of all possible values for the
EventsDescriptor Parameters. The SignalsDescriptor returns the list
of possible signals that could be applied to the Termination together
with the list of all possible values for the Signals Parameters.
StatisticsDescriptor returns the names of the statistics being kept
on the termination. ObservedEventsDescriptor returns the names of
active events on the termination. DigitMap and Packages are not
legal in AuditCapability.
7.2.7 Notify
The Notify Command allows the Media Gateway to notify the Media
Gateway Controller of events occurring within the Media Gateway.
Notify(TerminationID,
ObservedEventsDescriptor,
[ErrorDescriptor]
)
The TerminationID parameter specifies the Termination issuing the
Notify Command. The TerminationID shall be a fully qualified name.
The ObservedEventsDescriptor contains the RequestID and a list of
events that the Media Gateway detected in the order that they were
detected. Each event in the list is accompanied by parameters
associated with the event and an indication of the time that the
event was detected. Procedures for sending Notify commands with
RequestID equal to 0 are for further study.
Cuervo, et al. Standards Track [Page 49]
^L
RFC 2885 Megaco Protocol August 2000
Notify Commands with RequestID not equal to 0 shall occur only as the
result of detection of an event specified by an Events Descriptor
which is active on the termination concerned.
The RequestID returns the RequestID parameter of the EventsDescriptor
that triggered the Notify Command. It is used to correlate the
notification with the request that triggered it. The events in the
list must have been requested via the triggering EventsDescriptor or
embedded events descriptor unless the RequestID is 0 (which is for
further study).
7.2.8 ServiceChange
The ServiceChange Command allows the Media Gateway to notify the
Media Gateway Controller that a Termination or group of Terminations
is about to be taken out of service or has just been returned to
service. The Media Gateway Controller may indicate that
Termination(s) shall be taken out of or returned to service. The
Media Gateway may notify the MGC that the capability of a Termination
has changed. It also allows a MGC to hand over control of a MG to
another MGC.
TerminationID,
[ServiceChangeDescriptor]
ServiceChange(TerminationID,
ServiceChangeDescriptor
)
The TerminationID parameter specifies the Termination(s) that are
taken out of or returned to service. Wildcarding of Termination
names is permitted, with the exception that the CHOOSE mechanism
shall not be used. Use of the "Root" TerminationID indicates a
ServiceChange affecting the entire Media Gateway.
The ServiceChangeDescriptor contains the following parameters as
required:
. ServiceChangeMethod
. ServiceChangeReason
. ServiceChangeDelay
. ServiceChangeAddress
. ServiceChangeProfile
. ServiceChangeVersion
. ServiceChangeMgcId
. TimeStamp
The ServiceChangeMethod parameter specifies the type of ServiceChange
that will or has occurred:
Cuervo, et al. Standards Track [Page 50]
^L
RFC 2885 Megaco Protocol August 2000
1) Graceful - indicates that the specified Terminations will be taken
out of service after the specified ServiceChangeDelay; established
connections are not yet affected, but the Media Gateway Controller
should refrain from establishing new connections and should
attempt to gracefully tear down existing connections. The MG
should set termination serviceState at the expiry of
ServiceChangeDelay or the removal of the termination from an
active context (whichever is first), to "out of service".
2) Forced - indicates that the specified Terminations were taken
abruptly out of service and any established connections associated
with them were lost. The MGC is responsible for cleaning up the
context (if any) with which the failed termination is associated.
At a minimum the termination shall be subtracted from the context.
The termination serviceState should be "out of service".
3) Restart - indicates that service will be restored on the specified
Terminations after expiration of the ServiceChangeDelay. The
serviceState should be set to "inService" upon expiry of
ServiceChangeDelay.
4) Disconnected - always applied with the Root TerminationID,
indicates that the MG lost communication with the MGC, but it was
subsequently restored. Since MG state may have changed, the MGC
may wish to use the Audit command to resynchronize its state with
the MG's.
5) Handoff - sent from the MGC to the MG, this reason indicates that
the MGC is going out of service and a new MGC association must be
established. Sent from the MG to the MGC, this indicates that the
MG is attempting to establish a new association in accordance with
a Handoff received from the MGC with which it was previously
associated.
6) Failover - sent from MG to MGC to indicate the primary MG is out
of service and a secondary MG is taking over.
7) Another value whose meaning is mutually understood between the MG
and the MGC.
The ServiceChangeReason parameter specifies the reason why the
ServiceChange has or will occur. It consists of an alphanumeric
token (IANA registered) and an explanatory string.
The optional ServiceChangeAddress parameter specifies the address
(e.g., IP port number for IP networks) to be used for subsequent
communications. It can be specified in the input parameter
descriptor or the returned result descriptor. ServiceChangeAddress
Cuervo, et al. Standards Track [Page 51]
^L
RFC 2885 Megaco Protocol August 2000
and ServiceChangeMgcId parameters must not both be present in the
ServiceChangeDescriptor or the ServiceChangeResultDescriptor. The
serviceChangeAddress provides an address to be used within the
context of the association currently being negotiated, while the
ServiceChangeMgcId provides an alternate address where the MG should
seek to establish another association.
The optional ServiceChangeDelay parameter is expressed in seconds.
If the delay is absent or set to zero, the delay value should be
considered to be null. In the case of a "graceful"
ServiceChangeMethod, a null delay indicates that the Media Gateway
Controller should wait for the natural removal of existing
connections and should not establish new connections. . For
"graceful" only, a null delay means the MG must not set serviceState
"out of service" until the termination is in the null context.
The optional ServiceChangeProfile parameter specifies the Profile (if
any) of the protocol supported. The ServiceChangeProfile includes
the version of the profile supported.
The optional ServiceChangeVersion parameter contains the protocol
version and is used if protocol version negotiation occurs (see
section 11.3).
The optional TimeStamp parameter specifies the actual time as kept by
the sender. It can be used by the responder to determine how its
notion of time differs from that of its correspondent. TimeStamp is
sent with a precision of hundredths of a second, and is expressed in
UTC.
The optional Extension parameter may contain any value whose meaning
is mutually understood by the MG and MGC.
A ServiceChange Command specifying the "Root" for the TerminationID
and ServiceChangeMethod equal to Restart is a registration command by
which a Media Gateway announces its existence to the Media Gateway
Controller. The Media Gateway is expected to be provisioned with the
name of one primary and optionally some number of alternate Media
Gateway Controllers. Acknowledgement of the ServiceChange Command
completes the registration process. The MG may specify the transport
ServiceChangeAddress to be used by the MGC for sending messages in
the ServiceChangeAddress parameter in the input
ServiceChangeDescriptor. The MG may specify an address in the
ServiceChangeAddress parameter of the ServiceChange request, and the
MGC may also do so in the ServiceChange reply. In either case, the
recipient must use the supplied address as the destination for all
subsequent transaction requests within the association. At the same
time, as indicated in section 9, transaction replies and pending
Cuervo, et al. Standards Track [Page 52]
^L
RFC 2885 Megaco Protocol August 2000
indications must be sent to the address from which the corresponding
requests originated. This must be done even if it implies extra
messaging because commands and responses cannot be packed together.
The TimeStamp parameter shall be sent with a registration command and
its response.
The Media Gateway Controller may return an ServiceChangeMgcId
parameter that describes the Media Gateway Controller that should
preferably be contacted for further service by the Media Gateway. In
this case the Media Gateway shall reissue the ServiceChange command
to the new Media Gateway Controller. The Gateway specified in an
ServiceChangeMgcId, if provided, shall be contacted before any
further alternate MGCs. On a HandOff message from MGC to MG, the
ServiceChangeMgcId is the new MGC that will take over from the
current MGC.
The return from ServiceChange is empty except when the Root
terminationID is used. In that case it includes the following
parameters as required:
. ServiceChangeAddress, if the responding MGC wishes to specify an
new destination for messages from the MG for the remainder of the
association;
. ServiceChangeMgcId, if the responding MGC does not wish to
sustain an association with the MG;
. ServiceChangeProfile, if the responder wishes to negotiate the
profile to be used for the association;
. ServiceChangeVersion, if the responder wishes to negotiate the
version of the protocol to be used for the association.
The following ServiceChangeReasons are defined. This list may be
extended by an IANA registration as outlined in section 13.3
900 Service Restored
901 Cold Boot
902 Warm Boot
903 MGC Directed Change
904 Termination malfunctioning
905 Termination taken out of service
906 Loss of lower layer connectivity (e.g. downstream sync)
907 Transmission Failure
908 MG Impending Failure
909 MGC Impending Failure
910 Media Capability Failure
911 Modem Capability Failure
Cuervo, et al. Standards Track [Page 53]
^L
RFC 2885 Megaco Protocol August 2000
912 Mux Capability Failure
913 Signal Capability Failure
914 Event Capability Failure
915 State Loss
7.2.9 Manipulating and Auditing Context Attributes
The commands of the protocol as discussed in the preceding sections
apply to terminations. This section specifies how contexts are
manipulated and audited.
Commands are grouped into actions (see section 8). An action applies
to one context. In addition to commands, an action may contain
context manipulation and auditing instructions.
An action request sent to a MG may include a request to audit
attributes of a context. An action may also include a request to
change the attributes of a context.
The context properties that may be included in an action reply are
used to return information to a MGC. This can be information
requested by an audit of context attributes or details of the effect
of manipulation of a context.
If a MG receives an action which contains both a request to audit
context attributes and a request to manipulate those attributes, the
response SHALL include the values of the attributes after processing
the manipulation request.
7.2.10 Generic Command Syntax
The protocol can be encoded in a binary format or in a text format.
MGCs should support both encoding formats. MGs may support both
formats.
The protocol syntax for the binary format of the protocol is defined
in Annex A. Annex C specifies the encoding of the Local and Remote
descriptors for use with the binary format.
A complete ABNF of the text encoding of the protocol per RFC2234 is
given in Annex B. SDP is used as the encoding of the Local and
Remote Descriptors for use with the text encoding as modified in
section 7.1.8.
Cuervo, et al. Standards Track [Page 54]
^L
RFC 2885 Megaco Protocol August 2000
7.3 Command Error Codes
Errors consist of an IANA registered error code and an explanatory
string. Sending the explanatory string is optional. Implementations
are encouraged to append diagnostic information to the end of the
string.
When a MG reports an error to a MGC, it does so in an error
descriptor. An error descriptor consists of an error code and
optionally the associated explanatory string.
The identified error codes are:
400 - Bad Request
401 - Protocol Error
402 - Unauthorized
403 - Syntax Error in Transaction
404 - Syntax Error in TransactionReply
405 - Syntax Error in TransactionPending
406 - Version Not Supported
410 - Incorrect identifier
411 - The transaction refers to an unknown ContextId
412 - No ContextIDs available
421 - Unknown action or illegal combination of actions
422 - Syntax Error in Action
430 - Unknown TerminationID
431 - No TerminationID matched a wildcard
432 - Out of TerminationIDs or No TerminationID available
433 - TerminationID is already in a Context
440 - Unsupported or unknown Package
441 - Missing RemoteDescriptor
442 - Syntax Error in Command
443 - Unsupported or Unknown Command
444 - Unsupported or Unknown Descriptor
445 - Unsupported or Unknown Property
446 - Unsupported or Unknown Parameter
447 - Descriptor not legal in this command
448 - Descriptor appears twice in a command
450 - No such property in this package
451 - No such event in this package
452 - No such signal in this package
453 - No such statistic in this package
454 - No such parameter value in this package
455 - Parameter illegal in this Descriptor
456 - Parameter or Property appears twice in this Descriptor
461 - TransactionIDs in Reply do not match Request
Cuervo, et al. Standards Track [Page 55]
^L
RFC 2885 Megaco Protocol August 2000
462 - Commands in Transaction Reply do not match commands in
request
463 - TerminationID of Transaction Reply does not match
request
464 - Missing reply in Transaction Reply
465 - TransactionID in Transaction Pending does not match any
open request
466 - Illegal Duplicate Transaction Request
467 - Illegal Duplicate Transaction Reply
471 - Implied Add for Multiplex failure
500 - Internal Gateway Error
501 - Not Implemented
502 - Not ready.
503 - Service Unavailable
504 - Command Received from unauthorized entity
505 - Command Received before Restart Response
510 - Insufficient resources
512 - Media Gateway unequipped to detect requested Event
513 - Media Gateway unequipped to generate requested Signals
514 - Media Gateway cannot send the specified announcement
515 - Unsupported Media Type
517 - Unsupported or invalid mode
518 - Event buffer full
519 - Out of space to store digit map
520 - Media Gateway does not have a digit map
521 - Termination is "ServiceChangeing"
526 - Insufficient bandwidth
529 - Internal hardware failure
530 - Temporary Network failure
531 - Permanent Network failure
581 - Does Not Exist
8. TRANSACTIONS
Commands between the Media Gateway Controller and the Media Gateway
are grouped into Transactions, each of which is identified by a
TransactionID. Transactions consist of one or more Actions. An
Action consists of a series of Commands that are limited to operating
within a single Context. Consequently each Action typically
specifies a ContextID. However, there are two circumstances where a
specific ContextID is not provided with an Action. One is the case
of modification of a Termination outside of a Context. The other is
where the controller requests the gateway to create a new Context.
Following is a graphic representation of the Transaction, Action and
Command relationships.
Cuervo, et al. Standards Track [Page 56]
^L
RFC 2885 Megaco Protocol August 2000
+----------------------------------------------------------+
| Transaction x |
| +----------------------------------------------------+ |
| | Action 1 | |
| | +---------+ +---------+ +---------+ +---------+ | |
| | | Command | | Command | | Command | | Command | | |
| | | 1 | | 2 | | 3 | | 4 | | |
| | +---------+ +---------+ +---------+ +---------+ | |
| +----------------------------------------------------+ |
| |
| +----------------------------------------------------+ |
| | Action 2 | |
| | +---------+ | |
| | | Command | | |
| | | 1 | | |
| | +---------+ | |
| +----------------------------------------------------+ |
| |
| +----------------------------------------------------+ |
| | Action 3 | |
| | +---------+ +---------+ +---------+ | |
| | | Command | | Command | | Command | | |
| | | 1 | | 2 | | 3 | | |
| | +---------+ +---------+ +---------+ | |
| +----------------------------------------------------+ |
+----------------------------------------------------------+
Figure 5 Transactions, Actions and Commands
Transactions are presented as TransactionRequests. Corresponding
responses to a TransactionRequest are received in a single reply,
possibly preceded by a number of TransactionPending messages (see
section 8.2.3).
Transactions guarantee ordered Command processing. That is, Commands
within a Transaction are executed sequentially. Ordering of
Transactions is NOT guaranteed - transactions may be executed in any
order, or simultaneously.
At the first failing Command in a Transaction, processing of the
remaining Commands in that Transaction stops. If a command contains
a wildcarded TerminationID, the command is attempted with each of the
actual TerminationIDs matching the wildcard. A response within the
TransactionReply is included for each matching TerminationID, even if
one or more instances generated an error. If any TerminationID
matching a wildcard results in an error when executed, any commands
following the wildcarded command are not attempted. Commands may be
marked as "Optional" which can override this behaviour - if a
Cuervo, et al. Standards Track [Page 57]
^L
RFC 2885 Megaco Protocol August 2000
command marked as Optional results in an error, subsequent commands
in the Transaction will be executed. A TransactionReply includes the
results for all of the Commands in the corresponding
TransactionRequest. The TransactionReply includes the return values
for the Commands that were executed successfully, and the Command and
error descriptor for any Command that failed. TransactionPending is
used to periodically notify the receiver that a Transaction has not
completed yet, but is actively being processed.
Applications SHOULD implement an application level timer per
transaction. Expiration of the timer should cause a retransmission
of the request. Receipt of a Reply should cancel the timer. Receipt
of Pending should restart the timer.
8.1 Common Parameters
8.1.1 Transaction Identifiers
Transactions are identified by a TransactionID, which is assigned by
sender and is unique within the scope of the sender.
8.1.2 Context Identifiers
Contexts are identified by a ContextID, which is assigned by the
Media Gateway and is unique within the scope of the Media Gateway.
The Media Gateway Controller shall use the ContextID supplied by the
Media Gateway in all subsequent Transactions relating to that
Context. The protocol makes reference to a distinguished value that
may be used by the Media Gateway Controller when referring to a
Termination that is currently not associated with a Context, namely
the null ContextID.
The CHOOSE wildcard is used to request that the Media Gateway create
a new Context. The MGC shall not use partially specified ContextIDs
containing the CHOOSE wildcard.
The MGC may use the ALL wildcard to address all Contexts on the MG.
8.2 Transaction Application Programming Interface
Following is an Application Programming Interface (API) describing
the Transactions of the protocol. This API is shown to illustrate
the Transactions and their parameters and is not intended to specify
implementation (e.g. via use of blocking function calls). It will
describe the input parameters and return values expected to be used
by the various Transactions of the protocol from a very high level.
Transaction syntax and encodings are specified in later subsections.
Cuervo, et al. Standards Track [Page 58]
^L
RFC 2885 Megaco Protocol August 2000
8.2.1 TransactionRequest
The TransactionRequest is invoked by the sender. There is one
Transaction per request invocation. A request contains one or more
Actions, each of which specifies its target Context and one or more
Commands per Context.
TransactionRequest(TransactionId {
ContextID {Command _ Command},
. . .
ContextID {Command _ Command } })
The TransactionID parameter must specify a value for later
correlation with the TransactionReply or TransactionPending response
from the receiver.
The ContextID parameter must specify a value to pertain to all
Commands that follow up to either the next specification of a
ContextID parameter or the end of the TransactionRequest, whichever
comes first.
The Command parameter represents one of the Commands mentioned in the
"Command Details" subsection titled "Application Programming
Interface".
8.2.2 TransactionReply
The TransactionReply is invoked by the receiver. There is one reply
invocation per transaction. A reply contains one or more Actions,
each of which must specify its target Context and one or more
Responses per Context.
TransactionReply(TransactionID {
ContextID { Response _ Response },
. . .
ContextID { Response _ Response } })
The TransactionID parameter must be the same as that of the
corresponding TransactionRequest.
The ContextID parameter must specify a value to pertain to all
Responses for the action. The ContextID may be specific or null.
Each of the Response parameters represents a return value as
mentioned in section 7.2, or an error descriptor if the command
execution encountered an error. Commands after the point of failure
are not processed and, therefore, Responses are not issued for them.
Cuervo, et al. Standards Track [Page 59]
^L
RFC 2885 Megaco Protocol August 2000
An exception to this occurs if a command has been marked as optional
in the Transaction request. If the optional command generates an
error, the transaction still continues to execute, so the Reply
would, in this case, have Responses after an Error.
If the receiver encounters an error in processing a ContextID, the
requested Action response will consist of the context ID and a single
error descriptor, 422 Syntax Error in Action.
If the receiver encounters an error such that it cannot determine a
legal Action, it will return a TransactionReply consisting of the
TransactionID and a single error descriptor, 422 Syntax Error in
Action. If the end of an action cannot be reliably determined but one
or more Actions can be parsed, it will process them and then send 422
Syntax Error in Action as the last action for the transaction. If
the receiver encounters an error such that is cannot determine a
legal Transaction, it will return a TransactionReply with a null
TransactionID and a single error descriptor (403 Syntax Error in
Transaction).
If the end of a transaction can not be reliably determined and one or
more Actions can be parsed, it will process them and then return 403
Syntax Error in Transaction as the last action reply for the
transaction. If no Actions can be parsed, it will return 403 Syntax
Error in Transaction as the only reply
If the terminationID cannot be reliably determined it will send 442
Syntax Error in Command as the action reply.
If the end of a command cannot be reliably determined it will return
442 Syntax Error in Transaction as the reply to the last action it
can parse.
8.2.3 TransactionPending
The receiver invokes the TransactionPending. A TransactionPending
indicates that the Transaction is actively being processed, but has
not been completed. It is used to prevent the sender from assuming
the TransactionRequest was lost where the Transaction will take some
time to complete.
TransactionPending(TransactionID { } )
The TransactionID parameter must be the same as that of the
corresponding TransactionRequest. A property of root
(normalMGExecutionTime) is settable by the MGC to indicate the
interval within which the MGC expects a response to any transaction
from the MG. Another property (normalMGCExecutionTime) is settable
Cuervo, et al. Standards Track [Page 60]
^L
RFC 2885 Megaco Protocol August 2000
by the MGC to indicate the interval within which the MG should
expects a response to any transaction from the MGC. Senders may
receive more than one TransactionPending for a command. If a
duplicate request is received when pending, the responder may send a
duplicate pending immediately, or continue waiting for its timer to
trigger another Transaction Pending.
8.3 Messages
Multiple Transactions can be concatenated into a Message. Messages
have a header, which includes the identity of the sender. The Message
Identifier (MID) of a message is set to a provisioned name (e.g.
domain address/domain name/device name) of the entity transmitting
the message. Domain name is a suggested default.
Every Message contains a Version Number identifying the version of
the protocol the message conforms to. Versions consist of one or two
digits, beginning with version 1 for the present version of the
protocol.
The transactions in a message are treated independently. There is no
order implied, there is no application or protocol acknowledgement of
a message.
9. TRANSPORT
The transport mechanism for the protocol should allow the reliable
transport of transactions between an MGC and MG. The transport shall
remain independent of what particular commands are being sent and
shall be applicable to all application states. There are several
transports defined for the protocol, which are defined in normative
Annexes to this document. Additional Transports may be defined as
additional annexes in subsequent editions of this document, or in
separate documents. For transport of the protocol over IP, MGCs
shall implement both TCP and UDP/ALF, an MG shall implement TCP or
UDP/ALF or both.
The MG is provisioned with a name or address (such as DNS name or IP
address) of a primary and zero or more secondary MGCs (see section
7.2.8) that is the address the MG uses to send messages to the MGC.
If TCP or UDP is used as the protocol transport and the port to which
the initial ServiceChange request is to be sent is not otherwise
known, that request should be sent to the default port number for the
protocol. This port number is 2944 for text-encoded operation or
2945 for binary-encoded operation, for either UDP or TCP. The MGC
receives the message containing the ServiceChange request from the MG
and can determine the MG's address from it. As described in section
7.2.8, either the MG or the MGC may supply an address in the
Cuervo, et al. Standards Track [Page 61]
^L
RFC 2885 Megaco Protocol August 2000
ServiceChangeAddress parameter to which subsequent transaction
requests must be addressed, but responses (including the response to
the initial ServiceChange request) must always be sent back to the
address which was the source of the corresponding request.
9.1 Ordering of Commands
This document does not mandate that the underlying transport protocol
guarantees the sequencing of transactions sent to an entity. This
property tends to maximize the timeliness of actions, but it has a
few drawbacks. For example:
. Notify commands may be delayed and arrive at the MGC after the
transmission of a new command changing the EventsDescriptor
. If a new command is transmitted before a previous one is
acknowledged, there is no guarantee that prior command will be
executed before the new one.
Media Gateway Controllers that want to guarantee consistent operation
of the Media Gateway may use the following rules. These rules are
with respect to commands that are in different transactions.
Commands that are in the same transaction are executed in order (see
section 8).
1. When a Media Gateway handles several Terminations, commands
pertaining to the different Terminations may be sent in parallel,
for example following a model where each Termination (or group of
Terminations) is controlled by its own process or its own thread.
2. On a Termination, there should normally be at most one outstanding
command (Add or Modify or Move), unless the outstanding commands
are in the same transaction. However, a Subtract command may be
issued at any time. In consequence, a Media Gateway may sometimes
receive a Modify command that applies to a previously subtracted
Termination. Such commands should be ignored, and an error code
should be returned.
3. On a given Termination, there should normally be at most one
outstanding Notify command at any time.
4. In some cases, an implicitly or explicitly wildcarded Subtract
command that applies to a group of Terminations may step in front
of a pending Add command. The Media Gateway Controller should
individually delete all Terminations for which an Add command was
pending at the time of the global Subtract command. Also, new Add
Cuervo, et al. Standards Track [Page 62]
^L
RFC 2885 Megaco Protocol August 2000
commands for Terminations named by the wild-carding (or implied in
a Multiplex descriptor) should not be sent until the wild-carded
Subtract command is acknowledged.
5. AuditValue and AuditCapability are not subject to any sequencing.
6. ServiceChange shall always be the first command sent by a MG as
defined by the restart procedure. Any other command or response
must be delivered after this ServiceChange command.
These rules do not affect the command responder, which should always
respond to commands.
9.2 Protection against Restart Avalanche
In the event that a large number of Media Gateways are powered on
simultaneously and they were to all initiate a ServiceChange
transaction, the Media Gateway Controller would very likely be
swamped, leading to message losses and network congestion during the
critical period of service restoration. In order to prevent such
avalanches, the following behavior is suggested:
1. When a Media Gateway is powered on, it should initiate a restart
timer to a random value, uniformly distributed between 0 and a
maximum waiting delay (MWD). Care should be taken to avoid
synchronicity of the random number generation between multiple
Media Gateways that would use the same algorithm.
2. The Media Gateway should then wait for either the end of this
timer or the detection of a local user activity, such as for
example an off-hook transition on a residential Media Gateway.
3. When the timer elapses, or when an activity is detected, the Media
Gateway should initiate the restart procedure.
The restart procedure simply requires the MG to guarantee that the
first message that the Media Gateway Controller sees from this MG is
a ServiceChange message informing the Media Gateway Controller about
the restart.
Note - The value of MWD is a configuration parameter that depends on
the type of the Media Gateway. The following reasoning may be used to
determine the value of this delay on residential gateways.
Media Gateway Controllers are typically dimensioned to handle the
peak hour traffic load, during which, in average, 10% of the lines
will be busy, placing calls whose average duration is typically 3
minutes. The processing of a call typically involves 5 to 6 Media
Cuervo, et al. Standards Track [Page 63]
^L
RFC 2885 Megaco Protocol August 2000
Gateway Controller transactions between each Media Gateway and the
Media Gateway Controller. This simple calculation shows that the
Media Gateway Controller is expected to handle 5 to 6 transactions
for each Termination, every 30 minutes on average, or, to put it
otherwise, about one transaction per Termination every 5 to 6 minutes
on average. This suggests that a reasonable value of MWD for a
residential gateway would be 10 to 12 minutes. In the absence of
explicit configuration, residential gateways should adopt a value of
600 seconds for MWD.
The same reasoning suggests that the value of MWD should be much
shorter for trunking gateways or for business gateways, because they
handle a large number of Terminations, and also because the usage
rate of these Terminations is much higher than 10% during the peak
busy hour, a typical value being 60%. These Terminations, during the
peak hour, are this expected to contribute about one transaction per
minute to the Media Gateway Controller load. A reasonable algorithm
is to make the value of MWD per "trunk" Termination six times shorter
than the MWD per residential gateway, and also inversely proportional
to the number of Terminations that are being restarted. For example
MWD should be set to 2.5 seconds for a gateway that handles a T1
line, or to 60 milliseconds for a gateway that handles a T3 line.
10. SECURITY CONSIDERATIONS
This section covers security when using the protocol in an IP
environment.
10.1 Protection of Protocol Connections
A security mechanism is clearly needed to prevent unauthorized
entities from using the protocol defined in this document for setting
up unauthorized calls or interfering with authorized calls. The
security mechanism for the protocol when transported over IP networks
is IPsec [RFC2401 to RFC2411].
The AH header [RFC2402] affords data origin authentication,
connectionless integrity and optional anti-replay protection of
messages passed between the MG and the MGC. The ESP header [RFC2406]
provides confidentiality of messages, if desired. For instance, the
ESP encryption service should be requested if the session
descriptions are used to carry session keys, as defined in SDP.
Implementations of the protocol defined in this document employing
the ESP header SHALL comply with section 5 of [RFC2406], which
defines a minimum set of algorithms for integrity checking and
Cuervo, et al. Standards Track [Page 64]
^L
RFC 2885 Megaco Protocol August 2000
encryption. Similarly, implementations employing the AH header SHALL
comply with section 5 of [RFC2402], which defines a minimum set of
algorithms for integrity checking using manual keys.
Implementations SHOULD use IKE [RFC2409] to permit more robust keying
options. Implementations employing IKE SHOULD support authentication
with RSA signatures and RSA public key encryption.
10.2 Interim AH scheme
Implementation of IPsec requires that the AH or ESP header be
inserted immediately after the IP header. This cannot be easily done
at the application level. Therefore, this presents a deployment
problem for the protocol defined in this document where the
underlying network implementation does not support IPsec.
As an interim solution, an optional AH header is defined within the
H.248 protocol header. The header fields are exactly those of the
SPI, SEQUENCE NUMBER and DATA fields as defined in [RFC2402]. The
semantics of the header fields are the same as the "transport mode"
of [RFC2402], except for the calculation of the Integrity Check value
(ICV). In IPsec, the ICV is calculated over the entire IP packet
including the IP header. This prevents spoofing of the IP addresses.
To retain the same functionality, the ICV calculation should be
performed across the entire transaction prepended by a synthesized IP
header consisting of a 32 bit source IP address, a 32 bit destination
address and an 16 bit UDP encoded as 10 hex digits. When the interim
AH mechanism is employed when TCP is the transport Layer, the UDP
Port above becomes the TCP port, and all other operations are the
same.
Implementations of the H.248 protocol SHALL implement IPsec where the
underlying operating system and the transport network supports IPsec.
Implementations of the protocol using IPv4 SHALL implement the
interim AH scheme. However, this interim scheme SHALL NOT be used
when the underlying network layer supports IPsec. IPv6
implementations are assumed to support IPsec and SHALL NOT use the
interim AH scheme.
All implementations of the interim AH mechanism SHALL comply with
section 5 of [RFC2402] which defines a minimum set of algorithms for
integrity checking using manual keys.
The interim AH interim scheme does not provide protection against
eavesdropping; thus forbidding third parties from monitoring the
connections set up by a given termination. Also, it does not provide
protection against replay attacks. These procedures do not
necessarily protect against denial of service attacks by misbehaving
Cuervo, et al. Standards Track [Page 65]
^L
RFC 2885 Megaco Protocol August 2000
MGs or misbehaving MGCs. However, they will provide an identification
of these misbehaving entities, which should then be deprived of their
authorization through maintenance procedures.
10.3 Protection of Media Connections
The protocol allows the MGC to provide MGs with "session keys" that
can be used to encrypt the audio messages, protecting against
eavesdropping.
A specific problem of packet networks is "uncontrolled barge-in".
This attack can be performed by directing media packets to the IP
address and UDP port used by a connection. If no protection is
implemented, the packets must be decompressed and the signals must be
played on the "line side".
A basic protection against this attack is to only accept packets from
known sources, checking for example that the IP source address and
UDP source port match the values announced in the Remote Descriptor.
This has two inconveniences: it slows down connection establishment
and it can be fooled by source spoofing:
. To enable the address-based protection, the MGC must obtain the
remote session description of the egress MG and pass it to the
ingress MG. This requires at least one network roundtrip, and
leaves us with a dilemma: either allow the call to proceed
without waiting for the round trip to complete, and risk for
example, "clipping" a remote announcement, or wait for the full
roundtrip and settle for slower call-set-up procedures.
. Source spoofing is only effective if the attacker can obtain
valid pairs of source destination addresses and ports, for
example by listening to a fraction of the traffic. To fight
source spoofing, one could try to control all access points to
the network. But this is in practice very hard to achieve.
An alternative to checking the source address is to encrypt and
authenticate the packets, using a secret key that is conveyed during
the call set-up procedure. This will not slow down the call set-up,
and provides strong protection against address spoofing.
11. MG-MGC CONTROL INTERFACE
The control association between MG and MGC is initiated at MG cold
start, and announced by a ServiceChange message, but can be changed
by subsequent events, such as failures or manual service events.
While the protocol does not have an explicit mechanism to support
Cuervo, et al. Standards Track [Page 66]
^L
RFC 2885 Megaco Protocol August 2000
multiple MGCs controlling a physical MG, it has been designed to
support the multiple logical MG (within a single physical MG) that
can be associated with different MGCs.
11.1 Multiple Virtual MGs
A physical Media Gateway may be partitioned into one or more Virtual
MGs. A virtual MG consists of a set of statically partitioned
physical Terminations and/or sets of ephemeral Terminations. A
physical Termination is controlled by one MGC. The model does not
require that other resources be statically allocated, just
Terminations. The mechanism for allocating Terminations to virtual
MGs is a management method outside the scope of the protocol. Each
of the virtual MGs appears to the MGC as a complete MG client.
A physical MG may have only one network interface, which must be
shared across virtual MGs. In such a case, the packet/cell side
Termination is shared. It should be noted however, that in use, such
interfaces require an ephemeral instance of the Termination to be
created per flow, and thus sharing the Termination is
straightforward. This mechanism does lead to a complication, namely
that the MG must always know which of its controlling MGCs should be
notified if an event occurs on the interface.
In normal operation, the Virtual MG will be instructed by the MGC to
create network flows (if it is the originating side), or to expect
flow requests (if it is the terminating side), and no confusion will
arise. However, if an unexpected event occurs, the Virtual MG must
know what to do with respect to the physical resources it is
controlling.
If recovering from the event requires manipulation of a physical
interface's state, only one MGC should do so. These issues are
resolved by allowing any of the MGCs to create EventsDescriptors to
be notified of such events, but only one MGC can have read/write
access to the physical interface properties; all other MGCs have
read-only access. The management mechanism is used to designate
which MGC has read/write capability, and is designated the Master
MGC.
Each virtual MG has its own Root Termination. In most cases the
values for the properties of the Root Termination are independently
settable by each MGC. Where there can only be one value, the
parameter is read-only to all but the Master MGC.
ServiceChange may only be applied to a Termination or set of
Terminations partitioned to the Virtual MG or created (in the case of
ephemeral Terminations) by that Virtual MG.
Cuervo, et al. Standards Track [Page 67]
^L
RFC 2885 Megaco Protocol August 2000
11.2 Cold Start
A MG is pre-provisioned by a management mechanism outside the scope
of this protocol with a Primary and (optionally) an ordered list of
Secondary MGCs. Upon a cold start of the MG, it will issue a
ServiceChange command with a "Restart" method, on the Root
Termination to its primary MGC. If the MGC accepts the MG, it will
send a Transaction Accept, with the ServiceChangeMgcId set to itself.
If the MG receives an ServiceChangeMgcId not equal to the MGC it
contacted, it sends a ServiceChange to the MGC specified in the
ServiceChangeMgcId. It continues this process until it gets a
controlling MGC to accept its registration, or it fails to get a
reply. Upon failure to obtain a reply, either from the Primary MGC,
or a designated successor, the MG tries its pre-provisioned Secondary
MGCs, in order. If the MG is unable to comply and it has established
a transport connection to the MGC, it should close that connection.
In any event, it should reject all subsequent requests from the MGC
with Error 406 Version Not Supported.
It is possible that the reply to a ServiceChange with Restart will be
lost, and a command will be received by the MG prior to the receipt
of the ServiceChange response. The MG shall issue error 505 -
Command Received before Restart Response.
11.3 Negotiation of Protocol Version
The first ServiceChange command from an MG shall contain the version
number of the protocol supported by the MG in the
ServiceChangeVersion parameter. Upon receiving such a message, if the
MGC supports only a lower version, then the MGC shall send a
ServiceChangeReply with the lower version and thereafter all the
messages between MG and MGC shall conform to the lower version of the
protocol. If the MG is unable to comply and it has established a
transport connection to the MGC, it should close that connection. In
any event, it should reject all subsequent requests from the MGC with
Error 406 Version Not supported.
If the MGC supports a higher version than the MG but is able to
support the lower version proposed by the MG, it shall send a
ServiceChangeReply with the lower version and thereafter all the
messages between MG and MGC shall conform to the lower version of the
protocol. If the MGC is unable to comply, it shall reject the
association, with Error 406 Version Not Supported.
Protocol version negotiation may also occur at "handoff" and
"failover" ServiceChanges.
Cuervo, et al. Standards Track [Page 68]
^L
RFC 2885 Megaco Protocol August 2000
When extending the protocol with new versions, the following rules
should be followed.
1. Existing protocol elements, i.e., procedures, parameters,
descriptor, property, values, should not be changed unless a
protocol error needs to be corrected or it becomes necessary to
change the operation of the service that is being supported by the
protocol.
2. The semantics of a command, a parameter, descriptor, property,
value should not be changed.
3. Established rules for formatting and encoding messages and
parameters should not be modified.
4. When information elements are found to be obsolete they can be
marked as not used. However, the identifier for that information
element will be marked as reserved. In that way it can not be used
in future versions.
11.4 Failure of an MG
If a MG fails, but is capable of sending a message to the MGC, it
sends a ServiceChange with an appropriate method (graceful or forced)
and specifies the Root TerminationID. When it returns to service, it
sends a ServiceChange with a "Restart" method.
Allowing the MGC to send duplicate messages to both MGs accommodates
pairs of MGs that are capable of redundant failover of one of the
MGs. Only the Working MG shall accept or reject transactions. Upon
failover, the Primary MG sends a ServiceChange command with a
"Failover" method and a "MG Impending Failure" reason. The MGC then
uses the primary MG as the active MG. When the error condition is
repaired, the Working MG can send a "ServiceChange" with a "Restart"
method.
11.5 Failure of an MGC
If the MG detects a failure of its controlling MGC, it attempts to
contact the next MGC on its pre-provisioned list. It starts its
attempts at the beginning (Primary MGC), unless that was the MGC that
failed, in which case it starts at its first Secondary MGC. It sends
a ServiceChange message with a "Failover" method and a " MGC
Impending Failure" reason.
In partial failure, or manual maintenance reasons, an MGC may wish to
direct its controlled MGs to use a different MGC. To do so, it sends
a ServiceChange method to the MG with a "HandOff" method, and its
Cuervo, et al. Standards Track [Page 69]
^L
RFC 2885 Megaco Protocol August 2000
designated replacement in ServiceChangeMgcId. The MG should send a
ServiceChange message with a "Handoff" method and a "MGC directed
change" reason to the designated MGC. If it fails to get a reply, or
fails to see an Audit command subsequently, it should behave as if
its MGC failed, and start contacting secondary MGCs. If the MG is
unable to establish a control relationship with any MGC, it shall
wait a random amount of time as described in section 9.2 and then
start contacting its primary, and if necessary, its secondary MGCs
again.
No recommendation is made on how the MGCs involved in the Handoff
maintain state information; this is considered to be out of scope of
this recommendation. The MGC and MG may take the following steps when
Handoff occurs. When the MGC initiates a HandOff, the handover
should be transparent to Operations on the Media Gateway.
Transactions can be executed in any order, and could be in progress
when the ServiceChange is executed. Accordingly, commands in
progress continue, transaction replies are sent to the new MGC (after
a new control association is established), and the MG should expect
outstanding transaction replies from the new MGC. No new messages
shall be sent to the new MGC until the control association is
established. Repeated transaction requests shall be directed to the
new MGC. The MG shall maintain state on all terminations and
contexts.
It is possible that the MGC could be implemented in such a way that a
failed MGC is replaced by a working MGC where the identity of the new
MGC is the same as the failed one. In such a case,
ServiceChangeMgcId would be specified with the previous value and the
MG shall behave as if the value was changed, and send a ServiceChange
message, as above.
Pairs of MGCs that are capable of redundant failover can notify the
controlled MGs of the failover by the above mechanism.
12. PACKAGE DEFINITION
The primary mechanism for extension is by means of Packages.
Packages define additional Properties, Events, Signals and Statistics
that may occur on Terminations.
Packages defined by IETF will appear in separate RFCs.
Packages defined by ITU-T may appear in the relevant recommendations
(e.g. as annexes).
Cuervo, et al. Standards Track [Page 70]
^L
RFC 2885 Megaco Protocol August 2000
1. A public document or a standard forum document, which can be
referenced as the document that describes the package following
the guideline above, should be specified.
2. The document shall specify the version of the Package that it
describes.
3. The document should be available on a public web server and should
have a stable URL. The site should provide a mechanism to provide
comments and appropriate responses should be returned.
12.1 Guidelines for defining packages
Packages define Properties, Events, Signals, and Statistics.
Packages may also define new error codes according to the guidelines
given in section 13.2. This is a matter of documentary convenience:
the package documentation is submitted to IANA in support of the
error code registration. If a package is modified, it is unnecessary
to provide IANA with a new document reference in support of the error
code unless the description of the error code itself is modified.
Names of all such defined constructs shall consist of the PackageID
(which uniquely identifies the package) and the ID of the item (which
uniquely identifies the item in that package). In the text encoding
the two shall be separated by a forward slash ("/") character.
Example: togen/playtone is the text encoding to refer to the play
tone signal in the tone generation package.
A Package will contain the following sections:
12.1.1 Package
Overall description of the package, specifying:
. Package Name: only descriptive,
. PackageID: Is an identifier
. Description:
. Version: A new version of a package can only add additional
Properties, Events, Signals, Statistics and new possible values
for an existing parameter described in the original package. No
deletions or modifications shall be allowed. A version is an
integer in the range from 1 to 99.
. Extends (Optional): A package may extend an existing package. The
version of the original package must be specified. When a package
extends another package it shall only add additional Properties,
Events, Signals, Statistics and new possible values for an
Cuervo, et al. Standards Track [Page 71]
^L
RFC 2885 Megaco Protocol August 2000
existing parameter described in the original package. An extended
package shall not redefine or overload a name defined in the
original package. Hence, if package B version 1 extends package A
version 1, version 2 of B will not be able to extend the A version
2 if A version 2 defines a name already in B version 1.
12.1.2 Properties
Properties defined by the package, specifying:
. Property Name: only descriptive.
. PropertyID: Is an identifier
. Description:
. Type: One of:
String: UTF-8 string
Integer: 4 byte signed integer
Double: 8 byte signed integer
Character: Unicode UTF-8 encoding of a single letter.
Could be more than one octet.
Enumeration: One of a list of possible unique values (See 12.3)
Sub-list: A list of several values from a list
Boolean
. Possible Values:
. Defined in: Which H.248 descriptor the property is defined in.
LocalControl is for stream dependent properties. TerminationState
is for stream independent properties.
. Characteristics: Read / Write or both, and (optionally), global:
Indicates whether a property is read-only, or read-write, and if
it is global. If Global is omitted, the property is not global.
If a property is declared as global, the value of the property is
shared by all terminations realizing the package.
12.1.3 Events
Events defined by the package, specifying:
. Event name: only descriptive.
. EventID: Is an identifier
. Description:
. EventsDescriptor Parameters: Parameters used by the MGC to
configure the event, and found in the EventsDescriptor. See
section 12.2.
Cuervo, et al. Standards Track [Page 72]
^L
RFC 2885 Megaco Protocol August 2000
. ObservedEventsDescriptor Parameters: Parameters returned to the
MGC in Notify requests and in replies to command requests from
the MGC that audit ObservedEventsDescriptor, and found in the
ObservedEventsDescriptor. See section 12.2.
12.1.4 Signals
. Signals defined by the package, specifying:
. Signal Name: only descriptive.
. SignalID: Is an identifier. SignalID is used in a
SignalsDescriptor
. Description
. SignalType: One of:
- OO (On/Off)
- TO (TimeOut)
- BR (Brief)
Note - SignalType may be defined such that it is dependent on the
value of one or more parameters. Signals that would be played with
SignalType BR should have a default duration. The package has to
define the default duration and signalType.
. Duration: in hundredths of seconds
. Additional Parameters: See section 12.2
12.1.5 Statistics
Statistics defined by the package, specifying:
. Statistic name: only descriptive.
. StatisticID: Is an identifier. StatisticID is used in a
StatisticsDescriptor.
. Description
. Units: unit of measure, e.g. milliseconds, packets.
12.1.6 Procedures
Additional guidance on the use of the package.
12.2 Guidelines to defining Properties, Statistics and Parameters to
Events and Signals.
. Parameter Name: only descriptive
. ParameterID: Is an identifier
. Type: One of:
String: UTF-8 octet string
Integer: 4 octet signed integer
Double: 8 octet signed integer
Cuervo, et al. Standards Track [Page 73]
^L
RFC 2885 Megaco Protocol August 2000
Character: Unicode UTF-8 encoding of a single letter. Could be
more than one octet.
Enumeration: One of a list of possible unique values (See 12.3)
Sub-list: A list of several values from a list
Boolean
. Possible values:
. Description:
12.3 Lists
Possible values for parameters include enumerations. Enumerations
may be defined in a list. It is recommended that the list be IANA
registered so that packages that extend the list can be defined
without concern for conflicting names.
12.4 Identifiers
Identifiers in text encoding shall be strings of up to 64 characters,
containing no spaces, starting with an alphanumeric character and
consisting of alphanumeric characters and / or digits, and possibly
including the special character underscore ("_").
Identifiers in binary encoding are 2 octets long.
Both text and binary values shall be specified for each identifier,
including identifiers used as values in enumerated types.
12.5 Package Registration
A package can be registered with IANA for interoperability reasons.
See section 13 for IANA considerations.
13. IANA CONSIDERATIONS
13.1 Packages
The following considerations SHALL be met to register a package with
IANA:
1. A unique string name, unique serial number and version number is
registered for each package. The string name is used with text
encoding. The serial number shall be used with binary encoding.
Serial Numbers 60000-64565 are reserved for private use. Serial
number 0 is reserved.
Cuervo, et al. Standards Track [Page 74]
^L
RFC 2885 Megaco Protocol August 2000
2. A contact name, email and postal addresses for that contact shall
be specified. The contact information shall be updated by the
defining organization as necessary.
3. A reference to a document that describes the package, which should
be public:
The document shall specify the version of the Package that it
describes.
If the document is public, it should be located on a public web
server and should have a stable URL. The site should provide a
mechanism to provide comments and appropriate responses should be
returned.
4. Packages registered by other than recognized standards bodies
shall have a minimum package name length of 8 characters.
5. All other package names are first come-first served if all other
conditions are met
13.2 Error Codes
The following considerations SHALL be met to register an error code
with IANA:
1. An error number and a one line (80 character maximum) string is
registered for each error.
2. A complete description of the conditions under which the error is
detected shall be included in a publicly available document. The
description shall be sufficiently clear to differentiate the error
from all other existing error codes.
3. The document should be available on a public web server and should
have a stable URL.
4. Error numbers registered by recognized standards bodies shall have
3 or 4 character error numbers.
5. Error numbers registered by all other organizations or individuals
shall have 4 character error numbers.
6. An error number shall not be redefined, nor modified except by the
organization or individual that originally defined it, or their
successors or assigns.
Cuervo, et al. Standards Track [Page 75]
^L
RFC 2885 Megaco Protocol August 2000
13.3 ServiceChange Reasons
The following considerations SHALL be met to register service change
reason with IANA:
1. A one phrase, 80-character maximum, unique reason code is
registered for each reason.
2. A complete description of the conditions under which the reason is
used is detected shall be included in a publicly available
document. The description shall be sufficiently clear to
differentiate the reason from all other existing reasons.
3. The document should be available on a public web server and should
have a stable URL.
Cuervo, et al. Standards Track [Page 76]
^L
RFC 2885 Megaco Protocol August 2000
ANNEX A: BINARY ENCODING OF THE PROTOCOL (NORMATIVE)
This Annex specifies the syntax of messages using the notation
defined in ASN.1 [ITU-T Recommendation X.680 (1997): Information
Technology - Abstract Syntax Notation One (ASN.1) - Specification of
basic notation.]. Messages shall be encoded for transmission by
applying the basic encoding rules specified in [ITU-T Recommendation
X.690(1994) Information Technology - ASN.1 Encoding Rules:
Specification of Basic Encoding Rules (BER)].
A.1 Coding of wildcards
The use of wildcards ALL and CHOOSE is allowed in the protocol. This
allows a MGC to partially specify Termination IDs and let the MG
choose from the values that conform to the partial specification.
Termination IDs may encode a hierarchy of names. This hierarchy is
provisioned. For instance, a TerminationID may consist of a trunk
group, a trunk within the group and a circuit. Wildcarding must be
possible at all levels. The following paragraphs explain how this is
achieved.
The ASN.1 description uses octet strings of up to 8 octets in length
for Termination IDs. This means that Termination IDs consist of at
most 64 bits. A fully specified Termination ID may be preceded by a
sequence of wildcarding fields. A wildcarding field is octet in
length. Bit 7 (the most significant bit) of this octet specifies
what type of wildcarding is invoked: if the bit value equals 1, then
the ALL wildcard is used; if the bit value if 0, then the CHOOSE
wildcard is used. Bit 6 of the wildcarding field specifies whether
the wildcarding pertains to one level in the hierarchical naming
scheme (bit value 0) or to the level of the hierarchy specified in
the wildcarding field plus all lower levels (bit value 1). Bits 0
through 5 of the wildcarding field specify the bit position in the
Termination ID at which the starts.
We illustrate this scheme with some examples. In these examples, the
most significant bit in a string of bits appears on the left hand
side.
Assume that Termination IDs are three octets long and that each octet
represents a level in a hierarchical naming scheme. A valid
Termination ID is
00000001 00011110 01010101.
Addressing ALL names with prefix 00000001 00011110 is done as
follows:
wildcarding field: 10000111
Termination ID: 00000001 00011110 xxxxxxxx.
Cuervo, et al. Standards Track [Page 77]
^L
RFC 2885 Megaco Protocol August 2000
The values of the bits labeled "x" is irrelevant and shall be ignored
by the receiver.
Indicating to the receiver that is must choose a name with 00011110
as the second octet is done as follows:
wildcarding fields: 00010111 followed by 00000111
Termination ID: xxxxxxxx 00011110 xxxxxxxx.
The first wildcard field indicates a CHOOSE wildcard for the level in
the naming hierarchy starting at bit 23, the highest level in our
assumed naming scheme. The second wildcard field indicates a CHOOSE
wildcard for the level in the naming hierarchy starting at bit 7, the
lowest level in our assumed naming scheme.
Finally, a CHOOSE-wildcarded name with the highest level of the name
equal to 00000001 is specified as follows:
wildcard field: 01001111
Termination ID: 0000001 xxxxxxxx xxxxxxxx .
Bit value 1 at bit position 6 of the first octet of the wildcard
field indicates that the wildcarding pertains to the specified level
in the naming hierarchy and all lower levels.
Context IDs may also be wildcarded. In the case of Context IDs,
however, specifying partial names is not allowed. Context ID 0x0
SHALL be used to indicate the NULL Context, Context ID 0xFFFFFFFE
SHALL be used to indicate a CHOOSE wildcard, and Context ID
0xFFFFFFFF SHALL be used to indicate an ALL wildcard.
TerminationID 0xFFFFFFFFFFFFFFFF SHALL be used to indicate the ROOT
Termination.
A.2 ASN.1 syntax specification
This section contains the ASN.1 specification of the H.248 protocol
syntax.
NOTE - In case a transport mechanism is used that employs
application level framing, the definition of Transaction below
changes. Refer to the annex defining the transport mechanism for the
definition that applies in that case.
NOTE - The ASN.1 specification below contains a clause defining
TerminationIDList as a sequence of TerminationIDs. The length of
this sequence SHALL be one. The SEQUENCE OF construct is present
only to allow future extensions.
MEDIA-GATEWAY-CONTROL DEFINITIONS AUTOMATIC TAGS::= BEGIN
Cuervo, et al. Standards Track [Page 78]
^L
RFC 2885 Megaco Protocol August 2000
MegacoMessage ::= SEQUENCE
{
authHeader AuthenticationHeader OPTIONAL,
mess Message
}
AuthenticationHeader ::= SEQUENCE
{
secParmIndex SecurityParmIndex,
seqNum SequenceNum,
ad AuthData
}
SecurityParmIndex ::= OCTET STRING(SIZE(4))
SequenceNum ::= OCTET STRING(SIZE(4))
AuthData ::= OCTET STRING (SIZE (16..32))
Message ::= SEQUENCE
{
version INTEGER(0..99),
-- The version of the protocol defined here is equal to 1.
mId MId, -- Name/address of message originator
messageBody CHOICE
{
messageError ErrorDescriptor,
transactions SEQUENCE OF Transaction
},
...
}
MId ::= CHOICE
{
ip4Address IP4Address,
ip6Address IP6Address,
domainName DomainName,
deviceName PathName,
mtpAddress OCTET STRING(SIZE(2)),
-- Addressing structure of mtpAddress:
-- 15 0
-- | PC | NI |
-- 14 bits 2 bits
...
}
DomainName ::= SEQUENCE
{
Cuervo, et al. Standards Track [Page 79]
^L
RFC 2885 Megaco Protocol August 2000
name IA5String,
-- The name starts with an alphanumeric digit followed by a
-- sequence of alphanumeric digits, hyphens and dots. No two
-- dots shall occur consecutively.
portNumber INTEGER(0..65535) OPTIONAL
}
IP4Address ::= SEQUENCE
{
address OCTET STRING (SIZE(4)),
portNumber INTEGER(0..65535) OPTIONAL
}
IP6Address ::= SEQUENCE
{
address OCTET STRING (SIZE(16)),
portNumber INTEGER(0..65535) OPTIONAL
}
PathName ::= IA5String(SIZE (1..64))
-- See section A.3
Transaction ::= CHOICE
{
transactionRequest TransactionRequest,
transactionPending TransactionPending,
transactionReply TransactionReply,
transactionResponseAck TransactionResponseAck,
-- use of response acks is dependent on underlying
transport
...
}
TransactionId ::= INTEGER(0..4294967295) -- 32 bit unsigned integer
TransactionRequest ::= SEQUENCE
{
transactionId TransactionId,
actions SEQUENCE OF ActionRequest,
...
}
TransactionPending ::= SEQUENCE
{
transactionId TransactionId,
...
}
Cuervo, et al. Standards Track [Page 80]
^L
RFC 2885 Megaco Protocol August 2000
TransactionReply ::= SEQUENCE
{
transactionId TransactionId,
transactionResult CHOICE
{
transactionError ErrorDescriptor,
actionReplies SEQUENCE OF ActionReply
},
...
}
TransactionResponseAck ::= SEQUENCE
{
firstAck TransactionId,
lastAck TransactionId OPTIONAL
}
ErrorDescriptor ::= SEQUENCE
{
errorCode ErrorCode,
errorText ErrorText OPTIONAL
}
ErrorCode ::= INTEGER(0..65535)
-- See section 13 for IANA considerations w.r.t. error codes
ErrorText ::= IA5String
ContextID ::= INTEGER(0..4294967295)
-- Context NULL Value: 0
-- Context CHOOSE Value: 429467294 (0xFFFFFFFE)
-- Context ALL Value: 4294967295 (0xFFFFFFFF)
ActionRequest ::= SEQUENCE
{
contextId ContextID,
contextRequest ContextRequest OPTIONAL,
contextAttrAuditReq ContextAttrAuditRequest OPTIONAL,
commandRequests SEQUENCE OF CommandRequest
}
ActionReply ::= SEQUENCE
{
contextId ContextID,
errorDescriptor ErrorDescriptor OPTIONAL,
contextReply ContextRequest OPTIONAL,
Cuervo, et al. Standards Track [Page 81]
^L
RFC 2885 Megaco Protocol August 2000
commandReply SEQUENCE OF CommandReply
}
ContextRequest ::= SEQUENCE
{
priority INTEGER(0..15) OPTIONAL,
emergency BOOLEAN OPTIONAL,
topologyReq SEQUENCE OF TopologyRequest OPTIONAL,
...
}
ContextAttrAuditRequest ::= SEQUENCE
{
topology NULL OPTIONAL,
emergency NULL OPTIONAL,
priority NULL OPTIONAL,
...
}
CommandRequest ::= SEQUENCE
{
command Command,
optional NULL OPTIONAL,
wildcardReturn NULL OPTIONAL,
...
}
Command ::= CHOICE
{
addReq AmmRequest,
moveReq AmmRequest,
modReq AmmRequest,
-- Add, Move, Modify requests have the same parameters
subtractReq SubtractRequest,
auditCapRequest AuditRequest,
auditValueRequest AuditRequest,
notifyReq NotifyRequest,
serviceChangeReq ServiceChangeRequest,
...
}
CommandReply ::= CHOICE
{
addReply AmmsReply,
moveReply AmmsReply,
modReply AmmsReply,
subtractReply AmmsReply,
-- Add, Move, Modify, Subtract replies have the same parameters
Cuervo, et al. Standards Track [Page 82]
^L
RFC 2885 Megaco Protocol August 2000
auditCapReply AuditReply,
auditValueReply AuditReply,
notifyReply NotifyReply,
serviceChangeReply ServiceChangeReply,
...
}
TopologyRequest ::= SEQUENCE
{
terminationFrom TerminationID,
terminationTo TerminationID,
topologyDirection ENUMERATED
{
bothway(0),
isolate(1),
oneway(2)
}
}
AmmRequest ::= SEQUENCE
{
terminationID TerminationIDList,
mediaDescriptor MediaDescriptor OPTIONAL,
modemDescriptor ModemDescriptor OPTIONAL,
muxDescriptor MuxDescriptor OPTIONAL,
eventsDescriptor EventsDescriptor OPTIONAL,
eventBufferDescriptor EventBufferDescriptor OPTIONAL,
signalsDescriptor SignalsDescriptor OPTIONAL,
digitMapDescriptor DigitMapDescriptor OPTIONAL,
auditDescriptor AuditDescriptor OPTIONAL,
...
}
AmmsReply ::= SEQUENCE
{
terminationID TerminationIDList,
terminationAudit TerminationAudit OPTIONAL
}
SubtractRequest ::= SEQUENCE
{
terminationID TerminationIDList,
auditDescriptor AuditDescriptor OPTIONAL,
...
}
AuditRequest ::= SEQUENCE
{
Cuervo, et al. Standards Track [Page 83]
^L
RFC 2885 Megaco Protocol August 2000
terminationID TerminationID,
auditDescriptor AuditDescriptor,
...
}
AuditReply ::= SEQUENCE
{
terminationID TerminationID,
auditResult AuditResult
}
AuditResult ::= CHOICE
{
contextAuditResult TerminationIDList,
terminationAuditResult TerminationAudit
}
AuditDescriptor ::= SEQUENCE
{
auditToken BIT STRING
{
muxToken(0), modemToken(1), mediaToken(2),
eventsToken(3), signalsToken(4),
digitMapToken(5), statsToken(6),
observedEventsToken(7),
packagesToken(8), eventBufferToken(9)
} OPTIONAL,
...
}
TerminationAudit ::= SEQUENCE OF AuditReturnParameter
AuditReturnParameter ::= CHOICE
{
errorDescriptor ErrorDescriptor,
mediaDescriptor MediaDescriptor,
modemDescriptor ModemDescriptor,
muxDescriptor MuxDescriptor,
eventsDescriptor EventsDescriptor,
eventBufferDescriptor EventBufferDescriptor,
signalsDescriptor SignalsDescriptor,
digitMapDescriptor DigitMapDescriptor,
observedEventsDescriptor ObservedEventsDescriptor,
statisticsDescriptor StatisticsDescriptor,
packagesDescriptor PackagesDescriptor,
...
}
Cuervo, et al. Standards Track [Page 84]
^L
RFC 2885 Megaco Protocol August 2000
NotifyRequest ::= SEQUENCE
{
terminationID TerminationIDList,
observedEventsDescriptor ObservedEventsDescriptor,
errorDescriptor ErrorDescriptor OPTIONAL,
...
}
NotifyReply ::= SEQUENCE
{
terminationID TerminationIDList OPTIONAL,
errorDescriptor ErrorDescriptor OPTIONAL,
...
}
ObservedEventsDescriptor ::= SEQUENCE
{
requestId RequestID,
observedEventLst SEQUENCE OF ObservedEvent
}
ObservedEvent ::= SEQUENCE
{
eventName EventName,
streamID StreamID OPTIONAL,
eventParList SEQUENCE OF EventParameter,
timeNotation TimeNotation OPTIONAL
}
EventName ::= PkgdName
EventParameter ::= SEQUENCE
{
eventParameterName Name,
value Value
}
ServiceChangeRequest ::= SEQUENCE
{
terminationID TerminationIDList,
serviceChangeParms ServiceChangeParm,
...
}
ServiceChangeReply ::= SEQUENCE
{
terminationID TerminationIDList,
serviceChangeResult ServiceChangeResult,
Cuervo, et al. Standards Track [Page 85]
^L
RFC 2885 Megaco Protocol August 2000
...
}
-- For ServiceChangeResult, no parameters are mandatory. Hence the
-- distinction between ServiceChangeParm and ServiceChangeResParm.
ServiceChangeResult ::= CHOICE
{
errorDescriptor ErrorDescriptor,
serviceChangeResParms ServiceChangeResParm
}
WildcardField ::= OCTET STRING(SIZE(1))
TerminationID ::= SEQUENCE
{
wildcard SEQUENCE OF WildcardField,
id OCTET STRING(SIZE(1..8))
}
-- See Section A.1 for explanation of wildcarding mechanism.
-- Termination ID 0xFFFFFFFFFFFFFFFF indicates the ROOT Termination.
TerminationIDList ::= SEQUENCE OF TerminationID
MediaDescriptor ::= SEQUENCE
{
termStateDescr TerminationStateDescriptor OPTIONAL,
streams CHOICE
{
oneStream StreamParms,
multiStream SEQUENCE OF StreamDescriptor
},
...
}
StreamDescriptor ::= SEQUENCE
{
streamID StreamID,
streamParms StreamParms
}
StreamParms ::= SEQUENCE
{
localControlDescriptor LocalControlDescriptor OPTIONAL,
localDescriptor LocalRemoteDescriptor OPTIONAL,
remoteDescriptor LocalRemoteDescriptor OPTIONAL,
...
}
Cuervo, et al. Standards Track [Page 86]
^L
RFC 2885 Megaco Protocol August 2000
LocalControlDescriptor ::= SEQUENCE
{
streamMode StreamMode OPTIONAL,
reserveValue BOOLEAN,
reserveGroup BOOLEAN,
propertyParms SEQUENCE OF PropertyParm,
...
}
StreamMode ::= ENUMERATED
{
sendOnly(0),
recvOnly(1),
sendRecv(2),
inactive(3),
loopBack(4),
...
}
-- In PropertyParm, value is a SEQUENCE OF octet string. When sent
-- by an MGC the interpretation is as follows:
-- empty sequence means CHOOSE
-- one element sequence specifies value
-- longer sequence means "choose one of the values"
-- The relation field may only be selected if the value sequence
-- has length 1. It indicates that the MG has to choose a value
-- for the property. E.g., x > 3 (using the greaterThan
-- value for relation) instructs the MG to choose any value larger
-- than 3 for property x.
-- The range field may only be selected if the value sequence
-- has length 2. It indicates that the MG has to choose a value
-- in the range between the first octet in the value sequence and
-- the trailing octet in the value sequence, including the
-- boundary values.
-- When sent by the MG, only responses to an AuditCapability request
-- may contain multiple values, a range, or a relation field.
PropertyParm ::= SEQUENCE
{
name PkgdName,
value SEQUENCE OF OCTET STRING,
extraInfo CHOICE
{
relation Relation,
range BOOLEAN
} OPTIONAL
}
Cuervo, et al. Standards Track [Page 87]
^L
RFC 2885 Megaco Protocol August 2000
Name ::= OCTET STRING(SIZE(2))
PkgdName ::= OCTET STRING(SIZE(4))
-- represents Package Name (2 octets) plus Property Name (2 octets)
-- To wildcard a package use 0xFFFF for first two octets, choose
-- is not allowed. To reference native property tag specified in
-- Annex C, use 0x0000 as first two octets.
-- Wildcarding of Package Name is permitted only if Property Name is
-- also wildcarded.
Relation ::= ENUMERATED
{
greaterThan(0),
smallerThan(1),
unequalTo(2),
...
}
LocalRemoteDescriptor ::= SEQUENCE
{
propGrps SEQUENCE OF PropertyGroup,
...
}
PropertyGroup ::= SEQUENCE OF PropertyParm
TerminationStateDescriptor ::= SEQUENCE
{
propertyParms SEQUENCE OF PropertyParm,
eventBufferControl EventBufferControl OPTIONAL,
serviceState ServiceState OPTIONAL,
...
}
EventBufferControl ::= ENUMERATED
{
Off(0),
LockStep(1),
...
}
ServiceState ::= ENUMERATED
{
test(0),
outOfSvc(1),
inSvc(2),
...
}
Cuervo, et al. Standards Track [Page 88]
^L
RFC 2885 Megaco Protocol August 2000
MuxDescriptor ::= SEQUENCE
{
muxType MuxType,
termList SEQUENCE OF TerminationID,
nonStandardData NonStandardData OPTIONAL,
...
}
MuxType ::= ENUMERATED
{
h221(0),
h223(1),
h226(2),
v76(3),
...
}
StreamID ::= INTEGER(0..65535) -- 16 bit unsigned integer
EventsDescriptor ::= SEQUENCE
{
requestID RequestID,
eventList SEQUENCE OF RequestedEvent
}
RequestedEvent ::= SEQUENCE
{
pkgdName PkgdName,
streamID StreamID OPTIONAL,
eventAction RequestedActions OPTIONAL,
evParList SEQUENCE OF EventParameter
}
RequestedActions ::= SEQUENCE
{
keepActive BOOLEAN,
eventDM EventDM OPTIONAL,
secondEvent SecondEventsDescriptor OPTIONAL,
signalsDescriptor SignalsDescriptor OPTIONAL,
...
}
EventDM ::= CHOICE
{ digitMapName DigitMapName,
digitMapValue DigitMapValue
}
Cuervo, et al. Standards Track [Page 89]
^L
RFC 2885 Megaco Protocol August 2000
SecondEventsDescriptor ::= SEQUENCE
{
requestID RequestID,
eventList SEQUENCE OF SecondRequestedEvent
}
SecondRequestedEvent ::= SEQUENCE
{
pkgdName PkgdName,
streamID StreamID OPTIONAL,
eventAction SecondRequestedActions OPTIONAL,
evParList SEQUENCE OF EventParameter
}
SecondRequestedActions ::= SEQUENCE
{
keepActive BOOLEAN,
eventDM EventDM OPTIONAL,
signalsDescriptor SignalsDescriptor OPTIONAL,
...
}
EventBufferDescriptor ::= SEQUENCE OF ObservedEvent
SignalsDescriptor ::= SEQUENCE OF SignalRequest
SignalRequest ::=CHOICE
{
signal Signal,
seqSigList SeqSigList
}
SeqSigList ::= SEQUENCE
{
id INTEGER(0..65535),
signalList SEQUENCE OF Signal
}
Signal ::= SEQUENCE
{
signalName SignalName,
streamID StreamID OPTIONAL,
sigType SignalType OPTIONAL,
duration INTEGER (0..65535) OPTIONAL,
notifyCompletion BOOLEAN OPTIONAL,
keepActive BOOLEAN OPTIONAL,
sigParList SEQUENCE OF SigParameter
}
Cuervo, et al. Standards Track [Page 90]
^L
RFC 2885 Megaco Protocol August 2000
SignalType ::= ENUMERATED
{
brief(0),
onOff(1),
timeOut(2),
...
}
SignalName ::= PkgdName
SigParameter ::= SEQUENCE
{
sigParameterName Name,
value Value
}
RequestID ::= INTEGER(0..4294967295) -- 32 bit unsigned integer
ModemDescriptor ::= SEQUENCE
{
mtl SEQUENCE OF ModemType,
mpl SEQUENCE OF PropertyParm,
nonStandardData NonStandardData OPTIONAL
}
ModemType ::= ENUMERATED
{
v18(0),
v22(1),
v22bis(2),
v32(3),
v32bis(4),
v34(5),
v90(6),
v91(7),
synchISDN(8),
...
}
DigitMapDescriptor ::= SEQUENCE
{
digitMapName DigitMapName,
digitMapValue DigitMapValue
}
DigitMapName ::= Name
DigitMapValue ::= SEQUENCE
Cuervo, et al. Standards Track [Page 91]
^L
RFC 2885 Megaco Protocol August 2000
{
startTimer INTEGER(0..99) OPTIONAL,
shortTimer INTEGER(0..99) OPTIONAL,
longTimer INTEGER(0..99) OPTIONAL,
digitMapBody IA5String
-- See Section A.3 for explanation of digit map syntax
}
ServiceChangeParm ::= SEQUENCE
{
serviceChangeMethod ServiceChangeMethod,
serviceChangeAddress ServiceChangeAddress OPTIONAL,
serviceChangeVersion INTEGER(0..99) OPTIONAL,
serviceChangeProfile ServiceChangeProfile OPTIONAL,
serviceChangeReason Value,
serviceChangeDelay INTEGER(0..4294967295) OPTIONAL,
-- 32 bit unsigned integer
serviceChangeMgcId MId OPTIONAL,
timeStamp TimeNotation OPTIONAL,
nonStandardData NonStandardData OPTIONAL,
}
ServiceChangeAddress ::= CHOICE
{
portNumber INTEGER(0..65535), -- TCP/UDP port number
ip4Address IP4Address,
ip6Address IP6Address,
domainName DomainName,
deviceName PathName,
mtpAddress OCTET STRING(SIZE(2)),
...
}
ServiceChangeResParm ::= SEQUENCE
{
serviceChangeMgcId MId OPTIONAL,
serviceChangeAddress ServiceChangeAddress OPTIONAL,
serviceChangeVersion INTEGER(0..99) OPTIONAL,
serviceChangeProfile ServiceChangeProfile OPTIONAL
}
ServiceChangeMethod ::= ENUMERATED
{
failover(0),
forced(1),
graceful(2),
restart(3),
disconnected(4),
Cuervo, et al. Standards Track [Page 92]
^L
RFC 2885 Megaco Protocol August 2000
handOff(5),
...
}
ServiceChangeProfile ::= SEQUENCE
{
profileName Name,
version INTEGER(0..99)
}
PackagesDescriptor ::= SEQUENCE OF PackagesItem
PackagesItem ::= SEQUENCE
{
packageName Name,
packageVersion INTEGER(0..99)
}
StatisticsDescriptor ::= SEQUENCE OF StatisticsParameter
StatisticsParameter ::= SEQUENCE
{
statName PkgdName,
statValue Value
}
NonStandardData ::= SEQUENCE
{
nonStandardIdentifier NonStandardIdentifier,
data OCTET STRING
}
NonStandardIdentifier ::= CHOICE
{
object OBJECT IDENTIFIER,
h221NonStandard H221NonStandard,
experimental IA5STRING(SIZE(8)),
-- first two characters should be "X-" or "X+"
...
}
H221NonStandard ::= SEQUENCE
{ t35CountryCode INTEGER(0..255), -- country, as per T.35
t35Extension INTEGER(0..255), -- assigned nationally
manufacturerCode INTEGER(0..65535), -- assigned nationally
...
}
Cuervo, et al. Standards Track [Page 93]
^L
RFC 2885 Megaco Protocol August 2000
TimeNotation ::= SEQUENCE
{
date IA5String(SIZE(8)), -- yyyymmdd format
time IA5String(SIZE(8)) -- hhmmssss format
}
Value ::= OCTET STRING
END
A.3 Digit maps and path names
From a syntactic viewpoint, digit maps are strings with syntactic
restrictions imposed upon them. The syntax of valid digit maps is
specified in ABNF [RFC 2234]. The syntax for digit maps presented in
this section is for illustrative purposes only. The definition of
digitMap in Annex B takes precedence in the case of differences
between the two.
digitMap = (digitString / LWSP "(" LWSP digitStringList LWSP ")"
LWSP)
digitStringList = digitString *( LWSP "/" LWSP digitString )
digitString = 1*(digitStringElement)
digitStringElement = digitPosition [DOT]
digitPosition = digitMapLetter / digitMapRange
digitMapRange = ("x" / LWSP "[" LWSP digitLetter LWSP "]" LWSP)
digitLetter = *((DIGIT "-" DIGIT) /digitMapLetter)
digitMapLetter = DIGIT ;digits 0-9
/ %x41-4B / %x61-6B ;a-k and A-K
/ "L" / "S" ;Inter-event timers
;(long, short)
/ "Z" ;Long duration event
LWSP = *(WSP / COMMENT / EOL)
WSP = SP / HTAB
COMMENT = ";" *(SafeChar / RestChar / WSP) EOL
EOL = (CR [LF]) / LF
SP = %x20
HTAB = %x09
CR = %x0D
LF = %x0A
SafeChar = DIGIT / ALPHA / "+" / "-" / "&" / "!" / "_" / "/" /
"'" / "?" / "@" / "^" / "`" / "~" / "*" / "$" / "\" /
"(" / ")" / "%" / "."
RestChar = ";" / "[" / "]" / "{" / "}" / ":" / "," / "#" /
"<" / ">" / "=" / %x22
DIGIT = %x30-39 ; digits 0 through 9
Cuervo, et al. Standards Track [Page 94]
^L
RFC 2885 Megaco Protocol August 2000
ALPHA = %x41-5A / %x61-7A ; A-Z, a-z
A path name is also a string with syntactic restrictions imposed
upon it. The ABNF production defining it is copied from Annex B.
PathName = NAME *(["/"] ["*"] ["@"] (ALPHA / DIGIT)) ["*"]
NAME = ALPHA *63(ALPHA / DIGIT / "_" )
ANNEX B TEXT ENCODING OF THE PROTOCOL (NORMATIVE)
B.1 Coding of wildcards
In a text encoding of the protocol, while TerminationIDs are
arbitrary, by judicious choice of names, the wildcard character, "*"
may be made more useful. When the wildcard character is encountered,
it will "match" all TerminationIDs having the same previous and
following characters (if appropriate). For example, if there were
TerminationIDs of R13/3/1, R13/3/2 and R13/3/3, the TerminationID
R13/3/* would match all of them. There are some circumstances where
ALL Terminations must be referred to. The TerminationID "*"
suffices, and is referred to as ALL. The CHOOSE TerminationID "$" may
be used to signal to the MG that it has to create an ephemeral
Termination or select an idle physical Termination.
B.2 ABNF specification
The protocol syntax is presented in ABNF according to RFC2234.
megacoMessage = LWSP [authenticationHeader SEP ] message
authenticationHeader = AuthToken EQUAL SecurityParmIndex COLON
SequenceNum COLON AuthData
SecurityParmIndex = "0x" 8(HEXDIG)
SequenceNum = "0x" 8(HEXDIG)
AuthData = "0x" 32*64(HEXDIG)
message = MegacopToken SLASH Version SEP mId SEP messageBody
; The version of the protocol defined here is equal to 1.
messageBody = ( errorDescriptor / transactionList )
transactionList = 1*( transactionRequest / transactionReply /
transactionPending / transactionResponseAck )
;Use of response acks is dependent on underlying transport
transactionPending = PendingToken EQUAL TransactionID LBRKT RBRKT
Cuervo, et al. Standards Track [Page 95]
^L
RFC 2885 Megaco Protocol August 2000
transactionResponseAck = ResponseAckToken LBRKT transactionAck
*(COMMA transactionAck) RBRKT
transactionAck = transactionID / (transactionID "-" transactionID)
transactionRequest = TransToken EQUAL TransactionID LBRKT
actionRequest *(COMMA actionRequest) RBRKT
actionRequest = CtxToken EQUAL ContextID LBRKT ((
contextRequest [COMMA commandRequestList])
/ commandRequestList) RBRKT
contextRequest = ((contextProperties [COMMA contextAudit])
/ contextAudit)
contextProperties = contextProperty *(COMMA contextProperty)
; at-most-once
contextProperty = (topologyDescriptor / priority / EmergencyToken)
contextAudit = ContextAuditToken LBRKT
contextAuditProperties *(COMMA
contextAuditProperties) RBRKT
; at-most-once
contextAuditProperties = ( TopologyToken / EmergencyToken /
PriorityToken )
commandRequestList= ["O-"] commandRequest *(COMMA ["O-"]
commandRequest)
commandRequest = ( ammRequest / subtractRequest / auditRequest
/ notifyRequest / serviceChangeRequest)
transactionReply = ReplyToken EQUAL TransactionID LBRKT
( errorDescriptor / actionReplyList ) RBRKT
actionReplyList = actionReply *(COMMA actionReply )
actionReply = CtxToken EQUAL ContextID LBRKT
( errorDescriptor / commandReply ) RBRKT
commandReply = (( contextProperties [COMMA commandReplyList] )
/ commandReplyList )
commandReplyList = commandReplys *(COMMA commandReplys )
Cuervo, et al. Standards Track [Page 96]
^L
RFC 2885 Megaco Protocol August 2000
commandReplys = (serviceChangeReply / auditReply / ammsReply
/ notifyReply )
;Add Move and Modify have the same request parameters
ammRequest = (AddToken / MoveToken / ModifyToken ) EQUAL
TerminationID [LBRKT ammParameter *(COMMA
ammParameter) RBRKT]
;at-most-once
ammParameter = (mediaDescriptor / modemDescriptor /
muxDescriptor / eventsDescriptor /
signalsDescriptor / digitMapDescriptor /
eventBufferDescriptor / auditDescriptor)
ammsReply = (AddToken / MoveToken / ModifyToken /
SubtractToken ) EQUAL TerminationID [ LBRKT
terminationAudit RBRKT ]
subtractRequest = ["W-"] SubtractToken EQUAL TerminationID
[ LBRKT auditDescriptor RBRKT]
auditRequest = ["W-"] (AuditValueToken / AuditCapToken )
EQUAL TerminationID LBRKT auditDescriptor RBRKT
auditReply = (AuditValueToken / AuditCapToken )
( contextTerminationAudit / auditOther)
auditOther = EQUAL TerminationID LBRKT
terminationAudit RBRKT
terminationAudit = auditReturnParameter *(COMMA
auditReturnParameter)
contextTerminationAudit = EQUAL CtxToken ( terminationIDList /
LBRKT errorDescriptor RBRKT )
;at-most-once except errorDescriptor
auditReturnParameter = (mediaDescriptor / modemDescriptor /
muxDescriptor / eventsDescriptor /
signalsDescriptor / digitMapDescriptor /
observedEventsDescriptor / eventBufferDescriptor /
statisticsDescriptor / packagesDescriptor /
errorDescriptor )
auditDescriptor = AuditToken LBRKT [ auditItem
*(COMMA auditItem) ] RBRKT
Cuervo, et al. Standards Track [Page 97]
^L
RFC 2885 Megaco Protocol August 2000
notifyRequest = NotifyToken EQUAL TerminationID
LBRKT ( observedEventsDescriptor
[ COMMA errorDescriptor ] ) RBRKT
notifyReply = NotifyToken EQUAL TerminationID
[ LBRKT errorDescriptor RBRKT ]
serviceChangeRequest = ServiceChangeToken EQUAL TerminationID
LBRKT serviceChangeDescriptor RBRKT
serviceChangeReply = ServiceChangeToken EQUAL TerminationID
[LBRKT (errorDescriptor /
serviceChangeReplyDescriptor) RBRKT]
errorDescriptor = ErrorToken EQUAL ErrorCode
LBRKT [quotedString] RBRKT
ErrorCode = 1*4(DIGIT) ; could be extended
TransactionID = UINT32
mId = (( domainAddress / domainName )
[":" portNumber]) / mtpAddress / deviceName
; ABNF allows two or more consecutive "." although it is meaningless
; in a domain name.
domainName = "<" (ALPHA / DIGIT) *63(ALPHA / DIGIT / "-" /
".") ">"
deviceName = pathNAME
ContextID = (UINT32 / "*" / "-" / "$")
domainAddress = "[" (IPv4address / IPv6address) "]"
;RFC2373 contains the definition of IP6Addresses.
IPv6address = hexpart [ ":" IPv4address ]
IPv4address = V4hex DOT V4hex DOT V4hex DOT V4hex
V4hex = 1*3(DIGIT) ; "0".."225"
; this production, while occurring in RFC2373, is not referenced
; IPv6prefix = hexpart SLASH 1*2DIGIT
hexpart = hexseq "::" [ hexseq ] / "::" [ hexseq ] / hexseq
hexseq = hex4 *( ":" hex4)
hex4 = 1*4HEXDIG
portNumber = UINT16
; An mtp address is two octets long
mtpAddress = MTPToken LBRKT octetString RBRKT
Cuervo, et al. Standards Track [Page 98]
^L
RFC 2885 Megaco Protocol August 2000
terminationIDList = LBRKT TerminationID *(COMMA TerminationID)
RBRKT
; Total length of pathNAME must not exceed 64 chars.
pathNAME = ["*"] NAME *("/" / "*"/ ALPHA / DIGIT /"_" / "$" )
["@" pathDomainName ]
; ABNF allows two or more consecutive "." although it is meaningless
; in a path domain name.
pathDomainName = (ALPHA / DIGIT / "*" )
*63(ALPHA / DIGIT / "-" / "*" / ".")
TerminationID = "ROOT" / pathNAME / "$" / "*"
mediaDescriptor = MediaToken LBRKT mediaParm *(COMMA mediaParm)
RBRKT
; at-most-once per item
; and either streamParm or streamDescriptor but not both
mediaParm = (streamParm / streamDescriptor /
terminationStateDescriptor)
; at-most-once
streamParm = ( localDescriptor / remoteDescriptor /
localControlDescriptor )
streamDescriptor = StreamToken EQUAL StreamID LBRKT streamParm
*(COMMA streamParm) RBRKT
localControlDescriptor = LocalControlToken LBRKT localParm
*(COMMA localParm) RBRKT
; at-most-once per item
localParm = ( streamMode / propertyParm /
reservedValueMode
/ reservedGroupMode )
reservedValueMode = ReservedValueToken EQUAL ( "ON" / "OFF" )
reservedGroupMode = ReservedGroupToken EQUAL ( "ON" / "OFF" )
streamMode = ModeToken EQUAL streamModes
streamModes = (SendonlyToken / RecvonlyToken /
SendrecvToken /
InactiveToken / LoopbackToken )
Cuervo, et al. Standards Track [Page 99]
^L
RFC 2885 Megaco Protocol August 2000
propertyParm = pkgdName parmValue
parmValue = (EQUAL alternativeValue/ INEQUAL VALUE)
alternativeValue = ( VALUE / LSBRKT VALUE *(COMMA VALUE) RSBRKT
/
LSBRKT VALUE DOT DOT VALUE RSBRKT )
INEQUAL = LWSP (">" / "<" / "#" ) LWSP
LSBRKT = LWSP "[" LWSP
RSBRKT = LWSP "]" LWSP
localDescriptor = LocalToken LBRKT octetString RBRKT
remoteDescriptor = RemoteToken LBRKT octetString RBRKT
eventBufferDescriptor= EventBufferToken LBRKT observedEvent
*( COMMA observedEvent ) RBRKT
eventBufferControl = BufferToken EQUAL ( "OFF" / LockStepToken )
terminationStateDescriptor = TerminationStateToken LBRKT
terminationStateParm *( COMMA terminationStateParm )
RBRKT
; at-most-once per item
terminationStateParm =(propertyParm / serviceStates /
eventBufferControl )
serviceStates = ServiceStatesToken EQUAL ( TestToken /
OutOfSvcToken / InSvcToken )
muxDescriptor = MuxToken EQUAL MuxType terminationIDList
MuxType = ( H221Token / H223Token / H226Token /
V76Token / extensionParameter )
StreamID = UINT16
pkgdName = (PackageName SLASH ItemID) ;specific item
/ (PackageName SLASH "*") ;all events in package
/ ("*" SLASH "*") ; all events supported by the MG
PackageName = NAME
ItemID = NAME
eventsDescriptor = EventsToken EQUAL RequestID LBRKT
requestedEvent *( COMMA requestedEvent ) RBRKT
requestedEvent = pkgdName [ LBRKT eventParameter
*( COMMA eventParameter ) RBRKT ]
Cuervo, et al. Standards Track [Page 100]
^L
RFC 2885 Megaco Protocol August 2000
; at-most-once each of KeepActiveToken , eventDM and eventStream
;at most one of either embedWithSig or embedNoSig but not both
;KeepActiveToken and embedWithSig must not both be present
eventParameter = ( embedWithSig / embedNoSig / KeepActiveToken
/eventDM / eventStream / eventOther )
embedWithSig = EmbedToken LBRKT signalsDescriptor
[COMMA embedFirst ] RBRKT
embedNoSig = EmbedToken LBRKT embedFirst RBRKT
; at-most-once of each
embedFirst = EventsToken EQUAL RequestID LBRKT
secondRequestedEvent *(COMMA secondRequestedEvent) RBRKT
secondRequestedEvent = pkgdName [ LBRKT secondEventParameter
*( COMMA secondEventParameter ) RBRKT ]
; at-most-once each of embedSig , KeepActiveToken, eventDM or
; eventStream
; KeepActiveToken and embedSig must not both be present
secondEventParameter = ( EmbedSig / KeepActiveToken / eventDM /
eventStream / eventOther )
embedSig = EmbedToken LBRKT signalsDescriptor RBRKT
eventStream = StreamToken EQUAL StreamID
eventOther = eventParameterName parmValue
eventParameterName = NAME
eventDM = DigitMapToken ((EQUAL digitMapName ) /
(LBRKT digitMapValue RBRKT ))
signalsDescriptor = SignalsToken LBRKT [ signalParm
*(COMMA signalParm)] RBRKT
signalParm = signalList / signalRequest
signalRequest = signalName [ LBRKT sigParameter
*(COMMA sigParameter) RBRKT ]
signalList = SignalListToken EQUAL signalListId LBRKT
signalListParm *(COMMA signalListParm) RBRKT
signalListId = UINT16
Cuervo, et al. Standards Track [Page 101]
^L
RFC 2885 Megaco Protocol August 2000
;exactly once signalType, at most once duration and every signal
;parameter
signalListParm = signalRequest
signalName = pkgdName
;at-most-once sigStream, at-most-once sigSignalType,
;at-most-once sigDuration, every signalParameterName at most once
sigParameter = sigStream / sigSignalType / sigDuration / sigOther
/ notifyCompletion / KeepActiveToken
sigStream = StreamToken EQUAL StreamID
sigOther = sigParameterName parmValue
sigParameterName = NAME
sigSignalType = SignalTypeToken EQUAL signalType
signalType = (OnOffToken / TimeOutToken / BriefToken)
sigDuration = DurationToken EQUAL UINT16
notifyCompletion = NotifyCompletionToken EQUAL ("ON" / "OFF")
observedEventsDescriptor = ObservedEventsToken EQUAL RequestID
LBRKT observedEvent *(COMMA observedEvent) RBRKT
;time per event, because it might be buffered
observedEvent = [ TimeStamp LWSP COLON] LWSP
pkgdName [ LBRKT observedEventParameter
*(COMMA observedEventParameter) RBRKT ]
;at-most-once eventStream, every eventParameterName at most once
observedEventParameter = eventStream / eventOther
RequestID = UINT32
modemDescriptor = ModemToken (( EQUAL modemType) /
(LSBRKT modemType *(COMMA modemType) RSBRKT))
[ LBRKT NAME parmValue
*(COMMA NAME parmValue) RBRKT ]
; at-most-once
modemType = (V32bisToken / V22bisToken / V18Token /
V22Token / V32Token / V34Token / V90Token /
V91Token / SynchISDNToken / extensionParameter)
digitMapDescriptor = DigitMapToken EQUAL digitMapName
( LBRKT digitMapValue RBRKT )
digitMapName = NAME
digitMapValue = ["T" COLON Timer COMMA] ["S" COLON Timer COMMA]
["L" COLON Timer COMMA] digitMap
Timer = 1*2DIGIT
digitMap =
digitString / LWSP "(" LWSP digitStringList LWSP ")" LWSP)
Cuervo, et al. Standards Track [Page 102]
^L
RFC 2885 Megaco Protocol August 2000
digitStringList = digitString *( LWSP "|" LWSP digitString )
digitString = 1*(digitStringElement)
digitStringElement = digitPosition [DOT]
digitPosition = digitMapLetter / digitMapRange
digitMapRange = ("x" / LWSP "[" LWSP digitLetter LWSP "]" LWSP)
digitLetter = *((DIGIT "-" DIGIT ) / digitMapLetter)
digitMapLetter = DIGIT ;Basic event symbols
/ %x41-4B / %x61-6B ; a-k, A-K
/ "L" / "S" ;Inter-event timers (long, short)
/ Z" ;Long duration modifier
;at-most-once
auditItem = ( MuxToken / ModemToken / MediaToken /
SignalsToken / EventBufferToken /
DigitMapToken / StatsToken / EventsToken /
ObservedEventsToken / PackagesToken )
serviceChangeDescriptor = ServicesToken LBRKT serviceChangeParm
*(COMMA serviceChangeParm) RBRKT
serviceChangeParm = (serviceChangeMethod / serviceChangeReason /
serviceChangeDelay / serviceChangeAddress /
serviceChangeProfile / extension / TimeStamp /
serviceChangeMgcId / serviceChangeVersion )
serviceChangeReplyDescriptor = ServicesToken LBRKT
servChgReplyParm *(COMMA servChgReplyParm) RBRKT
;at-most-once. Version is REQUIRED on first ServiceChange response
servChgReplyParm = (serviceChangeAddress / serviceChangeMgcId /
serviceChangeProfile / serviceChangeVersion )
serviceChangeMethod = MethodToken EQUAL (FailoverToken /
ForcedToken / GracefulToken / RestartToken /
DisconnectedToken / HandOffToken /
extensionParameter)
serviceChangeReason = ReasonToken EQUAL VALUE
serviceChangeDelay = DelayToken EQUAL UINT32
serviceChangeAddress = ServiceChangeAddressToken EQUAL VALUE
serviceChangeMgcId = MgcIdToken EQUAL mId
serviceChangeProfile = ProfileToken EQUAL NAME SLASH Version
serviceChangeVersion = VersionToken EQUAL Version
extension = extensionParameter parmValue
packagesDescriptor = PackagesToken LBRKT packagesItem
*(COMMA packagesItem) RBRKT
Version = 1*2(DIGIT)
Cuervo, et al. Standards Track [Page 103]
^L
RFC 2885 Megaco Protocol August 2000
packagesItem = NAME "-" UINT16
TimeStamp = Date "T" Time ; per ISO 8601:1988
; Date = yyyymmdd
Date = 8(DIGIT)
; Time = hhmmssss
Time = 8(DIGIT)
statisticsDescriptor = StatsToken LBRKT statisticsParameter
*(COMMA statisticsParameter ) RBRKT
;at-most-once per item
statisticsParameter = pkgdName EQUAL VALUE
topologyDescriptor = TopologyToken LBRKT terminationA COMMA
terminationB COMMA topologyDirection RBRKT
terminationA = TerminationID
terminationB = TerminationID
topologyDirection = BothwayToken / IsolateToken / OnewayToken
priority = PriorityToken EQUAL UINT16
extensionParameter = "X" ("-" / "+") 1*6(ALPHA / DIGIT)
; octetString is used to describe SDP defined in RFC2327.
; Caution should be taken if CRLF in RFC2327 is used.
; To be safe, use EOL in this ABNF.
; Whenever "}" appears in SDP, it is escaped by "\", e.g., "\}"
octetString = *(nonEscapeChar)
nonEscapeChar = ( "\}" / %x01-7C / %x7E-FF )
quotedString = DQUOTE 1*(SafeChar / RestChar/ WSP) DQUOTE
UINT16 = 1*5(DIGIT) ; %x0-FFFF
UINT32 = 1*10(DIGIT) ; %x0-FFFFFFFF
NAME = ALPHA *63(ALPHA / DIGIT / "_" )
VALUE = quotedString / 1*(SafeChar)
SafeChar = DIGIT / ALPHA / "+" / "-" / "&" /
"!" / "_" / "/" / "'" / "?" / "@" /
"^" / "`" / "~" / "*" / "$" / "\" /
"(" / ")" / "%" / "|" / "."
EQUAL = LWSP %x3D LWSP ; "="
COLON = %x3A ; ":"
LBRKT = LWSP %x7B LWSP ; "{"
RBRKT = LWSP %x7D LWSP ; "}"
COMMA = LWSP %x2C LWSP ; ","
DOT = %x2E ; "."
SLASH = %x2F ; "/"
Cuervo, et al. Standards Track [Page 104]
^L
RFC 2885 Megaco Protocol August 2000
ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
DIGIT = %x30-39 ; 0-9
DQUOTE = %x22 ; " (Double Quote)
HEXDIG = ( DIGIT / "A" / "B" / "C" / "D" / "E" / "F" )
SP = %x20 ; space
HTAB = %x09 ; horizontal tab
CR = %x0D ; Carriage return
LF = %x0A ; linefeed
LWSP = *( WSP / COMMENT / EOL )
EOL = (CR [LF] / LF )
WSP = SP / HTAB ; white space
SEP = ( WSP / EOL / COMMENT) LWSP
COMMENT = ";" *(SafeChar/ RestChar / WSP / %x22) EOL
RestChar = ";" / "[" / "]" / "{" / "}" / ":" / "," / "#"
/
"<" / ">" / "="
AddToken = ("Add" / "A")
AuditToken = ("Audit" / "AT")
AuditCapToken = ("AuditCapability" / "AC")
AuditValueToken = ("AuditValue" / "AV")
AuthToken = ("Authentication" / "AU")
BothwayToken = ("Bothway" / "BW")
BriefToken = ("Brief" / "BR")
BufferToken = ("Buffer" / "BF")
CtxToken = ("Context" / "C")
ContextAuditToken = ("ContextAudit" / "CA")
DigitMapToken = ("DigitMap" / "DM")
DiscardToken = ("Discard" / "DS")
DisconnectedToken = ("Disconnected" / "DC")
DelayToken = ("Delay" / "DL")
DurationToken = ("Duration" / "DR")
EmbedToken = ("Embed" / "EB")
EmergencyToken = ("Emergency" / "EM")
ErrorToken = ("Error" / "ER")
EventBufferToken = ("EventBuffer" / "EB")
EventsToken = ("Events" / "E")
FailoverToken = ("Failover" / "FL")
ForcedToken = ("Forced" / "FO")
GracefulToken = ("Graceful" / "GR")
H221Token = ("H221" )
H223Token = ("H223" )
H226Token = ("H226" )
HandOffToken = ("HandOff" / "HO")
InactiveToken = ("Inactive" / "IN")
IsolateToken = ("Isolate" / "IS")
InSvcToken = ("InService" / "IV")
Cuervo, et al. Standards Track [Page 105]
^L
RFC 2885 Megaco Protocol August 2000
KeepActiveToken = ("KeepActive" / "KA")
LocalToken = ("Local" / "L")
LocalControlToken = ("LocalControl" / "O")
LockStepToken = ("LockStep" / "SP")
LoopbackToken = ("Loopback" / "LB")
MediaToken = ("Media" / "M")
MegacopToken = ("MEGACO" / "!")
MethodToken = ("Method" / "MT")
MgcIdToken = ("MgcIdToTry" / "MG")
ModeToken = ("Mode" / "MO")
ModifyToken = ("Modify" / "MF")
ModemToken = ("Modem" / "MD")
MoveToken = ("Move" / "MV")
MTPToken = ("MTP")
MuxToken = ("Mux" / "MX")
NotifyToken = ("Notify" / "N")
NotifyCompletionToken = ("NotifyCompletion" / "NC")
ObservedEventsToken = ("ObservedEvents" / "OE")
OnewayToken = ("Oneway" / "OW")
OnOffToken = ("OnOff" / "OO")
OutOfSvcToken = ("OutOfService" / "OS")
PackagesToken = ("Packages" / "PG")
PendingToken = ("Pending" / "PN")
PriorityToken = ("Priority" / "PR")
ProfileToken = ("Profile" / "PF")
ReasonToken = ("Reason" / "RE")
RecvonlyToken = ("ReceiveOnly" / "RC")
ReplyToken = ("Reply" / "P")
RestartToken = ("Restart" / "RS")
RemoteToken = ("Remote" / "R")
ReservedGroupToken = ("ReservedGroup" / "RG")
ReservedValueToken = ("ReservedValue" / "RV")
SendonlyToken = ("SendOnly" / "SO")
SendrecvToken = ("SendReceive" / "SR")
ServicesToken = ("Services" / "SV")
ServiceStatesToken = ("ServiceStates" / "SI")
ServiceChangeToken = ("ServiceChange" / "SC")
ServiceChangeAddressToken = ("ServiceChangeAddress" / "AD")
SignalListToken = ("SignalList" / "SL")
SignalsToken = ("Signals" / "SG")
SignalTypeToken = ("SignalType" / "SY")
StatsToken = ("Statistics" / "SA")
StreamToken = ("Stream" / "ST")
SubtractToken = ("Subtract" / "S")
SynchISDNToken = ("SynchISDN" / "SN")
TerminationStateToken = ("TerminationState" / "TS")
TestToken = ("Test" / "TE")
TimeOutToken = ("TimeOut" / "TO")
Cuervo, et al. Standards Track [Page 106]
^L
RFC 2885 Megaco Protocol August 2000
TopologyToken = ("Topology" / "TP")
TransToken = ("Transaction" / "T")
ResponseAckToken = ("TransactionResponseAck"/ "K")
V18Token = ("V18")
V22Token = ("V22")
V22bisToken = ("V22b")
V32Token = ("V32")
V32bisToken = ("V32b")
V34Token = ("V34")
V76Token = ("V76")
V90Token = ("V90")
V91Token = ("V91")
ANNEX C TAGS FOR MEDIA STREAM PROPERTIES (NORMATIVE)
Parameters for Local descriptors and Remote descriptors are specified
as tag-value pairs if binary encoding is used for the protocol. This
annex contains the property names (PropertyID), the tags (Property
Tag), type of the property (Type) and the values (Value).Values
presented in the Value field when the field contains references shall
be regarded as "information". The reference contains the normative
values. If a value field does not contain a reference then the
values in that field can be considered as "normative".
Tags are given as hexadecimal numbers in this annex. When setting the
value of a property, a MGC may underspecify the value according to
one of the mechanisms specified in section 7.1.1.
For type "enumeration" the value is represented by the value in
brackets, e.g., Send(0), Receive(1).
C.1 General Media Attributes
PropertyID Property Type Value
Tag
Media 1001 Enumeration Audio(0), Video(1),
Data(2),
Transmission mode 1002 Enumeration Send(0), Receive(1),
Send&Receive(2)
Number of Channels 1003 Unsigned 0-255
Integer
Sampling rate 1004 Unsigned 0-2^32
Integer
Bitrate 1005 Integer (0..4294967295)
Note - units of 100 bit/s
Cuervo, et al. Standards Track [Page 107]
^L
RFC 2885 Megaco Protocol August 2000
ACodec 1006 Octet String Audio Codec Type:
Reference: ITU-T Rec. Q.765 - Application transport mechanism.
Non-ITU codecs are defined with the appropriate standards
organisation under a defined Organizational Identifier.
Samplepp 1007 Unsigned Maximum samples or
Integer frames per packet: 0-
65535
Silencesupp 1008 BOOLEAN Silence Suppression:
True/false
Encrypttype 1009 Octet string Ref.: rec. H.245
Encryptkey 100A Octet string Encryption key
SIZE(0..65535)
Ref.: rec. H.235
Echocanc 100B Enumeration Echo Canceller:
Off(0), G.165(1),
G168(2)
Gain 100C Unsigned Gain in db: 0-65535
Integer
Jitterbuff 100D Unsigned Jitter buffer size in
Integer ms: 0-65535
PropDelay 100E Unsigned Propagation Delay:
Integer 0..65535
Maximum propagation delay in milliseconds for the bearer
connection between two media gateways. The maximum delay will be
dependent on the bearer technology.
RTPpayload 100F integer Payload type in RTP
Profile for Audio and
Video Conferences
with Minimal Control
Ref.: RFC 1890
C.2 Mux Properties
PropertyID Property Type Value
Tag
H.221 2001 Octet Ref.: rec. H.245,
string H222LogicalChannelParameters
Cuervo, et al. Standards Track [Page 108]
^L
RFC 2885 Megaco Protocol August 2000
H223 2002 Octet Ref.: rec. H.245,
string H223LogicalChannelParameters
V76 2003 Octet Ref.: rec. H.245,
String V76LogicalChannelParameters
H2250 2004 Octet Ref.: rec. H.245,
String H2250LogicalChannelParameters
C.3 General bearer properties
PropertyID Property Type Value
Tag
Mediatx 3001 Enumeration Media Transport Type:
TDM Circuit(0), ATM(1),
FR(2), Ipv4(3), Ipv6(4),
_
BIR 3002 4 OCTET Value depends on
transport technology
NSAP 3003 1-20 OCTETS See NSAP
Reference: ITU X.213 Annex A
C.4 General ATM properties
PropertyID Property Type Value
Tag
AESA 4001 20 OCTETS ATM End System Address
VPVC 4002 2 x 16 bit VPC/VCI
integer
SC 4003 4 bits Service Category
Reference: ITU Recommendation Q.2931 (1995)
BCOB 4004 5 bit integer Broadband Bearer Class
Reference: ITU Recommendation Q.2961.2 (06/97)
BBTC 4005 octet Broadband Transfer
Capability
Reference: ITU Recommendation Q.2961 (10/95)
ATC 4006 Enumeration I.371 ATM Traffic
Capability
Cuervo, et al. Standards Track [Page 109]
^L
RFC 2885 Megaco Protocol August 2000
Reference: ITU Recommendation I.371:
DBR(0), SBR1(1), SBR2(2), SBR(3), ABT/IT(4), ABT/DT(5), ABR(6)
STC 4007 2 bits Susceptibility to
clipping
Reference: ITU Recommendation Q.2931 (1995)
00 Susceptible
01 Not-susceptible
UPCC 4008 2 bits User Plane Connection
configuration:
Reference: ITU Recommendation Q.2931 (1995)
00 Pt-to-pt,
01 Pt-to-mpt
PCR0 4009 24 bit Peak Cell Rate (For
integer CLP=0)
Reference: ITU Recommendation I.371
SCR0 400A 24 bit Sustainable Cell Rate
integer (For CLP=0)
Reference: ITU Recommendation I.371
MBS0 400B 24 bit Maximum Burst Size (For
integer CLP=0)
Reference: ITU Recommendation I.371
PCR1 400C 24 bit Peak Cell Rate (For
integer CLP=0+1)
Reference: ITU Recommendation I.371
SCR2 400D 24 bit Sustainable Cell Rate
integer (For CLP=0+1)
Reference: ITU Recommendation I.371
MBS3 400E 24 bit Maximum Burst Size (For
integer CLP=0+1)
Reference: ITU Recommendation I.371
BEI 400F Boolean Best Effort Indicator
TI 4010 Boolean Tagging
FD 4011 Boolean Frame Discard
Cuervo, et al. Standards Track [Page 110]
^L
RFC 2885 Megaco Protocol August 2000
FCDV 4012 24 bit Forward P-P CDV
integer
BCDV 4013 24 bit Backward P-P CDV
integer
FCLR0 4014 8 bit integer Forward Cell Loss Ratio
(For CLP=0)
BCLR0 4015 8 bit integer Backward P-P Cell Loss
Ratio (For CLP=0)
FCLR1 4016 8 bit integer Forward Cell Loss Ratio
BCLR1 4017 8 bit integer Backward P-P Cell Loss
Ratio (For CLP=0+1)
FCDV 4018 24 bit Forward Cell Delay
integer Variation
BCDV 4019 24 bit Backward Cell Delay
integer Variation
FACDV 401A 24 bit Forward Acceptable P-P-P
integer CDV
BACDV 401B 24 bit Backward Acceptable P-P
integer CDV
FCCDV 401C 24 bit Forward Cumulative P-P
integer CDV
BCCDV 401D 24 bit Backward Cumulative P-P
integer CDV
FCLR 401E 8 bit integer Acceptable Forward Cell
Loss Ratio
BCLR 401F 8 bit integer Acceptable Backward Cell
Loss Ratio
EETD 4020 16 bit End-to-end transit delay
integer
Mediatx (See 4021 AAL Type
General
Properties)
Reference: ITU Recommendation Q.2931 (1995)
Cuervo, et al. Standards Track [Page 111]
^L
RFC 2885 Megaco Protocol August 2000
QosClass 4022 Integer 0-4 Qos Class
Reference: ITU Recommendation Q.2931 (1995)
QoS Parameter Application:
Qos Class0 QoS ApplicationBest Effort
Parameter Unspecified
0 Unspecified Best EffortConstant Bit rate
Specified circuit emulation
1 Specified Constant Bit rate circuit
Specified emulationVariable bit rate
video and audio
2 Specified Variable bit rate video and
Specified audioConnection-oriented data
3 Specified Connection-oriented
Specified dataConnectionless data
4 Specified Connectionless data
AALtype 4023 1 OCTET AAL Type
Reference: ITU Recommendation Q.2931 (1995)
00000000 AAL for voice
00000001 AAL type 1
00000010 AAL type 2
00000011 AAL type 3/4
00000101 AAL type 5
00010000 user defined AAL
C.5 Frame Relay
PropertyID Property Type Value
Tag
DLCI 5001 Unsigned Integer Data link connection
id
CID 5002 Unsigned Integer sub-channel id.
SID/Noiselevel 5003 Unsigned Integer silence insertion
descriptor
Primary Payload 5004 Unsigned Integer Primary Payload Type
type
Covers FAX and codecs
Cuervo, et al. Standards Track [Page 112]
^L
RFC 2885 Megaco Protocol August 2000
C.6 IP
PropertyID Property Type Value
Tag
IPv4 6001 32 BITS Ipv4Address:
Ipv4Address
Reference: IETF RFC791
IPv6 6002 128 BITS IPv6 Address:
Reference: IETF RFC2460
Port 6003 unsigned integer 0-65535
Porttype 6004 enumerated TCP(0), UDP(1),
SCTP(2)
C.7 ATM AAL2
PropertyID Property Type Value
Tag
AESA 7001 20 OCTETS AAL2 service endpoint
address
as defined in Reference: ITU Recommendation Q.2630.1
ESEA
NSEA
BIR See C.3 4 OCTETS Served user generated
reference
as defined in Reference: ITU Recommendation Q.2630.1
SUGR
ALC 7002 12 OCTETS AAL2 link
characteristics
as defined in Reference: ITU Recommendation Q.2630.1
max/average CPS-SDU bitrate,
max/average CPS-SDU size
SSCS 7003 I.366.2: Service
audio (8 OCTETS) specific
multirate (3 OCTETS) convergence
or I.366.1: sublayer
SAR-assured (14 OCTETS)/ information
unassured (7 OCTETS)
as defined in Reference: Q.2630.1 and used in I.366.1 and I.366.2
I.366.2: audio/multirate
Cuervo, et al. Standards Track [Page 113]
^L
RFC 2885 Megaco Protocol August 2000
I.366.1: SAR-assured/unassured
SUT 7004 1..254 octets Served user transport
parameter
as defined in Reference: ITU Recommendation Q.2630.1
TCI 7005 BOOLEAN Test connection
indicator
as defined in Reference: ITU Recommendation Q.2630.1
Timer_CU 7006 32 bit integer Timer-CU: Milliseconds
to hold partially
filled cell before
sending.
MaxCPSSDU 7007 8 bit integer Maximum Common Part
Sublayer Service Data
Unit
Ref.: rec. Q.2630.1
SCLP 7008 Boolean Set Cell Local
PriorityLP bit:
True if CLP bit is to
be set
EETR 7009 Boolean Timing Requirements
Reference: ITU Recommendation Q.2931 (1995)
End to End Timing Required:
In broadband bearer capability
CID 700A 8 bits subchannel id, 0-255
Ref.: rec. I.363.2 (09/97)
C.8 ATM AAL1
PropertyID Property Type Value
Tag
BIR See GIT (Generic
Table Identifier Transport) 4 OCTETS
C.3
Ref.: Recommendation Q.2941.1 (09/97)
AAL1ST 8001 1 OCTET AAL1 Subtype:
Reference: ITU Recommendation Q.2931 (1995)
00000000 Null
Cuervo, et al. Standards Track [Page 114]
^L
RFC 2885 Megaco Protocol August 2000
00000001 voiceband signal transport on 64kbit/s
00000010 circuit transport
00000100 high-quality audio signal transport
00000101 video signal transport
CBRR 8002 1 OCTET CBR Rate
Reference: ITU Recommendation Q.2931 (1995)
00000001 64 kbit/s
00000100 1544 kbit/s
00000101 6312 kbit/s
00000110 32064 kbit/s
00000111 44736 kbit/s
00001000 97728 kbit/s
00010000 2048 kbit/s
00010001 8448 kbit/s
00010010 34368 kbit/s
00010011 139264 kbit/s
01000000 n x 64 kbit/s
01000001 n * 8 kbit/s
MULT See Multiplier, or n x
Table 64k/8k/300
C.9
Reference: ITU Recommendation Q.2931 (1995)
SCRI 8003 1 OCTECT Source Clock Frequency
Recovery Method
Reference: ITU Recommendation Q.2931 (1995)
00000000 NULL
00000001 SRTS
00000010 ACM
ECM 8004 1 OCTECT Error Correction
Method
Reference: ITU Recommendation Q.2931 (1995)
00000000 Null
00000001 FEC-LOSS
00000010 FEC-DELAY
SDTB 8005 16 bit integer Structured Data
Transfer Blocksize
Reference: ITU Recommendation I.363.1
Block size of SDT CBR service
PFCI 8006 8 bit integer Partially filled cells
indentifier
Reference: ITU Recommendation I.363.1
Cuervo, et al. Standards Track [Page 115]
^L
RFC 2885 Megaco Protocol August 2000
1-47
EETR See See Table C.7 See Table C.7
Table
C.7
C.9 Bearer Capabilities
PropertyID Property Type Value
Tag
TMR 9001 1 OCTET Transmission Medium
Requirement (Q.763)
Reference: ITU Recommendation Q.763(09/97)
Bit 8 7 6 5 4 3 2 1
00000000 - speech
00000001 - spare
00000010 - 64 kbit/s unrestricted
00000011 - 3.1 kHz audio
00000100 - reserved for alternate speech (service 2)/64 kbit/s
unrestricted (service 1)
00000101 - reserved for alternate 64 kbit/s unrestricted (service
1)/speech (service 2)
00000110 - 64 kbit/s preferred
00000111 - 2 x 64 kbit/s unrestricted
00001000 - 384 kbit/s unrestricted
00001001 - 1536 kbit/s unrestricted
00001010 - 1920 kbit/s unrestricted
00001011 through 00001111- spare
00010000 - 3 x 64 kbit/s unrestricted
00010001 - 4 x 64 kbit/s unrestricted
00010010 - 5 x 64 kbit/s unrestricted
00010011 spare
00010100 - 7 x 64 kbit/s unrestricted
00010101 - 8 x 64 kbit/s unrestricted
00010110 - 9 x 64 kbit/s unrestricted
00010111 - 10 x 64 kbit/s unrestricted
00011000 - 11 x 64 kbit/s unrestricted
00011001 - 12 x 64 kbit/s unrestricted
00011010 - 13 x 64 kbit/s unrestricted
00011011 - 14 x 64 kbit/s unrestricted
00011100 - 15 x 64 kbit/s unrestricted
00011101 - 16 x 64 kbit/s unrestricted
00011110 - 17 x 64 kbit/s unrestricted
00011111 - 18 x 64 kbit/s unrestricted
00100000 - 19 x 64 kbit/s unrestricted
00100001 - 20 x 64 kbit/s unrestricted
Cuervo, et al. Standards Track [Page 116]
^L
RFC 2885 Megaco Protocol August 2000
00100010 - 21 x 64 kbit/s unrestricted
00100011 - 22 x 64 kbit/s unrestricted
00100100 - 23x 64 kbit/s unrestricted
00100101 - spare
00100110 - 25 x 64 kbit/s unrestricted
00100111 - 26 x 64 kbit/s unrestricted
00101000 - 27 x 64 kbit/s unrestricted
00101001 - 28 x 64 kbit/s unrestricted
00101010 - 29 x 64 kbit/s unrestricted
00101011 through 11111111 Spare
TMRSR 9002 1 OCTET Transmission Medium
Requirement Subrate
0 - unspecified
1 - 8kbit/s
2 - 16kbit/s
3 - 32kbit/s
Contcheck 9003 BOOLEAN Continuity Check
Reference: ITU Recommendation Q.763(09/97)
0 - Not required on this circuit
1 - Required on this circuit
ITC 9004 5 BITS Information Transfer
Capability
Reference: ITU Recommendation Q.763(09/97)
Bits 5 4 3 2 1
00000 - Speech
01000 -Unrestricted digital information
01001- Restricted digital information
10000 3.1 kHz audio
10001 - Unrestricted digital information with tones/announcements
(Note 2)
11000 -Video
All other values are reserved.
TransMode 9005 2 BITS Transfer Mode
Reference: ITU Recommendation Q.931 (1998)
Bit 2 1
00 - Circuit mode
10 - Packet mode
TransRate 9006 5 BITS Transfer Rate
Reference: ITU Recommendation Q.931 (1998)
Bit 5 4 3 2 1
00000 - This code shall be used for packet mode calls
10000 - 64 kbit/s
Cuervo, et al. Standards Track [Page 117]
^L
RFC 2885 Megaco Protocol August 2000
10001 - 2 x 64 kbit/s
10011 -384 kbit/s
10101 -1536 kbit/s
10111 -1920 kbit/s
11000 - Multirate (64 kbit/s base rate)
MULT 9007 7 BITS Rate Multiplier
Reference: ITU Recommendation Q.931 (1998)
Any value from 2 to n (maximum number of B-channels)
USI 9008 5 BITS User Information Layer
1 Protocol
Reference: ITU Recommendation Q.931 (1998)
Bits 5 4 3 2 1
00001 - CCITT standardized rate adaption V.110 and X.30.
00010 - Recommendation G.711 u-law
00011 - Recommendation G.711 A-law
00100 - Recommendation G.721 32 kbit/s ADPCM and Recommendation
I.460.
00101 - Recommendations H.221 and H.242
00110 - Recommendations H.223 and H.245
00111 - Non-ITU-T standardized rate adaption.
01000 - ITU-T standardized rate adaption V.120.
01001 - CCITT standardized rate adaption X.31 HDLC flag stuffing.
All other values are reserved.
syncasync 9009 BOOLEAN Synchronous/
Asynchronous
Reference: ITU Recommendation Q.931 (1998)
0 - Synchronous data
1 - Asynchronous data
negotiation 900A BOOLEAN Negotiation
Reference: ITU Recommendation Q.931 (1998)
0 - In-band negotiation possible
1 - In-band negotiation not possible
Userrate 900B 5 BITS User Rate
Reference: ITU Recommendation Q.931 (1998)
Bits 5 4 3 2 1
00000 - Rate is indicated by E-bits specified in Recommendation
I.460 or may be negotiated in-band
00001 - 0.6 kbit/s Recommendations V.6 and X.1
00010 - 1.2 kbit/s Recommendation V.6
00011 - 2.4 kbit/s Recommendations V.6 and X.1
00100 - 3.6 kbit/s Recommendation V.6
00101 - 4.8 kbit/s Recommendations V.6 and X.1
00110 - 7.2 kbit/s RecommendationV.6
Cuervo, et al. Standards Track [Page 118]
^L
RFC 2885 Megaco Protocol August 2000
00111 - 8 kbit/s Recommendation I.460
01000 - 9.6 kbit/s Recommendations V.6 and X.1
01001 - 14.4 kbit/s Recommendation V.6
01010 - 16 kbit/s Recommendation I.460
01011 - 19.2 kbit/s Recommendation V.6
01100 - 32 kbit/s Recommendation I.460
01101 - 38.4 kbit/s Recommendation V.110
01110 - 48 kbit/s Recommendations V.6 and X.1
01111 - 56 kbit/s Recommendation V.6
10010 - 57.6 kbit/s Recommendation V.14 extended
10011 - 28.8 kbit/s Recommendation V.110
10100 - 24 kbit/s Recommendation V.110
10101 - 0.1345 kbit/s Recommendation X.1
10110 - 0.100 kbit/s Recommendation X.1
10111 - 0.075/1.2 kbit/s Recommendations V.6 and X.1
11000 - 1.2/0.075 kbit/s Recommendations V.6 and X.1
11001 - 0.050 kbit/s Recommendations V.6 and X.1
11010 - 0.075 kbit/s Recommendations V.6 and X.1
11011 - 0.110 kbit/s Recommendations V.6 and X.1
11100 - 0.150 kbit/s Recommendations V.6 and X.1
11101 - 0.200 kbit/s Recommendations V.6 and X.1
11110 - 0.300 kbit/s Recommendations V.6 and X.1
11111 - 12 kbit/s Recommendation V.6
All other values are reserved.
INTRATE 900C 2 BITS Intermediate Rate
Reference: ITU Recommendation Q.931 (1998)
Bit 2 1
00 - Not used
01 - 8 kbit/s
10 - 16 kbit/s
11 - 32 kbit/s
nictx 900D BOOLEAN Network Independent
Clock (NIC) on
transmission
Reference: ITU Recommendation Q.931 (1998)
0 - Not required to send data with network independent clock
1 - Required to send data with network independent clock
nicrx 900E BOOLEAN Network independent
clock (NIC) on
reception
Reference: ITU Recommendation Q.931 (1998)
0 - Cannot accept data with network independent clock (i.e.
sender does not support this optional procedure)
1 - Can accept data with network independent clock (i.e. sender
does support this optional procedure)
Cuervo, et al. Standards Track [Page 119]
^L
RFC 2885 Megaco Protocol August 2000
flowconttx 900F BOOLEAN Flow Control on
transmission (Tx)
Reference: ITU Recommendation Q.931 (1998)
0 - Not required to send data with flow control mechanism
1 - Required to send data with flow control mechanism
flowcontrx 9010 BOOLEAN Flow control on
reception (Rx)
Reference: ITU Recommendation Q.931 (1998)
0 - Cannot accept data with flow control mechanism (i.e. sender
does not support this optional procedure)
1 - Can accept data with flow control mechanism (i.e. sender does
support this optional procedure)
rateadapthdr 9011 BOOLEAN Rate adaption
header/no header
Reference: ITU Recommendation Q.931 (1998)
0 - Rate adaption header not included
1 - Rate adaption header included
multiframe 9012 BOOLEAN Multiple frame
establishment support
in data link
Reference: ITU Recommendation Q.931 (1998)
0 - Multiple frame establishment not supported. Only UI frames
allowed.
1 - Multiple frame establishment supported
OPMODE 9013 BOOLEAN Mode of operation
Reference: ITU Recommendation Q.931 (1998)
0 Bit transparent mode of operation
1 Protocol sensitive mode of operation
llidnegot 9014 BOOLEAN Logical link
identifier negotiation
Reference: ITU Recommendation Q.931 (1998)
0 Default, LLI = 256 only
1 Full protocol negotiation
assign 9015 BOOLEAN Assignor/assignee
Reference: ITU Recommendation Q.931 (1998)
0 Message originator is "Default assignee"
1 Message originator is "Assignor only"
inbandneg 9016 BOOLEAN In-band/out-band
negotiation
Reference: ITU Recommendation Q.931 (1998)
Cuervo, et al. Standards Track [Page 120]
^L
RFC 2885 Megaco Protocol August 2000
0- Negotiation is done with USER INFORMATION messages on a
temporary signalling connection
1- Negotiation is done in-band using logical link zero
stopbits 9017 2 BITS Number of stop bits
Reference: ITU Recommendation Q.931 (1998)
Bits 2 1
00 - Not used
01 - 1 bit
10 - 1.5 bits
11 - 2 bits
databits 9018 2 BIT Number of data bits
excluding parity Bit
if present
Reference: ITU Recommendation Q.931 (1998)
Bit 2 1
00 - Not used
01 - 5 bits
10 - 7 bits
11 - 8 bits
parity 9019 3 BIT Parity information
Reference: ITU Recommendation Q.931 (1998)
Bit 3 2 1
000 - Odd
010 - Even
011 -None
100 - Forced to 0
101 - Forced to 1
All other values are reserved.
duplexmode 901A BOOLEAN Mode duplex
Reference: ITU Recommendation Q.931 (1998)
0 - Half duplex
1 - Full duplex
modem 901B 6 BIT Modem Type
Reference: ITU Recommendation Q.931 (1998)
Bits 6 5 4 3 2 1
00000 through 000101 National Use
010001 - Recommendation V.21
010010 - Recommendation V.22
010011 - Recommendation V.22 bis
010100 - Recommendation V.23
010101 - Recommendation V.26
011001 - Recommendation V.26 bis
010111 -Recommendation V.26 ter
Cuervo, et al. Standards Track [Page 121]
^L
RFC 2885 Megaco Protocol August 2000
011000 - RecommendationV.27
011001 - Recommendation V.27 bis
011010 - Recommendation V.27 ter
011011 - Recommendation V.29
011101 - Recommendation V.32
011110 - Recommendation V.34
100000 through 101111 National Use
110000 through 111111 User Specified
layer2prot 901C 5 BIT User information layer
2 protocol
Reference: ITU Recommendation Q.931 (1998)
Bit 5 4 3 2 1
00010 - Recommendation Q.921/I.441 [3]
00110 - Recommendation X.25 [5], link layer
01100 - LAN logical link control (ISO/IEC 8802-2)
All other values are reserved.
layer3prot 901D 5 BIT User information layer
3 protocol
Reference: ITU Recommendation Q.931 (1998)
Bit 5 4 3 2 1
00010 - Recommendation Q.931/I.451
00110 - Recommendation X.25, packet layer
01011 - ISO/IEC TR 9577 (Protocol identification in the network
layer)
All other values are reserved.
addlayer3prot 901E OCTET Additional User
Information layer 3
protocol
Reference: ITU Recommendation Q.931 (1998)
Bits 4321 4321
1100 1100 - Internet Protocol (RFC 791) (ISO/IEC TR 9577)
1100 1111 - Point-to-point Protocol (RFC 1548)
DialledN 901F 30 OCTETS Dialled Number
DiallingN 9020 30 OCTETS Dialling Number
ECHOCI 9021 Enumeration Echo Control
Information
echo canceler off (0), incoming echo canceler on (1), outgoing
echo canceler on (2), incoming and outgoing echo canceler on (3)
NCI 9022 1 OCTET Nature of Connection
Indicators
Reference: ITU Recommendation Q.763
Cuervo, et al. Standards Track [Page 122]
^L
RFC 2885 Megaco Protocol August 2000
Bits 8 7 6 5 4 3 2 1
Bits 2 1 Satellite Indicator
0 0 no satellite circuit in the connection
0 1 one satellite circuit in the connection
1 0 two satellite circuits in the connection
1 1 spare
Bits 4 3 Continuity check indicator
0 0 continuity check not required
0 1 continuity check required on this circuit
1 0 continuity check performed on a previous circuit
1 1 spare
Bits 5 Echo control device indicator
0 outgoing echo control device not included
1 outgoing echo control device included
Bits 8 7 6 Spare
C.10 AAL5 Properties
PropertyID Property Type Value
Tag
FMSDU A001 32 bit integer Forward Maximum CPCS-
SDU Size:
Reference: ITU Recommendation Q.2931 (1995)
Maximum CPCS-SDU size sent in the direction from the calling user
to the called user.
BMSDU A002 32 bit integer Backwards Maximum
CPCS-SDU Size
Reference: ITU Recommendation Q.2931 (1995)
Maximum CPCS-SDU size sent in the direction from the called user
to the calling user.
SSCS See See table C.7 See table C.7
table
C.7
Additional values:
VPI/VCI
SC See See Table C.4 See table C.4
Table
C.4
Cuervo, et al. Standards Track [Page 123]
^L
RFC 2885 Megaco Protocol August 2000
C.11 SDP Equivalents
PropertyID Property Type Value
Tag
SDP_V B001 STRING Protocol Version
SDP_O B002 STRING Owner/creator and
session ID
SDP_S B003 STRING Sesson name
SDP_I B004 STRING Session identifier
SDP_U B005 STRING URI of descriptor
SDC_E B006 STRING email address
SDP_P B007 STRING phone number
SDP_C B008 STRING Connection information
SDP_B B009 STRING Bandwidth Information
SDP_Z B00A STRING time zone adjustment
SDP_K B00B STRING Encryption Key
SDP_A B00C STRING Zero or more session
attributes
SDP_T B00D STRING Active Session Time
SDP_R B00E STRING Zero or more repeat
times
Reference in all cases: IETF RFC2327, "Session Description
Protocol"
C.12 H.245
PropertyID Property Type Value
Tag
OLC C001 octet string The value of H.245
OpenLogicalChannel
structure.
Cuervo, et al. Standards Track [Page 124]
^L
RFC 2885 Megaco Protocol August 2000
OLCack C002 octet string The value of H.245
OpenLogicalChannelAck
structure.
OLCcnf C003 octet string The value of H.245
OpenLogicalChannelConfirm
structure.
OLCrej C004 octet string The value of H.245
OpenLogicalChannelReject
structure.
CLC C005 octet string The value of H.245
CloseLogicalChannel
structure.
CLCack C006 octet string The value of H.245
CloseLogicalChannelAck
structure.
Reference in all cases: ITU-T Recommendation H.245
ANNEX D TRANSPORT OVER IP (NORMATIVE)
D.1 Transport over IP/UDP using Application Level Framing
Protocol messages defined in this document may be transmitted over
UDP. When no port is provided by the peer (see section 7.2.8),
commands should be sent to the default port number, 2944 for text-
encoded operation or 2945 for binary-encoded operation. Responses
must be sent to the address and port from which the corresponding
commands were sent except if the response is to a handoff or
failover, in which case the procedures of 11.5 apply.
Implementors using IP/UDP with ALF should be aware of the
restrictions of the MTU on the maximum message size.
D.1.1 Providing At-Most-Once Functionality
Messages, being carried over UDP, may be subject to losses. In the
absence of a timely response, commands are repeated. Most commands
are not idempotent. The state of the MG would become unpredictable
if, for example, Add commands were executed several times. The
transmission procedures shall thus provide an "At-Most-Once"
functionality.
Peer protocol entities are expected to keep in memory a list of the
responses that they sent to recent transactions and a list of the
transactions that are currently outstanding. The transaction
identifier of each incoming message is compared to the transaction
identifiers of the recent responses sent to the same MId. If a match
is found, the entity does not execute the transaction, but simply
repeats the response. If no match is found, the message will be
Cuervo, et al. Standards Track [Page 125]
^L
RFC 2885 Megaco Protocol August 2000
compared to the list of currently outstanding transactions. If a
match is found in that list, indicating a duplicate transaction, the
entity does not execute the transaction (see section 8.2.3 for
procedures on sending TransactionPending).
The procedure uses a long timer value, noted LONG-TIMER in the
following. The timer should be set larger than the maximum duration
of a transaction, which should take into account the maximum number
of repetitions, the maximum value of the repetition timer and the
maximum propagation delay of a packet in the network. A suggested
value is 30 seconds.
The copy of the responses may be destroyed either LONG-TIMER seconds
after the response is issued, or when the entity receives a
confirmation that the response has been received, through the
"Response Acknowledgement parameter". For transactions that are
acknowledged through this parameter, the entity shall keep a copy of
the transaction-id for LONG-TIMER seconds after the response is
issued, in order to detect and ignore duplicate copies of the
transaction request that could be produced by the network.
D.1.2 Transaction identifiers and three-way handshake
D.1.2.1 Transaction identifiers
Transaction identifiers are 32 bit integer numbers. A Media Gateway
Controller may decide to use a specific number space for each of the
MGs that they manage, or to use the same number space for all MGs
that belong to some arbitrary group. MGCs may decide to share the
load of managing a large MG between several independent processes.
These processes will share the same transaction number space. There
are multiple possible implementations of this sharing, such as having
a centralized allocation of transaction identifiers, or pre-
allocating non-overlapping ranges of identifiers to different
processes. The implementations shall guarantee that unique
transaction identifiers are allocated to all transactions that
originate from a logical MGC (identical mId). MGs can simply detect
duplicate transactions by looking at the transaction identifier and
mId only.
D.1.2.2 Three-way handshake
The TransactionResponse Acknowledgement parameter can be found in any
message. It carries a set of "confirmed transaction-id ranges".
Entities may choose to delete the copies of the responses to
transactions whose id is included in "confirmed transaction-id
Cuervo, et al. Standards Track [Page 126]
^L
RFC 2885 Megaco Protocol August 2000
ranges" received in the transaction response messages. They should
silently discard further commands when the transaction-id falls
within these ranges.
The "confirmed transaction-id ranges" values shall not be used if
more than LONG-TIMER seconds have elapsed since the MG issued its
last response to that MGC, or when a MG resumes operation. In this
situation, transactions should be accepted and processed, without any
test on the transaction-id.
Messages that carry the "Transaction Response Acknowledgement"
parameter may be transmitted in any order. The entity shall retain
the "confirmed transaction-id ranges" receivedfor LONG-TIMER seconds.
In the binary encoding, if only the firstAck is present in a response
acknowledgement (see Annex A.2), only one transaction is
acknowledged. If both firstAck and lastAck are present, then the
range of transactions from firstAck to lastAck is acknowledged. In
the text encoding, a horizontal dash is used to indicate a range of
transactions being acknowledged (see Annex B.2).
D.1.3 Computing retransmission timers
It is the responsibility of the requesting entity to provide suitable
time outs for all outstanding transactions, and to retry transactions
when time outs have been exceeded. Furthermore, when repeated
transactions fail to be acknowledged, it is the responsibility of the
requesting entity to seek redundant services and/or clear existing or
pending connections.
The specification purposely avoids specifying any value for the
retransmission timers. These values are typically network dependent.
The retransmission timers should normally estimate the timer value by
measuring the time spent between the sending of a command and the
return of a response.
Note - One possibility is to use the algorithm implemented in TCP-
IP, which uses two variables:
. The average acknowledgement delay, AAD, estimated through an
exponentially smoothed average of the observed delays.
. The average deviation, ADEV, estimated through an exponentially
smoothed average of the absolute value of the difference between
the observed delay and the current average. The retransmission
timer, in TCP, is set to the sum of the average delay plus N
times the average deviation. The maximum value of the timer
should however be bounded for the protocol defined in this
Cuervo, et al. Standards Track [Page 127]
^L
RFC 2885 Megaco Protocol August 2000
document, in order to guarantee that no repeated packet would be
received by the gateways after LONG-TIMER seconds. A suggested
maximum value is 4 seconds.
After any retransmission, the entity should do the following:
. It should double the estimated value of the average delay, AAD
. It should compute a random value, uniformly distributed between
0.5 AAD and AAD
. It should set the retransmission timer to the sum of that random
value and N times the average deviation.
This procedure has two effects. Because it includes an exponentially
increasing component, it will automatically slow down the stream of
messages in case of congestion. Because it includes a random
component, it will break the potential synchronization between
notifications triggered by the same external event.
D.1.4 Provisional responses
Executing some transactions may require a long time. Long execution
times may interact with the timer based retransmission procedure.
This may result either in an inordinate number of retransmissions, or
in timer values that become too long to be efficient. Entities that
can predict that a transaction will require a long execution time may
send a provisional response, "Transaction Pending".
Entities that receive a Transaction Pending shall switch to a
different repetition timer for repeating requests. The root
termination has a property (ProvisionalResponseTimerValue), which can
be set to the requested maximum number of milliseconds between
receipt of a command and transmission of the TransactionPending
response. Upon receipt of a final response, an immediate
confirmation shall be sent, and normal repetition timers shall be
used thereafter. Receipt of a Transaction Pending after receipt of a
reply shall be ignored.
D.1.5 Repeating Requests, Responses and Acknowledgements
The protocol is organized as a set of transactions, each of which is
composed request and a response, commonly referred to as an
acknowledgement. The protocol messages, being carried over UDP, may
be subject to losses. In the absence of a timely response,
transactions are repeated. Entities are expected to keep in memory a
Cuervo, et al. Standards Track [Page 128]
^L
RFC 2885 Megaco Protocol August 2000
list of the responses that they sent to recent transactions, i.e. a
list of all the responses they sent over the last LONG-TIMER seconds,
and a list of the transactions that are currently being executed.
The repetition mechanism is used to guard against three types of
possible errors:
. transmission errors, when for example a packet is lost due to
noise on a line or congestion in a queue;
. component failure, when for example an interface to a entity
becomes unavailable;
. entity failure, when for example an entire entity become
unavailable.
The entities should be able to derive from the past history an
estimate of the packet loss rate due to transmission errors. In a
properly configured system, this loss rate should be kept very low,
typically less than 1%. If a Media Gateway Controller or a Media
Gateway has to repeat a message more than a few times, it is very
legitimate to assume that something else than a transmission error is
occurring. For example, given a loss rate of 1%, the probability
that five consecutive transmission attempts fail is 1 in 100 billion,
an event that should occur less than once every 10 days for a Media
Gateway Controller that processes 1 000 transactions per second.
(Indeed, the number of repetition that is considered excessive should
be a function of the prevailing packet loss rate.) We should note
that the "suspicion threshold", which we will call "Max1", is
normally lower than the "disconnection threshold", which should be
set to a larger value.
A classic retransmission algorithm would simply count the number of
successive repetitions, and conclude that the association is broken
after retransmitting the packet an excessive number of times
(typically between 7 and 11 times.) In order to account for the
possibility of an undetected or in-progress "failover", we modify the
classic algorithm so that if the Media Gateway receives a valid
ServiceChange message announcing a failover, it will start
transmitting outstanding commands to that new MGC. Responses to
commands are still transmitted to the source address of the command.
In order to automatically adapt to network load, this document
specifies exponentially increasing timers. If the initial timer is
set to 200 milliseconds, the loss of a fifth retransmission will be
detected after about 6 seconds. This is probably an acceptable
waiting delay to detect a failover. The repetitions should continue
after that delay not only in order to perhaps overcome a transient
Cuervo, et al. Standards Track [Page 129]
^L
RFC 2885 Megaco Protocol August 2000
connectivity problem, but also in order to allow some more time for
the execution of a failover - waiting a total delay of 30 seconds is
probably acceptable.
It is, however, important that the maximum delay of retransmissions
be bounded. Prior to any retransmission, it is checked that the time
elapsed since the sending of the initial datagram is no greater than
T-MAX. If more than T-MAX time has elapsed, the MG concludes that the
MGC has failed, and it begins its recovery process. When the MG
establishes a new control association, it can retransmit to the new
MGC. Alternatively, a MG may use a ServiceChange with
ServiceChangeMethod equal to disconnected to inform the new MGC that
the MG lost one or more transactions. The value T-MAX is related to
the LONG-TIMER value: the LONG-TIMER value is obtained by adding to
T-MAX the maximum propagation delay in the network.
D.2 using TCP
Protocol messages as defined in this document may be transmitted over
TCP. When no port is specified by the other side (see section
7.2.8), the commands should be sent to the default port. The defined
protocol has messages as the unit of transfer, while TCP is a
stream-oriented protocol. TPKT, according to RFC1006 SHALL be used
to delineate messages within the TCP stream.
In a transaction-oriented protocol, there are still ways for
transaction requests or responses to be lost. As such, it is
recommended that entities using TCP transport implement application
level timers for each request and each response, similar to those
specified for application level framing over UDP.
D.2.1 Providing the At-Most-Once functionality
Messages, being carried over TCP, are not subject to transport
losses, but loss of a transaction request or its reply may
nonetheless be noted in real implementations. In the absence of a
timely response, commands are repeated. Most commands are not
idempotent. The state of the MG would become unpredictable if, for
example, Add commands were executed several times.
To guard against such losses, it is recommended that entities follow
the procedures in section D.1.1
D.2.2 Transaction identifiers and three way handshake
For the same reasons, it is possible that transaction replies may be
lost even with a reliable delivery protocol such as TCP. It is
recommended that entities follow the procedures in section D.1.2.2.
Cuervo, et al. Standards Track [Page 130]
^L
RFC 2885 Megaco Protocol August 2000
D.2.3 Computing retransmission timers
With reliable delivery, the incidence of loss of a transaction
request or reply is expected to be very low. Therefore, only simple
timer mechanisms are required. Exponential back-off algorithms should
not be necessary, although they could be employed where, as in an
MGC, the code to do so is already required, since MGCs must implement
ALF/UDP as well as TCP.
D.2.4 Provisional responses
As with UDP, executing some transactions may require a long time.
Entities that can predict that a transaction will require a long
execution time may send a provisional response, "Transaction
Pending". They should send this response if they receive a repetition
of a transaction that is still being executed.
Entities that receive a Transaction Pending shall switch to a longer
repetition timer for that transaction.
Entities shall retain Transactions and replies until they are
confirmed. The basic procedure of section D.1.4 should be followed,
but simple timer values should be sufficient. There is no need to
send an immediate confirmation upon receipt of a final response.
D.2.5 Ordering of commands
TCP provides ordered delivery of transactions. No special procedures
are required. It should be noted that ALF/UDP allows sending entity
to modify its behavior under congestion, and in particular, could
reorder transactions when congestion is encountered. TCP could not
achieve the same results.
ANNEX E BASIC PACKAGES
This Annex contains definitions of some packages for use with the
Megaco protocol.
E.1 Generic
PackageID: g (0x000e)
Version: 1
Extends: None
Description: Generic package for commonly encountered items.
Cuervo, et al. Standards Track [Page 131]
^L
RFC 2885 Megaco Protocol August 2000
E.1.1 Properties
None
E.1.2 Events
Cause
-----
EventID: cause (0x0001)
Generic error event
ObservedEvents Descriptor Parameters:
General Cause
-------------
ParameterID: Generalcause (0x0001)
Description: This parameter groups the failures into six
groups, which the MGC may act upon.
Possible values: Enumerated,
"NR" Normal Release (0x0001)
"UR" Unavailable Resources (0x0002)
"FT" Failure, Temporary (0x0003)
"FP" Failure, Permanent (0x0004)
"IW" Interworking Error (0x0005)
"UN" Unsupported (0x0006)
Failure Cause
-------------
ParameterID: Failurecause (0x0002)
Description: The Release Cause is the value generated by the
Released equipment, i.e. a released network connection.
The concerned value is defined in the appropriate bearer
control protocol.
Possible Values: OCTET STRING
Signal Completion
-----------------
EventID: sc (0x0002)
Indicates termination of one or more signals for which the
notifyCompletion parameter was set to "ON". For further procedural
description, see sections 7.1.11, 7.1.17, and 7.2.7.
Cuervo, et al. Standards Track [Page 132]
^L
RFC 2885 Megaco Protocol August 2000
ObservedEvents Descriptor parameters:
Signal Identity
---------------
ParameterID: SigID (0x0001)
This parameter identifies the signals which have terminated.
Type: list
Possible values: a list of signals and/or sequential signal
lists which have terminated. A signal outside of a sequential
signal list shall be identified using the pkgdName syntax
without wildcarding. An individual signal inside of a
sequential signal list shall be identified using the sequential
signal list syntax with the correct signal list identifier,
enclosing the name of the specific signal which terminated in
pkgdName syntax.
Termination Method
------------------
ParameterID: Meth (0x0002)
Indicates the means by which the signal terminated.
Type: enumeration
Possible values:
"TO" (0x0001) Duration expired
"EV" (0x0002) Interrupted by event
"SD" (0x0003) Halted by new Signals Descriptor
"NC" (0x0004) Not completed, other cause
E.1.3 Signals
None
E.1.4 Statistics
None
E.2 Base Root Package
Base Root Package
PackageID: root (0x000f)
Version: 1
Extends: None
Cuervo, et al. Standards Track [Page 133]
^L
RFC 2885 Megaco Protocol August 2000
Description: This package defines Gateway wide properties.
E.2.1 Properties
MaxNrOfContexts
---------------
PropertyID: maxNumberOfContexts (0x0001)
The value of this property gives the maximum number of contexts that
can exist at any time. The NULL context is not included in this
number.
Type: Double
Possible values: 1 and up
MaxTerminationsPerContext
-------------------------
PropertyID: maxTerminationsPerContext (0x0002)
The maximum number of allowed terminations in a context, see section
6.1
Type: Integer
Possible Values: any integer
Defined In: TerminationState
normalMGExecutionTime
---------------------
PropertyId: normalMGExecutionTime (0x0003)
Settable by the MGC to indicate the interval within which the MGC
expects a response to any transaction from the MG (exclusive of
network delay)
Type: Integer
Possible Values: any integer, represents milliseconds
normalMGCExecutionTime
----------------------
PropertyId: normalMGCExecutionTime (0x0004)
Settable by the MGC to indicate the interval within which the MG
should expects a response to any transaction from the MGC (exclusive
of network delay)
Cuervo, et al. Standards Track [Page 134]
^L
RFC 2885 Megaco Protocol August 2000
Type: Integer
Possible Values: any integer, represents milliseconds
ProvisionalResponseTimerValue
-----------------------------
PropertyId: ProvisionalResponseTimerValue (0x0005)
Indicates the time within which to expect a Pending Response if a
Transaction cannot be completed. Initially set to
normalMGExecutionTime or normalMGCExecutionTime as appropriate, plus
network delay, but may be lowered.
E.2.2 Events
None
E.2.3 Signals
None
E.2.4 Statistics
None
E.2.5 Procedures
None
E.3 Tone Generator Package
PackageID: tonegen (0x0001)
Version: 1
Extends: None
Description:
This package defines signals to generate audio tones. This package
does not specify parameter values. It is intended to be extendable.
Generally, tones are defined as an individual signal with a
parameter, ind, representing "interdigit" time delay, and a tone id
to be used with playtones. A tone id should be kept consistent with
any tone generation for the same tone. MGs are expected to be
provisioned with the characteristics of appropriate tones for the
country in which the MG is located.
E.3.1 Properties
None
Cuervo, et al. Standards Track [Page 135]
^L
RFC 2885 Megaco Protocol August 2000
E.3.2 Events
None
E.3.3 Signals
Play tone
---------
SignalID: pt (0x0001)
Plays audio tone over an audio channel
Signal Type: Brief
Duration: Provisioned
Additional Parameters:
Tone id list
------------
ParameterID: tl (0x0001)
Type: list of tone ids.
List of tones to be played in sequence. The list SHALL contain
one or more tone ids.
Inter signal duration
---------------------
ParameterID: ind (0x0002)
Type: integer.
Timeout between two consecutive tones in milliseconds
No tone ids are specified in this package. Packages that extend this
package can add possible values for tone id as well as adding
individual tone signals.
E.3.4 Statistics
None
E.3.5 Procedures
None
Cuervo, et al. Standards Track [Page 136]
^L
RFC 2885 Megaco Protocol August 2000
E.4 Tone Detection Package
PackageID: tonedet (0x0002)
Version: 1
Extends: None
This Package defines events for audio tone detection. Tones are
selected by name (tone id). MGs are expected to be provisioned with
the characteristics of appropriate tones for the country in which the
MG is located.
This package does not specify parameter values. It is intended to be
extendable.
E.4.1 Properties
None
E.4.2 Events
Start tone detected
-------------------
EventID: std, 0x0001
Detects the start of a tone. The characteristics of positive tone
detection is implementation dependent.
EventsDescriptor parameters:
Tone id list
------------
ParameterID: tl (0x0001)
Type: list of tone ids
Possible values: The only tone id defined in this package is
"wild card" which is "*" in text encoding and 0x0000 in binary.
Extensions to this package would add possible values for tone
id. If tl is "wild card", any tone id is detected.
ObservedEventsDescriptor parameters:
Tone id
--------
ParameterID: tid (0x0003)
Type: Enumeration
Cuervo, et al. Standards Track [Page 137]
^L
RFC 2885 Megaco Protocol August 2000
Possible values: "wildcard" as defined above is the only value
defined in this package. Extensions to this package would add
additional possible values for tone id.
End tone detected
-----------------
EventID: etd, 0x0002
Detects the end of a tone.
EventDescriptor parameters:
Tone id list
------------
ParameterID: tl (0x0001)
Type: enumeration or list of enumerated types
Possible values: No possible values are specified in this
package. Extensions to this package would add possible values
for tone id.
ObservedEventsDescriptor parameters:
Tone id
-------
ParameterID: tid (0x0003)
Type: Enumeration
Possible values: "wildcard" as defined above is the only value
defined in this package. Extensions to this package would add
possible values for tone id
Duration
--------
ParameterId: dur (0x0002)
Type: integer, in milliseconds
This parameter contains the duration of the tone from first
detection until it stopped.
Long tone detected
------------------
EventID: ltd, 0x0003
Cuervo, et al. Standards Track [Page 138]
^L
RFC 2885 Megaco Protocol August 2000
Detects that a tone has been playing for at least a certain amount of
time
EventDescriptor parameters:
Tone id list
------------
ParameterID: tl (0x0001)
Type: enumeration or list
Possible values: "wildcard" as defined above is the only value
defined in this package. Extensions to this package would add
possible values for tone id
Duration:
---------
ParameterID: dur (0x0002)
Type: integer, duration to test against
Possible values: any legal integer, expressed in milliseconds.
ObservedEventsDescriptor parameters:
Tone id
-------
ParameterID: tid (0x0003)
Possible values: No possible values are specified in this
package. Extensions to this package would add possible values
for tone id.
E.4.3 Signals
None
E.4.4 Statistics
None
E.4.5 Procedures
None
Cuervo, et al. Standards Track [Page 139]
^L
RFC 2885 Megaco Protocol August 2000
E.5 Basic DTMF Generator Package
PackageID: dg (0x0003) Version: 1 Extends: tonegen version 1
This package defines the basic DTMF tones as signals and extends the
allowed values of parameter tl of playtone in tonegen.
E.5.1 Properties
None
E.5.2 Events
None
E.5.3 Signals
dtmf character 0
----------------
SignalID: d0 (0x0010)
Generate DTMF 0 tone. The physical characteristic of DTMF 0 is
defined in the gateway.
Signal Type: Brief
Duration: Provisioned
Additional Parameters:
None
Additional Values:
-----------------
d0 (0x0010) is defined as a toneid for playtone.
The other dtmf characters are specified in exactly the same way. A
table with all signal names and signal IDs is included. Note that
each dtmf character is defined as both a signal and a toneid, thus
extending the basic tone generation package. Also note that dtmf
SignalIds are different from the names used in a digit map.
Cuervo, et al. Standards Track [Page 140]
^L
RFC 2885 Megaco Protocol August 2000
Signal Name Signal ID/tone id
dtmf character 0 d0 (0x0010)
dtmf character 1 d1 (0x0011)
dtmf character 2 d2 (0x0012)
dtmf character 3 d3 (0x0013)
dtmf character 4 d4 (0x0014)
dtmf character 5 d5 (0x0015)
dtmf character 6 d6 (0x0016)
dtmf character 7 d7 (0x0017)
dtmf character 8 d8 (0x0018)
dtmf character 9 d9 (0x0019)
dtmf character * ds (0x0020)
dtmf character # do (0x0021)
dtmf character A da (0x001a)
dtmf character B db (0x001b)
dtmf character C dc (0x001c)
dtmf character D dd (0x001d)
E.5.4 Statistics
None
E.5.5 Procedures
None
E.6 DTMF detection Package
PackageID: dd (0x0004)
Version: 1
Extends: tonedet version 1
This package defines the basic DTMF tones detection. This Package
extends the possible values of tone id in the "start tone detected"
"end tone detected" and "long tone detected" events.
Additional tone id values are all tone ids described in package dg
(basic DTMF generator package).
The following table maps DTMF events to digit map symbols as
described in section 7.1.14.
Cuervo, et al. Standards Track [Page 141]
^L
RFC 2885 Megaco Protocol August 2000
DTMF Event Symbol
d0 "0"
d1 "1"
d2 "2"
d3 "3"
d4 "4"
d5 "5"
d6 "6"
d7 "7"
d8 "8"
d9 "9"
da "A" or "a"
db "B" or "b"
dc "C" or "c"
dd "D" or "d"
ds "E" or "e"
do "F" or "f"
E.6.1 Properties
None
E.6.2 Events
DTMF digits
-----------
EventIds are defined with the same names as the SignalIds defined in
the table found in section E.5.3.
DigitMap Completion Event
-------------------------
EventID: ce, 0x0001
Generated when a digit map completes as described in section 7.1.14.
EventsDescriptor parameters: digit map processing is activated only
if a digit map parameter is present, specifying a digit map by name
or by value. Other parameters such as a KeepActive flag or embedded
Events or Signals Descriptors may be present.
ObservedEventsDescriptor parameters:
DigitString
-----------
ParameterID: ds (0x0001)
Cuervo, et al. Standards Track [Page 142]
^L
RFC 2885 Megaco Protocol August 2000
Type: string of digit map symbols (possibly empty) returned as
a quotedString.
Possible values: a sequence of the characters "0" through "9",
"A" through "F", and the long duration modifier "L".
Description: the portion of the current dial string as
described in section 7.1.14 which matched part or all of an
alternative event sequence specified in the digit map.
Termination Method
------------------
ParameterID: Meth (0x0003)
Type: enumeration
Possible values:
"UM" (0x0001) Unambiguous match
"PM" (0x0002) Partial match, completion by timer
expiry or unmatched event
"FM" (0x0003) Full match, completion by timer expiry
or unmatched event
Description: indicates the reason for generation of the event.
See the procedures in section 7.1.14.
E.6.3 Signals
None
E.6.4 Statistics
None
E.6.5 Procedures
None
E.7 Call Progress Tones Generator Package
PackageID: cg, 0x0005
Version: 1
Extends: tonegen version 1
This package defines the basic call progress tones as signals and
extends the allowed values of the tl parameter of playtone in
tonegen.
Cuervo, et al. Standards Track [Page 143]
^L
RFC 2885 Megaco Protocol August 2000
E.7.1 Properties
None
E.7.2 Events
None
E.7.3 Signals
Dial Tone
---------
SignaID: dt (0x0030)
Generate dial tone. The physical characteristic of dial tone is
available in the gateway.
Signal Type: Timeout
Duration: Provisioned
Additional Parameters:
None
Additional Values
-----------------
dt (0x0030) is defined as a tone id for playtone The other tones of
this package are defined in exactly the same way. A table with all
signal names and signal IDs is included. Note that each tone is
defined as both a signal and a toneid, thus extending the basic tone
generation package.
Signal Name Signal ID/tone id
Dial Tone dt (0x0030)
Ringing Tone rt (0x0031)
Busy Tone bt (0x0032)
Congestion Tone ct (0x0033)
Special Information Tone sit(0x0034)
Warning Tone wt (0x0035)
Payphone Recognition Tone pt (0x0036)
Call Waiting Tone cw (0x0037)
Caller Waiting Tone cr (0x0038)
Cuervo, et al. Standards Track [Page 144]
^L
RFC 2885 Megaco Protocol August 2000
E.7.4 Statistics
None
E.7.5 Procedures
NOTE - The required set of tone ids corresponds to those defined in
Recommendation E.180/Q.35 [ITU-T Recommendation E.180/Q.35 (1998)].
See E.180 for definition of the meanings of these tones.
E.8 Call Progress Tones Detection Package
PackageID: cd (0x0006)
Version: 1
Extends: tonedet version 1
This package defines the basic call progress detection tones. This
Package extends the possible values of tone id in the "start tone
detected", "end tone detected" and "long tone detected" events.
Additional values
-----------------
tone id values are defined for start tone detected, end tone detected
and long tone detected with the same values as those in package cg
(call progress tones generation package).
The required set of tone ids corresponds to Recommendation E.180/Q.35
[ITU-T Recommendation E.180/Q.35 (1998)]. See Recommendation
E.180/Q.35 for definition of the meanings of these tones.
E.8.1 Properties
none
E.8.2 Events
Events are defined as in the call progress tones generator package
(cg) for the tones listed in the table of section E.7.3
E.8.3 Signals
none
E.8.4 Statistics
none
Cuervo, et al. Standards Track [Page 145]
^L
RFC 2885 Megaco Protocol August 2000
E.8.5 Procedures
none
E.9 Analog Line Supervision Package
PackageID: al, 0x0009
Version: 1
Extends: None
This package defines events and signals for an analog line.
E.9.1 Properties
None
E.9.2 Events
onhook
------
EventID: on (0x0004)
Detects handset going on hook. Whenever an events descriptor is
activated that requests monitoring for an on-hook event and the line
is already on-hook, then the MG shall immediately generate an on-hook
event.
EventDescriptor parameters
None
ObservedEventsDescriptor parameters
None
offhook
-------
EventID: of (0x0005)
Detects handset going off hook. Whenever an events descriptor is
activated that requests monitoring for an off-hook event and the line
is already off-hook, then the MG shall immediately generate an off-
hook event.
EventDescriptor parameters
None
Cuervo, et al. Standards Track [Page 146]
^L
RFC 2885 Megaco Protocol August 2000
ObservedEventsDescriptor parameters
None
flashhook
---------
EventID: fl, 0x0006
Detects handset flash. A flash occurs when an onhook is followed by
an offhook between a minimum and maximum duration.
EventDescriptor parameters
Minimum duration
----------------
ParameterID: mindur (0x0004)
Type: integer in milliseconds
Default value is provisioned
Maximum duration
----------------
ParameterID: maxdur (0x0005)
Type: integer in milliseconds
Default value is provisioned
ObservedEventsDescriptor parameters
None
E.9.3 Signals
ring
----
SignalID: ri, 0x0002
Applies ringing on the line
Signal Type: TimeOut
Duration: Provisioned
Additional Parameters:
Cadence
Cuervo, et al. Standards Track [Page 147]
^L
RFC 2885 Megaco Protocol August 2000
-------
ParameterID: cad (0x0006)
Type: list of integers representing durations of alternating on
and off segments, constituting a complete ringing cycle
starting with an on. Units in milliseconds.
Default is fixed or provisioned. Restricted function MGs may
ignore cadence values they are incapable of generating.
Frequency
---------
ParameterID: freq (0x0007)
Type: integer in Hz
Default is fixed or provisioned. Restricted function MGs may
ignore frequency values they are incapable of generating.
E.9.4 Statistics
None
E.9.5 Procedures
None
E.10 Basic Continuity Package
PackageID: ct (0x000a)
Version: 1
Extends: None
This package defines events and signals for continuity test. The
continuity test includes provision of either a loopback or
transceiver functionality.
E.10.1 Properties
None
E.10.2 Events
Completion
----------
EventID: cmp, 0x0005
This event detects test completion of continuity test.
Cuervo, et al. Standards Track [Page 148]
^L
RFC 2885 Megaco Protocol August 2000
EventDescriptor parameters
None
ObservedEventsDescriptor parameters
Result
------
ParameterID: res (0x0008)
Type: Enumeration
Possible values: success (0x0001), failure (0x0000)
E.10.3 Signals
Continuity test
---------------
SignalID: ct (0x0003)
Initiates sending of continuity test tone on the termination to which
it is applied.
Signal Type: TimeOut
Default value is provisioned
Additional Parameters:
None
Respond
-------
SignalID: rsp (0x0004)
The signal is used to respond to a continuity test . See section
E.10.5 for further explanation.
Signal Type: TimeOut
Default duration is provisioned
Additional Parameters:
None.
Cuervo, et al. Standards Track [Page 149]
^L
RFC 2885 Megaco Protocol August 2000
E.10.4 Statistics
None
E.10.5 Procedures
When a MGC wants to initiate a continuity test, it sends a command to
the MG containing
. a signals descriptor with the ct signal, and
. an events descriptor containing the cmp event.
Upon reception of a command containing the ct signal and cmp event,
the MG initiates the continuity test tone for the specified
termination. If the return tone is detected before the signal times
out, the cmp event shall be generated with the value of the result
parameter equal to success. In all other cases, the cmp event shall
be generated with the value of the result parameter equal to failure.
When a MGC wants the MG to respond to a continuity test, it sends a
command to the MG containing a signals descriptor with the rsp
signal. Upon reception of a command with the rsp signal, the MG
awaits reception of the continuity test tone. When the tone is
received before the rsp signal times out, the MG returns the
applicable return tone. If the rsp signal times out, the MG removes
the detection and the return tone (if that was playing).
When a continuity test is performed on a termination, no echo devices
or codecs shall be active on that termination.
Performing voice path assurance as part of continuity testing is
provisioned by bilateral agreement between network operators.
E.11 Network Package
PackageID: nt (0x000b)
Version: 1
Extends: None
This package defines properties of network terminations independent
of network type.
E.11.1 Properties
Maximum Jitter Buffer
---------------------
PropertyID: jit (0x0007)
This property puts a maximum size on the jitter buffer.
Cuervo, et al. Standards Track [Page 150]
^L
RFC 2885 Megaco Protocol August 2000
Type: integer in milliseconds
Possible Values: This property is specified in milliseconds.
Defined In: LocalControlDescriptor
Characteristics: read/write
E.11.2 Events
network failure
---------------
EventID: netfail, 0x0005
The termination generates this event upon detection of a failure due
to external or internal network reasons.
EventDescriptor parameters
None
ObservedEventsDescriptor parameters
cause
-----
ParameterID: cs (0x0001)
Type: String
Possible values: any text string
This parameter may be included with the failure event to provide
diagnostic information on the reason of failure.
quality alert
-------------
EventID: qualert, 0x0006
This property allows the MG to indicate a loss of quality of the
network connection. The MG may do this by measuring packet loss,
interarrival jitter, propogation delay and then indicating this using
a percentage of quality loss.
EventDescriptor parameters
Threshold
---------
ParameterId: th (0x0001)
Cuervo, et al. Standards Track [Page 151]
^L
RFC 2885 Megaco Protocol August 2000
Type: integer
Possible Values: threshold for percent of quality loss
measured, calculated based on a provisioned method, that could
take into consideration packet loss, jitter, and delay for
example. Event is triggered when calculation exceeds the
threshold.
ObservedEventsDescriptor parameters
Threshold
---------
ParameterId: th (0x0001)
Type: integer
Possible Values: percent of quality loss measured, calculated
based on a provisioned method, that could take into
consideration packet loss, jitter, and delay for example.
E.11.3 Signals
none
E.11.4 Statistics
Duration
--------
StatisticsID: dur (0x0001)
Description: Provides duration of time the termination has been in
the context.
Type: Double, in milliseconds
Octets Sent
-----------
StatisticID: os (0x0002)
Type: double
Possible Values: any 64 bit integer
Octets Received
---------------
StatisticID: or (0x0003)
Type: double
Cuervo, et al. Standards Track [Page 152]
^L
RFC 2885 Megaco Protocol August 2000
Possible Values: any 64 bit integer
E.11.5 Procedures
none
E.12 RTP Package
PackageID: rtp (0x000c)
Version: 1
Extends: Network Package version 1
This package is used to support packet based multimedia data transfer
by means of the Real-time Transport Protocol (RTP) [RFC 1889].
E.12.1 Properties
None
E.12.2 Events
Payload Transition EventID: pltrans, 0x0001 This event detects and
notifies when there is a transition of the RTP payload format from
one format to another.
EventDescriptor parameters
None
ObservedEventsDescriptor parameters
rtppayload
----------
ParameterID: rtppltype, 0x01
Type: list of enumerated types.
Possible values: The encoding method shall be specified by
using one or several valid encoding names, as defined in the
RTP AV Profile or registered with IANA.
E.12.3 Signals
None
E.12.4 Statistics
Packets Sent ------------ StatisticID: ps (0x0004)
Cuervo, et al. Standards Track [Page 153]
^L
RFC 2885 Megaco Protocol August 2000
Type: double
Possible Values: any 64 bit integer
Packets Received ---------------- StatisticID: pr (0x0005)
Type: double
Possible Values: any 64 bit integer
Packet Loss ----------- StatisticID: pl (0x0006)
Describes the current rate of packet loss on an RTP stream, as
defined in IETF RFC 1889. Packet loss is expressed as percentage
value: number of packets lost in the interval between two reception
reports, divided by the number of packets expected during that
interval.
Type: double
Possible Values: a 32 bit whole number and a 32 bit fraction.
Jitter
------
StatisticID: jit (0x0007)
Requests the current value of the interarrival jitter on an RTP
stream as defined in IETF RFC 1889. Jitter measures the variation in
interarrival time for RTP data packets.
Delay
-----
StatisticID:delay (0x0008)
Requests the current value of packet propagation delay expressed in
timestamp units. Same as average latency.
E.12.5 Procedures
none
E.13 TDM Circuit Package
PackageID: tdmc (0x000d)
Version: 1
Extends: Network Package version 1
This package is used to support TDM circuit terminations.
Cuervo, et al. Standards Track [Page 154]
^L
RFC 2885 Megaco Protocol August 2000
E.13.1 Properties
Echo Cancellation
-----------------
PropertyID: ec (0x0008)
By default, the telephony gateways always perform echo cancellation.
However, it is necessary, for some calls, to turn off these
operations.
Type: boolean
Possible Values:
"on" (when the echo cancellation is requested) and
"off" (when it is turned off.)
The default is "on".
Defined In: LocalControlDescriptor
Characteristics: read/write
Gain Control
------------
PropertyID: gain (0x000a)
Gain control, or usage of of signal level adaptation and noise level
reduction is used to adapt the level of the signal. However, it is
necessary, for example for modem calls, to turn off this function.
Type: enumeration (integer)
Possible Values:
The gain control parameter may either be specified as "automatic"
(0xffffffff), or as an explicit number of decibels of gain (any other
integer value). The default is provisioned in the MG.
Defined In: LocalControlDescriptor
Characteristics: read/write
E.13.2 Events
none
E.13.3 Signals
none
Cuervo, et al. Standards Track [Page 155]
^L
RFC 2885 Megaco Protocol August 2000
E.13.4 Statistics
None
E.13.5 Procedures
None
Cuervo, et al. Standards Track [Page 156]
^L
RFC 2885 Megaco Protocol August 2000
APPENDIX A EXAMPLE CALL FLOWS (INFORMATIVE)
All Megaco implementors must read the normative part of this document
carefully before implementing from it. No one should use the examples
in this section as stand-alone explanations of how to create protocol
messages.
The examples in this section use SDP for encoding of the Local and
Remote stream descriptors. SDP is defined in RFC 2327. If there is
any discrepancy between the SDP in the examples, and RFC 2327, the
RFC should be consulted for correctness. Audio profiles used are
those defined in RFC 1890, and others registered with IANA. For
example, G.711 A-law is called PCMA in the SDP, and is assigned
profile 0. G.723 is profile 4, and H263 is profile 34. See also
http://www.iana.org/numbers.htm#R
A.1 Residential Gateway to Residential Gateway Call
This example scenario illustrates the use of the elements of the
protocol to set up a Residential Gateway to Residential Gateway call
over an IP-based network. For simplicity, this example assumes that
both Residential Gateways involved in the call are controlled by the
same Media Gateway Controller.
A.1.1 Programming Residential GW Analog Line Terminations for Idle
Behavior
The following illustrates the API invocations from the Media Gateway
Controller and Media Gateways to get the Terminations in this
scenario programmed for idle behavior. Both the originating and
terminating Media Gateways have idle AnalogLine Terminations
programmed to look for call initiation events (i.e.-offhook) by using
the Modify Command with the appropriate parameters. The null Context
is used to indicate that the Terminations are not yet involved in a
Context. The ROOT termination is used to indicate the entire MG
instead of a termination within the MG.
Cuervo, et al. Standards Track [Page 157]
^L
RFC 2885 Megaco Protocol August 2000
In this example, MG1 has the IP address 124.124.124.222, MG2 is
125.125.125.111, and the MGC is 123.123.123.4. The default Megaco
port is 55555 for all three.
1. An MG registers with an MGC using the ServiceChange command:
MG1 to MGC:
MEGACO/1 [124.124.124.222]
Transaction = 9998 {
Context = - {
ServiceChange = ROOT {Services {
Method=Restart,
ServiceChangeAddress=55555, Profile=ResGW/1}
}
}
}
2. The MGC sends a reply:
MGC to MG1:
MEGACO/1 [123.123.123.4]:55555
Reply = 9998 {
Context = - {ServiceChange = ROOT {
Services {ServiceChangeAddress=55555, Profile=ResGW/1} } }
}
3. The MGC programs a Termination in the NULL context. The
terminationId is A4444, the streamId is 1, the requestId in the
Events descriptor is 2222. The mId is the identifier of the sender
of this message, in this case, it is the IP address and port
[123.123.123.4]:55555. Mode for this stream is set to SendReceive.
"al" is the analog line supervision package.
MGC to MG1:
MEGACO/1 [123.123.123.4]:55555
Transaction = 9999 {
Context = - {
Modify = A4444 {
Media { Stream = 1 {
LocalControl {
Mode = SendReceive,
ds0/gain=2, ; in dB,
ds0/ec=G165
},
Local {
v=0
c=IN IP4 $
Cuervo, et al. Standards Track [Page 158]
^L
RFC 2885 Megaco Protocol August 2000
m=audio $ RTP/AVP 0
a=fmtp:PCMU VAD=X-NNVAD ; special voice activity
; detection algorithm
}
}
},
Events = 2222 {al/of}
}
}
}
The dialplan script could have been loaded into the MG previously.
Its function would be to wait for the OffHook, turn on dialtone and
start collecting DTMF digits. However in this example, we use the
digit map, which is put into place after the offhook is detected
(step 5 below).
Note that the embedded EventsDescriptor could have been used to
combine steps 3 and 4 with steps 8 and 9, eliminating steps 6 and 7.
4. The MG1 accepts the Modify with this reply:
MG1 to MGC:
MEGACO/1 [124.124.124.222]:55555
Reply = 9999 {
Context = - {Modify = A4444}
}
5. A similar exchange happens between MG2 and the MGC, resulting in
an idle Termination called A5555.
A.1.2 Collecting Originator Digits and Initiating Termination
The following builds upon the previously shown conditions. It
illustrates the transactions from the Media Gateway Controller and
originating Media Gateway (MG1) to get the originating Termination
(A4444) through the stages of digit collection required to initiate a
connection to the terminating Media Gateway (MG2).
6. MG1 detects an offhook event from User 1 and reports it to the
Media Gateway Controller via the Notify Command.
MG1 to MGC:
MEGACO/1 [124.124.124.222]:55555
Transaction = 10000 {
Context = - {
Notify = A4444 {ObservedEvents =2222 {
19990729T22000000:al/of}}
Cuervo, et al. Standards Track [Page 159]
^L
RFC 2885 Megaco Protocol August 2000
}
}
7. And the Notify is acknowledged.
MGC to MG1:
MEGACO/1 [123.123.123.4]:55555
Reply = 10000 {
Context = - {Notify = A4444}
}
8. The MGC Modifies the termination to play dial tone, to look for
digits according to Dialplan0 and to look for the on-hook event now.
MGC to MG1:
MEGACO/1 [123.123.123.4]:55555
Transaction = 10001 {
Context = - {
Modify = A4444 {
Events = 2223 {
al/on, dd/ce {DigitMap=Dialplan0}
},
Signals {cg/dt},
DigitMap= Dialplan0{
(0| 00|[1-7]xxx|8xxxxxxx|Fxxxxxxx|Exx|91xxxxxxxxxx|9011x.)}
}
}
}
9. And the Modify is acknowledged.
MG1 to MGC:
MEGACO/1 [124.124.124.222]:55555
Reply = 10001 {
Context = - {Modify = A4444}
}
10. Next, digits are accumulated by MG1 as they are dialed by User
1. Dialtone is stopped upon detection of the first digit. When an
appropriate match is made of collected digits against the currently
programmed Dialplan for A4444, another Notify is sent to the Media
Gateway Controller.
MG1 to MGC:
MEGACO/1 [124.124.124.222]:55555
Transaction = 10002 {
Context = - {
Notify = A4444 {ObservedEvents =2223 {
Cuervo, et al. Standards Track [Page 160]
^L
RFC 2885 Megaco Protocol August 2000
19990729T22010001:dd/ce{ds="916135551212",Meth=FM}}}
}
}
11. And the Notify is acknowledged.
MGC to MG1:
MEGACO/1 [123.123.123.4]:55555
Reply = 10002 {
Context = - {Notify = A4444}
}
12. The controller then analyses the digits and determines that a
connection needs to be made from MG1 to MG2. Both the TDM
termination A4444, and an RTP termination are added to a new context
in MG1. Mode is ReceiveOnly since Remote descriptor values are not
yet specified. Preferred codecs are in the MGC's preferred order of
choice.
MGC to MG1:
MEGACO/1 [123.123.123.4]:55555
Transaction = 10003 {
Context = $ {
Add = A4444,
Add = $ {
Media {
Stream = 1 {
LocalControl {
Mode = ReceiveOnly,
nt/jit=40, ; in ms
},
Local {
v=0
c=IN IP4 $
m=audio $ RTP/AVP 4
a=ptime:30
v=0
c=IN IP4 $
m=audio $ RTP/AVP 0
}
}
}
}
}
}
Cuervo, et al. Standards Track [Page 161]
^L
RFC 2885 Megaco Protocol August 2000
NOTE - The MGC states its preferred parameter values as a series of
sdp blocks in Local. The MG fills in the Local Descriptor in the
Reply.
13. MG1 acknowledges the new Termination and fills in the Local IP
address and UDP port. It also makes a choice for the codec based on
the MGC preferences in Local. MG1 sets the RTP port to 2222.
MEGACO/1 [124.124.124.222]:55555
Reply = 10003 {
Context = 2000 {
Add = A4444,
Add=A4445{
Media {
Stream = 1 {
Local {
v=0
c=IN IP4 124.124.124.222
m=audio 2222 RTP/AVP 4
a=ptime:30
a=recvonly
} ; RTP profile for G.723 is 4
}
}
}
}
}
14. The MGC will now associate A5555 with a new Context on MG2, and
establish an RTP Stream (i.e, A5556 will be assigned), SendReceive
connection through to the originating user, User 1. The MGC also
sets ring on A5555.
MGC to MG2:
MEGACO/1 [123.123.123.4]:55555
Transaction = 50003 {
Context = $ {
Add = A5555 { Media {
Stream = 1 {
LocalControl {Mode = SendReceive} }},
Events=1234{al/of}
Signals {al/ri}
},
Add = $ {Media {
Stream = 1 {
LocalControl {
Mode = SendReceive,
nt/jit=40 ; in ms
},
Cuervo, et al. Standards Track [Page 162]
^L
RFC 2885 Megaco Protocol August 2000
Local {
v=0
c=IN IP4 $
m=audio $ RTP/AVP 4
a=ptime:30
},
Remote {
v=0
c=IN IP4 124.124.124.222
m=audio 2222 RTP/AVP 4
a=ptime:30
} ; RTP profile for G.723 is 4
}
}
}
}
}
15. This is acknowledged. The stream port number is different from
the control port number. In this case it is 1111 (in the SDP).
MG2 to MGC:
MEGACO/1 [124.124.124.222]:55555
Reply = 50003 {
Context = 5000 {
Add = A5555{}
Add = A5556{
Media {
Stream = 1 {
Local {
v=0
c=IN IP4 125.125.125.111
m=audio 1111 RTP/AVP 4
}
} ; RTP profile for G723 is 4
}
}
}
}
16. The above IPAddr and UDPport need to be given to MG1 now.
MGC to MG1:
MEGACO/1 [123.123.123.4]:55555
Transaction = 10005 {
Context = 2000 {
Modify = A4444 {
Cuervo, et al. Standards Track [Page 163]
^L
RFC 2885 Megaco Protocol August 2000
Signals {cg/rt}
},
Modify = A4445 {
Media {
Stream = 1 {
Remote {
v=0
c=IN IP4 125.125.125.111
m=audio 1111 RTP/AVP 4
}
} ; RTP profile for G723 is 4
}
}
}
}
MG1 to MGC:
MEGACO/1 [124.124.124.222]:55555
Reply = 10005 {
Context = 2000 {Modify = A4444, Modify = A4445}
}
17. The two gateways are now connected and User 1 hears the
RingBack. The MG2 now waits until User2 picks up the receiver and
then the two-way call is established.
From MG2 to MGC:
MEGACO/1 [125.125.125.111]:55555
Transaction = 50005 {
Context = 5000 {
Notify = A5555 {ObservedEvents =1234 {
19990729T22020002:al/of}}
}
}
From MGC to MG2:
MEGACO/1 [123.123.123.4]:55555
Reply = 50005 {
Context = - {Notify = A5555}
}
From MGC to MG2:
MEGACO/1 [123.123.123.4]:55555
Transaction = 50006 {
Cuervo, et al. Standards Track [Page 164]
^L
RFC 2885 Megaco Protocol August 2000
Context = 5000 {
Modify = A5555 {
Events = 1235 {al/on},
Signals { } ; to turn off ringing
}
}
}
From MG2 to MGC:
MEGACO/1 [125.125.125.111]:55555
Reply = 50006 {
Context = 5000 {Modify = A4445}
}
18. Change mode on MG1 to SendReceive, and stop the ringback.
MGC to MG1:
MEGACO/1 [123.123.123.4]:55555
Transaction = 10006 {
Context = 2000 {
Modify = A4445 {
Media {
Stream = 1 {
LocalControl {
Mode=SendReceive
}
}
}
},
Modify = A4444 {
Signals { }
}
}
}
from MG1 to MGC:
MEGACO/1 [124.124.124.222]:55555
Reply = 10006 {
Context = 2000 {Modify = A4445, Modify = A4444}}
19. The MGC decides to Audit the RTP termination on MG2.
MEGACO/1 [123.123.123.4]:55555
Transaction = 50007 {
Context = - {AuditValue = A5556{
Audit{Media, DigitMap, Events, Signals, Packages, Statistics
}}
Cuervo, et al. Standards Track [Page 165]
^L
RFC 2885 Megaco Protocol August 2000
}
}
20. The MG2 replies. An RTP termination has no events nor signals,
so these are left out in the reply .
MEGACO/1 [125.125.125.111]:55555
Reply = 50007 {
Context = - {
AuditValue = A5556 {
Media {
Stream = 1 {
LocalControl { Mode = SendReceive,
nt/jit=40 },
Local {
v=0
c=IN IP4 125.125.125.111
m=audio 1111 RTP/AVP 4
a=ptime:30
},
Remote {
v=0
c=IN IP4 124.124.124.222
m=audio 2222 RTP/AVP 4
a=ptime:30
} } },
Packages {nt-1, rtp-1},
Statistics { rtp/ps=1200, ; packets sent
nt/os=62300, ; octets sent
rtp/pr=700, ; packets received
nt/or=45100, ; octets received
rtp/pl=0.2, ; % packet loss
rtp/jit=20,
rtp/delay=40 } ; avg latency
}
}
}
21. When the MGC receives an onhook signal from one of the MGs, it
brings down the call. In this example, the user at MG2 hangs up
first.
From MG2 to MGC:
MEGACO/1 [125.125.125.111]:55555
Transaction = 50008 {
Context = 5000 {
Notify = A5555 {ObservedEvents =1235 {
Cuervo, et al. Standards Track [Page 166]
^L
RFC 2885 Megaco Protocol August 2000
19990729T24020002:al/on}
}
}
}
From MGC to MG2:
MEGACO/1 [123.123.123.4]:55555
Reply = 50008 {
Context = - {Notify = A5555}
}
22. The MGC now sends both MGs a Subtract to take down the call.
Only the subtracts to MG2 are shown here. Each termination has its
own set of statistics that it gathers. An MGC may not need to
request both to be returned. A5555 is a physical termination, and
A5556 is an RTP termination.
From MGC to MG2:
MEGACO/1 [123.123.123.4]:55555
Transaction = 50009 {
Context = 5000 {
Subtract = A5555 {Audit{Statistics}},
Subtract = A5556 {Audit{Statistics}}
}
}
From MG2 to MGC:
MEGACO/1 [125.125.125.111]:55555
Reply = 50009 {
Context = 5000 {
Subtract = A5555 {
Statistics {
nt/os=45123, ; Octets Sent
nt/dur=40 ; in seconds
}
},
Subtract = A5556 {
Statistics {
rtp/ps=1245, ; packets sent
nt/os=62345, ; octets sent
rtp/pr=780, ; packets received
nt/or=45123, ; octets received
rtp/pl=10, ; % packets lost
rtp/jit=27,
Cuervo, et al. Standards Track [Page 167]
^L
RFC 2885 Megaco Protocol August 2000
rtp/delay=48 ; average latency
}
}
}
}
23. The MGC now sets up both MG1 and MG2 to be ready to detect the
next off-hook event. See step 1. Note that this could be the default
state of a termination in the null context, and if this were the
case, no message need be sent from the MGC to the MG. Once a
termination returns to the null context, it goes back to the default
termination values for that termination.
Authors' Addresses
Fernando Cuervo
Nortel Networks
P.O. Box 3511, Station C
Ottawa, ON K1Y 4H7
Canada
E-mail: fcuervo@nortelnetworks.com
Nancy Greene
Nortel Networks
P.O. Box 3511, Station C
Ottawa, ON K1Y 4H7
Canada
E-mail: ngreene@nortelnetworks.com
Christian Huitema
Microsoft Corporation
One Microsoft Way
Redmond, WA 98052-6399
USA
E-mail: huitema@microsoft.com
Abdallah Rayhan
Nortel Networks
P.O. Box 3511, Station C
Ottawa, ON K1Y 4H7
Canada
E-mail: arayhan@nortelnetworks.com
Cuervo, et al. Standards Track [Page 168]
^L
RFC 2885 Megaco Protocol August 2000
Brian Rosen
Marconi
1000 FORE Drive
Warrendale, PA 15086
USA
E-mail: brian.rosen@marconi.com
John Segers
Lucent Technologies, Room HE 303
Dept. Forward Looking Work
P.O. Box 18, 1270 AA Huizen
The Netherlands
E-mail: jsegers@lucent.com
Cuervo, et al. Standards Track [Page 169]
^L
RFC 2885 Megaco Protocol August 2000
Full Copyright Statement
Copyright (C) The Internet Society (2000). All Rights Reserved.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are
included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Acknowledgement
Funding for the RFC Editor function is currently provided by the
Internet Society.
Cuervo, et al. Standards Track [Page 170]
^L
|