中间件标准版5.1git,去除基础模块

Session.h 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*************************************************************************
  2. 【文件名】 Session.h
  3. 【功能模块和目的】 会话管理类头文件
  4. 【开发者及日期】 郑石诺 2016/07/28
  5. 【版本】 V1.0.0
  6. 【版权信息】 Copyright (C)2016 河南华谊网络科技有限公司
  7. 【更改记录】
  8. *************************************************************************/
  9. #pragma once
  10. class CFsProxy;
  11. class CVirtualChan;
  12. /*************************************************************************
  13. 【类名】 CSession
  14. 【功能】
  15. 【接口说明】 会话管理类
  16. 【开发者及日期】 郑石诺 2016/07/28
  17. 【版本】 V1.0.0
  18. 【版权信息】 Copyright (C)2016 河南华谊网络科技有限公司
  19. 【更改记录】
  20. *************************************************************************/
  21. class CSession
  22. {
  23. public:
  24. CSession(CFsProxy* pParent, LPCTSTR Id);
  25. ~CSession(void);
  26. // 属性接口
  27. LPCTSTR id(void) const { return m_Id; }
  28. bool isVoid(void) const { return m_ListChan.GetCount() == 0; }
  29. // 操作接口
  30. void prepare(PCHAN_EVENT_NOTIFY pNotify);
  31. void onChanEvent(PCHAN_EVENT_NOTIFY pNotify);
  32. void onChanDtmf(PDTMF_NOTIFY pNotify);
  33. void onChanHold(PHOLD_NOTIFY pNotify);
  34. CVirtualChan* getAssoChan(CVirtualChan* pChan);
  35. private:
  36. CVirtualChan* __getChan(LPCTSTR ChanId);
  37. CVirtualChan* __findChan(PCHAN_EVENT_NOTIFY pNotify);
  38. void __addChan(CVirtualChan* pChan);
  39. void __delChan(CVirtualChan* pChan);
  40. void __clearChan(void);
  41. void __notifySessionChanEvent(CVirtualChan* pChanHost, PCHAN_EVENT_NOTIFY pNotify);
  42. void __onChanFree(CVirtualChan* pChan, PCHAN_EVENT_NOTIFY pNotify);
  43. private:
  44. CFsProxy* m_pParent;
  45. CString m_Id;
  46. CList<CVirtualChan*, CVirtualChan*> m_ListChan;
  47. };