Brak opisu

VirtualChan.cpp 2.7KB

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