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
|
.TH megaco 3 "megaco 3.8" "Ericsson AB" "ERLANG MODULE DEFINITION"
.SH MODULE
megaco \- Main API of the Megaco application
.SH DESCRIPTION
.LP
Interface module for the Megaco application
.SH DATA TYPES
.nf
action_request() = #\&'ActionRequest\&'{}
action_reply() = #\&'ActionReply\&'{}
error_desc() = #\&'ErrorDescriptor\&'{}
segment_no() = integer()
resend_indication() = flag | boolean()
property_parm() = #\&'PropertyParm\&'{}
property_group() = [property_parm()]
property_groups() = [property_group()]
sdp() = sdp_c() | sdp_o() | sdp_s() | sdp_i() | sdp_u() |
sdp_e() | sdp_p() | sdp_b() | sdp_z() | sdp_k() |
sdp_a() | sdp_a_rtpmap() | sdp_a_ptime() |
sdp_t() | sdp_r() | sdp_m()
sdp_v() = #megaco_sdp_v{} (Protocol version)
sdp_o() = #megaco_sdp_o{} (Owner/creator and session indentifier)
sdp_s() = #megaco_sdp_s{} (Session name)
sdp_i() = #megaco_sdp_i{} (Session information)
sdp_u() = #megaco_sdp_u{} (URI of description)
sdp_e() = #megaco_sdp_e{} (Email address)
sdp_p() = #megaco_sdp_p{} (Phone number)
sdp_c() = #megaco_sdp_c{} (Connection information)
sdp_b() = #megaco_sdp_b{} (Bandwidth information)
sdp_k() = #megaco_sdp_k{} (Encryption key)
sdp_a() = #megaco_sdp_a{} (Session attribute)
sdp_a_rtpmap() = #megaco_sdp_a_rtpmap{}
sdp_a_ptime() = #megaco_sdp_a_ptime{}
sdp_a_quality() = #megaco_sdp_a_quality{}
sdp_a_fmtp() = #megaco_sdp_a_fmtp{}
sdp_z() = #megaco_sdp_z{} (Time zone adjustment)
sdp_t() = #megaco_sdp_t{} (Time the session is active)
sdp_r() = #megaco_sdp_r{} (Repeat times)
sdp_m() = #megaco_sdp_m{} (Media name and transport address)
sdp_property_parm() = sdp() | property_parm()
sdp_property_group() = [sdp_property_parm()]
sdp_property_groups() = [sdp_property_group()]
megaco_timer() = infinity | integer() >= 0 | megaco_incr_timer()
megaco_incr_timer() = #megaco_incr_timer{}
.fi
.LP
The record \fImegaco_incr_timer\fR contains the following fields:
.RS 2
.TP 4
.B
\fIwait_for = integer() >= 0\fR:
The actual timer time\&.
.TP 4
.B
\fIfactor = integer() >= 0\fR:
The factor when calculating the new timer time (\fIwait_for\fR)\&.
.TP 4
.B
\fIincr = integer()\fR:
The increment value when calculating the new timer time (\fIwait_for\fR)\&. Note that this value \fIcan\fR be negative and that a timer restart can therefor lead to a \fIwait_for\fR value of zero! It is up to the user to be aware of the consequences of a \fIwait_for\fR value of zero\&.
.TP 4
.B
\fImax_retries = infinity | infinity_restartable | integer() >= 0\fR:
The maximum number of repetitions of the timer\&.
.RS 4
.LP
.LP
There is a special case for this field\&. When the \fImax_retries\fR has the value \fIinfinity_restartable\fR, it means that the timer is restartable as long as some external event occurs (e\&.g\&. receipt of a pending message for instance)\&. But the timer will never be restarted "by itself", i\&.e\&. when the timer expires (whatever the timeout time), so does the timer\&. Whenever the timer is restarted, the timeout time will be calculated in the usual way! Also, as mentioned above, beware the consequences of setting the value to \fIinfinity\fR if \fIincr\fR has been set to an negative value\&.
.RE
.RE
.SH EXPORTS
.LP
.B
start() -> ok | {error, Reason}
.br
.RS
.TP
Types
Reason = term()
.br
.RE
.RS
.LP
Starts the Megaco application
.LP
Users may either explicitly be registered with megaco:start_user/2 and/or be statically configured by setting the application environment variable \&'users\&' to a list of {UserMid, Config} tuples\&. See the function megaco:start_user/2 for details\&.
.RE
.LP
.B
stop() -> ok | {error, Reason}
.br
.RS
.TP
Types
Reason = term()
.br
.RE
.RS
.LP
Stops the Megaco application
.RE
.LP
.B
start_user(UserMid, Config) -> ok | {error, Reason}
.br
.RS
.TP
Types
UserMid = megaco_mid()
.br
Config = [{user_info_item(), user_info_value()}]
.br
Reason = term()
.br
.RE
.RS
.LP
Initial configuration of a user
.LP
Requires the megaco application to be started\&. A user is either a Media Gateway (MG) or a Media Gateway Controller (MGC)\&. One Erlang node may host many users\&.
.LP
A user is identified by its UserMid, which must be a legal Megaco MID\&.
.LP
Config is a list of {Item, Value} tuples\&. See megaco:user_info/2 about which items and values that are valid\&.
.RE
.LP
.B
stop_user(UserMid) -> ok | {error, Reason}
.br
.RS
.TP
Types
UserMid = megaco_mid()
.br
Reason = term()
.br
.RE
.RS
.LP
Delete the configuration of a user
.LP
Requires that the user does not have any active connection\&.
.RE
.LP
.B
user_info(UserMid) -> [{Item, Value}]
.br
.B
user_info(UserMid, Item) -> Value | exit(Reason)
.br
.RS
.TP
Types
Handle = user_info_handle()
.br
UserMid = megaco_mid()
.br
Item = user_info_item()
.br
Value = user_info_value()
.br
Reason = term()
.br
.RE
.RS
.LP
Lookup user information
.LP
The following Item\&'s are valid:
.RS 2
.TP 4
.B
\fIconnections\fR:
Lists all active connections for this user\&. Returns a list of megaco_conn_handle records\&.
.RS 4
.LP
.RE
.TP 4
.B
\fIreceive_handle\fR:
Construct a megaco_receive_handle record from user config
.RS 4
.LP
.RE
.TP 4
.B
\fItrans_id\fR:
Current transaction id\&.
.RS 4
.LP
.LP
A positive integer or the atom \fIundefined_serial\fR (in case no messages has been sent)\&.
.LP
.RE
.TP 4
.B
\fImin_trans_id\fR:
First trans id\&.
.RS 4
.LP
.LP
A positive integer, defaults to 1\&.
.LP
.RE
.TP 4
.B
\fImax_trans_id\fR:
Last trans id\&.
.RS 4
.LP
.LP
A positive integer or \fIinfinity\fR, defaults to \fIinfinity\fR\&.
.LP
.RE
.TP 4
.B
\fIrequest_timer\fR:
Wait for reply\&.
.RS 4
.LP
.LP
The timer is cancelled when a reply is received\&.
.LP
.LP
When a pending message is received, the timer is cancelled and the \fIlong_request_timer\fR is started instead (see below)\&. No resends will be performed from this point (since we now know that the other side has received the request)\&.
.LP
.LP
When the timer reaches an intermediate expire, the request is resent and the timer is restarted\&.
.LP
.LP
When the timer reaches the final expire, either the function \fImegaco:call\fR will return with \fI{error, timeout}\fR or the callback function \fIhandle_trans_reply\fR will be called with \fIUserReply = {error, timeout}\fR (if \fImegaco:cast\fR was used)\&.
.LP
.LP
A Megaco Timer (see explanation above), defaults to \fI#megaco_incr_timer{}\fR\&.
.LP
.RE
.TP 4
.B
\fIlong_request_timer\fR:
Wait for reply after having received a pending message\&.
.RS 4
.LP
.LP
When the timer reaches an intermediate expire, the timer is restarted\&.
.LP
.LP
When a pending message is received, and the \fIlong_request_timer\fR is \fInot\fR "on it\&'s final leg", the timer will be restarted, and, if \fIlong_request_resend = true\fR, the request will be re-sent\&.
.LP
.LP
A Megaco Timer (see explanation above), defaults to \fI60 seconds\fR\&.
.LP
.RE
.TP 4
.B
\fIlong_request_resend\fR:
This option indicates weather the request should be resent until the reply is received, \fIeven\fR though a pending message has been received\&.
.RS 4
.LP
.LP
Normally, after a pending message has been received, the request is not resent (since a pending message is an indication that the request has been received)\&. But since the reply (to the request) can be lost, this behaviour has it\&'s values\&.
.LP
.LP
It is ofcourse pointless to set this value to \fItrue\fR unless the \fIlong_request_timer\fR (see above) is also set to an incremental timer (\fI#megaco_incr_timer{}\fR)\&.
.LP
.LP
A \fIboolean\fR, defaults to \fIfalse\fR\&.
.LP
.RE
.TP 4
.B
\fIreply_timer\fR:
Wait for an ack\&.
.RS 4
.LP
.LP
When a request is received, some info related to the reply is store internally (e\&.g\&. the binary of the reply)\&. This info will live until either an ack is received or this timer expires\&. For instance, if the same request is received again (e\&.g\&. a request with the same transaction id), the (stored) reply will be (re-) sent automatically by megaco\&.
.LP
.LP
If the timer is of type \fI#megaco_incr_timer{}\fR, then for each intermediate timout, the reply will be resent (this is valid until the ack is received or the timer expires)\&.
.LP
.LP
A Megaco Timer (see explanation above), defaults to 30000\&.
.LP
.RE
.TP 4
.B
\fIauto_ack\fR:
Automatic send transaction ack when the transaction reply has been received (see \fItrans_ack\fR below)\&.
.RS 4
.LP
.LP
This is used for \fIthree-way-handshake\fR\&.
.LP
.LP
A \fIboolean\fR, defaults to \fIfalse\fR\&.
.LP
.RE
.TP 4
.B
\fItrans_ack\fR:
Shall ack\&'s be accumulated or not\&.
.RS 4
.LP
.LP
This property is only valid if \fIauto_ack\fR is true\&.
.LP
.LP
If \fIauto_ack\fR is true, then if \fItrans_ack\fR is \fIfalse\fR, ack\&'s will be sent immediatelly\&. If \fItrans_ack\fR is \fItrue\fR, then ack\&'s will instead be sent to the transaction sender process for accumulation and later sending (see \fItrans_ack_maxcount\fR, \fItrans_req_maxcount\fR, \fItrans_req_maxsize\fR, \fItrans_ack_maxcount\fR and \fItrans_timer\fR)\&.
.LP
.LP
See also transaction sender for more info\&.
.LP
.LP
An \fIboolean\fR, defaults to \fIfalse\fR\&.
.LP
.RE
.TP 4
.B
\fItrans_ack_maxcount\fR:
Maximum number of accumulated ack\&'s\&. At most this many ack\&'s will be accumulated by the transaction sender (if started and configured to accumulate ack\&'s)\&.
.RS 4
.LP
.LP
See also transaction sender for more info\&.
.LP
.LP
An \fIinteger\fR, defaults to 10\&.
.LP
.RE
.TP 4
.B
\fItrans_req\fR:
Shall requests be accumulated or not\&.
.RS 4
.LP
.LP
If \fItrans_req\fR is \fIfalse\fR, then request(s) will be sent immediatelly (in it\&'s own message)\&.
.LP
.LP
If \fItrans_req\fR is true, then request(s) will instead be sent to the transaction sender process for accumulation and later sending (see \fItrans_ack_maxcount\fR, \fItrans_req_maxcount\fR, \fItrans_req_maxsize\fR, \fItrans_ack_maxcount\fR and \fItrans_timer\fR)\&.
.LP
.LP
See also transaction sender for more info\&.
.LP
.LP
An \fIboolean\fR, defaults to \fIfalse\fR\&.
.LP
.RE
.TP 4
.B
\fItrans_req_maxcount\fR:
Maximum number of accumulated requests\&. At most this many requests will be accumulated by the transaction sender (if started and configured to accumulate requests)\&.
.RS 4
.LP
.LP
See also transaction sender for more info\&.
.LP
.LP
An \fIinteger\fR, defaults to 10\&.
.LP
.RE
.TP 4
.B
\fItrans_req_maxsize\fR:
Maximum size of the accumulated requests\&. At most this much requests will be accumulated by the transaction sender (if started and configured to accumulate requests)\&.
.RS 4
.LP
.LP
See also transaction sender for more info\&.
.LP
.LP
An \fIinteger\fR, defaults to 2048\&.
.LP
.RE
.TP 4
.B
\fItrans_timer\fR:
Transaction sender timeout time\&. Has two functions\&. First, if the value is 0, then transactions will not be accumulated (e\&.g\&. the transaction sender process will not be started)\&. Second, if the value is greater then 0 and \fIauto_ack\fR and \fItrans_ack\fR are both true or if \fItrans_req\fR is true, then transaction sender will be started and transactions (which is depending on the values of \fIauto_ack\fR, \fItrans_ack\fR and \fItrans_req\fR) will be accumulated, for later sending\&.
.RS 4
.LP
.LP
See also transaction sender for more info\&.
.LP
.LP
An \fIinteger\fR, defaults to 0\&.
.LP
.RE
.TP 4
.B
\fIpending_timer\fR:
Automatically send pending if the timer expires before a transaction reply has been sent\&. This timer is also called provisional response timer\&.
.RS 4
.LP
.LP
A Megaco Timer (see explanation above), defaults to 30000\&.
.LP
.RE
.TP 4
.B
\fIsent_pending_limit\fR:
Sent pending limit (see the MGOriginatedPendingLimit and the MGCOriginatedPendingLimit of the megaco root package)\&. This parameter specifies how many pending messages that can be sent (for a given received transaction request)\&. When the limit is exceeded, the transaction is aborted (see handle_trans_request_abort) and an error message is sent to the other side\&.
.RS 4
.LP
.LP
Note that this has no effect on the actual sending of pending transactions\&. This is either implicit (e\&.g\&. when receiving a re-sent transaction request for a request which is beeing processed) or controlled by the pending_timer, see above\&.
.LP
.LP
A positive integer or \fIinfinity\fR, defaults to \fIinfinity\fR\&.
.LP
.RE
.TP 4
.B
\fIrecv_pending_limit\fR:
Receive pending limit (see the MGOriginatedPendingLimit and the MGCOriginatedPendingLimit of the megaco root package)\&. This parameter specifies how many pending messages that can be received (for a sent transaction request)\&. When the limit is exceeded, the transaction is considered lost, and an error returned to the user (through the call-back function \fIhandle_trans_reply\fR)\&.
.RS 4
.LP
.LP
A positive integer or \fIinfinity\fR, defaults to \fIinfinity\fR\&.
.LP
.RE
.TP 4
.B
\fIsend_mod\fR:
Send callback module which exports send_message/2\&. The function SendMod:send_message(SendHandle, Binary) is invoked when the bytes needs to be transmitted to the remote user\&.
.RS 4
.LP
.LP
An \fIatom\fR, defaults to \fImegaco_tcp\fR\&.
.LP
.RE
.TP 4
.B
\fIencoding_mod\fR:
Encoding callback module which exports encode_message/2 and decode_message/2\&. The function EncodingMod:encode_message(EncodingConfig, MegacoMessage) is invoked whenever a \&'MegacoMessage\&' record needs to be translated into an Erlang binary\&. The function EncodingMod:decode_message(EncodingConfig, Binary) is invoked whenever an Erlang binary needs to be translated into a \&'MegacoMessage\&' record\&.
.RS 4
.LP
.LP
An \fIatom\fR, defaults to \fImegaco_pretty_text_encoder\fR\&.
.LP
.RE
.TP 4
.B
\fIencoding_config\fR:
Encoding module config\&.
.RS 4
.LP
.LP
A \fIlist\fR, defaults to \fI[]\fR\&.
.LP
.RE
.TP 4
.B
\fIprotocol_version\fR:
Actual protocol version\&.
.RS 4
.LP
.LP
An \fIinteger\fR, default is 1\&.
.LP
.RE
.TP 4
.B
\fIstrict_version\fR:
Strict version control, i\&.e\&. when a message is received, verify that the version is that which was negotiated\&.
.RS 4
.LP
.LP
An \fIboolean\fR, default is true\&.
.LP
.RE
.TP 4
.B
\fIreply_data\fR:
Default reply data\&.
.RS 4
.LP
.LP
Any term, defaults to the atom \fIundefined\fR\&.
.LP
.RE
.TP 4
.B
\fIuser_mod\fR:
Name of the user callback module\&. See the the reference manual for megaco_user for more info\&.
.RS 4
.LP
.RE
.TP 4
.B
\fIuser_args\fR:
List of extra arguments to the user callback functions\&. See the the reference manual for megaco_user for more info\&.
.RS 4
.LP
.RE
.TP 4
.B
\fIthreaded\fR:
If a received message contains several transaction requests, this option indicates whether the requests should be handled sequencially in the same process (\fIfalse\fR), or if each request should be handled by it\&'s own process (\fItrue\fR i\&.e\&. a separate process is spawned for each request)\&.
.RS 4
.LP
.LP
An \fIboolean\fR, defaults to \fIfalse\fR\&.
.LP
.RE
.TP 4
.B
\fIresend_indication\fR:
This option indicates weather the transport module should be told if a message send is a resend or not\&.
.RS 4
.LP
.LP
If \fIfalse\fR, megaco messages are sent using the send_message function\&.
.LP
.LP
If \fItrue\fR, megaco message \fIre-sends\fR are made using the resend_message function\&. The initial message send is still done using the send_message function\&.
.LP
.LP
The special value \fIflag\fR instead indicates that the function send_message/3 shall be used\&.
.LP
.LP
A \fIresend_indication()\fR, defaults to \fIfalse\fR\&.
.LP
.RE
.TP 4
.B
\fIsegment_reply_ind\fR:
This option specifies if the user shall be notified of received segment replies or not\&.
.RS 4
.LP
.LP
See handle_segment_reply callback function for more information\&.
.LP
.LP
A \fIboolean\fR, defaults to \fIfalse\fR\&.
.LP
.RE
.TP 4
.B
\fIsegment_recv_timer\fR:
This timer is started when the segment indicated by the \fIsegmentation complete token\fR is received, but all segments has not yet been received\&.
.RS 4
.LP
.LP
When the timer finally expires, a "megaco segments not received" (459) error message is sent to the other side and the user is notified with a \fIsegment timeout\fR\fIUserReply\fR in either the handle_trans_reply callback function or the return value of the call function\&.
.LP
.LP
A Megaco Timer (see explanation above), defaults to \fI10000\fR\&.
.LP
.RE
.TP 4
.B
\fIsegment_send\fR:
Shall outgoing messages be segmented or not:
.RS 4
.LP
.RS 2
.TP 4
.B
\fInone\fR:
Do not segment outgoing reply messages\&. This is usefull when either it is known that messages are never to large or that the transport protocol can handle such things on it\&'s own (e\&.g\&. TCP or SCTP)\&.
.TP 4
.B
\fIinteger() > 0\fR:
Outgoing reply messages will be segmented as needed (see \fImax_pdu_size\fR below)\&. This value, K, indicate the outstanding window, i\&.e\&. how many segments can be outstanding (not acknowledged) at any given time\&.
.TP 4
.B
\fIinfinity\fR:
Outgoing reply messages will be segmented as needed (see \fImax_pdu_size\fR below)\&. Segment messages are sent all at once (i\&.e\&. no acknowledgement awaited before sending the next segment)\&.
.RE
.LP
.LP
Defaults to \fInone\fR\&.
.LP
.RE
.TP 4
.B
\fImax_pdu_size\fR:
Max message size\&. If the encoded message (PDU) exceeds this size, the message should be segmented, and then encoded\&.
.RS 4
.LP
.LP
A positive integer or \fIinfinity\fR, deefaults to \fIinfinity\fR\&.
.RE
.RE
.RE
.LP
.B
update_user_info(UserMid, Item, Value) -> ok | {error, Reason}
.br
.RS
.TP
Types
UserMid = megaco_mid()
.br
Item = user_info_item()
.br
Value = user_info_value()
.br
Reason = term()
.br
.RE
.RS
.LP
Update information about a user
.LP
Requires that the user is started\&. See megaco:user_info/2 about which items and values that are valid\&.
.RE
.LP
.B
conn_info(ConnHandle) -> [{Item, Value}]
.br
.B
conn_info(ConnHandle, Item) -> Value | exit(Reason)
.br
.RS
.TP
Types
ConnHandle = #megaco_conn_handle{}
.br
Item = conn_info_item()
.br
Value = conn_info_value()
.br
Reason = {no_such_connection, ConnHandle} | term()
.br
.RE
.RS
.LP
Lookup information about an active connection
.LP
Requires that the connection is active\&.
.RS 2
.TP 4
.B
\fIcontrol_pid\fR:
The process identifier of the controlling process for a connenction\&.
.RS 4
.LP
.RE
.TP 4
.B
\fIsend_handle\fR:
Opaque send handle whose contents is internal for the send module\&. May be any term\&.
.RS 4
.LP
.RE
.TP 4
.B
\fIlocal_mid\fR:
The local mid (of the connection, i\&.e\&. the own mid)\&. \fImegaco_mid()\fR\&.
.RS 4
.LP
.RE
.TP 4
.B
\fIremote_mid\fR:
The remote mid (of the connection)\&. \fImegaco_mid()\fR\&.
.RS 4
.LP
.RE
.TP 4
.B
\fIreceive_handle\fR:
Construct a megaco_receive_handle record\&.
.RS 4
.LP
.RE
.TP 4
.B
\fItrans_id\fR:
Next transaction id\&. A positive integer or the atom \fIundefined_serial\fR (only in case of error)\&.
.RS 4
.LP
.LP
Note that transaction id\&'s are (currently) maintained on a per user basis so there is no way to be sure that the value returned will actually be used for a transaction sent on this connection (in case a user has several connections, which is not at all unlikely)\&.
.LP
.RE
.TP 4
.B
\fImax_trans_id\fR:
Last trans id\&.
.RS 4
.LP
.LP
A positive integer or \fIinfinity\fR, defaults to \fIinfinity\fR\&.
.LP
.RE
.TP 4
.B
\fIrequest_timer\fR:
Wait for reply\&.
.RS 4
.LP
.LP
The timer is cancelled when a reply is received\&.
.LP
.LP
When a pending message is received, the timer is cancelled and the \fIlong_request_timer\fR is started instead (see below)\&. No resends will be performed from this point (since we now know that the other side has received the request)\&.
.LP
.LP
When the timer reaches an intermediate expire, the request is resent and the timer is restarted\&.
.LP
.LP
When the timer reaches the final expire, either the function \fImegaco:call\fR will return with \fI{error, timeout}\fR or the callback function \fIhandle_trans_reply\fR will be called with \fIUserReply = {error, timeout}\fR (if \fImegaco:cast\fR was used)\&.
.LP
.LP
A Megaco Timer (see explanation above), defaults to #megaco_incr_timer{}\&.
.LP
.RE
.TP 4
.B
\fIlong_request_timer\fR:
Wait for reply after having received a pending message\&.
.RS 4
.LP
.LP
When the timer reaches an intermediate expire, the timer restarted\&.
.LP
.LP
When a pending message is received, and the \fIlong_request_timer\fR is \fInot\fR "on it\&'s final leg", the timer will be restarted, and, if \fIlong_request_resend = true\fR, the request will be re-sent\&.
.LP
.LP
A Megaco Timer (see explanation above), defaults to \fI60 seconds\fR\&.
.LP
.RE
.TP 4
.B
\fIlong_request_resend\fR:
This option indicates weather the request should be resent until the reply is received, \fIeven\fR though a pending message has been received\&.
.RS 4
.LP
.LP
Normally, after a pending message has been received, the request is not resent (since a pending message is an indication that the request has been received)\&. But since the reply (to the request) can be lost, this behaviour has it\&'s values\&.
.LP
.LP
It is ofcourse pointless to set this value to \fItrue\fR unless the \fIlong_request_timer\fR (see above) is also set to an incremental timer (\fI#megaco_incr_timer{}\fR)\&.
.LP
.LP
A \fIboolean\fR, defaults to \fIfalse\fR\&.
.LP
.RE
.TP 4
.B
\fIreply_timer\fR:
Wait for an ack\&.
.RS 4
.LP
.LP
When a request is received, some info related to the reply is store internally (e\&.g\&. the binary of the reply)\&. This info will live until either an ack is received or this timer expires\&. For instance, if the same request is received again (e\&.g\&. a request with the same transaction id), the (stored) reply will be (re-) sent automatically by megaco\&.
.LP
.LP
If the timer is of type \fI#megaco_incr_timer{}\fR, then for each intermediate timout, the reply will be resent (this is valid until the ack is received or the timer expires)\&.
.LP
.LP
A Megaco Timer (see explanation above), defaults to 30000\&.
.LP
.RE
.TP 4
.B
\fIauto_ack\fR:
Automatic send transaction ack when the transaction reply has been received (see \fItrans_ack\fR below)\&.
.RS 4
.LP
.LP
This is used for \fIthree-way-handshake\fR\&.
.LP
.LP
A \fIboolean\fR, defaults to \fIfalse\fR\&.
.LP
.RE
.TP 4
.B
\fItrans_ack\fR:
Shall ack\&'s be accumulated or not\&.
.RS 4
.LP
.LP
This property is only valid if \fIauto_ack\fR is true\&.
.LP
.LP
If \fIauto_ack\fR is true, then if \fItrans_ack\fR is \fIfalse\fR, ack\&'s will be sent immediatelly\&. If \fItrans_ack\fR is \fItrue\fR, then ack\&'s will instead be sent to the transaction sender process for accumulation and later sending (see \fItrans_ack_maxcount\fR, \fItrans_req_maxcount\fR, \fItrans_req_maxsize\fR, \fItrans_ack_maxcount\fR and \fItrans_timer\fR)\&.
.LP
.LP
See also transaction sender for more info\&.
.LP
.LP
An \fIboolean\fR, defaults to \fIfalse\fR\&.
.LP
.RE
.TP 4
.B
\fItrans_ack_maxcount\fR:
Maximum number of accumulated ack\&'s\&. At most this many ack\&'s will be accumulated by the transaction sender (if started and configured to accumulate ack\&'s)\&.
.RS 4
.LP
.LP
See also transaction sender for more info\&.
.LP
.LP
An integer, defaults to 10\&.
.LP
.RE
.TP 4
.B
\fItrans_req\fR:
Shall requests be accumulated or not\&.
.RS 4
.LP
.LP
If \fItrans_req\fR is \fIfalse\fR, then request(s) will be sent immediatelly (in it\&'s own message)\&.
.LP
.LP
If \fItrans_req\fR is true, then request(s) will instead be sent to the transaction sender process for accumulation and later sending (see \fItrans_ack_maxcount\fR, \fItrans_req_maxcount\fR, \fItrans_req_maxsize\fR, \fItrans_ack_maxcount\fR and \fItrans_timer\fR)\&.
.LP
.LP
See also transaction sender for more info\&.
.LP
.LP
An \fIboolean\fR, defaults to \fIfalse\fR\&.
.LP
.RE
.TP 4
.B
\fItrans_req_maxcount\fR:
Maximum number of accumulated requests\&. At most this many requests will be accumulated by the transaction sender (if started and configured to accumulate requests)\&.
.RS 4
.LP
.LP
See also transaction sender for more info\&.
.LP
.LP
An \fIinteger\fR, defaults to 10\&.
.LP
.RE
.TP 4
.B
\fItrans_req_maxsize\fR:
Maximum size of the accumulated requests\&. At most this much requests will be accumulated by the transaction sender (if started and configured to accumulate requests)\&.
.RS 4
.LP
.LP
See also transaction sender for more info\&.
.LP
.LP
An \fIinteger\fR, defaults to 2048\&.
.LP
.RE
.TP 4
.B
\fItrans_timer\fR:
Transaction sender timeout time\&. Has two functions\&. First, if the value is 0, then transactions will not be accumulated (e\&.g\&. the transaction sender process will not be started)\&. Second, if the value is greater then 0 and \fIauto_ack\fR and \fItrans_ack\fR is true or if \fItrans_req\fR is true, then transaction sender will be started and transactions (which is depending on the values of \fIauto_ack\fR, \fItrans_ack\fR and \fItrans_req\fR) will be accumulated, for later sending\&.
.RS 4
.LP
.LP
See also transaction sender for more info\&.
.LP
.LP
An \fIinteger\fR, defaults to 0\&.
.LP
.RE
.TP 4
.B
\fIpending_timer\fR:
Automatic send transaction pending if the timer expires before a transaction reply has been sent\&. This timer is also called provisional response timer\&.
.RS 4
.LP
.LP
A Megaco Timer (see explanation above), defaults to 30000\&.
.LP
.RE
.TP 4
.B
\fIsent_pending_limit\fR:
Sent pending limit (see the MGOriginatedPendingLimit and the MGCOriginatedPendingLimit of the megaco root package)\&. This parameter specifies how many pending messages that can be sent (for a given received transaction request)\&. When the limit is exceeded, the transaction is aborted (see handle_trans_request_abort) and an error message is sent to the other side\&.
.RS 4
.LP
.LP
Note that this has no effect on the actual sending of pending transactions\&. This is either implicit (e\&.g\&. when receiving a re-sent transaction request for a request which is beeing processed) or controlled by the pending_timer, see above\&.
.LP
.LP
A positive integer or \fIinfinity\fR, defaults to \fIinfinity\fR\&.
.LP
.RE
.TP 4
.B
\fIrecv_pending_limit\fR:
Receive pending limit (see the MGOriginatedPendingLimit and the MGCOriginatedPendingLimit of the megaco root package)\&. This parameter specifies how many pending messages that can be received (for a sent transaction request)\&. When the limit is exceeded, the transaction is considered lost, and an error returned to the user (through the call-back function \fIhandle_trans_reply\fR)\&.
.RS 4
.LP
.LP
A positive integer or \fIinfinity\fR, defaults to \fIinfinity\fR\&.
.LP
.RE
.TP 4
.B
\fIsend_mod\fR:
Send callback module which exports send_message/2\&. The function SendMod:send_message(SendHandle, Binary) is invoked when the bytes needs to be transmitted to the remote user\&.
.RS 4
.LP
.LP
An \fIatom\fR, defaults to \fImegaco_tcp\fR\&.
.LP
.RE
.TP 4
.B
\fIencoding_mod\fR:
Encoding callback module which exports encode_message/2 and decode_message/2\&. The function EncodingMod:encode_message(EncodingConfig, MegacoMessage) is invoked whenever a \&'MegacoMessage\&' record needs to be translated into an Erlang binary\&. The function EncodingMod:decode_message(EncodingConfig, Binary) is invoked whenever an Erlang binary needs to be translated into a \&'MegacoMessage\&' record\&.
.RS 4
.LP
.LP
An \fIatom\fR, defaults to \fImegaco_pretty_text_encoder\fR\&.
.LP
.RE
.TP 4
.B
\fIencoding_config\fR:
Encoding module config\&.
.RS 4
.LP
.LP
A \fIlist\fR, defaults to []\&.
.LP
.RE
.TP 4
.B
\fIprotocol_version\fR:
Actual protocol version\&.
.RS 4
.LP
.LP
An positive integer, Current default is 1\&.
.LP
.RE
.TP 4
.B
\fIstrict_version\fR:
Strict version control, i\&.e\&. when a message is received, verify that the version is that which was negotiated\&.
.RS 4
.LP
.LP
An \fIboolean\fR, default is true\&.
.LP
.RE
.TP 4
.B
\fIreply_data\fR:
Default reply data\&.
.RS 4
.LP
.LP
Any term, defaults to the atom \fIundefined\fR\&.
.LP
.RE
.TP 4
.B
\fIthreaded\fR:
If a received message contains several transaction requests, this option indicates whether the requests should be handled sequencially in the same process (\fIfalse\fR), or if each request should be handled by it\&'s own process (\fItrue\fR i\&.e\&. a separate process is spawned for each request)\&.
.RS 4
.LP
.LP
An \fIboolean\fR, defaults to \fIfalse\fR\&.
.LP
.RE
.TP 4
.B
\fIresend_indication\fR:
This option indicates weather the transport module should be told if a message send is a resend or not\&.
.RS 4
.LP
.LP
If \fIfalse\fR, megaco messages are sent using the send_message/2 function\&.
.LP
.LP
If \fItrue\fR, megaco message \fIre-sends\fR are made using the resend_message function\&. The initial message send is still done using the send_message function\&.
.LP
.LP
The special value \fIflag\fR instead indicates that the function send_message/3 shall be used\&.
.LP
.LP
A \fIresend_indication()\fR, defaults to \fIfalse\fR\&.
.LP
.RE
.TP 4
.B
\fIsegment_reply_ind\fR:
This option specifies if the user shall be notified of received segment replies or not\&.
.RS 4
.LP
.LP
See handle_segment_reply callback function for more information\&.
.LP
.LP
A \fIboolean\fR, defaults to \fIfalse\fR\&.
.LP
.RE
.TP 4
.B
\fIsegment_recv_timer\fR:
This timer is started when the segment indicated by the \fIsegmentation complete token\fR (e\&.g\&. the last of the segment which makes up the reply) is received, but all segments has not yet been received\&.
.RS 4
.LP
.LP
When the timer finally expires, a "megaco segments not received" (459) error message is sent to the other side and the user is notified with a \fIsegment timeout\fR\fIUserReply\fR in either the handle_trans_reply callback function or the return value of the call function\&.
.LP
.LP
A Megaco Timer (see explanation above), defaults to \fI10000\fR\&.
.LP
.RE
.TP 4
.B
\fIsegment_send\fR:
Shall outgoing messages be segmented or not:
.RS 4
.LP
.RS 2
.TP 4
.B
\fInone\fR:
Do not segment outgoing reply messages\&. This is usefull when either it is known that messages are never to large or that the transport protocol can handle such things on it\&'s own (e\&.g\&. TCP or SCTP)\&.
.TP 4
.B
\fIinteger() > 0\fR:
Outgoing reply messages will be segmented as needed (see \fImax_pdu_size\fR below)\&. This value, K, indicate the outstanding window, i\&.e\&. how many segments can be outstanding (not acknowledged) at any given time\&.
.TP 4
.B
\fIinfinity\fR:
Outgoing reply messages will be segmented as needed (see \fImax_pdu_size\fR below)\&. Segment messages are sent all at once (i\&.e\&. no acknowledgement awaited before sending the next segment)\&.
.RE
.LP
.LP
Defaults to \fInone\fR\&.
.LP
.RE
.TP 4
.B
\fImax_pdu_size\fR:
Max message size\&. If the encoded message (PDU) exceeds this size, the message should be segmented, and then encoded\&.
.RS 4
.LP
.LP
A positive integer or \fIinfinity\fR, deefaults to \fIinfinity\fR\&.
.RE
.RE
.RE
.LP
.B
update_conn_info(ConnHandle, Item, Value) -> ok | {error, Reason}
.br
.RS
.TP
Types
ConnHandle = #megaco_conn_handle{}
.br
Item = conn_info_item()
.br
Value = conn_info_value()
.br
Reason = term()
.br
.RE
.RS
.LP
Update information about an active connection
.LP
Requires that the connection is activated\&. See megaco:conn_info/2 about which items and values that are valid\&.
.RE
.LP
.B
system_info() -> [{Item, Value}] | exit(Reason)
.br
.B
system_info(Item) -> Value | exit(Reason)
.br
.RS
.TP
Types
Item = system_info_item()
.br
.RE
.RS
.LP
Lookup system information
.LP
The following items are valid:
.RS 2
.TP 4
.B
\fItext_config\fR:
The text encoding config\&.
.TP 4
.B
\fIconnections\fR:
Lists all active connections\&. Returns a list of megaco_conn_handle records\&.
.TP 4
.B
\fIusers\fR:
Lists all active users\&. Returns a list of megaco_mid()\&'s\&.
.TP 4
.B
\fIn_active_requests\fR:
Returns an integer representing the number of requests that has originated from this Erlang node and still are active (and therefore consumes system resources)\&.
.TP 4
.B
\fIn_active_replies\fR:
Returns an integer representing the number of replies that has originated from this Erlang node and still are active (and therefore consumes system resources)\&.
.TP 4
.B
\fIn_active_connections\fR:
Returns an integer representing the number of active connections\&.
.RE
.RE
.LP
.B
info() -> Info
.br
.RS
.TP
Types
Info = [{Key, Value}]
.br
.RE
.RS
.LP
This function produces a list of information about the megaco application\&. Such as users and their config, connections and their config, statistics and so on\&.
.LP
This information can be produced by the functions user_info, conn_info, system_info and get_stats but this is a simple way to get it all at once\&.
.RE
.LP
.B
connect(ReceiveHandle, RemoteMid, SendHandle, ControlPid) -> {ok, ConnHandle} | {error, Reason}
.br
.RS
.TP
Types
ReceiveHandle = #megaco_receive_handle{}
.br
RemoteMid = preliminary_mid | megaco_mid()
.br
SendHandle = term()
.br
ControlPid = pid()
.br
ConnHandle = #megaco_conn_handle{}
.br
Reason = connect_reason() | handle_connect_reason() | term()
.br
connect_reason() = {no_such_user, LocalMid} | {already_connected, ConnHandle} | term()
.br
handle_connect_error() = {connection_refused, ConnData, ErrorInfo} | term()
.br
LocalMid = megaco_mid()
.br
ConnData = term()
.br
ErrorInfo = term()
.br
.RE
.RS
.LP
Establish a "virtual" connection
.LP
Activates a connection to a remote user\&. When this is done the connection can be used to send messages (with SendMod:send_message/2)\&. The ControlPid is the identifier of a process that controls the connection\&. That process will be supervised and if it dies, this will be detected and the UserMod:handle_disconnect/2 callback function will be invoked\&. See the megaco_user module for more info about the callback arguments\&. The connection may also explicitly be deactivated by invoking megaco:disconnect/2\&.
.LP
The ControlPid may be the identity of a process residing on another Erlang node\&. This is useful when you want to distribute a user over several Erlang nodes\&. In such a case one of the nodes has the physical connection\&. When a user residing on one of the other nodes needs to send a request (with megaco:call/3 or megaco:cast/3), the message will encoded on the originating Erlang node, and then be forwarded to the node with the physical connection\&. When the reply arrives, it will be forwarded back to the originator\&. The distributed connection may explicitely be deactivated by a local call to megaco:disconnect/2 or implicitely when the physical connection is deactivated (with megaco:disconnect/2, killing the controlling process, halting the other node, \&.\&.\&.)\&.
.LP
The call of this function will trigger the callback function UserMod:handle_connect/2 to be invoked\&. See the megaco_user module for more info about the callback arguments\&.
.LP
A connection may be established in several ways:
.RS 2
.TP 4
.B
\fIprovisioned MID\fR:
The MG may explicitely invoke megaco:connect/4 and use a provisioned MID of the MGC as the RemoteMid\&.
.TP 4
.B
\fIupgrade preliminary MID\fR:
The MG may explicitely invoke megaco:connect/4 with the atom \&'preliminary_mid\&' as a temporary MID of the MGC, send an intial message, the Service Change Request, to the MGC and then wait for an initial message, the Service Change Reply\&. When the reply arrives, the Megaco application will pick the MID of the MGC from the message header and automatically upgrade the connection to be a "normal" connection\&. By using this method of establishing the connection, the callback function UserMod:handle_connect/2 to be invoked twice\&. First with a ConnHandle with the remote_mid-field set to preliminary_mid, and then when the connection upgrade is done with the remote_mid-field set to the actual MID of the MGC\&.
.TP 4
.B
\fIautomatic\fR:
When the MGC receives its first message, the Service Change Request, the Megaco application will automatically establish the connection by using the MG MID found in the message header as remote mid\&.
.TP 4
.B
\fIdistributed\fR:
When a user (MG/MGC) is distributed over several nodes, it is required that the node hosting the connection already has activated the connection and that it is in the "normal" state\&. The RemoteMid must be a real Megaco MID and not a preliminary_mid\&.
.RE
.LP
An initial megaco_receive_handle record may be obtained with megaco:user_info(UserMid, receive_handle)
.LP
The send handle is provided by the preferred transport module, e\&.g\&. megaco_tcp, megaco_udp\&. Read the documentation about each transport module about the details\&.
.LP
The connect is done in two steps: first an internal \fIconnection setup\fR and then by calling the user handle_connect callback function\&. The first step could result in an error with \fIReason = connect_reason()\fR and the second an error with \fIReason = handle_connect_reason()\fR:
.RS 2
.TP 4
.B
\fIconnect_reason()\fR:
An error with this reason is generated by the megaco application itself\&.
.TP 4
.B
\fIhandle_connect_reason()\fR:
An error with this reason is caused by the user handle_connect callback function either returning an error or an invalid value\&.
.RE
.RE
.LP
.B
disconnect(ConnHandle, DiscoReason) -> ok | {error, ErrReason}
.br
.RS
.TP
Types
ConnHandle = conn_handle()
.br
DiscoReason = term()
.br
ErrReason = term()
.br
.RE
.RS
.LP
Tear down a "virtual" connection
.LP
Causes the UserMod:handle_disconnect/2 callback function to be invoked\&. See the megaco_user module for more info about the callback arguments\&.
.RE
.LP
.B
call(ConnHandle, Actions, Options) -> {ProtocolVersion, UserReply}
.br
.RS
.TP
Types
ConnHandle = conn_handle()
.br
Actions = action_reqs() | [action_reqs()]
.br
action_reqs() = binary() | [action_request()]
.br
Options = [send_option()]
.br
send_option() = {request_timer, megaco_timer()} | {long_request_timer, megaco_timer()} | {send_handle, term()} | {protocol_version, integer()}
.br
ProtocolVersion = integer()
.br
UserReply = user_reply() | [user_reply()]
.br
user_reply() = success() | failure()
.br
success() = {ok, result()} | {ok, result(), extra()}
.br
result() = message_result() | segment_result()
.br
message_result() = action_reps()
.br
segment_result() = segments_ok()
.br
failure() = {error, reason()} | {error, reason(), extra()}
.br
reason() = message_reason() | segment_reason() | user_cancel_reason() | send_reason() | other_reason()
.br
message_reason() = error_desc()
.br
segment_reason() = {segment, segments_ok(), segments_err()} | {segment_timeout, missing_segments(), segments_ok(), segments_err()}
.br
segments_ok() = [segment_ok()]
.br
segment_ok() = {segment_no(), action_reps()}
.br
segments_err() = [segment_err()]
.br
segment_err() = {segment_no(), error_desc()}
.br
missing_segments() = [segment_no()]
.br
user_cancel_reason() = {user_cancel, reason_for_user_cancel()}
.br
reason_for_user_cancel() = term()
.br
send_reason() = send_cancelled_reason() | send_failed_reason()
.br
send_cancelled_reason() = {send_message_cancelled, reason_for_send_cancel()}
.br
reason_for_send_cancel() = term()
.br
send_failed_reason() = {send_message_failed, reason_for_send_failure()}
.br
reason_for_send_failure() = term()
.br
other_reason() = term()
.br
action_reps() = [action_reply()]
.br
extra() = term()
.br
.RE
.RS
.LP
Sends one or more transaction request(s) and waits for the reply\&.
.LP
When sending one transaction in a message, \fIActions\fR should be \fIaction_reqs()\fR (\fIUserReply\fR will then be \fIuser_reply()\fR)\&. When sending several transactions in a message, \fIActions\fR should be \fI[action_reqs()]\fR (\fIUserReply\fR will then be \fI[user_reply()]\fR)\&. Each element of the list is part of one transaction\&.
.LP
For some of \fIour\fR codecs (not binary), it is also possible to pre-encode the actions, in which case \fIActions\fR will be either a \fIbinary()\fR or \fI[binary()]\fR\&.
.LP
The function returns when the reply arrives, when the request timer eventually times out or when the outstanding requests are explicitly cancelled\&.
.LP
The default values of the send options are obtained by \fImegaco:conn_info(ConnHandle, Item)\fR\&. But the send options above, may explicitly be overridden\&.
.LP
The \fIProtocolVersion\fR version is the version actually encoded in the reply message\&.
.LP
At \fIsuccess()\fR, the \fIUserReply\fR contains a list of \&'ActionReply\&' records possibly containing error indications\&.
.LP
A \fImessage_error()\fR, indicates that the remote user has replied with an explicit transactionError\&.
.LP
A \fIuser_cancel_error()\fR, indicates that the request has been canceled by the user\&. \fIreason_for_user_cancel()\fR is the reason given in the call to the cancel function\&.
.LP
A \fIsend_error()\fR, indicates that the send function of the megaco transport callback module failed to send the request\&. There are two separate cases: \fIsend_cancelled_reason()\fR and \fIsend_failed_reason()\fR\&. The first is the result of the send function returning \fI{cancel, Reason}\fR and the second is some other kind of erroneous return value\&. See the send_message function for more info\&.
.LP
An \fIother_error()\fR, indicates some other error such as timeout\&.
.LP
For more info abount the \fIextra()\fR part of the result, see the note in the user callback module documentation\&.
.RE
.LP
.B
cast(ConnHandle, Actions, Options) -> ok | {error, Reason}
.br
.RS
.TP
Types
ConnHandle = conn_handle()
.br
Actions = action_reqs() | [action_reqs()]
.br
action_reqs() = binary() | [action_request()]
.br
Options = [send_option()]
.br
send_option() = {request_timer, megaco_timer()} | {long_request_timer, megaco_timer()} | {send_handle, term()} | {reply_data, reply_data()} | {protocol_version, integer()}
.br
Reason = term()
.br
.RE
.RS
.LP
Sends one or more transaction request(s) but does NOT wait for a reply
.LP
When sending one transaction in a message, \fIActions\fR should be \fIaction_reqs()\fR\&. When sending several transactions in a message, \fIActions\fR should be \fI[action_reqs()]\fR\&. Each element of the list is part of one transaction\&.
.LP
For some of \fIour\fR codecs (not binary), it is also possible to pre-encode the actions, in which case \fIActions\fR will be either a \fIbinary()\fR or \fI[binary()]\fR\&.
.LP
The default values of the send options are obtained by megaco:conn_info(ConnHandle, Item)\&. But the send options above, may explicitly be overridden\&.
.LP
The ProtocolVersion version is the version actually encoded in the reply message\&.
.LP
The callback function UserMod:handle_trans_reply/4 is invoked when the reply arrives, when the request timer eventually times out or when the outstanding requests are explicitly cancelled\&. See the megaco_user module for more info about the callback arguments\&.
.LP
Given as UserData argument to UserMod:handle_trans_reply/4\&.
.RE
.LP
.B
encode_actions(ConnHandle, Actions, Options) -> {ok, BinOrBins} | {error, Reason}
.br
.RS
.TP
Types
ConnHandle = conn_handle()
.br
Actions = action_reqs() | [action_reqs()]
.br
action_reqs() = [#\&'ActionRequest\&'{}]
.br
Options = [send_option()]
.br
send_option() = {request_timer, megaco_timer()} | {long_request_timer, megaco_timer()} | {send_handle, term()} | {protocol_version, integer()}
.br
BinOrBins = binary() | [binary()]
.br
Reason = term()
.br
.RE
.RS
.LP
Encodes lists of action requests for one or more transaction request(s)\&.
.LP
When encoding action requests for one transaction, \fIActions\fR should be \fIaction_reqs()\fR\&. When encoding action requests for several transactions, \fIActions\fR should be \fI[action_reqs()]\fR\&. Each element of the list is part of one transaction\&.
.RE
.LP
.B
token_tag2string(Tag) -> Result
.br
.B
token_tag2string(Tag, EncoderMod) -> Result
.br
.B
token_tag2string(Tag, EncoderMod, Version) -> Result
.br
.RS
.TP
Types
Tag = atom()
.br
EncoderMod = pretty | compact | encoder_module()
.br
encoder_module() = megaco_pretty_text_encoder | megaco_compact_text_encoder | atom()
.br
Version = int_version() | atom_version()
.br
int_version() = 1 | 2 | 3
.br
atom_version() = v1 | v2 | v3 | prev3c | prev3b
.br
Result = string() | {error, Reason}
.br
Reason = term()
.br
.RE
.RS
.LP
Convert a token tag to a string
.LP
If no encoder module is given, the default is used (which is pretty)\&.
.LP
If no or an unknown version is given, the \fIbest\fR version is used (which is v3)\&.
.LP
If no match is found for \fITag\fR, \fIResult\fR will be the empty string (\fI[]\fR)\&.
.RE
.LP
.B
cancel(ConnHandle, CancelReason) -> ok | {error, ErrReason}
.br
.RS
.TP
Types
ConnHandle = conn_handle()
.br
CancelReason = term()
.br
ErrReason = term()
.br
.RE
.RS
.LP
Cancel all outstanding messages for this connection
.LP
This causes outstanding megaco:call/3 requests to return\&. The callback functions UserMod:handle_reply/4 and UserMod:handle_trans_ack/4 are also invoked where it applies\&. See the megaco_user module for more info about the callback arguments\&.
.RE
.LP
.B
process_received_message(ReceiveHandle, ControlPid, SendHandle, BinMsg) -> ok
.br
.B
process_received_message(ReceiveHandle, ControlPid, SendHandle, BinMsg, Extra) -> ok
.br
.RS
.TP
Types
ReceiveHandle = #megaco_receive_handle{}
.br
ControlPid = pid()
.br
SendHandle = term()
.br
BinMsg = binary()
.br
Extra = term()
.br
.RE
.RS
.LP
Process a received message
.LP
This function is intended to be invoked by some transport modules when get an incoming message\&. Which transport that actually is used is up to the user to choose\&.
.LP
The message is delivered as an Erlang binary and is decoded by the encoding module stated in the receive handle together with its encoding config (also in the receive handle)\&. Depending of the outcome of the decoding various callback functions will be invoked\&. See megaco_user for more info about the callback arguments\&.
.LP
The argument \fIExtra\fR is just an opaque data structure passed to the user via the callback functions in the user callback module\&. Note however that if \fIExtra\fR has the value \fIextra_undefined\fR the argument will be ignored (same as if \fIprocess_received_message/4\fR had been called)\&. See the documentation for the behaviour of the callback module, megaco_user, for more info\&.
.LP
Note that all processing is done in the context of the calling process\&. A transport module could call this function via one of the \fIspawn\fR functions (e\&.g\&. \fIspawn_opt\fR)\&. See also \fIreceive_message/4, 5\fR\&.
.LP
If the message cannot be decoded the following callback function will be invoked:
.RS 2
.TP 2
*
UserMod:handle_syntax_error/3
.RE
.LP
If the decoded message instead of transactions contains a message error, the following callback function will be invoked:
.RS 2
.TP 2
*
UserMod:handle_message_error/3
.RE
.LP
If the decoded message happens to be received before the connection is established, a new "virtual" connection is established\&. This is typically the case for the Media Gateway Controller (MGC) upon the first Service Change\&. When this occurs the following callback function will be invoked:
.RS 2
.TP 2
*
UserMod:handle_connect/2
.RE
.LP
For each transaction request in the decoded message the following callback function will be invoked:
.RS 2
.TP 2
*
UserMod:handle_trans_request/3
.RE
.LP
For each transaction reply in the decoded message the reply is returned to the user\&. Either the originating function megaco:call/3 will return\&. Or in case the originating function was megaco:case/3 the following callback function will be invoked:
.RS 2
.TP 2
*
UserMod:handle_trans_reply/4
.RE
.LP
When a transaction acknowledgement is received it is possible that user has decided not to bother about the acknowledgement\&. But in case the return value from UserMod:handle_trans_request/3 indicates that the acknowledgement is important the following callback function will be invoked:
.RS 2
.TP 2
*
UserMod:handle_trans_ack/4
.RE
.LP
See the megaco_user module for more info about the callback arguments\&.
.RE
.LP
.B
receive_message(ReceiveHandle, ControlPid, SendHandle, BinMsg) -> ok
.br
.B
receive_message(ReceiveHandle, ControlPid, SendHandle, BinMsg, Extra) -> ok
.br
.RS
.TP
Types
ReceiveHandle = #megaco_receive_handle{}
.br
ControlPid = pid()
.br
SendHandle = term()
.br
BinMsg = binary()
.br
Extra = term()
.br
.RE
.RS
.LP
Process a received message
.LP
This is a callback function intended to be invoked by some transport modules when get an incoming message\&. Which transport that actually is used is up to the user to choose\&.
.LP
In principle, this function calls the \fIprocess_received_message/4\fR function via a \fIspawn\fR to perform the actual processing\&.
.LP
For further information see the process_received_message/4 function\&.
.RE
.LP
.B
parse_digit_map(DigitMapBody) -> {ok, ParsedDigitMap} | {error, Reason}
.br
.RS
.TP
Types
DigitMapBody = string()
.br
ParsedDigitMap = parsed_digit_map()
.br
parsed_digit_map() = term()
.br
Reason = term()
.br
.RE
.RS
.LP
Parses a digit map body
.LP
Parses a digit map body, represented as a list of characters, into a list of state transitions suited to be evaluated by megaco:eval_digit_map/1,2\&.
.RE
.LP
.B
eval_digit_map(DigitMap) -> {ok, MatchResult} | {error, Reason}
.br
.B
eval_digit_map(DigitMap, Timers) -> {ok, MatchResult} | {error, Reason}
.br
.RS
.TP
Types
DigitMap = #\&'DigitMapValue\&'{} | parsed_digit_map()
.br
parsed_digit_map() = term()
.br
ParsedDigitMap = term()
.br
Timers = ignore() | reject()
.br
ignore() = ignore | {ignore, digit_map_value()}
.br
reject() = reject | {reject, digit_map_value()} | digit_map_value()
.br
MatchResult = {Kind, Letters} | {Kind, Letters, Extra}
.br
Kind = kind()
.br
kind() = full | unambiguous
.br
Letters = [letter()]
.br
letter() = $0\&.\&.$9 | $a \&.\&. $k
.br
Extra = letter()
.br
Reason = term()
.br
.RE
.RS
.LP
Collect digit map letters according to the digit map\&.
.LP
When evaluating a digit map, a state machine waits for timeouts and letters reported by megaco:report_digit_event/2\&. The length of the various timeouts are defined in the digit_map_value() record\&.
.LP
When a complete sequence of valid events has been received, the result is returned as a list of letters\&.
.LP
There are two options for handling syntax errors (that is when an unexpected event is received when the digit map evaluator is expecting some other event)\&. The unexpected events may either be ignored or rejected\&. The latter means that the evaluation is aborted and an error is returned\&.
.RE
.LP
.B
report_digit_event(DigitMapEvalPid, Events) -> ok | {error, Reason}
.br
.RS
.TP
Types
DigitMapEvalPid = pid()
.br
Events = Event | [Event]
.br
Event = letter() | pause() | cancel()
.br
letter() = $0\&.\&.$9 | $a \&.\&. $k | $A \&.\&. $K
.br
pause() = one_second() | ten_seconds()
.br
one_second() = $s | $S
.br
ten_seconds() = $l | $L
.br
cancel() = $z | $Z | cancel
.br
Reason = term()
.br
.RE
.RS
.LP
Send one or more events to the event collector process\&.
.LP
Send one or more events to a process that is evaluating a digit map, that is a process that is executing megaco:eval_digit_map/1,2\&.
.LP
Note that the events \fI$s | $S\fR, \fIl | $L\fR and \fI$z | $Z\fR has nothing to do with the timers using the same characters\&.
.RE
.LP
.B
test_digit_event(DigitMap, Events) -> {ok, Kind, Letters} | {error, Reason}
.br
.RS
.TP
Types
DigitMap = #\&'DigitMapValue\&'{} | parsed_digit_map()
.br
parsed_digit_map() = term()
.br
ParsedDigitMap = term()
.br
Timers = ignore() | reject()
.br
ignore() = ignore | {ignore, digit_map_value()}
.br
reject() = reject | {reject, digit_map_value()} | digit_map_value()
.br
DigitMapEvalPid = pid()
.br
Events = Event | [Event]
.br
Event = letter() | pause() | cancel()
.br
Kind = kind()
.br
kind() = full | unambiguous
.br
Letters = [letter()]
.br
letter() = $0\&.\&.$9 | $a \&.\&. $k | $A \&.\&. $K
.br
pause() = one_second() | ten_seconds()
.br
one_second() = $s | $S
.br
ten_seconds() = $l | $L
.br
cancel () = $z | $Z | cancel
.br
Reason = term()
.br
.RE
.RS
.LP
Feed digit map collector with events and return the result
.LP
This function starts the evaluation of a digit map with megaco:eval_digit_map/1 and sends a sequence of events to it megaco:report_digit_event/2 in order to simplify testing of digit maps\&.
.RE
.LP
.B
encode_sdp(SDP) -> {ok, PP} | {error, Reason}
.br
.RS
.TP
Types
SDP = sdp_property_parm() | sdp_property_group() | sdp_property_groups() | asn1_NOVALUE
.br
PP = property_parm() | property_group() | property_groups() | asn1_NOVALUE
.br
Reason = term()
.br
.RE
.RS
.LP
Encode (generate) an SDP construct\&.
.LP
If a \fIproperty_parm()\fR is found as part of the input (\fISDP\fR) then it is left unchanged\&.
.LP
This function performs the following transformation:
.RS 2
.TP 2
*
sdp() -> property_parm()
.TP 2
*
sdp_property_group() -> property_group()
.TP 2
*
sdp_property_groups() -> property_groups()
.RE
.RE
.LP
.B
decode_sdp(PP) -> {ok, SDP} | {error, Reason}
.br
.RS
.TP
Types
PP = property_parm() | property_group() | property_groups() | asn1_NOVALUE
.br
SDP = sdp() | decode_sdp_property_group() | decode_sdp_property_groups() | asn1_NOVALUE
.br
decode_sdp() = sdp() | {property_parm(), DecodeError}
.br
decode_sdp_property_group() = [decode_sdp()]
.br
decode_sdp_property_groups() = [decode_sdp_property_group()]
.br
DecodeError = term()
.br
Reason = term()
.br
.RE
.RS
.LP
Decode (parse) a property parameter construct\&.
.LP
When decoding \fIproperty_group()\fR or \fIproperty_groups()\fR, those property parameter constructs that cannot be decoded (either because of decode error or because they are unknown), will be returned as a two-tuple\&. The first element of which will be the (undecoded) property parameter and the other the actual reason\&. This means that the caller of this function has to expect not only sdp-records, but also this two-tuple construct\&.
.LP
This function performs the following transformation:
.RS 2
.TP 2
*
property_parm() -> sdp()
.TP 2
*
property_group() -> sdp_property_group()
.TP 2
*
property_groups() -> sdp_property_groups()
.RE
.RE
.LP
.B
get_sdp_record_from_PropertGroup(Type, PG) -> [sdp()]
.br
.RS
.TP
Types
Type = v | c | m | o | a | b | t | r | z | k | s | i | u | e | p
.br
PG = sdp_property_group()
.br
Reason = term()
.br
.RE
.RS
.LP
Retreive all the sdp records of type \fIType\fR from the property group \fIPG\fR\&.
.RE
.LP
.B
versions1() -> {ok, VersionInfo} | {error, Reason}
.br
.B
versions2() -> {ok, Info} | {error, Reason}
.br
.RS
.TP
Types
VersionInfo = [version_info()]
.br
version_info() = term()
.br
Reason = term()
.br
.RE
.RS
.LP
Utility functions used to retreive some system and application info\&.
.LP
The difference between the two functions is in how they get the modules to check\&. \fIversions1\fR uses the app-file and \fIversions2\fR uses the function \fIapplication:get_key\fR\&.
.RE
.LP
.B
print_version_info() -> void()
.br
.B
print_version_info(VersionInfo) -> void()
.br
.RS
.TP
Types
VersionInfo = [version_info()]
.br
version_info() = term()
.br
.RE
.RS
.LP
Utility function to produce a formated printout of the versions info generated by the \fIversions1\fR and \fIversions2\fR functions\&.
.LP
The function print_version_info/0 uses the result of function version1/0 as \fIVersionInfo\fR\&.
.LP
Example:
.nf
{ok, V} = megaco:versions1(), megaco:format_versions(V)\&.
.fi
.RE
.LP
.B
enable_trace(Level, Destination) -> void()
.br
.RS
.TP
Types
Level = max | min | 0 <= integer() <= 100
.br
Destination = File | Port | HandlerSpec | io
.br
File = string()
.br
Port = integer()
.br
HandleSpec = {HandlerFun, Data}
.br
HandleFun = fun() (two arguments)
.br
Data = term()
.br
.RE
.RS
.LP
This function is used to start megaco tracing at a given \fILevel\fR and direct result to the given \fIDestination\fR\&.
.LP
It starts a tracer server and then sets the proper match spec (according to \fILevel\fR)\&.
.LP
In the case when \fIDestination\fR is \fIFile\fR, the printable megaco trace events will be printed to the file \fIFile\fR using plain \fIio:format/2\fR\&.
.LP
In the case when \fIDestination\fR is \fIio\fR, the printable megaco trace events will be printed on stdout using plain \fIio:format/2\fR\&.
.LP
See \fIdbg\fR for further information\&.
.RE
.LP
.B
disable_trace() -> void()
.br
.RS
.LP
This function is used to stop megaco tracing\&.
.RE
.LP
.B
set_trace(Level) -> void()
.br
.RS
.TP
Types
Level = max | min | 0 <= integer() <= 100
.br
.RE
.RS
.LP
This function is used to change the megaco trace level\&.
.LP
It is assumed that tracing has already been enabled (see \fIenable_trace\fR above)\&.
.RE
.LP
.B
get_stats() -> {ok, TotalStats} | {error, Reason}
.br
.B
get_stats(GlobalCounter) -> {ok, CounterStats} | {error, Reason}
.br
.B
get_stats(ConnHandle) -> {ok, ConnHandleStats} | {error, Reason}
.br
.B
get_stats(ConnHandle, Counter) -> {ok, integer()} | {error, Reason}
.br
.RS
.TP
Types
TotalStats = [total_stats()]
.br
total_stats() = {conn_handle(), [stats()]} | {global_counter(), integer()}
.br
GlobalCounter = global_counter()
.br
GlobalCounterStats = integer()
.br
ConnHandle = conn_handle()
.br
ConnHandleStats = [stats()]
.br
stats() = {counter(), integer()}
.br
Counter = counter()
.br
counter() = medGwyGatewayNumTimerRecovery | medGwyGatewayNumErrors
.br
global_counter() = medGwyGatewayNumErrors
.br
Reason = term()
.br
.RE
.RS
.LP
Retreive the (SNMP) statistic counters maintained by the megaco application\&. The global counters handle events that cannot be attributed to a single connection (e\&.g\&. protocol errors that occur before the connection has been properly setup)\&.
.RE
.LP
.B
reset_stats() -> void()
.br
.B
reset_stats(ConnHandle) -> void()
.br
.RS
.TP
Types
ConnHandle = conn_handle()
.br
.RE
.RS
.LP
Reset all related (SNMP) statistics counters\&.
.RE
.LP
.B
test_request(ConnHandle, Version, EncodingMod, EncodingConfig, Actions) -> {MegaMsg, EncodeRes}
.br
.RS
.TP
Types
ConnHandle = conn_handle()
.br
Version = integer()
.br
EncodingMod = atom()
.br
EncodingConfig = Encoding configuration
.br
Actions = A list
.br
MegaMsg = #\&'MegacoMessage\&'{}
.br
EncodeRes = {ok, Bin} | {error, Reason}
.br
Bin = binary()
.br
Reason = term()
.br
.RE
.RS
.LP
Tests if the Actions argument is correctly composed\&.
.LP
This function is only intended for testing purposes\&. It\&'s supposed to have a same kind of interface as the call or cast functions (with the additions of the \fIEncodingMod\fR and \fIEncodingConfig\fR arguments)\&. It composes a complete megaco message end attempts to encode it\&. The return value, will be a tuple of the composed megaco message and the encode result\&.
.RE
.LP
.B
test_reply(ConnHandle, Version, EncodingMod, EncodingConfig, Reply) -> {MegaMsg, EncodeRes}
.br
.RS
.TP
Types
ConnHandle = conn_handle()
.br
Version = integer()
.br
EncodingMod = atom()
.br
EncodingConfig = A list
.br
Reply = actual_reply()
.br
MegaMsg = #\&'MegacoMessage\&'{}
.br
EncodeRes = {ok, Bin} | {error, Reason}
.br
Bin = binary()
.br
Reason = term()
.br
.RE
.RS
.LP
Tests if the Reply argument is correctly composed\&.
.LP
This function is only intended for testing purposes\&. It\&'s supposed to test the \fIactual_reply()\fR return value of the callback functions handle_trans_request and handle_trans_long_request functions (with the additions of the \fIEncodingMod\fR and \fIEncodingConfig\fR arguments)\&. It composes a complete megaco message end attempts to encode it\&. The return value, will be a tuple of the composed megaco message and the encode result\&.
.RE
|