| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- /*************************************************************************
- 【文件名】 EslGateway.h
- 【功能模块和目的】 ESL网关类头文件
- 【开发者及日期】 郑石诺 2016/07/14
- 【版本】 V1.0.0
- 【版权信息】 Copyright (C)2016 河南华谊网络科技有限公司
- 【更改记录】
- *************************************************************************/
- #pragma once
- class CChanTrunk;
- /*************************************************************************
- 【类名】 CEslGateway
- 【功能】 负责ESL消息解析、收发
- 【接口说明】 ESL网关类
- 【开发者及日期】 郑石诺 2016/07/14
- 【版本】 V1.0.0
- 【版权信息】 Copyright (C)2016 河南华谊网络科技有限公司
- 【更改记录】
- *************************************************************************/
- class CEslGateway
- {
- public:
- ~CEslGateway(void);
- // 控制接口
- bool start(void);
- void stop(void);
- bool hangupAll(void);
- bool scanExten(void);
- bool sendCmd(LPCTSTR pCmd);
- bool execute(esl_handle_t* pHandle, LPCTSTR App, LPCTSTR Param);
- bool Execte2( LPCTSTR App, LPCTSTR Param,LPCTSTR ChanId);
- private:
- friend class CFsProxy;
- CEslGateway(CFsProxy* pParent);
-
- // ESL服务端线程函数
- static DWORD WINAPI __eslListenThread(LPVOID lpParameter);
- static void __eslListenThreadCb(esl_socket_t server_sock, esl_socket_t client_sock, struct sockaddr_in *addr, void *user_data);
- void __processCallConnect(esl_handle_t* pHandle, CChanTrunk* pTrunk);
- // 事件处理的线程函数
- static DWORD WINAPI __eventThread(LPVOID lpParameter);
- void __onEslEvent(esl_event_t* pEvent);
- void __onEslDisconnect(void);
- void __onEslEvtBgJobDone(esl_event_t* pEvent);
- void __onEslEvtChanEvent(esl_event_t* pEvent);
- void __onEslEvtCustom(esl_event_t* pEvent);
- void __onEslEvtDtmf(esl_event_t* pEvent);
- void __onEslEvtHold(esl_event_t* pEvent, EVENT_HOLD_TYPE EvtType);
- private:
- CFsProxy* m_pParent;
- volatile bool m_Stop;
- HANDLE m_ListenThread;
- HANDLE m_EventThread;
- esl_handle_t m_EslHdl4Listen; // 监听FreeSWITCH消息
- esl_handle_t m_EslHdl4Send; // 向FreeSWITCH发送命令
- };
|