MiddleWares_YiHe 郑州颐和医院随访系统中间件

IpoLinkInc.h 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*************************************************************************
  2. 【文件名】 IpoLinkInc.h
  3. 【功能模块和目的】 IPOLink公共头文件
  4. 【开发者及日期】 郑石诺 2016/03/23
  5. 【版本】 V1.0.0
  6. 【版权信息】 Copyright (C)2016 河南华谊网络科技有限公司
  7. 【更改记录】
  8. *************************************************************************/
  9. #pragma once
  10. #include "../Public/GlobalDef/CommonTypeDef.h"
  11. #include "../Public/GlobalDef/DevLinkInc.h"
  12. #include "../Public/GlobalDef/DevInfoInc.h"
  13. #include "NetCtrlInterface.h"
  14. #include "NetRepInterface.h"
  15. #include "PduLinkInc.h"
  16. #include "PduEntity.h"
  17. #include "PduDataFormat.h"
  18. #include "Logger.h"
  19. #define OTL_ODBC //OTL连接方式为ODBC
  20. #define OTL_STREAM_READ_ITERATOR_ON //使用OTL迭代器
  21. #define OTL_STL //OTL使用标准库
  22. #include "../Public/OTL/otlv4.h"
  23. #include "../Public/OTL/OtlDB.h"
  24. #define CONST_DEV_LINK_CALL_NULL -1
  25. #define CONST_DEV_LINK_SUSPEND -2
  26. #define CONST_DEV_ID_INVALID -1
  27. #define CONST_DEVLINK_HANGUP_BY_A 0
  28. #define CONST_DEVLINK_HANGUP_BY_B 1
  29. #define CONST_DEVLINK_OUTBOUND_ANSWER 0
  30. #define CONST_DEVLINK_INBOUND_ANSWER 1
  31. #define CONST_LINE_INIT_TIME_LIMIT 3
  32. #define CONST_TAPI_DEST_DEVICE _T("Avaya")
  33. #define CONST_TAPI_OP_INSTANCE_INVALID -1
  34. #define CONST_TAPI_DIGIT_MEETING _T("!")
  35. #define CONST_TAPI_CODE_MEETING _T("*47")
  36. #define CONST_TAPI_CODE_PARK _T("*****")
  37. const int CALL_IDENT_LEN (6);
  38. const int COMMA (0x2C);
  39. const int MAX_FIELD_LEN (33);
  40. // CDR constants
  41. const int CALL_START (0);
  42. const int CALL_DURATION (1);
  43. const int RING_DURATION (2);
  44. const int CALLER (3);
  45. const int DIRECTION (4);
  46. const int CALLED_NUMBER (5);
  47. const int DIALED_NUMBER (6);
  48. const int NAME (7);
  49. const int TAG (8);
  50. const int ACCOUNT (9);
  51. const int IS_INTERNAL (10);
  52. const int LCR_CALLED_NUMBER (11);
  53. // Real Time Event constants
  54. const int ASTATE (2);
  55. const int BSTATE (3);
  56. const int ACONNECTED (4);
  57. const int BCONNECTED (6);
  58. const int A_IS_MUSIC (5);
  59. const int B_IS_MUSIC (7);
  60. const int ANAME (8);
  61. const int BNAME (9);
  62. const int BLIST (10);
  63. const int ASLOT (11);
  64. const int BSLOT (12);
  65. const int CALLED_NUM (14);
  66. const int CALLING_NUM (16);
  67. const int TARG_UNAME (32);
  68. const int IS_INTERNAL_CALL (34);
  69. const int PARK_SLOT_NUMBER (41);
  70. const int RTE_TAG (43);
  71. const int ACCOUNT_CODE (48);
  72. const int CALL_ID (49);
  73. typedef enum tagDEV_LINK_EVENT_TYPE /* 事件类型 */
  74. {
  75. DEV_LINK_EVENT_TYPE_S, // S事件
  76. DEV_LINK_EVENT_TYPE_D, // D事件
  77. DEV_LINK_EVENT_TYPE_A // A事件
  78. } DEV_LINK_EVENT_TYPE;
  79. typedef enum tagDEV_LINK_CALL_STATE /* 呼叫状态 */
  80. {
  81. CSIdle,
  82. CSRinging,
  83. CSConnected,
  84. CSDisconnected,
  85. CSSuspending,
  86. CSSuspended,
  87. CSResuming,
  88. CSDialling,
  89. CSDialled,
  90. CSLocalDial,
  91. CSQueued,
  92. CSParked,
  93. CSHeld,
  94. CSReDialling
  95. } DEV_LINK_CALL_STATE;
  96. /* 解析后的S事件内容 */
  97. typedef struct tagDevLinkInfoS
  98. {
  99. int nDevLinkCallId; // DevLink CallId
  100. int nResType; // 触发事件设备类型
  101. CHAR szResId[MAX_FIELD_LEN]; // 触发事件的设备ID
  102. int nResStatus; // 设备当前状态
  103. int nPeerResType; // 对端设备类型(-1 表示无对端设备)
  104. CHAR szPeerResId[MAX_FIELD_LEN]; // 对端设备ID
  105. CHAR szCallerNum[MAX_FIELD_LEN]; // 主叫号码
  106. CHAR szCalleeNum[MAX_FIELD_LEN]; // 被叫号码
  107. int nFlag; // 主动挂机方(0 -> A端,1 -> B端), 接通时的通话方向(0 -> 呼出接通,1 -> 应答接通)
  108. } DevLinkInfoS;
  109. // 中继线路类型
  110. typedef enum tagTrunkType
  111. {
  112. TRUNK_UNKNOWN = 0,
  113. TRUNK_DT,
  114. TRUNK_ANA,
  115. TRUNK_H323,
  116. TRUNK_SIP
  117. } TrunkType;