#include "StdAfx.h" #include "VirtualChan.h" #include "Operation.h" #include "FsProxy.h" CVirtualChan::CVirtualChan(CFsProxy* pParent, UINT ChanNo) : m_pParent(pParent), m_No(ChanNo), m_State(CHAN_LOGIC_STATE_FREE), m_IsInMeeting(false), m_pOperation(NULL) { ASSERT(m_pParent != NULL); } CVirtualChan::~CVirtualChan(void) { } /***************************************************************** **【函数名称】 _setSession **【函数功能】 设置通道会话环境 **【参数】 **【返回值】 ****************************************************************/ void CVirtualChan::_setSession( LPCTSTR SessionId, LPCTSTR ChanId ) { if(SessionId != NULL) m_SessionId = SessionId; else m_SessionId = _T(""); if(ChanId != NULL) { m_ChanId = ChanId; m_pParent->regBusyChan(this); } else { m_pParent->unregBusyChan(this); m_ChanId = _T(""); } } /***************************************************************** **【函数名称】 _reset **【函数功能】 重置通道 **【参数】 **【返回值】 ****************************************************************/ void CVirtualChan::_reset( void ) { m_State = CHAN_LOGIC_STATE_FREE; m_IsInMeeting = false; m_CalleeNum = _T(""); m_CalleeNum = _T(""); m_ChanId = _T(""); m_SessionId = _T(""); m_OpNumber = _T(""); } /***************************************************************** **【函数名称】 bindOp **【函数功能】 绑定操作 **【参数】 **【返回值】 ****************************************************************/ bool CVirtualChan::bindOp( COperation* pOp ) { ASSERT(pOp != NULL); if(pOp == NULL || m_pOperation != NULL) return false; m_pOperation = pOp; return true; } /***************************************************************** **【函数名称】 releaseOp **【函数功能】 释放操作 **【参数】 **【返回值】 ****************************************************************/ bool CVirtualChan::releaseOp( COperation* pOp ) { if(m_pOperation != pOp) return false; m_pOperation = NULL; return true; } /***************************************************************** **【函数名称】 onChanDtmf **【函数功能】 通道DTMF事件处理 **【参数】 **【返回值】 ****************************************************************/ void CVirtualChan::onChanDtmf( LPCTSTR Dtmf ) { if(m_pOperation != NULL) m_pOperation->onHostChanDtmf(Dtmf); } /***************************************************************** **【函数名称】 onChanHold **【函数功能】 通道保持事件处理 **【参数】 **【返回值】 ****************************************************************/ void CVirtualChan::onChanHold( EVENT_HOLD_TYPE HoldType ) { }