linux版本中间件

OpForceAgentState.cpp 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #include "OpForceAgentState.h"
  2. #include "ChanExten.h"
  3. #include "OperationReactor.h"
  4. #include "FsProxy.h"
  5. COpForceAgentState::COpForceAgentState(COperationReactor * pParent, long Instance) : COperation(pParent, Instance)
  6. {
  7. }
  8. COpForceAgentState::~COpForceAgentState(void)
  9. {
  10. }
  11. bool COpForceAgentState::start(LineOpParam * pParam)
  12. {
  13. m_OpTime = Util::CurTime();
  14. m_CallerAgent = pParam->szParam1;
  15. m_Caller = pParam->nParam1;
  16. m_CalleeAgent = pParam->szParam2;
  17. m_Callee = pParam->szParam3;
  18. bool ret = pParam->nParam2;
  19. LOG_INFO("{COpForceAgentState}: 坐席[%s]-分机[%s]执行强制坐席状态, DestAgent = %s,DestExten = %s", m_CallerAgent.c_str(), m_Caller.c_str(), m_CalleeAgent.c_str(), m_Callee.c_str());
  20. ChanExten* pDestExten = CFsProxy::GetInstance().getExten(atoi(m_Callee.c_str()));
  21. if (pDestExten)
  22. pDestExten->forceState(CHAN_LOGIC_STATE_FREE);
  23. else
  24. ret = false;
  25. _end(ret);
  26. return ret;
  27. }
  28. void COpForceAgentState::_end(bool IsSucceed)
  29. {
  30. SqlWrite::GetInstance()->addSql(toSql(IsSucceed, "强制坐席状态"));
  31. m_pParent->onOpResult(m_Instance, this, IsSucceed, m_Caller);
  32. }