Açıklama Yok

EslGateway.h 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 getConferenceMemberId(LPCTSTR MeetingId, LPCTSTR ChanId, CString& MemberId);
  30. bool setConferencePlay(LPCTSTR MeetingId, LPCTSTR MemberId, bool isPlay);
  31. bool sendCmd(LPCTSTR pCmd);
  32. bool execute(esl_handle_t* pHandle, LPCTSTR App, LPCTSTR Param);
  33. bool Execte2( LPCTSTR App, LPCTSTR Param,LPCTSTR ChanId);
  34. bool sendCustomEvt(LPCTSTR CustomName, LPCTSTR ChanId, LPCTSTR Content);
  35. private:
  36. friend class CFsProxy;
  37. CEslGateway(CFsProxy* pParent);
  38. // ESL服务端线程函数
  39. static DWORD WINAPI __eslListenThread(LPVOID lpParameter);
  40. static void __eslListenThreadCb(esl_socket_t server_sock, esl_socket_t client_sock, struct sockaddr_in *addr, void *user_data);
  41. void __processCallConnect(esl_handle_t* pHandle, CChanTrunk* pTrunk);
  42. // 事件处理的线程函数
  43. static DWORD WINAPI __eventThread(LPVOID lpParameter);
  44. void __onEslEvent(esl_event_t* pEvent);
  45. void __onEslDisconnect(void);
  46. void __onEslEvtBgJobDone(esl_event_t* pEvent);
  47. void __onEslEvtChanEvent(esl_event_t* pEvent);
  48. void __onEslEvtCustom(esl_event_t* pEvent);
  49. void __onEslEvtDtmf(esl_event_t* pEvent);
  50. void __onEslEvtHold(esl_event_t* pEvent, EVENT_HOLD_TYPE EvtType);
  51. private:
  52. CFsProxy* m_pParent;
  53. volatile bool m_Stop;
  54. HANDLE m_ListenThread;
  55. HANDLE m_EventThread;
  56. esl_handle_t m_EslHdl4Listen; // 监听FreeSWITCH消息
  57. esl_handle_t m_EslHdl4Send; // 向FreeSWITCH发送命令
  58. };