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

VirtualChan.cpp 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #include "StdAfx.h"
  2. #include "VirtualChan.h"
  3. #include "Operation.h"
  4. #include "FsProxy.h"
  5. CVirtualChan::CVirtualChan(CFsProxy* pParent, UINT ChanNo) : m_pParent(pParent), m_No(ChanNo), m_State(CHAN_LOGIC_STATE_FREE), m_IsInMeeting(false), m_pOperation(NULL)
  6. {
  7. ASSERT(m_pParent != NULL);
  8. }
  9. CVirtualChan::~CVirtualChan(void)
  10. {
  11. }
  12. /*****************************************************************
  13. **【函数名称】 _setSession
  14. **【函数功能】 设置通道会话环境
  15. **【参数】
  16. **【返回值】
  17. ****************************************************************/
  18. void CVirtualChan::_setSession( LPCTSTR SessionId, LPCTSTR ChanId )
  19. {
  20. if(SessionId != NULL)
  21. m_SessionId = SessionId;
  22. else
  23. m_SessionId = _T("");
  24. if(ChanId != NULL)
  25. {
  26. m_ChanId = ChanId;
  27. m_pParent->regBusyChan(this);
  28. }
  29. else
  30. {
  31. m_pParent->unregBusyChan(this);
  32. m_ChanId = _T("");
  33. }
  34. }
  35. /*****************************************************************
  36. **【函数名称】 _reset
  37. **【函数功能】 重置通道
  38. **【参数】
  39. **【返回值】
  40. ****************************************************************/
  41. void CVirtualChan::_reset( void )
  42. {
  43. m_State = CHAN_LOGIC_STATE_FREE;
  44. m_IsInMeeting = false;
  45. m_CalleeNum = _T("");
  46. m_CalleeNum = _T("");
  47. m_ChanId = _T("");
  48. m_SessionId = _T("");
  49. m_OpNumber = _T("");
  50. }
  51. /*****************************************************************
  52. **【函数名称】 bindOp
  53. **【函数功能】 绑定操作
  54. **【参数】
  55. **【返回值】
  56. ****************************************************************/
  57. bool CVirtualChan::bindOp( COperation* pOp )
  58. {
  59. ASSERT(pOp != NULL);
  60. if(pOp == NULL || m_pOperation != NULL)
  61. return false;
  62. m_pOperation = pOp;
  63. return true;
  64. }
  65. /*****************************************************************
  66. **【函数名称】 releaseOp
  67. **【函数功能】 释放操作
  68. **【参数】
  69. **【返回值】
  70. ****************************************************************/
  71. bool CVirtualChan::releaseOp( COperation* pOp )
  72. {
  73. if(m_pOperation != pOp)
  74. return false;
  75. m_pOperation = NULL;
  76. return true;
  77. }
  78. /*****************************************************************
  79. **【函数名称】 onChanDtmf
  80. **【函数功能】 通道DTMF事件处理
  81. **【参数】
  82. **【返回值】
  83. ****************************************************************/
  84. void CVirtualChan::onChanDtmf( LPCTSTR Dtmf )
  85. {
  86. if(m_pOperation != NULL)
  87. m_pOperation->onHostChanDtmf(Dtmf);
  88. }
  89. /*****************************************************************
  90. **【函数名称】 onChanHold
  91. **【函数功能】 通道保持事件处理
  92. **【参数】
  93. **【返回值】
  94. ****************************************************************/
  95. void CVirtualChan::onChanHold( EVENT_HOLD_TYPE HoldType )
  96. {
  97. }