/************************************************************************* 【文件名】 Session.h 【功能模块和目的】 会话管理类头文件 【开发者及日期】 郑石诺 2016/07/28 【版本】 V1.0.0 【版权信息】 Copyright (C)2016 河南华谊网络科技有限公司 【更改记录】 *************************************************************************/ #pragma once #include class CFsProxy; class CVirtualChan; /************************************************************************* 【类名】 CSession 【功能】 【接口说明】 会话管理类 【开发者及日期】 郑石诺 2016/07/28 【版本】 V1.0.0 【版权信息】 Copyright (C)2016 河南华谊网络科技有限公司 【更改记录】 *************************************************************************/ class CSession { public: CSession(CFsProxy* pParent, LPCTSTR Id); ~CSession(void); // 属性接口 LPCTSTR id(void) const { return m_Id; } bool isVoid(void) const { return m_ListChan.GetCount() == 0; } // 操作接口 void prepare(PCHAN_EVENT_NOTIFY pNotify); void onChanEvent(PCHAN_EVENT_NOTIFY pNotify); void onChanDtmf(PDTMF_NOTIFY pNotify); void onChanHold(PHOLD_NOTIFY pNotify); CVirtualChan* getAssoChan(CVirtualChan* pChan); private: CVirtualChan* __getChan(LPCTSTR ChanId); CVirtualChan* __findChan(PCHAN_EVENT_NOTIFY pNotify); void __addChan(CVirtualChan* pChan); void __delChan(CVirtualChan* pChan); void __clearChan(void); void __notifySessionChanEvent(CVirtualChan* pChanHost, PCHAN_EVENT_NOTIFY pNotify); void __onChanFree(CVirtualChan* pChan, PCHAN_EVENT_NOTIFY pNotify); private: CFsProxy* m_pParent; CString m_Id; CList m_ListChan; std::mutex m_LockChan; // 2020-03-02 };