|
|
@@ -16,15 +16,7 @@
|
|
|
#include "../mod_sipphone/SIPPhone_client_g.h"
|
|
|
#include "../mod_sipphone/SIPPhone_def_g.h"
|
|
|
using namespace SIPPhone;
|
|
|
-
|
|
|
-#define LOG_EVT_SELFCHECK_ASSISTANTCHANNEL_IDLE 0x50500001 //协助通道重启
|
|
|
-#define LOG_EVT_SELFCHECK_LOCALMEDIAPLAY_IDLE 0x50500006 //本地播放重启
|
|
|
-
|
|
|
-#define LOG_EVT_START_CONTINURECORD 0x21A00001 //开始全程录像(self)
|
|
|
-#define LOG_EVT_STOP_CONTINURECORD 0x21A00002 //停止全程录像(self)
|
|
|
-#define LOG_EVT_CONTINURECORD_FAILED 0x21A00003 //全程录像失败
|
|
|
-
|
|
|
-#define LOG_EVT_AUDIOSTREAM_TRANSMISSION_FAILED 0x31600001
|
|
|
+
|
|
|
|
|
|
#define SYSVAR_CALLTYPE "CallType"
|
|
|
#define CALLTYPE_NORMAL 'N' // 呼叫类型,普通模式
|
|
|
@@ -167,15 +159,15 @@ DeviceTypeEnum CITCtrlEntity::RvcGetDeviceType()
|
|
|
CSmartPointer<IEntityFunction> spFunction = GetFunction();
|
|
|
CSystemStaticInfo stStaticinfo;
|
|
|
spFunction->GetSystemStaticInfo(stStaticinfo);
|
|
|
- if (stricmp(stStaticinfo.strMachineType, "RVC.PAD") == 0) {
|
|
|
- if (stricmp(stStaticinfo.strSite, "CMB.FLB") == 0) {
|
|
|
+ if (_stricmp(stStaticinfo.strMachineType, "RVC.PAD") == 0) {
|
|
|
+ if (_stricmp(stStaticinfo.strSite, "CMB.FLB") == 0) {
|
|
|
eType = eMobilePadType;
|
|
|
}
|
|
|
else {
|
|
|
eType = ePadtype;
|
|
|
}
|
|
|
}
|
|
|
- else if (stricmp(stStaticinfo.strMachineType, "RVC.Desk2S") == 0) {
|
|
|
+ else if (_stricmp(stStaticinfo.strMachineType, "RVC.Desk2S") == 0) {
|
|
|
eType = eDesk2SType;
|
|
|
WORD nMajor = stStaticinfo.MachineVersion.GetMajor();
|
|
|
WORD nMinor = stStaticinfo.MachineVersion.GetMinor();
|
|
|
@@ -184,10 +176,10 @@ DeviceTypeEnum CITCtrlEntity::RvcGetDeviceType()
|
|
|
eType = eDesk2SIntegratedType;
|
|
|
}
|
|
|
}
|
|
|
- else if (stricmp(stStaticinfo.strMachineType, "RPM.Stand1S") == 0) {
|
|
|
+ else if (_stricmp(stStaticinfo.strMachineType, "RPM.Stand1S") == 0) {
|
|
|
eType = eRpm1sType;
|
|
|
}
|
|
|
- else if (stricmp(stStaticinfo.strMachineType, "RVC.Desk1S") == 0) {
|
|
|
+ else if (_stricmp(stStaticinfo.strMachineType, "RVC.Desk1S") == 0) {
|
|
|
eType = eDesk1SType;
|
|
|
}
|
|
|
else {
|
|
|
@@ -203,9 +195,10 @@ DeviceTypeEnum CITCtrlEntity::RvcGetDeviceType()
|
|
|
|
|
|
ErrorCodeEnum CITCtrlEntity::__OnStart(ErrorCodeEnum preOperationError)
|
|
|
{
|
|
|
- if (preOperationError != Error_Succeed)
|
|
|
+ if (preOperationError != Error_Succeed) {
|
|
|
return preOperationError;
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
CSmartPointer<IEntityFunction> pFunc = GetFunction();
|
|
|
|
|
|
auto Error = pFunc->RegistSysVarEvent("CustomerHandle", this);
|
|
|
@@ -217,21 +210,21 @@ ErrorCodeEnum CITCtrlEntity::__OnStart(ErrorCodeEnum preOperationError)
|
|
|
if (Error != Error_Succeed){
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("register sysvar %s failed!", "SessionID");
|
|
|
}
|
|
|
+
|
|
|
m_nSysCallType = 0;
|
|
|
- {
|
|
|
- CSmartPointer<IEntityFunction> Func = GetFunction();
|
|
|
- CSimpleStringA strValue;
|
|
|
- Func->RegistSysVarEvent(SYSVAR_CALLTYPE, this);
|
|
|
- Func->GetSysVar(SYSVAR_CALLTYPE, strValue);
|
|
|
- if (strValue[0] == CALLTYPE_NORMAL){
|
|
|
- m_nSysCallType = 0;
|
|
|
- }
|
|
|
- else if (strValue[0] == CALLTYPE_MOBILE){
|
|
|
- m_nSysCallType = 1;
|
|
|
- }
|
|
|
- else{
|
|
|
- assert(0);
|
|
|
- }
|
|
|
+
|
|
|
+ CSmartPointer<IEntityFunction> Func = GetFunction();
|
|
|
+ CSimpleStringA strValue;
|
|
|
+ Func->RegistSysVarEvent(SYSVAR_CALLTYPE, this);
|
|
|
+ Func->GetSysVar(SYSVAR_CALLTYPE, strValue);
|
|
|
+ if (strValue[0] == CALLTYPE_NORMAL){
|
|
|
+ m_nSysCallType = 0;
|
|
|
+ }
|
|
|
+ else if (strValue[0] == CALLTYPE_MOBILE){
|
|
|
+ m_nSysCallType = 1;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ assert(0);
|
|
|
}
|
|
|
|
|
|
m_eDeviceType = RvcGetDeviceType();
|
|
|
@@ -263,35 +256,22 @@ ErrorCodeEnum CITCtrlEntity::__OnStart(ErrorCodeEnum preOperationError)
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("AdvOnFlag:[%s]", m_bAdvOnFlag ? "true" : "false");
|
|
|
}
|
|
|
|
|
|
- if (!(eMobilePadType==m_eDeviceType|| IsSurpportContinuRecordType()))
|
|
|
- {
|
|
|
- int i = 0;
|
|
|
- m_arrListener.Init(4);
|
|
|
-
|
|
|
- pFunc->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, 0x40100002, "IEBrowser");
|
|
|
- pFunc->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, 0x40100003, "IEBrowser");
|
|
|
- pFunc->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_SELFCHECK_ASSISTANTCHANNEL_IDLE,NULL,false);
|
|
|
- pFunc->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_SELFCHECK_LOCALMEDIAPLAY_IDLE, NULL, false);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- int i = 0;
|
|
|
- m_arrListener.Init(5);
|
|
|
-
|
|
|
- pFunc->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, 0x40100002, "IEBrowser");
|
|
|
- pFunc->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, 0x40100003, "IEBrowser");
|
|
|
- pFunc->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_SELFCHECK_ASSISTANTCHANNEL_IDLE,NULL,false);
|
|
|
- pFunc->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_SELFCHECK_LOCALMEDIAPLAY_IDLE, NULL, false);
|
|
|
- pFunc->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_CONTINURECORD_FAILED, NULL, false);
|
|
|
- }
|
|
|
+ int i = 0;
|
|
|
+ m_arrListener.Init(5);
|
|
|
+ pFunc->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, 0x40100002, "IEBrowser");
|
|
|
+ pFunc->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, 0x40100003, "IEBrowser");
|
|
|
+ pFunc->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_MOD_ASSISCHAN_STARTED_SUCCESS,NULL,false);
|
|
|
+ pFunc->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_MOD_LOCALPLAYER_STARTED_SUCCESS, NULL, false);
|
|
|
+ pFunc->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_MOD_SALESRECORDER_STARTED_SUCCESS, NULL, false);
|
|
|
|
|
|
return Error_Succeed;
|
|
|
}
|
|
|
|
|
|
ErrorCodeEnum CITCtrlEntity::__OnClose(ErrorCodeEnum preOperationError)
|
|
|
{
|
|
|
- if (preOperationError != Error_Succeed)
|
|
|
+ if (preOperationError != Error_Succeed){
|
|
|
return preOperationError;
|
|
|
+ }
|
|
|
|
|
|
CSmartPointer<IEntityFunction> pFunc = GetFunction();
|
|
|
pFunc->UnregistSysVarEvent("UIState");
|
|
|
@@ -442,7 +422,6 @@ void CITCtrlEntity::OnSysVarEvent(const char *pszKey, const char *pszValue,const
|
|
|
{
|
|
|
if (pszValue[0] != 'N' && pszValue[0] != 'I')
|
|
|
{
|
|
|
- // 低柜双屏版双录时不报内置摄像头故障 add by ly@2018/10
|
|
|
if ((eDesk2SType != m_eDeviceType && eDesk1SType != m_eDeviceType && eDesk2SIntegratedType != m_eDeviceType) || m_bSalesRecording == FALSE)
|
|
|
{
|
|
|
CameraFaultOccurred evt;
|
|
|
@@ -510,8 +489,14 @@ void CITCtrlEntity::OnSysVarEvent(const char *pszKey, const char *pszValue,const
|
|
|
|
|
|
void CITCtrlEntity::SyncMenuTree(int tree, int path)
|
|
|
{
|
|
|
- if (!m_bConnected)
|
|
|
+ if (NULL == m_pChannelClient){
|
|
|
return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!m_bConnected){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (tree)
|
|
|
{
|
|
|
if (m_strMenuTree.GetLength() > 0)
|
|
|
@@ -575,6 +560,10 @@ void CITCtrlEntity::SyncMenuTree(int tree, int path)
|
|
|
|
|
|
ErrorCodeEnum CITCtrlEntity::SendAgentText(CSimpleStringW strText)
|
|
|
{
|
|
|
+ if (NULL == m_pChannelClient){
|
|
|
+ return Error_Param;
|
|
|
+ }
|
|
|
+
|
|
|
if (m_nSysCallType == 0)
|
|
|
{
|
|
|
SpBuffer buf;
|
|
|
@@ -616,6 +605,10 @@ void CITCtrlEntity::SetMenuTreePath(CSimpleStringW strMenuPath)
|
|
|
|
|
|
ErrorCodeEnum CITCtrlEntity::SendFrontSyncData(int id, CSimpleStringW strContent)
|
|
|
{
|
|
|
+ if (NULL == m_pChannelClient){
|
|
|
+ return Error_Param;
|
|
|
+ }
|
|
|
+
|
|
|
if (m_nSysCallType == 0)
|
|
|
{
|
|
|
SpBuffer buf;
|
|
|
@@ -645,6 +638,10 @@ ErrorCodeEnum CITCtrlEntity::SendFrontSyncData(int id, CSimpleStringW strContent
|
|
|
|
|
|
ErrorCodeEnum CITCtrlEntity::SendH5SyncData(CSimpleStringW strContent)
|
|
|
{
|
|
|
+ if (NULL == m_pChannelClient){
|
|
|
+ return Error_Param;
|
|
|
+ }
|
|
|
+
|
|
|
if (m_nSysCallType == 0)
|
|
|
{
|
|
|
SpBuffer buf;
|
|
|
@@ -811,6 +808,10 @@ void CITCtrlEntity::OnReceivePacket(int type,int sub_type, const char *data, int
|
|
|
|
|
|
void CITCtrlEntity::SendAnswer(int sub_type, ErrorCodeEnum Error)
|
|
|
{
|
|
|
+ if (NULL == m_pChannelClient){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (m_nSysCallType == 0)
|
|
|
{
|
|
|
SpBuffer buf;
|
|
|
@@ -833,6 +834,10 @@ void CITCtrlEntity::SendAnswer(int sub_type, ErrorCodeEnum Error)
|
|
|
|
|
|
void CITCtrlEntity::SendAnswertoMobile(CSimpleStringW packet)
|
|
|
{
|
|
|
+ if (NULL == m_pChannelClient){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
SpBuffer buf;
|
|
|
buf.OpenWrite();
|
|
|
CSimpleString16Bit convertedData = CSimpleStringW216Bit(packet);
|
|
|
@@ -864,19 +869,6 @@ ErrorCodeEnum CITCtrlEntity::StartPlayVideo(int nCfgInx, int nWndX, int nWndY, i
|
|
|
return error;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-ErrorCodeEnum CITCtrlEntity::StartPlayNotice(int nCfgInx, int nWndX, int nWndY, int nWndWidth, int nWndHeight, CSimpleStringW VideoName, DWORD dwTimeout)
|
|
|
-{
|
|
|
- PlayService_StartPlayNotice_Req Req;
|
|
|
- Req.CfgInx = nCfgInx;
|
|
|
- Req.WndX = nWndX;
|
|
|
- Req.WndY = nWndY;
|
|
|
- Req.WndWidth = nWndWidth;
|
|
|
- Req.WndHeight = nWndHeight;
|
|
|
- Req.VideoName = VideoName;
|
|
|
- CSmartPointer<IAsynWaitSp> spAsyncWait;
|
|
|
- return m_pPlayClient->StartPlayNotice(Req, spAsyncWait, dwTimeout);
|
|
|
-}
|
|
|
|
|
|
ErrorCodeEnum CITCtrlEntity::StartPlayAudio(CSimpleStringW AudioNames, DWORD dwTimeout)
|
|
|
{
|
|
|
@@ -923,14 +915,7 @@ ErrorCodeEnum CITCtrlEntity::StopPlayVideo(int nCfgInx, DWORD dwTimeout)
|
|
|
return error;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-ErrorCodeEnum CITCtrlEntity::StopPlayNotice(int nCfgInx, DWORD dwTimeout)
|
|
|
-{
|
|
|
- PlayService_StopPlayNotice_Req Req;
|
|
|
- Req.CfgInx = nCfgInx;
|
|
|
- CSmartPointer<IAsynWaitSp> spAsyncWait;
|
|
|
- return m_pPlayClient->StopPlayNotice(Req, spAsyncWait, dwTimeout);
|
|
|
-}
|
|
|
+
|
|
|
|
|
|
ErrorCodeEnum CITCtrlEntity::StopPlayAudio(DWORD dwTimeout)
|
|
|
{
|
|
|
@@ -1165,107 +1150,96 @@ ErrorCodeEnum CITCtrlEntity::SetPickupCallOutVolume(int nVolume, DWORD dwTimeout
|
|
|
|
|
|
return rc;
|
|
|
}
|
|
|
- void CITCtrlEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const LogTypeEnum eLogType, const SeverityLevelEnum eLevel,
|
|
|
- const DWORD dwSysError,const DWORD dwUserCode,const DWORD dwEntityInstanceID, const WORD wEntityDevelID,
|
|
|
- const CAutoArray<DWORD> &Param, const char *pszEntityName, const char *pszModuleName,const char *pszMessage, const linkContext& pLinkInfo)
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("user_code = %08x", dwUserCode);
|
|
|
- switch (dwUserCode) {
|
|
|
- case 0x40100002: // AgentInputState_Writing
|
|
|
- {
|
|
|
- AgentInputState evt;
|
|
|
- evt.state = eAgentInputState_Writing;
|
|
|
- SpSendBroadcast(GetFunction(), SP_MSG_OF(AgentInputState), SP_MSG_SIG_OF(AgentInputState), evt);
|
|
|
- }
|
|
|
- break;
|
|
|
- case 0x40100003: // AgentInputState_Idle
|
|
|
- {
|
|
|
- AgentInputState evt;
|
|
|
- evt.state = eAgentInputState_Idle;
|
|
|
- SpSendBroadcast(GetFunction(), SP_MSG_OF(AgentInputState), SP_MSG_SIG_OF(AgentInputState), evt);
|
|
|
- }
|
|
|
- break;
|
|
|
|
|
|
- case LOG_EVT_SELFCHECK_ASSISTANTCHANNEL_IDLE:
|
|
|
+void CITCtrlEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const LogTypeEnum eLogType, const SeverityLevelEnum eLevel,
|
|
|
+ const DWORD dwSysError,const DWORD dwUserCode,const DWORD dwEntityInstanceID, const WORD wEntityDevelID,
|
|
|
+ const CAutoArray<DWORD> &Param, const char *pszEntityName, const char *pszModuleName,const char *pszMessage, const linkContext &pLinkInfo)
|
|
|
+{
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("user_code = 0x%08x", dwUserCode);
|
|
|
+ switch (dwUserCode) {
|
|
|
+ case 0x40100002: // AgentInputState_Writing
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_SELFCHECK_ASSISTANTCHANNEL_IDLE");
|
|
|
- if (m_pChannelClient!=NULL)
|
|
|
- {
|
|
|
+ AgentInputState evt;
|
|
|
+ evt.state = eAgentInputState_Writing;
|
|
|
+ SpSendBroadcast(GetFunction(), SP_MSG_OF(AgentInputState), SP_MSG_SIG_OF(AgentInputState), evt);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 0x40100003: // AgentInputState_Idle
|
|
|
+ {
|
|
|
+ AgentInputState evt;
|
|
|
+ evt.state = eAgentInputState_Idle;
|
|
|
+ SpSendBroadcast(GetFunction(), SP_MSG_OF(AgentInputState), SP_MSG_SIG_OF(AgentInputState), evt);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case LOG_EVT_MOD_ASSISCHAN_STARTED_SUCCESS:
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_MOD_ASSISCHAN_STARTED_SUCCESS");
|
|
|
+ Sleep(310);
|
|
|
+ if (m_pChannelClient!=NULL){
|
|
|
m_pChannelClient->GetFunction()->CloseSession();
|
|
|
m_pChannelClient = NULL;
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Close AssistChannel Session ");
|
|
|
+ m_bConnectAssist = FALSE;
|
|
|
}
|
|
|
|
|
|
- if (m_pChannelClient == NULL)
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ReConnection AssistChannel Session");
|
|
|
- m_pChannelClient = new ChannelClient(this);
|
|
|
- ErrorCodeEnum Error = m_pChannelClient->Connect();
|
|
|
- if (Error != Error_Succeed)
|
|
|
- {
|
|
|
- m_pChannelClient->SafeDelete();
|
|
|
- m_pChannelClient = NULL;
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_pChannelClient connect fail!");
|
|
|
- }
|
|
|
-
|
|
|
- if (Error == Error_Succeed)
|
|
|
- {
|
|
|
- ChannelService_BeginRecv_Sub Sub;
|
|
|
- Sub.type = ACM_TYPE_IM;
|
|
|
- Error = m_pChannelClient->BeginRecv(Sub);
|
|
|
- if (Error != Error_Succeed)
|
|
|
- {
|
|
|
- m_pChannelClient->GetFunction()->CloseSession();
|
|
|
- m_pChannelClient = NULL;
|
|
|
- }
|
|
|
- Sub.type = ACM_TYPE_FLW;
|
|
|
- Error = m_pChannelClient->BeginRecv(Sub);
|
|
|
- if (Error != Error_Succeed)
|
|
|
- {
|
|
|
- m_pChannelClient->GetFunction()->CloseSession();
|
|
|
- m_pChannelClient = NULL;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(Error == Error_Succeed)
|
|
|
- {
|
|
|
- ChannelService_BeginState_Sub Sub1;
|
|
|
- Error = m_pChannelClient->BeginState(Sub1);
|
|
|
- if (Error != Error_Succeed)
|
|
|
- {
|
|
|
- m_pChannelClient->GetFunction()->CloseSession();
|
|
|
- m_pChannelClient = NULL;
|
|
|
- }
|
|
|
- }
|
|
|
+ if (Error_Succeed == ConnectAssistChannel()) {
|
|
|
+ m_bConnectAssist = TRUE;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start timer for reconnect to assist channel.");
|
|
|
+ GetFunction()->SetTimer(1, this, 3370);
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
- case LOG_EVT_SELFCHECK_LOCALMEDIAPLAY_IDLE:
|
|
|
+ case LOG_EVT_MOD_LOCALPLAYER_STARTED_SUCCESS:
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_SELFCHECK_LOCALMEDIAPLAY_IDLE");
|
|
|
- if (m_pPlayClient!=NULL)
|
|
|
- {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_MOD_LOCALPLAYER_STARTED_SUCCESS.");
|
|
|
+ Sleep(300);
|
|
|
+ if (m_pPlayClient!=NULL){
|
|
|
m_pPlayClient->GetFunction()->CloseSession();
|
|
|
m_pPlayClient = NULL;
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Close AssistChannel Session ");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Close AssistChannel Session.");
|
|
|
}
|
|
|
|
|
|
- if (m_pPlayClient == NULL)
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ReConnection LocalPlay Session");
|
|
|
+ if (m_pPlayClient == NULL){
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ReConnection LocalPlay Session.");
|
|
|
m_pPlayClient = new LocalPlayClient(this);
|
|
|
ErrorCodeEnum Error = m_pPlayClient->Connect();
|
|
|
if (Error != Error_Succeed)
|
|
|
{
|
|
|
- m_pPlayClient->SafeDelete();
|
|
|
+ m_pPlayClient = NULL;
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_pPlayClient connect fail!");
|
|
|
}
|
|
|
+ else {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_pPlayClient connect Success!");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
- case LOG_EVT_CONTINURECORD_FAILED:
|
|
|
+ case LOG_EVT_MOD_SALESRECORDER_STARTED_SUCCESS:
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_CONTINURECORD_FAILED");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_MOD_SALESRECORDER_STARTED_SUCCESS.");
|
|
|
+ Sleep(350);
|
|
|
+ if (m_pSalesRecordClient != NULL) {
|
|
|
+ m_pSalesRecordClient->GetFunction()->CloseSession();
|
|
|
+ m_pSalesRecordClient = NULL;
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Close Sales Record Session.");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (m_pSalesRecordClient == NULL) {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ReConnection Sales Record Session.");
|
|
|
+ m_pSalesRecordClient = new SalesRecordClient(this);
|
|
|
+ ErrorCodeEnum Error = m_pSalesRecordClient->Connect();
|
|
|
+ if (Error != Error_Succeed)
|
|
|
+ {
|
|
|
+ m_pSalesRecordClient = NULL;
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_pSalesRecordClient connect fail!");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_pSalesRecordClient connect Success!");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
default:
|
|
|
@@ -1540,17 +1514,93 @@ CSimpleStringA CITCtrlEntity::EncryptVideoNameCarNumber(CSimpleStringA StrVideoN
|
|
|
}
|
|
|
|
|
|
|
|
|
-ErrorCodeEnum CITCtrlEntity::ConnectToLocalPlay()
|
|
|
+ErrorCodeEnum CITCtrlEntity::ConnectAssistChannel()
|
|
|
+{
|
|
|
+ if (NULL == m_pChannelClient){
|
|
|
+ m_pChannelClient = new ChannelClient(this);
|
|
|
+ }
|
|
|
+
|
|
|
+ ErrorCodeEnum Error = m_pChannelClient->Connect();
|
|
|
+ if (Error != Error_Succeed) {
|
|
|
+ m_pChannelClient = NULL;
|
|
|
+ return Error;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ChannelClient Connect Success!");
|
|
|
+ }
|
|
|
+
|
|
|
+ ChannelService_BeginRecv_Sub Sub;
|
|
|
+ Sub.type = ACM_TYPE_IM;
|
|
|
+ Error = m_pChannelClient->BeginRecv(Sub);
|
|
|
+ if (Error != Error_Succeed) {
|
|
|
+ m_pChannelClient->GetFunction()->CloseSession();
|
|
|
+ m_pChannelClient = NULL;
|
|
|
+ return Error;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("BeginRecv ACM_TYPE_IM Success!");
|
|
|
+ }
|
|
|
+
|
|
|
+ Sub.type = ACM_TYPE_FLW;
|
|
|
+ Error = m_pChannelClient->BeginRecv(Sub);
|
|
|
+ if (Error != Error_Succeed) {
|
|
|
+ m_pChannelClient->GetFunction()->CloseSession();
|
|
|
+ m_pChannelClient = NULL;
|
|
|
+ return Error;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("BeginRecv ACM_TYPE_FLW Success!");
|
|
|
+ }
|
|
|
+
|
|
|
+ Sub.type = ACM_TYPE_DEVICE;
|
|
|
+ Error = m_pChannelClient->BeginRecv(Sub);
|
|
|
+ if (Error != Error_Succeed) {
|
|
|
+ m_pChannelClient->GetFunction()->CloseSession();
|
|
|
+ m_pChannelClient = NULL;
|
|
|
+ return Error;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("BeginRecv ACM_TYPE_DEVICE Success!");
|
|
|
+ }
|
|
|
+
|
|
|
+ Sub.type = ACM_TYPE_H5_SYNC;
|
|
|
+ Error = m_pChannelClient->BeginRecv(Sub);
|
|
|
+ if (Error != Error_Succeed) {
|
|
|
+ m_pChannelClient->GetFunction()->CloseSession();
|
|
|
+ m_pChannelClient = NULL;
|
|
|
+ return Error;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("BeginRecv ACM_TYPE_H5_SYNC Success!");
|
|
|
+ }
|
|
|
+
|
|
|
+ ChannelService_BeginState_Sub Sub1;
|
|
|
+ Error = m_pChannelClient->BeginState(Sub1);
|
|
|
+ if (Error != Error_Succeed) {
|
|
|
+ m_pChannelClient->GetFunction()->CloseSession();
|
|
|
+ m_pChannelClient = NULL;
|
|
|
+ return Error;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ChannelService_BeginState_Sub Success!");
|
|
|
+ }
|
|
|
+
|
|
|
+ return Error;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+ErrorCodeEnum CITCtrlEntity::ConnectToLocalPlay(bool blogevt)
|
|
|
{
|
|
|
if (!IsLocalPlayConnectSessionOK()) {
|
|
|
FreeLocalPlayClient();
|
|
|
m_pPlayClient = new LocalPlayClient(this);
|
|
|
ErrorCodeEnum erroCode = m_pPlayClient->Connect();
|
|
|
if (FAILURED(erroCode)){
|
|
|
- m_pPlayClient->SafeDelete();
|
|
|
m_pPlayClient = NULL;
|
|
|
- LogWarn(Severity_Middle, Error_InvalidState, LOG_EVT_CONNECT_LOCALPLAY_FAILED,
|
|
|
- CSimpleStringA::Format("Connect to localplayer entity failed:0x%X", erroCode));
|
|
|
+ if (blogevt) {
|
|
|
+ LogWarn(Severity_Middle, Error_InvalidState, LOG_EVT_CONNECT_LOCALPLAY_FAILED,
|
|
|
+ CSimpleStringA::Format("Connect to localplayer entity failed:0x%X", erroCode));
|
|
|
+ }
|
|
|
return Error_InvalidState;
|
|
|
}
|
|
|
}
|
|
|
@@ -1559,18 +1609,18 @@ ErrorCodeEnum CITCtrlEntity::ConnectToLocalPlay()
|
|
|
}
|
|
|
|
|
|
|
|
|
-ErrorCodeEnum CITCtrlEntity::ConnectToSalesRecord()
|
|
|
+ErrorCodeEnum CITCtrlEntity::ConnectToSalesRecord(bool blogevt)
|
|
|
{
|
|
|
if (!IsSalesRecordConnectSessionOK()) {
|
|
|
FreeSalesRecordClient();
|
|
|
m_pSalesRecordClient = new SalesRecordClient(this);
|
|
|
ErrorCodeEnum erroCode = m_pSalesRecordClient->Connect();
|
|
|
- if (FAILURED(erroCode))
|
|
|
- {
|
|
|
- m_pSalesRecordClient->SafeDelete();
|
|
|
+ if (FAILURED(erroCode)){
|
|
|
m_pSalesRecordClient = NULL;
|
|
|
- LogWarn(Severity_Middle, Error_InvalidState, LOG_EVT_CONNECT_SAELSRECORD_FAILED,
|
|
|
- CSimpleStringA::Format("Connect to sales record entity failed:0x%X", erroCode));
|
|
|
+ if (blogevt) {
|
|
|
+ LogWarn(Severity_Middle, Error_InvalidState, LOG_EVT_CONNECT_SAELSRECORD_FAILED,
|
|
|
+ CSimpleStringA::Format("Connect to sales record entity failed:0x%X", erroCode));
|
|
|
+ }
|
|
|
return Error_InvalidState;
|
|
|
}
|
|
|
}
|
|
|
@@ -1591,8 +1641,7 @@ bool CITCtrlEntity::IsSalesRecordConnectSessionOK()
|
|
|
|
|
|
void CITCtrlEntity::FreeLocalPlayClient()
|
|
|
{
|
|
|
- if (m_pPlayClient)
|
|
|
- {
|
|
|
+ if (m_pPlayClient){
|
|
|
m_pPlayClient->GetFunction()->CloseSession();
|
|
|
m_pPlayClient = NULL;
|
|
|
}
|
|
|
@@ -1601,8 +1650,7 @@ void CITCtrlEntity::FreeLocalPlayClient()
|
|
|
|
|
|
void CITCtrlEntity::FreeSalesRecordClient()
|
|
|
{
|
|
|
- if (m_pSalesRecordClient)
|
|
|
- {
|
|
|
+ if (m_pSalesRecordClient){
|
|
|
m_pSalesRecordClient->GetFunction()->CloseSession();
|
|
|
m_pSalesRecordClient = NULL;
|
|
|
}
|
|
|
@@ -1615,6 +1663,22 @@ LocalPlayClient* CITCtrlEntity::GetLocalPlayClient()
|
|
|
}
|
|
|
|
|
|
|
|
|
+void CITCtrlEntity::OnTimeout(DWORD dwTimerID)
|
|
|
+{
|
|
|
+ if (1 == dwTimerID)
|
|
|
+ {
|
|
|
+ if (FALSE == m_bConnectAssist) {
|
|
|
+ if (Error_Succeed == ConnectAssistChannel()) {
|
|
|
+ m_bConnectAssist = TRUE;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (TRUE == m_bConnectAssist) {
|
|
|
+ GetFunction()->KillTimer(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
void UIServiceSession::Handle_SetUIState(SpOnewayCallContext<UIService_SetUIState_Info>::Pointer ctx)
|
|
|
{
|
|
|
|
|
|
@@ -1771,35 +1835,6 @@ void UIServiceSession::Handle_SendOperateState(SpOnewayCallContext<UIService_Sen
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("UI send operate state!");
|
|
|
}
|
|
|
|
|
|
-void UIServiceSession::Handle_CheckContinuRecord( SpReqAnsContext<UIService_CheckContinuRecord_Req, UIService_CheckContinuRecord_Ans>::Pointer ctx )
|
|
|
-{
|
|
|
- ctx->Answer(Error_Succeed);
|
|
|
-}
|
|
|
-
|
|
|
-void UIServiceSession::Handle_StartContinuRecord( SpReqAnsContext<UIService_StartContinuRecord_Req, UIService_StartContinuRecord_Ans>::Pointer ctx )
|
|
|
-{
|
|
|
- ErrorCodeEnum eCode = Error_Succeed;
|
|
|
-
|
|
|
- ctx->Answer(eCode);
|
|
|
-}
|
|
|
-
|
|
|
-void UIServiceSession::Handle_StopContinuRecord( SpReqAnsContext<UIService_StopContinuRecord_Req, UIService_StopContinuRecord_Ans>::Pointer ctx )
|
|
|
-{
|
|
|
- CSimpleStringA videoname = (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName);
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop continue record,videoname=%s",(LPCTSTR)videoname);
|
|
|
- LogEvent(Severity_Middle,LOG_EVT_UI_STOP_CONTINURECORD,(LPCTSTR)videoname);
|
|
|
- ctx->Answer(Error_Succeed);
|
|
|
-}
|
|
|
-
|
|
|
-void UIServiceSession::Handle_StartEchoContinuRecord( SpReqAnsContext<UIService_StartEchoContinuRecord_Req, UIService_StartEchoContinuRecord_Ans>::Pointer ctx )
|
|
|
-{
|
|
|
- ctx->Answer(Error_Succeed);
|
|
|
-}
|
|
|
-
|
|
|
-void UIServiceSession::Handle_StopEchoContinuRecord( SpReqAnsContext<UIService_StopEchoContinuRecord_Req, UIService_StopEchoContinuRecord_Ans>::Pointer ctx )
|
|
|
-{
|
|
|
- ctx->Answer(Error_Succeed);
|
|
|
-}
|
|
|
void UIServiceSession::Handle_HideOnlineVideo(SpOnewayCallContext<UIService_HideOnlineVideo_Info>::Pointer ctx)
|
|
|
{
|
|
|
/// override by user
|