| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #include "VirtualChan.h"
- #include "Log.h"
- #include "FsProxy.h"
- #include "Operation.h"
- VirtualChan::VirtualChan(CFsProxy* pParent, uint32_t ChanNo) : m_pParent(pParent), m_No(ChanNo), m_State(CHAN_LOGIC_STATE_FREE), m_IsInMeeting(false), m_pOperation(nullptr)
- {
- }
- VirtualChan::~VirtualChan()
- {
- }
- void VirtualChan::_setSession(string SessionId, string ChanId)
- {
- m_SessionId = SessionId;
- if (!ChanId.empty())
- {
- m_ChanId = ChanId;
- m_pParent->regBusyChan(this);
- }
- else
- {
- m_pParent->unregBusyChan(this);
- m_ChanId.clear();
- }
- }
- void VirtualChan::_reset(void)
- {
- LOG_INFO("{CVirtualChan}: 执行线路[%lu]重置", m_No);
- m_State = CHAN_LOGIC_STATE_FREE;
- m_IsInMeeting = false;
- m_CalleeNum.clear();
- m_CalleeNum.clear();
- m_ChanId.clear();
- m_SessionId.clear();
- m_OpNumber.clear();
- }
- bool VirtualChan::bindOp(COperation * pOp)
- {
- if(pOp==nullptr || m_pOperation !=nullptr)
- return false;
- m_pOperation = pOp;
- return true;
- }
- bool VirtualChan::releaseOp(COperation * pOp)
- {
- if(m_pOperation != pOp)
- return false;
- m_pOperation = nullptr;
- return true;
- }
|