中间件底层,websocket

Queue.h 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*************************************************************************
  2. 【文件名】 Queue.h
  3. 【功能模块和目的】 外线来电队列基类头文件
  4. 【开发者及日期】 郑石诺 2015/01/21
  5. 【版本】 V1.0.0
  6. 【版权信息】 Copyright (C)2015 河南加一信息技术有限公司
  7. 【更改记录】
  8. *************************************************************************/
  9. #pragma once
  10. #include "AgentGroup.h"
  11. #include "IncomingCallGroup.h"
  12. class CIncomingCall;
  13. /*************************************************************************
  14. 【类名】 CQueue
  15. 【功能】
  16. 【接口说明】 外线来电队列基类
  17. 【开发者及日期】 郑石诺 2015/01/21
  18. 【版本】 V1.0.0
  19. 【版权信息】 Copyright (C)2015 河南加一信息技术有限公司
  20. 【更改记录】
  21. *************************************************************************/
  22. class CQueue
  23. {
  24. public:
  25. CQueue(UINT QueueNo);
  26. ~CQueue(void);
  27. UINT no(void) const { return m_QueueNo; }
  28. UINT callCount(void) const { return m_CallGroup.GetCount(); }
  29. bool getCallInfo(Call2Show& Info) { return m_CallGroup.getCallInfo(Info); }
  30. void clear(void);
  31. UINT talkIngAgentCount(void) { return m_AgentGroup.talkIngAgentCount(); } // 获取坐席组内通话中的数量 2022-01-27
  32. CString callIndex(); // 2022-04-01
  33. // 呼叫管理操作
  34. void onQueueRequest(CPduEntity* pCmd); // 呼叫请求排队
  35. bool onQueueCancel(CPduEntity* pCmd); // 呼叫取消排队
  36. bool onQueuePause(CPduEntity* pCmd); // 呼叫暂停排队
  37. bool onQueueContinue(CPduEntity* pCmd); // 呼叫继续排队
  38. // 座席相关
  39. void addAgent(CAgent* pAgent);
  40. void delAgent(CAgent* pAgent, bool isSave = true); // 2022-09-13 添加参数issave,如果cti断开造成删除坐席,不更新坐席在线情况
  41. void distributeAgent(void);
  42. // 保存坐席所在组的位置 2022-09-07
  43. std::string saveCurAllAgent();
  44. // 获取组内所有坐席,(坐席号|分机号|组号|坐席类型)
  45. CString getCurAllAgent() { m_AgentGroup.GetCurAllAgent(); };
  46. CAgent* GetFreeAgentForLoop() { return m_AgentGroup.GetFreeAgentForLoop(); };
  47. private:
  48. void __initStrategy(void);
  49. void __freeStrategy(void);
  50. CStrategyAD* __getStrategy(AGENT_STRATEGY StrategyId);
  51. void __onAgentDispatched(QUEUE_AGENT_RESULT Result, UINT Agent, UINT Exten, CIncomingCall* pCall); // 处理请求座席结果
  52. protected:
  53. UINT m_QueueNo;
  54. CIncomingCallGroup m_CallGroup; // 外线来电队列
  55. CAgentGroup m_AgentGroup; // 座席队列
  56. CMap<AGENT_STRATEGY, AGENT_STRATEGY, CStrategyAD*, CStrategyAD*> m_StrategyMap; // 保存所有座席分配策略
  57. };