中间件标准版5.1git,去除基础模块

IprControl.h 4.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*************************************************************************
  2. 【文件名】 IprControl.h
  3. 【功能模块和目的】 IPR控制类头文件
  4. 【开发者及日期】 郑石诺 2016/04/08
  5. 【版本】 V1.0.0
  6. 【版权信息】 Copyright (C)2016 河南华谊网络科技有限公司
  7. 【更改记录】
  8. *************************************************************************/
  9. #pragma once
  10. class CLine;
  11. class CLineRecordIprr;
  12. class CLineRecordIpra;
  13. /*************************************************************************
  14. 【类名】 CIprControl
  15. 【功能】
  16. 【接口说明】 IPR控制类
  17. 【开发者及日期】 郑石诺 2016/04/08
  18. 【版本】 V1.0.0
  19. 【版权信息】 Copyright (C)2016 河南华谊网络科技有限公司
  20. 【更改记录】
  21. *************************************************************************/
  22. class CIprControl
  23. {
  24. SINGLETON_DECLARE(CIprControl)
  25. public:
  26. ~CIprControl(void);
  27. int getIprrLineCount(void) const { return m_IprrLineArray.GetCount(); }
  28. int getIpraLineCount(void) const { return m_IpraLineArray.GetCount(); }
  29. void init(void);
  30. void release(void);
  31. void newIprrLine(int LineID);
  32. void newIpraLine(int LineID);
  33. CLine* findLineByID(int LineID); // 根据逻辑线号查找线路基类
  34. CLineRecordIprr* findLineByIPOLineID(int IpoLineID); // 根据IPO线路号查找线路基类
  35. // 录音线路命令处理
  36. void onCmdLineRecord(CLineRecordIprr* pLine, CPduEntity* pPdu); // 录音命令处理
  37. void onCmdLineControl(CLineRecordIprr* pLine, CPduEntity* pPdu); // 录音线路控制命令处理
  38. // 事件处理
  39. void onEventUsbKeyRemoved(PSSM_EVENT pEvent); // 授权狗被移除事件处理
  40. void onEventAuthOverflow(PSSM_EVENT pEvent); // 授权溢出事件处理
  41. void onEventSlaverConnected(PSSM_EVENT pEvent); // 录音slaver连接事件处理
  42. void onEventSlaverDisconnected(PSSM_EVENT pEvent); // 录音slaver连接中断事件处理
  43. void onEventStartSlaverCb(PSSM_EVENT pEvent); // 启动slaver反馈事件的处理
  44. void onEventCloseSlaverCb(PSSM_EVENT pEvent); // 关闭slaver反馈事件的处理
  45. void onEventStationAdd(PSSM_EVENT pEvent); // station添加事件的处理
  46. void onEventStationRemoved(PSSM_EVENT pEvent); // station删除事件的处理
  47. void onEventDChannel(PSSM_EVENT pEvent); // D通道信令事件处理
  48. void onEventIprState(CLineRecordIprr* pLine, int State); // IPR录音事件处理
  49. void onEventIpaState(CLineRecordIpra* pLine, int State); // IPR录音事件处理
  50. void onEventStartRecCb(CLineRecordIprr* pLine, PSSM_EVENT pEvent); // 开始录音反馈事件的处理
  51. void onEventStopRecCb(CLineRecordIprr* pLine, PSSM_EVENT pEvent); // 结束录音反馈事件的处理
  52. void onEventPauseRecCb(CLineRecordIprr* pLine, PSSM_EVENT pEvent); // 暂停录音反馈事件的处理
  53. void onEventRestartRecCb(CLineRecordIprr* pLine, PSSM_EVENT pEvent); // 重启录音反馈事件的处理
  54. void onEventActiveSessionCb(CLineRecordIprr* pLine, PSSM_EVENT pEvent); // 激活会话反馈事件的处理
  55. void onEventDeactiveSessionCb(CLineRecordIprr* pLine, PSSM_EVENT pEvent); // 去激活会话反馈事件的处理
  56. void onEventActiveAndRecCb(CLineRecordIprr* pLine, PSSM_EVENT pEvent); // 激活会话并录音反馈事件的处理
  57. void onEventDeactiveAndStopRecCb(CLineRecordIprr* pLine, PSSM_EVENT pEvent);// 去激活停止录音反馈事件的处理
  58. void onEventMediaSessionStarted(CLineRecordIpra* pLine, PSSM_EVENT pEvent); // 媒体会话开始事件的处理
  59. void onEventMediaSessionStoped(CLineRecordIpra* pLine, PSSM_EVENT pEvent); // 媒体会话结束事件的处理
  60. private:
  61. CIprControl(void);
  62. DWORD __checkRecFileEnv(LPCTSTR RecFile);
  63. void __scanIprSlaver(void);
  64. void __openIprSlaver(void);
  65. void __closeIprSlaver(void);
  66. CLineRecordIpra* __findLineIpraBySessionId(int SessionId);
  67. CLineRecordIprr* __findLineIprrByStationId(int StationId);
  68. bool __startRecord(CLineRecordIprr* pLine, LPCTSTR FileName); // 录音
  69. bool __stopRecord(CLineRecordIprr* pLine); // 停止留言/录音
  70. bool __pauseRecord(CLineRecordIprr* pLine); // 暂停录音
  71. bool __resumeRecord(CLineRecordIprr* pLine); // 继续录音
  72. private:
  73. int m_IprBoardId;
  74. int m_IpaBoardId;
  75. int m_SlaverCount;
  76. IPR_SLAVERADDR m_IprSlaver; // 目前仅考虑适用单路slaver
  77. CArray<CLineRecordIprr*, CLineRecordIprr*> m_IprrLineArray;
  78. CArray<CLineRecordIpra*, CLineRecordIpra*> m_IpraLineArray;
  79. };