| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- #include "StdAfx.h"
- #include "LineAudio.h"
- #include "Config.h"
- #include "LineOpImplement.h"
- CLineAudio::CLineAudio(int LineId) : CLine(LineId), m_pDevFax(NULL)
- {
- m_IPOLineID = CConfig::getAssoIpoLineIdOfAudioLine(LineId);
- ILogger::getInstance().log(LOG_CLASS_BUSI, LOG_LEVEL_NORMAL, _T("{Line}: 初始化放音线路, LineId = %d, IPOLineId = %d"), m_LineID, m_IPOLineID);
- }
- CLineAudio::~CLineAudio(void)
- {
- }
- /*****************************************************************
- **【函数名称】 procDevMsg
- **【函数功能】 底层事件响应处理
- **【参数】 pMsgInfo: 事件信息结构体
- **【返回值】
- ****************************************************************/
- void CLineAudio::procDevMsg( PSSM_EVENT pEvent )
- {
- switch(pEvent->wEventCode)
- {
- case E_PROC_RecordEnd: //录音完成或者留言完成事件
- CLineOpImplement::GetInstance().onMsgReturnRecord(this);
- break;
- case E_CHG_ChState: //状态事件
- CLineOpImplement::GetInstance().onMsgPlayState(this, SsmGetChState(pEvent->nReference));
- break;
- case E_PROC_PlayEnd: //放音结束
- CLineOpImplement::GetInstance().onMsgReturnPlay(this);
- break;
- case E_PROC_WaitDTMF: //DTMF结束
- CLineOpImplement::GetInstance().onMsgReturnDTMF(this); //收到收不到都要返回
- break;
- case E_CHG_FaxPages:
- case E_PROC_FaxEnd:
- CLineOpImplement::GetInstance().onMsgReturnFax(this, pEvent->dwParam);
- break;
- case E_CHG_BusyTone: //忙音
- break;
- }
- }
- /*****************************************************************
- **【函数名称】 procCmd
- **【函数功能】 线路命令处理
- **【参数】 pPduEntity: 线路命令指针
- **【返回值】
- ****************************************************************/
- void CLineAudio::procCmd( CPduEntity* pPduEntity )
- {
- switch(pPduEntity->GetCmdType())
- {
- case PDU_CMD_IVR_PLAY_DTMF: //处理放音命令
- CLineOpImplement::GetInstance().onCmdLinePlay(this, pPduEntity);
- break;
-
- case PDU_CMD_CTI_VS_LINECONTROL: //处理线路控制命令
- CLineOpImplement::GetInstance().onCmdLinePlayControl(this, pPduEntity);
- break;
-
- case PDU_CMD_IVR_FAX: //传真
- CLineOpImplement::GetInstance().onCmdFax(this, pPduEntity);
- break;
-
- case PDU_CMD_IVR_LEAVE_WORD: //留言
- CLineOpImplement::GetInstance().onCmdLeaveWord(this, pPduEntity);
- break;
- }
- }
- /*****************************************************************
- **【函数名称】 getState
- **【函数功能】 获取状态字符串
- **【参数】
- **【返回值】
- ****************************************************************/
- LPCTSTR CLineAudio::getState( void ) const
- {
- switch(m_State)
- {
- case S_CALL_STANDBY: return _T("空闲");
- case S_CALL_PICKUPED: return _T("摘机");
- case S_CALL_RINGING: return _T("振铃");
- case S_CALL_TALKING: return _T("通话");
- case S_CALL_OFFLINE: return _T("断开");
- case S_CALL_ANALOG_WAITDIALTONE: return _T("等待拨号");
- case S_CALL_ANALOG_TXPHONUM: return _T("拨号");
- default: return _T("未知状态");
- }
- }
|