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

VirtualChan.h 3.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*************************************************************************
  2. 【文件名】 VirtualChan.h
  3. 【功能模块和目的】 虚拟通道基类头文件
  4. 【开发者及日期】 郑石诺 2016/07/13
  5. 【版本】 V1.0.0
  6. 【版权信息】 Copyright (C)2016 河南华谊网络科技有限公司
  7. 【更改记录】
  8. *************************************************************************/
  9. #pragma once
  10. class CFsProxy;
  11. class COperation;
  12. /*************************************************************************
  13. 【类名】 CVirtualChan
  14. 【功能】
  15. 【接口说明】 虚拟通道基类
  16. 【开发者及日期】 郑石诺 2016/07/13
  17. 【版本】 V1.0.0
  18. 【版权信息】 Copyright (C)2016 河南华谊网络科技有限公司
  19. 【更改记录】
  20. *************************************************************************/
  21. class CVirtualChan
  22. {
  23. public:
  24. CVirtualChan(CFsProxy* pParent, UINT ChanNo);
  25. virtual ~CVirtualChan(void);
  26. UINT no(void) const { return m_No; }
  27. CHAN_LOGIC_STATE state(void) const { return m_State; }
  28. bool isInMeeting(void) const { return m_IsInMeeting; }
  29. bool& isInMeeting(void) { return m_IsInMeeting; }
  30. COperation* currOp(void) const { return m_pOperation; }
  31. LPCTSTR chanId(void) const { return m_ChanId; }
  32. LPCTSTR sessionId(void) const { return m_SessionId; }
  33. LPCTSTR callerNum(void) const { return m_CallerNum; }
  34. LPCTSTR calleeNum(void) const { return m_CalleeNum; }
  35. LPCTSTR opNumber(void) const { return m_OpNumber; }
  36. CString& opNumber(void) { return m_OpNumber; }
  37. bool bindOp(COperation* pOp);
  38. bool releaseOp(COperation* pOp);
  39. // 颐和随访
  40. void SetState(CHAN_LOGIC_STATE statu) { m_State = statu; }
  41. // 待实现接口
  42. virtual DEV_RES_TYPE type(void) const = 0; // 通道类型
  43. virtual bool isFree(void) const = 0;
  44. virtual bool isVoid(void) const = 0;
  45. virtual void regist(void) const = 0;
  46. virtual void onChanDtmf(LPCTSTR Dtmf);
  47. virtual void onChanHold(EVENT_HOLD_TYPE HoldType);
  48. virtual void onChanEvent(PCHAN_EVENT_NOTIFY pNotify) = 0;
  49. virtual void onSessionChanEvent(CVirtualChan* pChanSession, PCHAN_EVENT_NOTIFY pNotify) = 0;
  50. protected:
  51. void _setSession(LPCTSTR SessionId, LPCTSTR ChanId);
  52. void _reset(void);
  53. protected:
  54. CFsProxy* m_pParent; // 宿主类
  55. UINT m_No; // 通道号
  56. CHAN_LOGIC_STATE m_State; // 状态
  57. bool m_IsInMeeting; // 是否在会议中
  58. COperation* m_pOperation; // 关联操作
  59. CString m_CallerNum; // 主叫号码
  60. CString m_CalleeNum; // 被叫号码
  61. CString m_OpNumber; // 通道操作号码
  62. TCHAR* m_Callid;
  63. // by 增加的中继通道的键值以及分机通道的键值
  64. protected:
  65. int trunkId() const { return m_TrunkSessionKey; }
  66. int& trunkId() { return m_TrunkSessionKey; } //获取中继通道会话键值
  67. void setTurnkId(int TrunkSessionKey) { this->m_TrunkSessionKey = TrunkSessionKey; } // 设置中继通道会话键值
  68. int ExtenId() const { return m_ExtenSessionKey; }
  69. int& ExtenId() { return m_ExtenSessionKey; } //获取分机通道会话键值
  70. void setExtenId(int ExtenSessionKey) { this->m_ExtenSessionKey = ExtenSessionKey; } // 设置分机通道会话键值
  71. int trunkCallId() const { return m_TrunkSessionKey; }
  72. int& trunkCallId() { return m_TrunkSessionKey; }
  73. void setTurnkCallId(int TrunkSessionKey) { this->m_TrunkSessionKey = TrunkSessionKey; } // 设置中继通道会话键值
  74. TCHAR* ExtenCallId() const { return m_ExtenCallidKey; }
  75. //TCHAR*& ExtenCallId() { return m_ExtenCallidKey; } //获取分机通道会话键值
  76. void setExtenCallId(TCHAR* ExtenSessionKey) { this->m_ExtenCallidKey = ExtenSessionKey; } // 设置分机通道会话键值
  77. protected:
  78. int m_TrunkSessionKey;
  79. int m_ExtenSessionKey;
  80. TCHAR* m_ExtenCallidKey;
  81. private:
  82. CString m_ChanId; // 通道动态ID
  83. CString m_SessionId; // 会话ID
  84. };