| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- #include "StdAfx.h"
- #include "LogicLine.h"
- #include "StatisticsMgr.h"
- #include "SessionHolder.h"
- #include "CallSession.h"
- CLogicLine::CLogicLine(UINT ResId) : m_LineId(ResId), m_LineStatus(INNER_STATE_DISABLED), m_CallId(0), m_HoldCallId(0),
- m_CurrentOpType(PDU_CMD_UNKNOWN), m_CurrentOpResult(TRUE), m_TaskIdBinded(TASK_ID_INVALID), m_CallerNum(_T("")), m_CalleeNum(_T("")), m_RecordFile(_T(""))
- {
- }
- /*****************************************************************
- **【函数名称】 __reportLineStatus
- **【函数功能】 统计线路状态变化
- **【参数】
- **【返回值】
- ****************************************************************/
- void CLogicLine::_reportLineStatus( void )
- {
- if(m_CallId == 0 || m_HoldCallId != 0) return;
- // 状态变化统计
- T_EvtStateChanged repInfo;
- memset(&repInfo, 0, sizeof(repInfo));
- repInfo.nLineState = m_LineStatus; // 状态
- repInfo.nAgentId = getAgentNum(); // 工号
- lstrcpy(repInfo.szCallerNum, m_CallerNum); // 被叫
- lstrcpy(repInfo.szFileName, m_RecordFile); // 录音文件
- CStatisticsMgr::GetInstance().onCallDetail(m_CallId, REP_EVENT_STATE_CHANGED, m_LineId, &repInfo);
- }
- /*****************************************************************
- **【函数名称】 setRecordFile
- **【函数功能】 设置坐席录音文件名,录音文件名在挂机前不能被修改
- **【参数】 strFileName: 录音文件名
- **【返回值】
- ****************************************************************/
- void CLogicLine::setRecordFile( const CString& strFileName )
- {
- if(m_RecordFile == "" && strFileName != "")
- {
- // 设置录音文件名,并向坐席发送
- m_RecordFile = strFileName;
- pushRecord2ACD();
- }
- // 统计 REP_EVENT_REC_BEGIN
- T_EvtRecBegin repInfo;
- memset(&repInfo, 0, sizeof(repInfo));
- lstrcpy(repInfo.szFileName, m_RecordFile);
- CStatisticsMgr::GetInstance().onCallDetail(m_CallId, REP_EVENT_REC_BEGIN, m_LineId, &repInfo);
- }
- /*****************************************************************
- **【函数名称】 resetLine
- **【函数功能】 线路重置
- **【参数】
- **【返回值】
- ****************************************************************/
- void CLogicLine::resetLine()
- {
- // 清除线路信息
- m_CallId = 0;
- m_RecordFile = _T("");
- m_CallerNum = _T("");
- m_CalleeNum = _T("");
- m_CurrentOpType = PDU_CMD_UNKNOWN;
- }
- /*****************************************************************
- **【函数名称】 assoLine
- **【函数功能】 获取对端线路指针
- **【参数】
- **【返回值】 对端线路指针
- ****************************************************************/
- CLogicLine* CLogicLine::assoLine()
- {
- CCallSession* pSession = CSessionHolder::GetInstance().findSession(m_CallId);
- if(pSession == NULL)
- return NULL;
- return pSession->getAssoLine(this);
- }
|