mtc_call.h 51.8 KB
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
/************************************************************************

        Copyright (c) 2005-2011 by Juphoon System Software, Inc.
                       All rights reserved.

     This software is confidential and proprietary to Juphoon System,
     Inc. No part of this software may be reproduced, stored, transmitted,
     disclosed or used in any form or by any means other than as expressly
     provided by the written license agreement between Juphoon and its
     licensee.

     THIS SOFTWARE IS PROVIDED BY JUPHOON "AS IS" AND ANY EXPRESS OR 
     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     ARE DISCLAIMED. IN NO EVENT SHALL JUPHOON BE LIABLE FOR ANY DIRECT, 
     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 
     OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
     STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
     IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
     POSSIBILITY OF SUCH DAMAGE. 

                    Juphoon System Software, Inc.
                    Email: support@juphoon.com
                    Web: http://www.juphoon.com

************************************************************************/
/*************************************************
  File name     : mtc_call.h
  Module        : multimedia talk client
  Author        : leo.lv
  Created on    : 2011-01-03
  Description   :
      Data structure and function declare required by MTC call

  Modify History:
  1. Date:        Author:         Modification:
*************************************************/
#ifndef _MTC_CALL_H__
#define _MTC_CALL_H__

/**
 * @file mtc_call.h
 * @brief MTC Call Interface Functions
 *
 * This file includes call interface function. Those function is used to manage calls.
 */
#ifdef __cplusplus
extern "C" {
#endif

/** @brief MTC call dtmf type */
typedef enum EN_MTC_CALL_DTMF_TYPE
{
    EN_MTC_CALL_DTMF_0,              /**< @brief DTMF signal 0. */
    EN_MTC_CALL_DTMF_1,              /**< @brief DTMF signal 1. */
    EN_MTC_CALL_DTMF_2,              /**< @brief DTMF signal 2. */
    EN_MTC_CALL_DTMF_3,              /**< @brief DTMF signal 3. */
    EN_MTC_CALL_DTMF_4,              /**< @brief DTMF signal 4. */
    EN_MTC_CALL_DTMF_5,              /**< @brief DTMF signal 5. */
    EN_MTC_CALL_DTMF_6,              /**< @brief DTMF signal 6. */
    EN_MTC_CALL_DTMF_7,              /**< @brief DTMF signal 7. */
    EN_MTC_CALL_DTMF_8,              /**< @brief DTMF signal 8. */
    EN_MTC_CALL_DTMF_9,              /**< @brief DTMF signal 9. */
    EN_MTC_CALL_DTMF_STAR,           /**< @brief DTMF signal *. */
    EN_MTC_CALL_DTMF_POUND,          /**< @brief DTMF signal #. */
    EN_MTC_CALL_DTMF_A,              /**< @brief DTMF signal A. */
    EN_MTC_CALL_DTMF_B,              /**< @brief DTMF signal B. */
    EN_MTC_CALL_DTMF_C,              /**< @brief DTMF signal C. */
    EN_MTC_CALL_DTMF_D,              /**< @brief DTMF signal D. */
} EN_MTC_CALL_DTMF_TYPE;

/** @brief MTC call record mode type */
typedef enum EN_MTC_CALL_REC_MODE_TYPE
{
    EN_MTC_CALL_REC_MODE_ALL,        /**< @brief Record all data. */
    EN_MTC_CALL_REC_MODE_PLAY,       /**< @brief Record palying data. */
    EN_MTC_CALL_REC_MODE_MIC         /**< @brief Record microphone data. */
} EN_MTC_CALL_REC_MODE_TYPE;

/** @brief MTC call terminate reason type */
typedef enum EN_MTC_CALL_TERM_STATUS_CODE
{
    EN_MTC_CALL_TERM_STATUS_NORMAL = 1000,  /**< @brief Normal session term, bye or cancel. */
    EN_MTC_CALL_TERM_STATUS_BUSY,    /**< @brief The session is rejected. */
    EN_MTC_CALL_TERM_STATUS_DECLINE, /**< @brief Decline the session. */

    EN_MTC_CALL_TERM_STATUS_TIMEOUT = 1100, /**< @brief Terminated by timeout. */
    EN_MTC_CALL_TERM_STATUS_USER_OFFLINE, /**< @brief Call participant is offline. */
    EN_MTC_CALL_TERM_STATUS_NOT_FOUND, /**< @brief Call participant not found. */
    EN_MTC_CALL_TERM_STATUS_NOT_FRIEND, /**< @brief Call participant is not friend. */
    EN_MTC_CALL_TERM_STATUS_IN_BLACK_LST, /**< @brief Call participant is in black list. */
    EN_MTC_CALL_TERM_STATUS_TRANSFERED,  /**< @brief Terminated by transfered. */
    EN_MTC_CALL_TERM_STATUS_REDIRECTED,/**< @brief Terminated by redirect. */
    EN_MTC_CALL_TERM_STATUS_REPLACED, /**< @brief Terminated by replace. */
    EN_MTC_CALL_TERM_STATUS_JOIN_CONF, /**< @brief Terminated by invite to meeting replaced. */
    EN_MTC_CALL_TERM_STATUS_CALL_EACH, /**< @brief Terminated by call each other. */
    EN_MTC_CALL_TERM_STATUS_SERVER_RELEASE, /**< @brief Server released. */

    EN_MTC_CALL_TERM_STATUS_ERROR_OTHER = 1200, /**< @brief Other error. */
    EN_MTC_CALL_TERM_STATUS_ERROR_AUTH_FAILED, /**< @brief Authentication failed, invalid user or password. */
    EN_MTC_CALL_TERM_STATUS_ERROR_SESSION_TIMER, /**< @brief Call refresh error. */
    EN_MTC_CALL_TERM_STATUS_ERROR_FORBIDDEN, /**< @brief Call forbidden. */
    EN_MTC_CALL_TERM_STATUS_ERROR_NOT_ACCEPTED, /**< @brief Call not accepted. */
    EN_MTC_CALL_TERM_STATUS_ERROR_TEMP_UNAVAIL, /**< @brief Call participant temp unavailable. */
    EN_MTC_CALL_TERM_STATUS_ERROR_REQUEST_TERMED, /**< @brief Call request terminated. */
    EN_MTC_CALL_TERM_STATUS_ERROR_INTERNAL, /**< @brief Server internal error. */
    EN_MTC_CALL_TERM_STATUS_ERROR_SERVICE_UNAVAIL, /**< @brief Service unavailable. */
    EN_MTC_CALL_TERM_STATUS_ERROR_NOT_EXIST, /**< @brief Not exist. */
    EN_MTC_CALL_TERM_STATUS_ERROR_TRANSACTION_FAIL, /**< @brief Call transaction error. */
    EN_MTC_CALL_TERM_STATUS_ERROR_SERVER,    /**< @brief Server error. */
    EN_MTC_CALL_TERM_STATUS_ERROR_PEER_FAILED, /**< @brief Peer failed. */
    EN_MTC_CALL_TERM_STATUS_ERROR_NO_EPCP_PARM, /**< @brief No EP or CP parameter. */
    EN_MTC_CALL_TERM_STATUS_ERROR_GONE, /**< @brief Call has gone. */
    EN_MTC_CALL_TERM_STATUS_ERROR_SESSION_TOO_LONG, /**< @brief Session last too long. */

    EN_MTC_CALL_TERM_STATUS_ERROR_ACCOUNT_SERVER = 1300, /**< @brief Account server error. */
    
    EN_MTC_CALL_TERM_STATUS_ERROR_CALL_SERVER = 1400, /**< @brief Call server error. */
    EN_MTC_CALL_TERM_STATUS_ERROR_CALL_SERVER_NO_RESOURCE, /**< @brief Call server resource runs out. */
    EN_MTC_CALL_TERM_STATUS_ERROR_CALL_SERVER_INTERNAL, /**< @brief Call server internal error. */
    
    EN_MTC_CALL_TERM_STATUS_ERROR_EP_SERVER = 1500, /**< @brief Endpoint server error. */
} EN_MTC_CALL_TERM_STATUS_CODE;

/** @brief MTC call alert type */
typedef enum EN_MTC_CALL_ALERT_TYPE
{
    EN_MTC_CALL_ALERT_UNDEFINED = 2000, /**< @brief Alerted by other type. */
    EN_MTC_CALL_ALERT_RING,          /**< @brief Alerted by 180. */
    EN_MTC_CALL_ALERT_QUEUED,        /**< @brief Alerted by 182. */
    EN_MTC_CALL_ALERT_IN_PROGRESS,   /**< @brief Alerted by 183. */
} EN_MTC_CALL_ALERT_TYPE;

/** @brief Type of MTC network status. */
typedef enum EN_MTC_NET_STATUS_TYPE
{
    EN_MTC_NET_STATUS_DISCONNECTED = -3, /**< @brief Disconnected from network. */
    EN_MTC_NET_STATUS_VERY_BAD  = -2, /**< @brief Network status is very bad. */
    EN_MTC_NET_STATUS_BAD       = -1, /**< @brief Network status is bad. */
    EN_MTC_NET_STATUS_NORMAL    = 0,  /**< @brief Network status is normal. */
    EN_MTC_NET_STATUS_GOOD      = 1,  /**< @brief Network status is good. */
    EN_MTC_NET_STATUS_VERY_GOOD = 2,  /**< @brief Network status is very good. */
} EN_MTC_NET_STATUS_TYPE;

/** @brief Type of MTC session state */
typedef enum EN_MTC_CALL_STATE_TYPE
{
    EN_MTC_CALL_STATE_IDLE,      /**<@brief Session state is idle. */
    EN_MTC_CALL_STATE_OUTGOING,  /**<@brief Session state is outgoing. */
    EN_MTC_CALL_STATE_INCOMING,  /**<@brief Session state is incoming. */
    EN_MTC_CALL_STATE_ALERTED,   /**<@brief Session state is alerted. */
    EN_MTC_CALL_STATE_CONNECTING,/**<@brief Session state is connecting. */ 
    EN_MTC_CALL_STATE_TALKING,   /**<@brief Session state is talking. */
    EN_MTC_CALL_STATE_TERMED,    /**<@brief Session state is terminated. */
    EN_MTC_CALL_STATE_DIDTERM,   /**<@brief Session state is did terminate. */
} EN_MTC_CALL_STATE_TYPE;

/** @brief MTC call transmission state type */
typedef enum EN_MTC_CALL_TRANSMISSION_STATE
{
    /** @brief Transmission is normal, 'nrml'. */ 
    EN_MTC_CALL_TRANSMISSION_NORMAL = 0x6E726D6C,
    /** @brief Transmission is paused for camera is off, 'coff'. */
    EN_MTC_CALL_TRANSMISSION_CAMOFF = 0x636F6666,
    /** @brief Transmission is paused, 'pasd'. */
    EN_MTC_CALL_TRANSMISSION_PAUSE  = 0x70617364,
    /** @brief Transmission is pause for QoS reason, 'pqos'. */
    EN_MTC_CALL_TRANSMISSION_PAUSE4QOS = 0x70716F73,
} EN_MTC_CALL_TRANSMISSION_STATE;

/**
 * @defgroup MtcCallStatus MTC call status option.
 * @{
 */
/** @brief Real time send bit rate for audio and video. */
#define MTC_CALL_STATUS_SEND_BITRATE         0x01
/** @brief Real time receive bit rate for audio and video. */  
#define MTC_CALL_STATUS_RECV_BITRATE         0x02
/** @brief Real time send frame rate for video. */
#define MTC_CALL_STATUS_SEND_FRAMERATE       0x04
/** @brief Real time receive frame rate for video. */
#define MTC_CALL_STATUS_RECV_FRAMERATE       0x08
/** @brief Real time send resulotion video. */
#define MTC_CALL_STATUS_SEND_RESOLUTION      0x10
/** @brief Real time receive resulotion video. */
#define MTC_CALL_STATUS_RECV_RESOLUTION      0x20
/** @} */

/**
 * @defgroup MtcCallStatusKey Key of call status option.
 * @{
 */

/**
 * @brief A key whose value is a number object reflecting the send bit rate.
 */
#define MtcSendBitRateKey           "MtcSendBitRateKey"

/**
 * @brief A key whose value is a number object reflecting the receive bit rate.
 */
#define MtcRecvBitRateKey           "MtcRecvBitRateKey"

/**
 * @brief A key whose value is a number object reflecting the send frame rate.
 */
#define MtcSendFrameRateKey         "MtcSendFrameRateKey"

/**
 * @brief A key whose value is a number object reflecting the receive frame rate.
 */
#define MtcRecvFrameRateKey         "MtcRecvFrameRateKey"

/**
 * @brief A key whose value is a string object reflecting the send resulotion.
 */
#define MtcSendResolutionKey        "MtcSendResolutionKey"

/**
 * @brief A key whose value is a string object reflecting the receive resulotion.
 */
#define MtcRecvResolutionKey        "MtcRecvResolutionKey"
/** @} */

/**
 * @defgroup MtcCallKey MTC notification key of session event.
 * @{
 */

/**
 * @brief A key whose value is a number object reflecting the ID of voice/audio
 * call.
 */
#define MtcCallIdKey                "MtcCallIdKey"

/**
 * @brief A key whose value is a string object reflecting the SIP content.
 */
#define MtcCallBodyKey              "MtcCallBodyKey"

/**
 * @brief A key whose value is a number object reflecting the video image width
 * in pixels.
 */
#define MtcCallWidthKey             "MtcCallWidthKey"

/**
 * @brief A key whose value is a number object reflecting the video image 
 * height in pixels.
 */
#define MtcCallHeightKey            "MtcCallHeightKey"

/**
 * @brief A key whose value is a number object reflecting the video orientation.
 */
#define MtcCallOrentationKey        "MtcCallOrentationKey"

/**
 * @brief A key whose value is a number object reflecting the video frame rate
 * in fps.
 */
#define MtcCallFrameRateKey         "MtcCallFrameRateKey"

/**
 * @brief A key whose value is a number object reflecting the video bitrate in
 * bps.
 */
#define MtcCallBitRateKey           "MtcCallBitRateKey"

/**
 * @brief A key whose value is a number object reflecting the video bitrate 
 * of forward error correction.
 */
#define MtcCallBitRateFecKey        "MtcCallBitRateFecKey"

/**
 * @brief A key whose value is a number object reflecting the video bit rate 
 * of negative acknowledgement.
 */
#define MtcCallBitRateNackKey       "MtcCallBitRateNackKey"

/**
 * @brief A key whose value is a boolean object reflecting if the call is a video
 * call.
 */
#define MtcCallIsVideoKey           "MtcCallIsVideoKey"

/**
 * @brief A key whose value is a boolean object reflecting if the media data is 
 * being sent.
 */
#define MtcCallIsSendKey            "MtcCallIsSendKey"

/**
 * @brief A key whose value is a number object reflecting the network status
 * @ref EN_MTC_NET_STATUS_TYPE.
 */
#define MtcCallNetworkStatusKey     "MtcCallNetworkStatusKey"

/**
 * @brief A key whose value is a number object reflecting the status code
 * @ref EN_MTC_CALL_TERM_STATUS_CODE.
 */
#define MtcCallStatusCodeKey        "MtcCallStatusCodeKey"

/**
 * @brief A key whose value is a string object reflecting the description.
 */
#define MtcCallDescriptionKey       "MtcCallDescriptionKey"

/**
 * @brief A key whose value is a bool object reflecting if the network state is 
 * good enough to send data.
 */
#define MtcCallSendAdviceKey        "MtcCallSendAdviceKey"

/**
 * @brief A key whose value is a number object reflecting video status.
 */
#define MtcCallVideoStatusKey       "MtcCallVideoStatusKey"

/**
 * @brief A key whose value is a number object reflecting the alert type
 * @ref EN_MTC_CALL_ALERT_TYPE.
 */
#define MtcCallAlertTypeKey         "MtcCallAlertTypeKey"

/**
 * @brief A key whose value is a number object relfecting the image timestamp.
 */
#define MtcCallImageTimeStampKey    "MtcCallImageTimeStampKey"

/**
 * @brief A key whose value is a boolean object relfecting the if record log.
 */
#define MtcCallNoLogKey             "MtcCallNoLogKey"

/**
 * @brief A key whose value is a string object in json format reflecting 
 * the data received from server.
 */
#define MtcCallUserDataParmKey      "MtcCallUserDataParmKey"

/**
 * @brief A key whose value is a string object in json format reflecting 
 * the data received from server.
 */
#define MtcCallUserDataKey          "MtcUserDataKey"

/**
 * @brief A key whose value is a string object in json format reflecting 
 * the data received from server.
 */
#define MtcCallServerUserDataKey    "MtcCallServerUserDataKey"

/**
 * @brief A key whose value is a string object in json format reflecting 
 * the name of stream data received.
 */
#define MtcCallDataNameKey          "MtcCallDataNameKey"

/**
 * @brief A key whose value is a string object in json format reflecting 
 * the value of stream data received.
 */
#define MtcCallDataValueKey         "MtcCallDataValueKey"

/**
 * @brief A key whose value is a string object in json format reflecting 
 * the file's name.
 */
#define MtcCallFileNameKey          "MtcCallFileNameKey"

/**
 * @brief A key whose value is a string object in json format reflecting 
 * the file's path.
 */
#define MtcCallFilePathKey          "MtcCallFilePathKey"
/** @} */

/**
 * @defgroup MtcCallNotification MTC notification of session event.
 * @{
 */

/**
 * @brief Posted when the call goes out.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallOutgoingNotification           "MtcCallOutgoingNotification"

/**
 * @brief Posted when the call comes in.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallIncomingNotification           "MtcCallIncomingNotification"

/**
 * @brief Posted when the call is evoked by a refer.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey,
 * @ref MtcCallIsVideoKey, @ref MtcCallUserDataParmKey.
 */
#define MtcCallReferInNotification            "MtcCallReferInNotification"

/**
 * @brief Posted when the call is evoked by a refer.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallReferOutNotification           "MtcCallReferOutNotification"

/**
 * @brief Posted when receive the response for call out.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallTryingNotification             "MtcCallTryingNotification"

/**
 * @brief Posted when the call rings.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey and
 * @ref MtcCallAlertTypeKey.
 */
#define MtcCallAlertedNotification            "MtcCallAlertedNotification"

/**
 * @brief Posted when the call is forwarded.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallForwardedNotification          "MtcCallForwardedNotification"

/**
 * @brief Posted when the call is pre-acknowledged.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallPrackNotification              "MtcCallPrackNotification"

/**
 * @brief Posted when answering the call.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallAnsweringNotification         "MtcCallAnsweringNotification"

/**
 * @brief Posted when the connection is being established.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallConnectingNotification         "MtcCallConnectingNotification"

/**
 * @brief Posted when the connection is established and the voice can be heard.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallTalkingNotification            "MtcCallTalkingNotification"

/**
 * @brief Posted when the call session is terminated by a user.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey and
 * @ref MtcCallStatusCodeKey.
 */
#define MtcCallDidTermNotification            "MtcCallDidTermNotification"

/**
 * @brief Posted when the call session is terminated but not by a user.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey, 
 * @ref MtcCallDescriptionKey and @ref MtcCallStatusCodeKey.
 */
#define MtcCallTermedNotification             "MtcCallTermedNotification"

/**
 * @brief Posted when you hold the call successfully.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallHoldOkNotification             "MtcCallHoldOkNotification"

/**
 * @brief Posted when you fail to hold the call.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallHoldFailedNotification         "MtcCallHoldFailedNotification"

/**
 * @brief Posted when you unhold the call successfully.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallUnholdOkNotification           "MtcCallUnholdOkNotification"

/**
 * @brief Posted when you fail to unhold the call.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallUnholdFailedNotification       "MtcCallUnholdFailedNotification"

/**
 * @brief Posted when you are held by the other peer.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallHeldNotification               "MtcCallHeldNotification"

/**
 * @brief Posted when you are unheld by the other peer.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallUnheldNotification             "MtcCallUnheldNotification"

/**
 * @brief Posted when the audio is added successfully.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallAddAudioOkNotification         "MtcCallAddAudioOkNotification"

/**
 * @brief Posted when the audo failed to be added.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallAddAudioFailedNotification     "MtcCallAddAudioFailedNotification"

/**
 * @brief Posted when the audio is removed successfully.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallRmvAudioOkNotification         "MtcCallRmvAudioOkNotification"

/**
 * @brief Posted when the audio failed to be removed.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallRmvAudioFailedNotification     "MtcCallRmvAudioFailedNotification"

/**
 * @brief Posted when receiving the request of adding audio to the call.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallAddAudioRequestNotification    "MtcCallAddAudioRequestNotification"

/**
 * @brief Posted when the video is added successfully.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallAddVideoOkNotification         "MtcCallAddVideoOkNotification"

/**
 * @brief Posted when the video failed to be added.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallAddVideoFaieldNotification     "MtcCallAddVideoFaieldNotification"

/**
 * @brief Posted when the video is added successfully.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallRmvVideoOkNotification         "MtcCallRmvVideoOkNotification"

/**
 * @brief Posted when the video faild to be added.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallRmvVideoFailedNotification     "MtcCallRmvVideoFailedNotification"

/**
 * @brief Posted when receiving the request of adding video to the call.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallAddVideoRequestNotification    "MtcCallAddVideoRequestNotification"

/**
 * @brief Posted when a request is received to refer the call.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallReferedNotification            "MtcCallReferedNotification"

/**
 * @brief Posted when the transfer is accepted.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallTransferAcceptedNotification   "MtcCallTransferAcceptedNotification"

/**
 * @brief Posted when the transfer process is finished.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallTransferEndedNotification      "MtcCallTransferEndedNotification"

/**
 * @brief Posted when the transfer is failed.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallTransferFailedNotification     "MtcCallTransferFailedNotification"

/**
 * @brief Posted when the call is redirected.
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallRedirectedNotification         "MtcCallRedirectedNotification"

/**
 * @brief Posted when your call is replaced.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallReplacedNotification           "MtcCallReplacedNotification"

/**
 * @brief Posted when you replace the call successfully.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallReplaceOkNotification          "MtcCallReplaceOkNotification"

/**
 * @brief Posted when you fail to replace the call.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallReplaceFailedNotification      "MtcCallReplaceFailedNotification"

/**
 * @brief Posted when an info message is received.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey and 
 * @ref MtcCallBodyKey.
 */
#define MtcCallInfoReceivedNotification       "MtcCallInfoReceivedNotification"

/**
 * @brief Posted when the camera is disconnected.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallCamDisconnedNotification       "MtcCallCamDisconnedNotification"

/**
 * @brief Posted when the video image size is changed.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey, 
 * @ref MtcCallWidthKey, @ref MtcCallHeightKey and @ref MtcCallOrentationKey.
 */
#define MtcCallVideoSizeChangedNotification   "MtcCallVideoSizeChangedNotification"

/**
 * @brief Posted when collecting the network statistics of the received video
 * stream including framerate and bitrate.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey, 
 * @ref MtcCallFrameRateKey and @ref MtcCallBitRateKey.
 */
#define MtcCallVideoIncomingStaNotification   "MtcCallVideoIncomingStaNotification"

/**
 * @brief Posted when collecting the network statistics of the sending video
 * stream including framerate and bitrate.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey, 
 * @ref MtcCallFrameRateKey and @ref MtcCallBitRateKey.
 */
#define MtcCallVideoOutgoingStaNotification   "MtcCallVideoOutgoingStaNotification"

/**
 * @brief Posted when collecting the status of FEC and NACK.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey, 
 * @ref MtcCallBitRateFecKey and @ref MtcCallBitRateNackKey.
 */
#define MtcCallVideoProtectStatusNotification "MtcCallVideoProtectStatusNotification"

/**
 * @brief Posted when capturing the video framerate.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey and
 * @ref MtcCallFrameRateKey.
 */
#define MtcCallCaptureFramerateNotification   "MtcCallCaptureFramerateNotification"

/**
 * @brief Posted when capturing the video size.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey,
 * @ref MtcCallWidthKey, and @ref MtcCallHeightKey.
 */
#define MtcCallCaptureSizeNotification        "MtcCallCaptureSizeNotification"

/**
 * @brief Posted when network status changes.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey,
 * @ref MtcCallIsVideoKey, @ref MtcCallIsSendKey and @ref MtcCallNetworkStatusKey.
 */
#define MtcCallNetworkStatusChangedNotification "MtcCallNetworkStatusChangedNotification"

/**
 * @brief Posted when render starts.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey.
 */
#define MtcCallRenderDidStartNotification     "MtcCallRenderDidStartNotification"

/**
 * @brief Posted when the send advice changes. The send advice decides whether 
 * or not to send the data depending on the network status.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey and
 * @ref MtcCallSendAdviceKey.
 */
#define MtcCallVideoSendAdviceChangedNotification    "MtcCallVideoSendAdviceChangedNotification"

/**
 * @brief Posted when the user stops receiving data or starts receiving data.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey and
 * @ref MtcCallVideoStatusKey.
 */
#define MtcCallVideoReceiveStatusChangedNotification "MtcCallVideoReceiveStatusChangedNotification"

/**
 * @brief Posted when received the mangified image.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey and
 * @ref MtcCallImageTimeStampKey.
 */
#define MtcCallReceivedMangifiedImageNotification "MtcCallReceivedMangifiedImageNotification"

/**
 * @brief Posted when you received data from peer.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey @ref MtcCallDataNameKey
 * @ref MtcCallDataValueKey.
 */
#define MtcCallStreamDataReceivedNotification "MtcCallStreamDataReceivedNotification"

/**
 * @brief Posted when send file OK.
 *
 * The pcInfo of this notification contains 
 * @ref MtcCallIdKey @ref MtcCallFileNameKey
 */
#define MtcCallStreamFileSendOkNotification "MtcCallStreamFileSendOkNotification"

/**
 * @brief Posted when failed to send file.
 *
 * The pcInfo of this notification contains 
 * @ref MtcCallIdKey @ref MtcCallFileNameKey
 */
#define MtcCallStreamFileSendDidFailNotification "MtcCallStreamFileSendDidFailNotification"

/**
 * @brief Posted when you received data from peer.
 *
 * The pcInfo of this notification contains 
 * @ref MtcCallIdKey @ref MtcCallFileNameKey @ref MtcCallFilePathKey
 * @ref MtcCallUserDataKey
 */
#define MtcCallStreamFileReceivedNotification "MtcCallStreamFileReceivedNotification"

/**
 * @brief Posted when error occurs.
 *
 * The pcInfo of this notification contains @ref MtcCallIdKey and
 * @ref MtcCallStatusCodeKey.
 */
#define MtcCallErrorNotification              "MtcCallErrorNotification"
/** @} */

/** 
 * @brief MTC Call, establishing session call with video or audio.
 *
 * If send a new call and the callee answered, GUI will be notified by
 * MtcCallAlertedNotification, MtcCallTalkingNotification
 *
 * If send a new call and the callee redirected, GUI will be notified by
 * MtcCallOutgoingNotification, MtcCallAlertedNotification, MtcCallTalkingNotification
 *
 * If send a new call and the callee do not answered(timeout, busy now, etc.), GUI will be 
 * notified by MtcCallAlertedNotification, MtcCallDidTermNotification
 *
 * While receiving call invitation, GUI will be notified by
 * MtcCallIncomingNotification.
 *
 * While receiving call invitation and session is exist, GUI will be notified by
 * MtcCallReplacedNotification.
 *
 * @param [in] pcUri The destination URI to which you want to make a session call.
 * @param [in] zCookie Used to correspond session with UI resource. The cookie
 *                      value could be get by @ref Mtc_CallGetCookie or reset by
 *                      @ref Mtc_CallSetCookie at any time of session's life.
 * @param [in] bAudio Indicate whether this call has a voice stream.
 * @param [in] bVideo Indicate whether this call has a video stream.
 *
 * @return The id of this new created session on succeed, otherwise return ZMAXUINT.
 *
 * @see @ref Mtc_CallAnswer, @ref Mtc_CallGetCookie, @ref Mtc_CallSetCookie
 */
MTCFUNC ZUINT Mtc_Call(ZCONST ZCHAR *pcUri, ZCOOKIE zCookie, ZBOOL bAudio,
                ZBOOL bVideo);

/**
 * @defgroup MtcCallKey MTC notification key of session event.
 * @{
 */

/**
 * @brief A key whose value is a boolean object reflecting if the call is a video call.
 * the value must be true or false.
 */
#define MtcCallInfoHasVideoKey "MtcCallInfoHasVideoKey"

/**
 * @brief A key whose value is a string object reflecting the nick name.
 */
#define MtcCallInfoDisplayNameKey "MtcCallInfoDisplayNameKey"

/**
 * @brief A key whose value is a string object reflecting the prefered uri.
 */
#define MtcCallInfoPreferedUriKey "MtcCallInfoPreferedUriKey"

/**
 * @brief A key whose value is a string object reflecting the peer name.
 */
#define MtcCallInfoPeerDisplayNameKey "MtcCallInfoPeerDisplayNameKey"

/**
 * @brief A key whose value is a string object reflecting the user data.
 */
#define MtcCallInfoUserDataKey "MtcCallInfoUserDataKey"

/**
 * @brief A key whose value is a string object reflecting the user data
 * deliveried to server.
 */
#define MtcCallInfoServerUserDataKey "MtcCallInfoServerUserDataKey"
/** @} */

/** 
 * @brief MTC Call, establishing session call with video or audio.
 *
 * If send a new call and the callee answered, GUI will be notified by
 * MtcCallAlertedNotification, MtcCallTalkingNotification
 *
 * If send a new call and the callee redirected, GUI will be notified by
 * MtcCallOutgoingNotification, MtcCallAlertedNotification, MtcCallTalkingNotification
 *
 * If send a new call and the callee do not answered(timeout, busy now, etc.), GUI will be 
 * notified by MtcCallAlertedNotification, MtcCallDidTermNotification
 *
 * While receiving call invitation, GUI will be notified by
 * MtcCallIncomingNotification.
 *
 * While receiving call invitation and session is exist, GUI will be notified by
 * MtcCallReplacedNotification.
 *
 * @param [in] pcUri The destination URI to which you want to make a session call.
 * @param [in] zCookie Used to correspond session with UI resource. The cookie
 *                      value could be get by @ref Mtc_CallGetCookie or reset by
 *                      @ref Mtc_CallSetCookie at any time of session's life.
 * @param [in] pcInfo Information of call in JSON format.
 *
 * @return The id of this new created session on succeed, otherwise return ZMAXUINT.
 *
 * @see @ref Mtc_CallAnswer, @ref Mtc_CallGetCookie, @ref Mtc_CallSetCookie
 */
MTCFUNC ZUINT Mtc_CallJ(ZCONST ZCHAR *pcUri, ZCOOKIE zCookie,
                ZCONST ZCHAR *pcInfo);

/**
 * @brief MTC Call, establishing session call after MtcCAllReferOutNotification.
 * 
 * @param  iCallId The id of session to perform call.
 * @param [in] zCookie Used to correspond session with UI resource. The cookie
 *                      value could be get by Mtc_CallGetCookie or reset by
 *                      Mtc_CallSetCookie at any time of session's life.
 *
 * @retval ZOK on succeed.
 * @retval ZFAILED on failure.
 */
MTCFUNC ZINT Mtc_CallOut(ZUINT iCallId, ZCOOKIE zCookie);

/** 
 * @brief MTC session alert an incoming session.
 *
 * @param [in] iCallId The id of incoming session which you want answer.
 * @param [in] zCookie Used to correspond session with UI resource. The cookie
 *                      value could be get by Mtc_CallGetCookie or reset by
 *                      Mtc_CallSetCookie at any time of session's life.
 * @param [in] iType Alert type, @ref EN_MTC_CALL_ALERT_RING,
                      @ref EN_MTC_CALL_ALERT_QUEUED 
                      or @ref EN_MTC_CALL_ALERT_IN_PROGRESS.
 * @param [in] bReliable If ZTRUE, message will be sending as reliable
 *                      provisional response.
 *
 * @retval ZOK on succeed.
 * @retval ZFAILED on failure.
 *
 * @see Mtc_Call, Mtc_CallGetCookie, Mtc_CallSetCookie
 */
MTCFUNC ZINT Mtc_CallAlert(ZUINT iCallId, ZCOOKIE zCookie, ZUINT iType,
                ZBOOL bReliable);

/** 
 * @brief MTC session answer an incoming session call which is notified by
 *        callback function which MtcCallIncomingNotification.
 *
 * @param [in] iCallId The id of incoming session which you want to answer.
 * @param [in] zCookie Used to correspond session with UI resource. The cookie
 *                      value could be get by @ref Mtc_CallGetCookie or reset by
 *                      @ref Mtc_CallSetCookie at any time of session's life.
 * @param [in] bAudio Indicate whether this call has a voice stream.
 * @param [in] bVideo Indicate whether this call has a video stream.
 *
 * @retval ZOK on succeed.
 * @retval ZFAILED on failure.
 *
 * @see @ref Mtc_Call, MtcCallIncomingNotification, @ref Mtc_CallGetCookie, @ref Mtc_CallSetCookie
 */
MTCFUNC ZINT Mtc_CallAnswer(ZUINT iCallId, ZCOOKIE zCookie, ZBOOL bAudio,
                ZBOOL bVideo);

/** 
 * @brief MTC session terminate.
 *
 * @param [in] iCallId The ID of session which you want to terminate.
 * @param [in] iReason Indicate the terminate reason. Only
 *                      @ref EN_MTC_CALL_TERM_STATUS_NORMAL,
 *                      @ref EN_MTC_CALL_TERM_STATUS_BUSY,
 *                      @ref EN_MTC_CALL_TERM_STATUS_DECLINE can be used.
 * @param [in] pcDesc Detail description string.
 *
 * @retval ZOK on succeed.
 * @retval ZFAILED on failure.
 *
 * Actually Mtc_CallTerm does not free all resource allocated for this
 * session. It only starts a terminating procedure. All resource will be
 * freed automatically when the procedure ends.
 *
 * @see @ref Mtc_Call, @ref Mtc_CallAnswer...
 */
MTCFUNC ZINT Mtc_CallTerm(ZUINT iCallId, ZUINT iReason, ZCONST ZCHAR *pcDesc);

/** 
 * @brief MTC session send DTMF info.
 *
 * @param [in] iCallId The ID of session which you want to send DTMF info.
 * @param [in] iDtmfType DTMF type which will be sent, see @ref EN_MTC_CALL_DTMF_TYPE.
 *
 * @retval ZOK on succeed.
 * @retval ZFAILED on failure.
 */
MTCFUNC ZINT Mtc_CallDtmf(ZUINT iCallId, ZUINT iDtmfType);

/** 
 * @brief MTC session send INFO with text.
 *
 * @param [in] iCallId The ID of session which you want to send INFO.
 * @param [in] pcInfo Text string carried by INFO.
 *
 * @retval ZOK on succeed.
 * @retval ZFAILED on failure.
 */
MTCFUNC ZINT Mtc_CallInfo(ZUINT iCallId, ZCONST ZCHAR *pcInfo);

/** 
 * @brief MTC session attach camera.
 *
 * @param [in] iCallId The ID of session.
 * @param [in] pcName The name string of camera.
 *
 * @retval ZOK on succeed.
 * @retval ZFAILED on failure.
 */
MTCFUNC ZINT Mtc_CallCameraAttach(ZUINT iCallId, ZCONST ZCHAR *pcName);

/** 
 * @brief MTC session detach camera.
 *
 * @param [in] iCallId The ID of session.
 *
 * @retval ZOK on succeed.
 * @retval ZFAILED on failure.
 */
MTCFUNC ZINT Mtc_CallCameraDetach(ZUINT iCallId);

/**
 * @brief MTC get session name.
 *
 * @param [in] iCallId The ID of session.
 *
 * @return The Render name string when found, otherwise "".
 */
MTCFUNC ZCONST ZCHAR * Mtc_CallGetName(ZUINT iCallId);

/**
 * @brief MTC get session from render name.
 *
 * @param pcName Render name string.
 *
 * @return The ID of session when found, otherwise ZMAXULONG.
 */
MTCFUNC ZVOID * Mtc_CallFromName(ZCONST ZCHAR *pcName);

/** 
 * @brief MTC session pause sending video.
 *
 * @param [in] iCallId The ID of session which you want to stop video transmission.
 * @param [in] iState Transport state type, @ref EN_MTC_CALL_TRANSMISSION_STATE.
 *
 * @retval ZOK on succeed.
 * @retval ZFAILED on failure.
 */
MTCFUNC ZINT Mtc_CallVideoSetSend(ZUINT iCallId, ZUINT iState);

/** 
 * @brief Get MTC session video sending state.
 *
 * @param [in] iCallId The ID of session.
 *
 * @return Transport state type, @ref EN_MTC_CALL_TRANSMISSION_STATE.
 */
MTCFUNC ZUINT Mtc_CallVideoGetSend(ZUINT iCallId);

/** 
 * @brief Get if the network status is suitable for sending video.
 *
 * @param [in] iCallId The ID of session.
 *
 * @retval ZTRUE It is suitable for sending video.
 * @retval ZFALSE It is not suitable for sending video.
 */
MTCFUNC ZBOOL Mtc_CallVideoGetSendAdvice(ZUINT iCallId);

/** 
 * @brief Get MTC session video received state.
 *
 * @param [in] iCallId The ID of session.
 *
 * @return Transport state type, @ref EN_MTC_CALL_TRANSMISSION_STATE.
 */
MTCFUNC ZUINT Mtc_CallVideoGetRecv(ZUINT iCallId);

/**
 * @brief MTC session get network status of video stream.
 *
 * @param [in] iCallId The ID of session.
 *
 * @return Network status @ref EN_MTC_NET_STATUS_TYPE.
 */
MTCFUNC ZINT Mtc_CallGetVideoNetSta(ZUINT iCallId);

/**
 * @brief MTC session get network status of audio stream.
 *
 * @param [in] iCallId The ID of session.
 *
 * @return Network status @ref EN_MTC_NET_STATUS_TYPE.
 */
MTCFUNC ZINT Mtc_CallGetAudioNetSta(ZUINT iCallId);

/**
 * @brief MTC session get session state.
 *
 * @param [in] iCallId The ID of session.
 *
 * @return Session state @ref EN_MTC_CALL_STATE_TYPE.
 */
MTCFUNC ZINT Mtc_CallGetState(ZUINT iCallId);

/** 
 * @brief MTC session check if has a active video stream.
 *
 * @param [in] iCallId The ID of session.
 *
 * @retval ZTRUE on yes.
 * @retval ZFALSE on no.
 *
 * @see @ref Mtc_CallVideoStart, @ref Mtc_CallVideoStop, @ref Mtc_CallHasAudio
 */
MTCFUNC ZBOOL Mtc_CallHasVideo(ZUINT iCallId);

/** 
 * @brief MTC session check if has a active audio stream.
 *
 * @param [in] iCallId The ID of session.
 *
 * @retval ZTRUE on yes.
 * @retval ZFALSE on no.
 *
 * @see @ref Mtc_CallHasVideo
 */
MTCFUNC ZBOOL Mtc_CallHasAudio(ZUINT iCallId);

/** 
 * @brief MTC check session has entered in talking state.
 *
 * @param [in] iCallId The ID of session.
 *
 * @retval ZTRUE on talking state.
 * @retval ZFALSE on talking state.
 *
 * @see @ref Mtc_Call, @ref Mtc_CallAnswer
 */
MTCFUNC ZBOOL Mtc_CallHasTalk(ZUINT iCallId);

/** 
 * @brief MTC check session has entered in hold state.
 *
 * @param [in] iCallId The ID of session.
 *
 * @retval ZTRUE on hold state.
 * @retval ZFALSE on hold state.
 *
 * @see @ref Mtc_CallHasHeld
 */
MTCFUNC ZBOOL Mtc_CallHasHold(ZUINT iCallId);

/** 
 * @brief MTC check session has entered in held state.
 *
 * @param [in] iCallId The ID of session.
 *
 * @retval ZTRUE on held state.
 * @retval ZFALSE on held  state.
 *
 * @see @ref Mtc_CallHasHold
 */
MTCFUNC ZBOOL Mtc_CallHasHeld(ZUINT iCallId);

/** 
 * @brief MTC session check if peer offer a video stream.
 *
 * @param [in] iCallId The ID of session.
 *
 * @retval ZTRUE on yes.
 * @retval ZFALSE on no.
 *
 * @see @ref Mtc_CallVideoStart, @ref Mtc_CallVideoStop, @ref Mtc_CallPeerOfferAudio
 */
MTCFUNC ZBOOL Mtc_CallPeerOfferVideo(ZUINT iCallId);

/** 
 * @brief MTC session check if peer offer a audio stream.
 *
 * @param [in] iCallId The ID of session.
 *
 * @retval ZTRUE on yes.
 * @retval ZFALSE on no.
 *
 * @see @ref Mtc_CallPeerOfferVideo
 */
MTCFUNC ZBOOL Mtc_CallPeerOfferAudio(ZUINT iCallId);

/** 
 * @brief MTC session get the mute status of microphone.
 *
 * @param [in] iCallId The ID of session which you want to get.
 *
 * @retval ZTRUE on muted.
 * @retval ZFALSE on not muted.
 *
 * @see @ref Mtc_CallSetMicMute
 */
MTCFUNC ZBOOL Mtc_CallGetMicMute(ZUINT iCallId);

/** 
 * @brief MTC session set the mute status of microphone.
 *
 * @param [in] iCallId The ID of session which you want to set.
 * @param [in] bMute Indicate whether to mute the microphone.
 *
 * @retval ZOK on succeed.
 * @retval ZFAILED on failure.
 *
 * @see @ref Mtc_CallGetMicMute
 */
MTCFUNC ZINT Mtc_CallSetMicMute(ZUINT iCallId, ZBOOL bMute);

/** 
 * @brief MTC session get scale of microphone.
 *
 * @param [in] iCallId The ID of session which you want get.
 *
 * @return Scale value, from 0.0 to 10.0, 1.0 for no scaling.
 *
 * @see Mtc_CallSetMicScale
 */
MTCFUNC ZFLOAT Mtc_CallGetMicScale(ZUINT iCallId);

/** 
 * @brief MTC session set scale of microphone.
 *
 * @param [in] iCallId The ID of session which you want set.
 * @param [in] fScale Scale value, from 0.0 to 10.0, 1.0 for no scaling.
 *
 * @retval ZOK on succeed.
 * @retval ZFAILED on failure.
 *
 * @see Mtc_CallGetMicScale
 */
MTCFUNC ZINT Mtc_CallSetMicScale(ZUINT iCallId, ZFLOAT fScale);

/** 
 * @brief MTC session get the mute status of speaker.
 *
 * @param [in] iCallId The ID of session which you want to get.
 *
 * @retval ZTRUE on muted.
 * @retval ZFALSE on not muted.
 *
 * @see @ref Mtc_CallSetSpkMute
 */
MTCFUNC ZBOOL Mtc_CallGetSpkMute(ZUINT iCallId);

/** 
 * @brief MTC session set the mute status of speaker.
 *
 * @param [in] iCallId The ID of session which you want to set.
 * @param [in] bMute Indicate whether to mute the speaker.
 *
 * @retval ZOK on succeed.
 * @retval ZFAILED on failure.
 *
 * @see @ref Mtc_CallGetSpkMute
 */
MTCFUNC ZINT Mtc_CallSetSpkMute(ZUINT iCallId, ZBOOL bMute);

/** 
 * @brief MTC session get scale of speaker.
 *
 * @param [in] iCallId The ID of session which you want get.
 *
 * @return Scale value, from 0.0 to 10.0, 1.0 for no scaling.
 *
 * @see Mtc_CallSetSpkScale
 */
MTCFUNC ZFLOAT Mtc_CallGetSpkScale(ZUINT iCallId);

/** 
 * @brief MTC session set scale of speaker.
 *
 * @param [in] iCallId The ID of session which you want set.
 * @param [in] fScale Scale value, from 0.0 to 10.0, 1.0 for no scaling.
 *
 * @retval ZOK on succeed.
 * @retval ZFAILED on failure.
 *
 * @see Mtc_CallGetSpkScale
 */
MTCFUNC ZINT Mtc_CallSetSpkScale(ZUINT iCallId, ZFLOAT fScale);

/** 
 * @brief MTC session get volume of speaker.
 *
 * @param [in] iCallId The ID of session which you want get.
 *
 * @return Volume value, from 0 to 20.
 *
 * @see Mtc_CallSetSpkVol
 */
MTCFUNC ZUINT Mtc_CallGetSpkVol(ZUINT iCallId);

/** 
 * @brief MTC session set volume of speaker.
 *
 * @param [in] iCallId The ID of session which you want set.
 * @param [in] iVol Volume value, from 0 to 20.
 *
 * @retval ZOK on succeed.
 * @retval ZFAILED on failure.
 *
 * @see Mtc_CallGetSpkVol
 */
MTCFUNC ZINT Mtc_CallSetSpkVol(ZUINT iCallId, ZUINT iVol);

/** 
 * @brief MTC session get mix voice status.
 *
 * @param [in] iCallId The ID of session which you want to set.
 *
 * @return mix voice status.
 */
MTCFUNC ZBOOL Mtc_CallGetMixVoice(ZUINT iCallId);

/** 
 * @brief MTC session set mix voice status.
 *
 * @param [in] iCallId The ID of session which you want to set.
 * @param [in] bEnable Indicate whether to mix voice. If ZTRUE, it will mix
 *                     corresponding session's voice.
 *
 * @retval ZOK on succeed.
 * @retval ZFAILED on failure.
 */
MTCFUNC ZINT Mtc_CallSetMixVoice(ZUINT iCallId, ZBOOL bEnable);

/** 
 * @brief MTC session get cookie value.
 *
 * @param [in] iCallId The ID of session which you want to get cookie of.
 *
 * @return The cookie of session.
 *
 * The cookie value could be set by @ref Mtc_Call, @ref Mtc_CallAnswer or
 * @ref Mtc_CallSetCookie previously.
 *
 * @see @ref Mtc_Call, @ref Mtc_CallAnswer, @ref Mtc_CallSetCookie
 */
MTCFUNC ZCOOKIE Mtc_CallGetCookie(ZUINT iCallId);

/** 
 * @brief MTC session set cookie value.
 *
 * @param [in] iCallId The ID of session which you want to set cookie.
 * @param [in] zCookie The cookie which you want to set.
 *
 * @retval ZOK on succeed.
 * @retval ZFAILED on failure.
 *
 * @see @ref Mtc_Call, @ref Mtc_CallAnswer, @ref Mtc_CallGetCookie
 */
MTCFUNC ZINT Mtc_CallSetCookie(ZUINT iCallId, ZCOOKIE zCookie);

/** 
 * @brief MTC session get name of peer id, based on polices.
 *
 * @param [in] iCallId The ID of session which you want to get.
 *
 * @retval The string of name.
 *
 * Note the result of this function may be different with Mtc_CallGetPeerUri
 * because the apply of polices. For example, OIP, OIR, TIP, TIR, and privacy.
 *
 * @see @ref Mtc_CallGetPeerId
 */
MTCFUNC ZCONST ZCHAR * Mtc_CallGetPeerName(ZUINT iCallId);

/** 
 * @brief MTC session get display name of peer id, based on polices.
 *
 * @param [in] iCallId The ID of session which you want to get.
 *
 * @retval The string of display name.
 *
 * Note the result of this function may be different with Mtc_CallGetPeerUri
 * because the apply of polices. For example, OIP, OIR, TIP, TIR, and privacy.
 *
 * @see @ref Mtc_CallGetPeerId
 */
MTCFUNC ZCONST ZCHAR * Mtc_CallGetPeerDisplayName(ZUINT iCallId);

/** 
 * @brief MTC session get peer URI and display name.
 *
 * @param [in] iCallId The ID of session which you want to get.
 * @param [out] ppcDispName The display name of peer user.
 * @param [out] ppcUri The URI of peer user.
 *
 *   The caller must copy out parameter, then use.
 *
 * @retval ZOK on succeed.
 * @retval ZFAILED on failure.
 *
 * The peer information get by this function is actually from FROM/TO header in
 * SIP message. So the true identity of peer user is not asserted by server.
 *
 * @see @ref Mtc_CallGetPeerId
 */
MTCFUNC ZINT Mtc_CallGetPeerUri(ZUINT iCallId, ZCHAR **ppcDispName, 
                ZCHAR **ppcUri);

/** 
 * @brief Mtc session get audio statistics.
 *
 * @param [in] iCallId The ID of session.
 *
 * @retval String of audio statistics.
 *
 * @see 
 */
MTCFUNC ZCONST ZCHAR * Mtc_CallGetAudioStat(ZUINT iCallId);

/** 
 * @brief Mtc session get video statistics.
 *
 * @param [in] iCallId The ID of session.
 *
 * @retval String of video statistics.
 *
 * @see 
 */
MTCFUNC ZCONST ZCHAR * Mtc_CallGetVideoStat(ZUINT iCallId);

/** 
 * @brief Mtc session get mpt statistics.
 *
 * @param [in] iCallId The ID of session.
 *
 * @retval String of mpt statistics.
 *
 * @see 
 */
MTCFUNC ZCONST ZCHAR * Mtc_CallGetMptStat(ZUINT iCallId);

/**
 * @brief Mtc session set parameters.
 *
 * @param [in] iCallId The ID of session.
 * @param [in] pcKey The key of parameter.
 * @param [in] pcValue The value of parameter.
 *
 * @retval ZOK on succeed.
 * @retval ZFAILED on failure.
 */
MTCFUNC ZINT Mtc_CallSetMpt(ZUINT iCallId, ZCONST ZCHAR *pcKey,  ZCONST ZCHAR *pcValue);

/** 
 * @brief Mtc session get audio status.
 *
 * @param [in] iCallId The ID of session.
 * @param [in] iFlag Call option @ref MtcCallStatus.
 *
 * @retval String which is JSON format includes @ref MtcCallStatusKey.
 *
 * @see 
 */
MTCFUNC ZCONST ZCHAR * Mtc_CallAudioGetStatus(ZUINT iCallId, ZUINT iFlag);

/** 
 * @brief Mtc session get video status.
 *
 * @param [in] iCallId The ID of session.
 * @param [in] iFlag Call option @ref MtcCallStatus.
 *
 * @retval String which is JSON format includes @ref MtcCallStatusKey.
 *
 * @see 
 */
MTCFUNC ZCONST ZCHAR * Mtc_CallVideoGetStatus(ZUINT iCallId, ZUINT iFlag);

/**
 * @brief MTC session mangify image of video.
 *
 * @param [in] iCallId The ID of session.
 * @param [in] dCenterX X position of original point of the movement, from 0.0 to 1.0.
 * @param [in] dCenterY Y position of original point of the movement, from 0.0 to 1.0.
 * @param [in] dZoom Mangification factor.
 * @param [in] dOffsetX The moving distance of the X-axis direction, from 0.0 to 1.0.
 * @param [in] dOffsetY The moving distance of the Y-axis direction, from 0.0 to 1.0.
 *
 * @retval ZOK on successfully.
 * @retval ZFAILED on failed.
 */
MTCFUNC ZINT Mtc_CallMangify(ZUINT iCallId, ZDOUBLE dCenterX, ZDOUBLE dCenterY,
                ZDOUBLE dZoom, ZDOUBLE dOffsetX, ZDOUBLE dOffsetY);

/**
 * @brief Reccord call start.
 *
 * It will reccord from call to file.
 *
 * @param [in] iCallId The ID of session.
 * @param [in] pcFileName The reccord file name.
 * @param [in] ucFileType The reccord file type, @ref EN_MTC_MFILE_TYPE
 *
 * @retval ZOK Audio Reccord  successfully.
 * @retval ZFAILED Audio Reccord failed.
 *
 * @see @ref Mtc_CallRecCallStop
 */
MTCFUNC ZINT Mtc_CallRecCallStart(ZUINT iCallId, ZCONST ZCHAR *pcFileName,
                ZUCHAR ucFileType);

/**
 * @brief Reccord Audio stop.
 *
 * @param [in] iCallId The ID of session.
 *
 * @see @ref Mtc_CallRecCallStart
 */
MTCFUNC ZINT Mtc_CallRecCallStop(ZUINT iCallId);

/**
 * @brief MTC session start recoding incoming video.
 *
 * @param [in] iCallId The ID of session.
 * @param [in] pcFileName Name of the file which to store the recording data.
 * @param [in] ucFileType File type, @ref EN_MTC_MFILE_TYPE.
 * @param [in] iWidth Video width in pixel of recoding data.
 * @param [in] iHeight Video height in pixel of recoding data.
 * @param [in] iOption @ref EN_MTC_VIDEO_RECORD_OPTION.
 *
 * @retval ZOK on successfully.
 * @retval ZFAILED on failed.
 *
 * @see Mtc_CallRecRecvVideoStop
 */
MTCFUNC ZINT Mtc_CallRecRecvVideoStart(ZUINT iCallId, 
                ZCONST ZCHAR *pcFileName, ZUCHAR ucFileType, ZUINT iWidth, 
                ZUINT iHeight, ZUINT iOption);

/**
 * @brief MTC session stop recoding incoming video.
 *
 * @param [in] iCallId The ID of session.
 *
 * @retval ZOK on successfully.
 * @retval ZFAILED on failed.
 *
 * @see Mtc_CallRecRecvVideoStart
 */
MTCFUNC ZINT Mtc_CallRecRecvVideoStop(ZUINT iCallId);

/**
 * @brief MTC session start recoding sending video.
 *
 * @param [in] iCallId The ID of session.
 * @param [in] pcFileName Name of the file which to store the recording data.
 * @param [in] ucFileType File type, @ref EN_MTC_MFILE_TYPE.
 * @param [in] iWidth Video width in pixel of recoding data.
 * @param [in] iHeight Video height in pixel of recoding data.
 * @param [in] iOption @ref EN_MTC_VIDEO_RECORD_OPTION.
 *
 * @retval ZOK on successfully.
 * @retval ZFAILED on failed.
 *
 * @see Mtc_CallRecSendVideoStop
 */
MTCFUNC ZINT Mtc_CallRecSendVideoStart(ZUINT iCallId, 
                ZCONST ZCHAR *pcFileName, ZUCHAR ucFileType, 
                ZUINT iWidth, ZUINT iHeight, ZUINT iOption);

/**
 * @brief MTC session stop recoding sending video.
 *
 * @param [in] iCallId The ID of session.
 *
 * @retval ZOK on successfully.
 * @retval ZFAILED on failed.
 *
 * @see Mtc_CallRecSendVideoStart
 */
MTCFUNC ZINT Mtc_CallRecSendVideoStop(ZUINT iCallId);

/**
 * @brief MTC session start recoding camera video.
 *
 * @param [in] iCallId The ID of session.
 * @param [in] pcFileName Name of the file which to store the recording data.
 * @param [in] pcCameraId Name of camera.
 * @param [in] ucFileType File type, @ref EN_MTC_MFILE_TYPE.
 * @param [in] iWidth Video width in pixel of recoding data.
 * @param [in] iHeight Video height in pixel of recoding data.
 * @param [in] iOption @ref EN_MTC_VIDEO_RECORD_OPTION.
 *
 * @retval ZOK on successfully.
 * @retval ZFAILED on failed.
 *
 * @see Mtc_CallRecCameraStop
 */
MTCFUNC ZINT Mtc_CallRecCameraStart(ZUINT iCallId, ZCONST ZCHAR *pcFileName,
                ZCONST ZCHAR *pcCameraId, ZUCHAR ucFileType,
                ZUINT iWidth, ZUINT iHeight, ZUINT iOption);

/**
 * @brief MTC session stop recoding camera video.
 *
 * @param [in] iCallId The ID of session.
 *
 * @retval ZOK on successfully.
 * @retval ZFAILED on failed.
 *
 * @see Mtc_CallRecCameraStart
 */
MTCFUNC ZINT Mtc_CallRecCameraStop(ZUINT iCallId);

/**
 * @brief Take a snapshot of display render.
 *
 * @param [in] iCallId The ID of session.
 * @param [in] pcFileName Name of the file which to store the picture.
 *
 * @retval ZOK on successfully.
 * @retval ZFAILED on failed.
 *
 * @see Mtc_CallCaptureSnapshot
 */
MTCFUNC ZINT Mtc_CallRenderSnapshot(ZUINT iCallId, ZCONST ZCHAR *pcFileName);

/**
 * @brief Take a snapshot of capture.
 *
 * @param [in] iCallId The ID of session.
 * @param [in] pcFileName Name of the file which to store the picture.
 *
 * @retval ZOK on successfully.
 * @retval ZFAILED on failed.
 *
 * @see Mtc_CallRenderSnapshot
 */
MTCFUNC ZINT Mtc_CallCaptureSnapshot(ZUINT iCallId, ZCONST ZCHAR *pcFileName);

/**
 * @brief Send data through stream.
 *
 * @param  iCallId The ID of session.
 * @param  bReliable ZTRUE to send data through reliable stream.
 * @param  pcName The data name.
 * @param  pcValue The data value.
 *
 * @retval ZOK on successfully.
 * @retval ZFAILED on failed.
 */
MTCFUNC ZINT Mtc_CallSendStreamData(ZUINT iCallId, ZBOOL bReliable,
  ZCONST ZCHAR *pcName, ZCONST ZCHAR *pcValue);

/**
 * @brief Send file through stream.
 *
 * @param  iCallId The ID of session.
 * @param  pcFileName The file name.
 * @param  pcFilePath The fiel path.
 * @param  pcUserData The user data.
 *
 * @retval ZOK on successfully.
 * @retval ZFAILED on failed.
 */
MTCFUNC ZINT Mtc_CallSendStreamFile(ZUINT iCallId, ZCONST ZCHAR *pcFileName,
    ZCONST ZCHAR *pcFilePath, ZCONST ZCHAR *pcUserData);

#ifdef __cplusplus
}
#endif

#endif /* _MTC_CALL_H__ */