📄 monitorchannel.cpp
字号:
// MonitorChannel.cpp: implementation of the CMonitorChannel class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "PhoneRec.h"
#include "MonitorChannel.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CMonitorChannel::CMonitorChannel( int lineID, CPhonic* pCtrl ) : CChannel(lineID, pCtrl )
{
m_bIsRecording = FALSE;
m_pRecordObject = new CRecordObject( lineID , "");
SetVoiceCoder( _DEF_VOICE_CODER );
}
CMonitorChannel::~CMonitorChannel()
{
}
void CMonitorChannel::OnCallIn(char * callerID, char * phoneNum)
{
CChannel::OnCallIn( callerID, phoneNum);
SetDeviceTimer(60*1000);
}
void CMonitorChannel::OnAnswer()
{
CChannel::OnAnswer();
m_strDTMF.Empty();
ClearDeviceTimer();
if( !m_bRecordEnable )
{
m_pRecordObject->m_startDate = CTime::GetCurrentTime();
m_pRecordObject->m_StartTime = m_pRecordObject->m_startDate;
SetVoiceCoder(_DEF_VOICE_CODER);
m_pRecordObject->InitRecord();
CheckCreateDir( m_pRecordObject->GetFilePath() );
RecordFile( m_pRecordObject->GetFileName(), -1, 0) ;
}
ShowChannelState();
}
void CMonitorChannel::OnHangup(int cause)
{
Hangup();
}
void CMonitorChannel::OnDTMF(char dtmf)
{
CChannel::OnDTMF(dtmf);
//按键*启动录音
if( dtmf == '*' )
{
m_bIsRecording = TRUE;
}
//按键#关闭录音
if( dtmf == '#')
{
m_bIsRecording = FALSE;
}
}
void CMonitorChannel::OnRecordEnd(int completeSize)
{
}
void CMonitorChannel::OnRing()
{
// m_strTask = "Ring";
}
void CMonitorChannel::OnHanging()
{
Hangup();
}
int CMonitorChannel::Hangup()
{
StopRecord();
if( m_pRecordObject )
{
m_pRecordObject->m_strCallerID = m_strCallerID;
m_pRecordObject->m_strDTMF = m_strDTMF;
m_pRecordObject->SetPhoneEndTime();
m_pRecordObject->InsertRedataTodb( );
m_strDTMF.Empty();
m_strCallerID.Empty();
}
return CChannel::Hangup();
}
void CMonitorChannel::OnDeviceTimer()
{
// Hangup();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -