升龙物业 老版本 ocx IPO, 加密狗 转值班电话

EslGateway.h 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*************************************************************************
  2. 【文件名】 EslGateway.h
  3. 【功能模块和目的】 ESL网关类头文件
  4. 【开发者及日期】 郑石诺 2016/07/14
  5. 【版本】 V1.0.0
  6. 【版权信息】 Copyright (C)2016 河南华谊网络科技有限公司
  7. 【更改记录】
  8. *************************************************************************/
  9. #pragma once
  10. class CChanTrunk;
  11. /*************************************************************************
  12. 【类名】 CEslGateway
  13. 【功能】 负责ESL消息解析、收发
  14. 【接口说明】 ESL网关类
  15. 【开发者及日期】 郑石诺 2016/07/14
  16. 【版本】 V1.0.0
  17. 【版权信息】 Copyright (C)2016 河南华谊网络科技有限公司
  18. 【更改记录】
  19. *************************************************************************/
  20. class CEslGateway
  21. {
  22. public:
  23. ~CEslGateway(void);
  24. // 控制接口
  25. bool start(void);
  26. void stop(void);
  27. bool hangupAll(void);
  28. bool scanExten(void);
  29. bool sendCmd(LPCTSTR pCmd);
  30. bool execute(esl_handle_t* pHandle, LPCTSTR App, LPCTSTR Param);
  31. private:
  32. friend class CFsProxy;
  33. CEslGateway(CFsProxy* pParent);
  34. // ESL服务端线程函数
  35. static DWORD WINAPI __eslListenThread(LPVOID lpParameter);
  36. static void __eslListenThreadCb(esl_socket_t server_sock, esl_socket_t client_sock, struct sockaddr_in *addr, void *user_data);
  37. void __processCallConnect(esl_handle_t* pHandle, CChanTrunk* pTrunk);
  38. // 事件处理的线程函数
  39. static DWORD WINAPI __eventThread(LPVOID lpParameter);
  40. void __onEslEvent(esl_event_t* pEvent);
  41. void __onEslDisconnect(void);
  42. void __onEslEvtBgJobDone(esl_event_t* pEvent);
  43. void __onEslEvtChanEvent(esl_event_t* pEvent);
  44. void __onEslEvtCustom(esl_event_t* pEvent);
  45. void __onEslEvtDtmf(esl_event_t* pEvent);
  46. void __onEslEvtHold(esl_event_t* pEvent, EVENT_HOLD_TYPE EvtType);
  47. private:
  48. CFsProxy* m_pParent;
  49. volatile bool m_Stop;
  50. HANDLE m_ListenThread;
  51. HANDLE m_EventThread;
  52. esl_handle_t m_EslHdl4Listen; // 监听FreeSWITCH消息
  53. esl_handle_t m_EslHdl4Send; // 向FreeSWITCH发送命令
  54. };