修改三方通话功能,在发起三方通话时,先保持住主叫,然后再拉回主叫到会议

SpanChannel.h 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*************************************************************************
  2. 【文件名】 DevResSpanCh.h
  3. 【功能模块和目的】 数字中继通道类头文件
  4. 【开发者及日期】 郑石诺 2015/03/18
  5. 【版本】 V1.0.0
  6. 【版权信息】 Copyright (C)2015 河南华谊网络科技有限公司
  7. 【更改记录】
  8. *************************************************************************/
  9. #pragma once
  10. #include "ChannelResource.h"
  11. #include "OneLeg.h"
  12. #include "IMixerHost.h"
  13. #include "Mixer.h"
  14. class CVoipChannel;
  15. /*************************************************************************
  16. 【类名】 CDevResSpanCh
  17. 【功能】
  18. 【接口说明】 数字中继通道类
  19. 【开发者及日期】 郑石诺 2015/03/18
  20. 【版本】 V1.0.0
  21. 【版权信息】 Copyright (C)2015 河南华谊网络科技有限公司
  22. 【更改记录】
  23. *************************************************************************/
  24. class CSpanChannel : public CChannelResource, public COneLeg, public IMixerHost
  25. {
  26. public:
  27. CSpanChannel(DEV_RES_CH_TYPE ChannelNo, DEV_RES_NO_TYPE SpanNo, DEV_RES_NO_TYPE NodeNo, DEV_RES_NO_TYPE BoardNo);
  28. virtual ~CSpanChannel(void);
  29. ////////////////////////////////////////////////////////////////////////////////
  30. //继承自CChannelResource
  31. bool open(void);
  32. void close(void);
  33. bool isFree(void) const { return (m_State == GCST_NULL && !m_IsBlocked); }
  34. int type(void) const { return SC_DTI; }
  35. LPCTSTR getStateStr(void) const;
  36. void onDevEvent(METAEVENT* pMetaEvent);
  37. ////////////////////////////////////////////////////////////////////////////////
  38. //继承自COneLeg
  39. bool offhook(bool IgnoreSession, LPCTSTR CallerNum = NULL) { return false;} // 内线摘机
  40. bool dropCall(bool IsPassive = false); // 挂机
  41. bool makeCall(LPCTSTR Callee, LPCTSTR Caller, int AccountId); // 启动线路拨号
  42. bool answer(void); // 应答呼叫
  43. bool playSound(PlayVoiceContent* pContent); // 放音收号
  44. bool playTone(int Type); // 播放信号音
  45. bool playStop(void); // 停止放音
  46. bool startRecord(RecordContent* pContent); // 开始录音
  47. bool stopRecord(void); // 停止录音
  48. bool monitor(COneLeg* pTalker, bool IsStop); // 监听
  49. bool allowMonitor(COneLeg* pMonitorParty) ; // 接受监听
  50. bool cancelMonitor(COneLeg* pMonitorParty); // 取消监听
  51. void freeResBinded(void) {} // 释放绑定资源
  52. bool reply(void);
  53. bool progress(void) { return true; }
  54. bool accept(void);
  55. void onFaxEnd(bool IsSuccess, LPCTSTR Reason);
  56. CChannelResource* routeChannel(void) { return this; }
  57. CChannelResource* resourceAttribute(void) { return this; }
  58. ////////////////////////////////////////////////////////////////////////////////
  59. //继承自IMixerHost
  60. int node(void) const { return nodeNo(); }
  61. int mixHandle(void) const { return m_Handle; }
  62. int mixType(void) const { return SC_DTI_MIX; }
  63. int normalType(void) const { return SC_DTI; }
  64. void onPlayEnd(LPCTSTR lpDtmf);
  65. void onRecEnd(UINT TaskId);
  66. void onToneEnd(int ToneTp);
  67. private:
  68. void __freeBindingChan(void);
  69. bool __clearCall(int Cause = GC_NORMAL_CLEARING);
  70. // 系统事件处理接口
  71. void __onOffered(METAEVENT* pMetaEvent);
  72. void __onAccept(void);
  73. void __onAlerting(METAEVENT* pMetaEvent);
  74. void __onAnswered(void);
  75. void __onConnected(void);
  76. void __onProgressing(void);
  77. void __onTaskFail(void);
  78. void __onCallFinished(void);
  79. void __onCallDisconnected(METAEVENT* pMetaEvent);
  80. private:
  81. DEV_RES_HANDLE m_GcHandle;
  82. DEV_RES_CALL_ID m_CallId;
  83. bool m_IsBlocked;
  84. CMixer m_Mixer;
  85. };