|
@@ -181,6 +181,8 @@ public:
|
|
|
virtual void Handle_SetHandfreeOutVolume(SpReqAnsContext<UIService_SetHandfreeOutVolume_Req, UIService_SetHandfreeOutVolume_Ans>::Pointer ctx);
|
|
|
virtual void Handle_GetPickupOutVolume(SpReqAnsContext<UIService_GetPickupOutVolume_Req, UIService_GetPickupOutVolume_Ans>::Pointer ctx);
|
|
|
virtual void Handle_SetPickupOutVolume(SpReqAnsContext<UIService_SetPickupOutVolume_Req, UIService_SetPickupOutVolume_Ans>::Pointer ctx);
|
|
|
+ virtual void Handle_StartPlayNotice(SpReqAnsContext<UIService_StartPlayNotice_Req, UIService_StartPlayNotice_Ans>::Pointer ctx);
|
|
|
+ virtual void Handle_StopPlayNotice(SpReqAnsContext<UIService_StopPlayNotice_Req, UIService_StopPlayNotice_Ans>::Pointer ctx);
|
|
|
|
|
|
private:
|
|
|
CITCtrlEntity *m_pEntity;
|
|
@@ -1151,6 +1153,19 @@ public:
|
|
|
return error;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ ErrorCodeEnum 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 StartPlayAudio(CSimpleStringW AudioNames, DWORD dwTimeout)
|
|
|
{
|
|
@@ -1212,6 +1227,14 @@ public:
|
|
|
return error;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ ErrorCodeEnum StopPlayNotice(int nCfgInx, DWORD dwTimeout)
|
|
|
+ {
|
|
|
+ PlayService_StopPlayNotice_Req Req;
|
|
|
+ Req.CfgInx = nCfgInx;
|
|
|
+ CSmartPointer<IAsynWaitSp> spAsyncWait;
|
|
|
+ return m_pPlayClient->StopPlayNotice(Req, spAsyncWait, dwTimeout);
|
|
|
+ }
|
|
|
|
|
|
ErrorCodeEnum StopPlayAudio(DWORD dwTimeout)
|
|
|
{
|
|
@@ -1825,6 +1848,49 @@ public:
|
|
|
return eState;
|
|
|
}
|
|
|
|
|
|
+ CSimpleStringA EncryptString(LPCTSTR lpszText)
|
|
|
+ {
|
|
|
+ int iEncrypt=0;
|
|
|
+ int len = strlen(lpszText);
|
|
|
+ CSimpleStringA csEncrypted('\0', len*2+1);
|
|
|
+ for(int i=0; i<len; ++i) {
|
|
|
+ sprintf(&csEncrypted[i*2],"%02X", (int)((lpszText[i]) ^ (128 | (iEncrypt++ & 127))));
|
|
|
+ }
|
|
|
+ return CSimpleStringA((LPCTSTR)csEncrypted);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //隐藏录像文件信息中的卡号信息
|
|
|
+ CSimpleStringA EncryptVideoNameCarNumber(CSimpleStringA StrVideoName)
|
|
|
+ {
|
|
|
+ CSimpleStringA StrVideoInfo;
|
|
|
+
|
|
|
+ char *result[16] = {0};
|
|
|
+ auto arr1 = CSimpleStringA2W(StrVideoName).Split('@');
|
|
|
+ int iCount = arr1.GetCount();
|
|
|
+
|
|
|
+ if(iCount > 0){
|
|
|
+ auto arr2 = CAutoArray<CSimpleStringA>(iCount);
|
|
|
+ int i = 0;
|
|
|
+ for (; i < iCount; ++i){
|
|
|
+ arr2[i] = CSimpleStringW2A(arr1[i]);
|
|
|
+ if (5 != i){
|
|
|
+ if (0 != i){
|
|
|
+ StrVideoInfo += "@";
|
|
|
+ }
|
|
|
+ StrVideoInfo += arr2[i];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ StrVideoInfo += "@";
|
|
|
+ StrVideoInfo += EncryptString(const_cast<LPSTR>(arr2[i].GetData()));
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return StrVideoInfo;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
private:
|
|
|
CSimpleStringA m_SessionID;
|
|
@@ -2284,18 +2350,31 @@ void UIServiceSession::Handle_StartRemoteRecord(SpReqAnsContext<UIService_StartR
|
|
|
m_pEntity->GetFunction()->GetSysVar("CameraState",camstate);
|
|
|
Dbg("start remote record, camstate=%s, videoname=%s.",(LPCTSTR)camstate,(LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
|
|
|
if (camstate[0] == 'N') {
|
|
|
- LogEvent(Severity_Middle,LOG_EVT_UI_STARTREMOTERECORD,(LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
|
|
|
+ LogEvent(Severity_Middle,LOG_EVT_UI_STARTREMOTERECORD,(LPCTSTR)(m_pEntity->EncryptVideoNameCarNumber(CSimpleStringW2A(ctx->Req.VideoName))));
|
|
|
ctx->Ans.ErrorCode = 0;
|
|
|
ctx->Ans.ErrorMsg = CSimpleStringA2W("");
|
|
|
m_pEntity->m_bSalesRecording = TRUE;
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_EVT_START_REMOTERECORD_SUCCESS, "start remote record success!");
|
|
|
}
|
|
|
else if(camstate[0] == 'I') {
|
|
|
ctx->Ans.ErrorCode = 0x30B81001;
|
|
|
ctx->Ans.ErrorMsg = CSimpleStringA2W("录音录像设备正在启动,请稍后重试!");
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_EVT_START_REMOTERECORD_FAILED, "录音录像设备正在启动,请稍后重试!");
|
|
|
+ }
|
|
|
+ else if (camstate[0] == 'E' || camstate[0] == 'O'){
|
|
|
+ ctx->Ans.ErrorCode = 0x30B81003;
|
|
|
+ ctx->Ans.ErrorMsg = CSimpleStringA2W("摄像头故障,请联系分行技术部!");
|
|
|
+ if ('E' == camstate[0]){
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_EVT_START_REMOTERECORD_FAILED, "env 摄像头故障,启动远程双录失败");
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_EVT_START_REMOTERECORD_FAILED, "opt 摄像头故障,启动远程双录失败");
|
|
|
+ }
|
|
|
}
|
|
|
else {
|
|
|
ctx->Ans.ErrorCode = 0x30B81002;
|
|
|
ctx->Ans.ErrorMsg = CSimpleStringA2W("录音录像设备出现故障,请稍后重试!");
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_EVT_START_REMOTERECORD_FAILED, "录音录像设备出现故障,请稍后重试!");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2305,10 +2384,16 @@ void UIServiceSession::Handle_StartRemoteRecord(SpReqAnsContext<UIService_StartR
|
|
|
void UIServiceSession::Handle_StopRemoteRecord(SpReqAnsContext<UIService_StopRemoteRecord_Req, UIService_StopRemoteRecord_Ans>::Pointer ctx)
|
|
|
{
|
|
|
Dbg("stop remote record,videoname=%s",(LPCTSTR)CSimpleStringW2A(ctx->Req.content));
|
|
|
- LogEvent(Severity_Middle,LOG_EVT_UI_STOPREMOTERECORD,(LPCTSTR)CSimpleStringW2A(ctx->Req.content));
|
|
|
+ LogEvent(Severity_Middle,LOG_EVT_UI_STOPREMOTERECORD,(LPCTSTR)(m_pEntity->EncryptVideoNameCarNumber(CSimpleStringW2A(ctx->Req.content))));
|
|
|
m_pEntity->m_bSalesRecording = FALSE;
|
|
|
ErrorCodeEnum Error = m_pEntity->StopRecord(CSimpleStringW2A(ctx->Req.content));
|
|
|
ctx->Answer(Error);
|
|
|
+ if (Error_Succeed == Error){
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_EVT_STOP_REMOTERECORD_SUCCESS, "stop remote record success!");
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_EVT_STOP_REMOTERECORD_FAILED, "stop remote record failed!");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void UIServiceSession::Handle_StartSalesRecord(SpReqAnsContext<UIService_StartSalesRecord_Req, UIService_StartSalesRecord_Ans>::Pointer ctx)
|
|
@@ -2355,7 +2440,7 @@ void UIServiceSession::Handle_StartSalesRecord(SpReqAnsContext<UIService_StartSa
|
|
|
m_pEntity->GetFunction()->GetSysVar("CameraState", camstate);
|
|
|
Dbg("start record,camstate=%s,videoname=%s", (LPCTSTR)camstate, (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
|
|
|
if (camstate[0] == 'N') {
|
|
|
- LogEvent(Severity_Middle, LOG_EVT_UI_STARTRECORD, (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
|
|
|
+ LogEvent(Severity_Middle, LOG_EVT_UI_STARTRECORD, (LPCTSTR)(m_pEntity->EncryptVideoNameCarNumber(CSimpleStringW2A(ctx->Req.VideoName))));
|
|
|
m_pEntity->m_bSalesRecording = TRUE;
|
|
|
ctx->Ans.ErrorCode = 0;
|
|
|
ctx->Ans.ErrorMsg = CSimpleStringA2W("");
|
|
@@ -2373,7 +2458,7 @@ void UIServiceSession::Handle_StartSalesRecord(SpReqAnsContext<UIService_StartSa
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- CSimpleStringA videoname = CSimpleStringA::Format("ews|%s", (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
|
|
|
+ CSimpleStringA videoname = CSimpleStringA::Format("ews|%s", (LPCTSTR)(m_pEntity->EncryptVideoNameCarNumber(CSimpleStringW2A(ctx->Req.VideoName))));
|
|
|
if (ePadtype == deviceType) {
|
|
|
if (false == m_pEntity->m_bSalesRecordPriorityEws) {
|
|
|
videoname = videoname.SubString(4, videoname.GetLength() - 4);
|
|
@@ -2392,7 +2477,7 @@ void UIServiceSession::Handle_StartSalesRecord(SpReqAnsContext<UIService_StartSa
|
|
|
m_pEntity->GetFunction()->GetSysVar("CameraState", camstate);
|
|
|
Dbg("start record,camstate=%s,videoname=%s", (LPCTSTR)camstate, (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
|
|
|
if (camstate[0] == 'N') {
|
|
|
- LogEvent(Severity_Middle, LOG_EVT_UI_STARTRECORD, (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
|
|
|
+ LogEvent(Severity_Middle, LOG_EVT_UI_STARTRECORD, (LPCTSTR)(m_pEntity->EncryptVideoNameCarNumber(CSimpleStringW2A(ctx->Req.VideoName))));
|
|
|
m_pEntity->m_bSalesRecording = TRUE;
|
|
|
ctx->Ans.ErrorCode = 0;
|
|
|
ctx->Ans.ErrorMsg = CSimpleStringA2W("");
|
|
@@ -2463,7 +2548,7 @@ void UIServiceSession::Handle_StartRecordPreview(SpReqAnsContext<UIService_Start
|
|
|
m_pEntity->GetFunction()->GetSysVar("CameraState", camstate);
|
|
|
Dbg("start record preview,camstate=%s,videoname=%s", (LPCTSTR)camstate, (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
|
|
|
if (camstate[0] == 'N') {
|
|
|
- LogEvent(Severity_Middle, LOG_EVT_UI_STARTRECORDPREVIEW, (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
|
|
|
+ LogEvent(Severity_Middle, LOG_EVT_UI_STARTRECORDPREVIEW, (LPCTSTR)(m_pEntity->EncryptVideoNameCarNumber(CSimpleStringW2A(ctx->Req.VideoName))));
|
|
|
ctx->Ans.ErrorCode = 0;
|
|
|
ctx->Ans.ErrorMsg = CSimpleStringA2W("");
|
|
|
}
|
|
@@ -2481,7 +2566,7 @@ void UIServiceSession::Handle_StartRecordPreview(SpReqAnsContext<UIService_Start
|
|
|
}
|
|
|
else {
|
|
|
m_pEntity->m_bSalesRecordUseEws = true;
|
|
|
- CSimpleStringA videoname = CSimpleStringA::Format("ews|%s", (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
|
|
|
+ CSimpleStringA videoname = CSimpleStringA::Format("ews|%s", (LPCTSTR)(m_pEntity->EncryptVideoNameCarNumber(CSimpleStringW2A(ctx->Req.VideoName))));
|
|
|
if (ePadtype == deviceType) {
|
|
|
if (false == m_pEntity->m_bSalesRecordPriorityEws) {
|
|
|
videoname = videoname.SubString(4, videoname.GetLength() - 4);
|
|
@@ -2500,7 +2585,7 @@ void UIServiceSession::Handle_StartRecordPreview(SpReqAnsContext<UIService_Start
|
|
|
m_pEntity->GetFunction()->GetSysVar("CameraState", camstate);
|
|
|
Dbg("start record preview,camstate=%s,videoname=%s", (LPCTSTR)camstate, (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
|
|
|
if (camstate[0] == 'N') {
|
|
|
- LogEvent(Severity_Middle, LOG_EVT_UI_STARTRECORDPREVIEW, (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
|
|
|
+ LogEvent(Severity_Middle, LOG_EVT_UI_STARTRECORDPREVIEW, (LPCTSTR)(m_pEntity->EncryptVideoNameCarNumber(CSimpleStringW2A(ctx->Req.VideoName))));
|
|
|
ctx->Ans.ErrorCode = 0;
|
|
|
ctx->Ans.ErrorMsg = CSimpleStringA2W("");
|
|
|
}
|
|
@@ -2548,9 +2633,9 @@ void UIServiceSession::Handle_StartSalesVideoRecord(SpReqAnsContext<UIService_St
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- CSimpleStringA videoname = CSimpleStringW2A(ctx->Req.VideoName);
|
|
|
+ CSimpleStringA videoname = m_pEntity->EncryptVideoNameCarNumber(CSimpleStringW2A(ctx->Req.VideoName));
|
|
|
if (true == m_pEntity->m_bSalesRecordUseEws){
|
|
|
- videoname = CSimpleStringA::Format("ews|%s", (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
|
|
|
+ videoname = CSimpleStringA::Format("ews|%s", (LPCTSTR)(m_pEntity->EncryptVideoNameCarNumber(CSimpleStringW2A(ctx->Req.VideoName))));
|
|
|
}
|
|
|
|
|
|
LogEvent(Severity_Middle, LOG_EVT_UI_STARTAFTERPREVIEWRECORD, videoname.GetData());
|
|
@@ -2653,6 +2738,66 @@ void UIServiceSession::Handle_SetPickupOutVolume(SpReqAnsContext<UIService_SetPi
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+void UIServiceSession::Handle_StartPlayNotice(SpReqAnsContext<UIService_StartPlayNotice_Req, UIService_StartPlayNotice_Ans>::Pointer ctx)
|
|
|
+{
|
|
|
+ ErrorCodeEnum Error = Error_Succeed;
|
|
|
+ auto pPlayClient = new LocalPlayClient(m_pEntity);
|
|
|
+ if (pPlayClient->Connect() != Error_Succeed) {
|
|
|
+ pPlayClient->SafeDelete();
|
|
|
+ pPlayClient = NULL;
|
|
|
+ ctx->Ans.ErrorCode = Error_DevConnFailed;
|
|
|
+ ctx->Ans.ErrorMsg = CSimpleStringA2W("StartPlayNotice, Connect PlayClient entity failed!");
|
|
|
+ Error = Error_DevConnFailed;
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_EVT_LOCALMEDIAPLAYER_LOST, "StartPlayNotice call");
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ PlayService_StartPlayNotice_Req req;
|
|
|
+ PlayService_StartPlayNotice_Ans ans;
|
|
|
+ req.CfgInx = ctx->Req.CfgInx;
|
|
|
+ req.WndX = ctx->Req.WndX;
|
|
|
+ req.WndY = ctx->Req.WndY;
|
|
|
+ req.WndWidth = ctx->Req.WndWidth;
|
|
|
+ req.WndHeight = ctx->Req.WndHeight;
|
|
|
+ req.VideoName = ctx->Req.VideoName;
|
|
|
+ Error = pPlayClient->StartPlayNotice(req, ans, 800);
|
|
|
+ Dbg("StartPlayNotice Result = 0x%08x.", Error);
|
|
|
+ ctx->Ans.ErrorCode = Error;
|
|
|
+ }
|
|
|
+
|
|
|
+ ctx->Answer(Error);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+void UIServiceSession::Handle_StopPlayNotice(SpReqAnsContext<UIService_StopPlayNotice_Req, UIService_StopPlayNotice_Ans>::Pointer ctx)
|
|
|
+{
|
|
|
+ ErrorCodeEnum Error = Error_Succeed;
|
|
|
+ auto pPlayClient = new LocalPlayClient(m_pEntity);
|
|
|
+ if (pPlayClient->Connect() != Error_Succeed) {
|
|
|
+ pPlayClient->SafeDelete();
|
|
|
+ pPlayClient = NULL;
|
|
|
+ ctx->Ans.ErrorCode = Error_DevConnFailed;
|
|
|
+ ctx->Ans.ErrorMsg = CSimpleStringA2W("StopPlayNotice, Connect PlayClient entity failed!");
|
|
|
+ Error = Error_DevConnFailed;
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_EVT_LOCALMEDIAPLAYER_LOST, "StopPlayNotice call");
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ PlayService_StopPlayNotice_Req req;
|
|
|
+ PlayService_StopPlayNotice_Ans ans;
|
|
|
+ req.CfgInx = ctx->Req.CfgInx;
|
|
|
+ Error = pPlayClient->StopPlayNotice(req, ans, 800);
|
|
|
+ if (Error_Succeed == Error){
|
|
|
+ ctx->Ans.ErrorMsg = CSimpleStringA2W("Stop Play Notice success!");
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ ctx->Ans.ErrorMsg = CSimpleStringA2W("Stop Play Notice failed!");
|
|
|
+ }
|
|
|
+ ctx->Ans.ErrorCode = Error;
|
|
|
+ }
|
|
|
+
|
|
|
+ ctx->Answer(Error);
|
|
|
+}
|
|
|
+
|
|
|
ChannelClient::ChannelClient( CITCtrlEntity *pEntity ) : ChannelService_ClientBase(pEntity)
|
|
|
{
|
|
|
|