Kaynağa Gözat

Z991239-5169 #comment 优化和精简音视频相关实体日志

80274480 1 yıl önce
ebeveyn
işleme
2bbeb8e73b

+ 13 - 94
Module/mod_SalesRecorder/unix/mod_SalesRecorder.cpp

@@ -59,14 +59,12 @@ static BOOL CheckDiskStatus(const char *szRoot, int nPercent, int *pFreeRatio)
 	BOOL ret = GetDiskFreeSpaceEx(szRoot, &lpFreeBytesAvailableToCaller, &lpTotalNumberOfBytes, &lpTotalNumberOfFreeBytes);
 	if (ret == 0)
 	{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("CheckDiskStatus.GetDiskFreeSpaceEx failed(%d).",GetLastError());
 		return FALSE;
 	}
 	DWORD dwTotal = lpTotalNumberOfBytes.QuadPart/1048576;
 	DWORD dwTotalFree = lpTotalNumberOfFreeBytes.QuadPart/1048576;
 	int ratio = dwTotalFree*100/dwTotal;
 	*pFreeRatio = ratio;
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("free disk %d MB, %d percent free.\n", dwTotalFree, ratio);
 	//if (ratio < (100-MAX_DISK_PERCENT))
 	if (ratio < (100-nPercent))
 	{
@@ -205,7 +203,6 @@ static BOOL FindMatchedFile(LPCSTR sFindPath, LPCSTR sFindFileName, ULONGLONG& u
 
 	while ((pFile = readdir(pDir)) != NULL) {
 		if (pFile->d_type & DT_DIR) {
-			//m_pHostApi->Debug("FindMatchedFile DIR name: %s.", pFile->d_name);
 			if (strcmp(pFile->d_name, ".") == 0
 				|| strcmp(pFile->d_name, "..") == 0) continue;
 
@@ -214,11 +211,9 @@ static BOOL FindMatchedFile(LPCSTR sFindPath, LPCSTR sFindFileName, ULONGLONG& u
 			strncpy(Path, sFindPath, len + 1);
 			if (sFindPath[len - 1] != '/') strncat(Path, "/", 2);
 			strncat(Path, pFile->d_name, strlen(pFile->d_name) + 1);
-			//m_pHostApi->Debug("FindMatchedFile Path: %s.", Path);
 			FindMatchedFile(Path, (LPCTSTR)tmpFindFileName, uCountFile);
 		}
 		else {
-			//m_pHostApi->Debug("FindMatchedFile FILE name: %s.", pFile->d_name);
 			if (strstr(pFile->d_name, (LPCTSTR)tmpFindFileName) != NULL) {
 				++uCountFile;
 			}
@@ -288,7 +283,6 @@ void SalesRecordServiceSession::Handle_StopRecord(SpReqAnsContext<SalesRecorderS
 void SalesRecordServiceSession::Handle_SetAudioTransFlag(SpReqAnsContext<SalesRecorderSerVice_SetAudioTransFlag_Req, SalesRecorderSerVice_SetAudioTransFlag_Ans>::Pointer ctx)
 {
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Audio transmission flag is %s.", ctx->Req.TransFlag ? "true" : "false");
 	ctx->Answer(Error_Succeed);
 }
 
@@ -296,7 +290,6 @@ void SalesRecordServiceSession::Handle_SetAudioTransFlag(SpReqAnsContext<SalesRe
 void SalesRecordServiceSession::Handle_StopShowVideo(SpReqAnsContext<SalesRecorderSerVice_StopShowVideo_Req, SalesRecorderSerVice_StopShowVideo_Ans>::Pointer ctx)
 {
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Stop Show Video.");
 	ErrorCodeEnum ErrorCode = m_pEntity->HandleStopShowVideo();
 	ctx->Answer(ErrorCode);
 }
@@ -304,7 +297,6 @@ void SalesRecordServiceSession::Handle_StopShowVideo(SpReqAnsContext<SalesRecord
 void SalesRecordServiceSession::Handle_PlaySalesRecord(SpReqAnsContext<SalesRecorderSerVice_PlaySalesRecord_Req, SalesRecorderSerVice_PlaySalesRecord_Ans>::Pointer ctx)
 {
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Stop Show Video.");
 	ErrorCodeEnum ErrorCode = m_pEntity->HandlePlaySalesRecordVideo(ctx->Req.WndX, ctx->Req.WndY, ctx->Req.WndWidth, ctx->Req.WndHeight);
 	ctx->Answer(ErrorCode);
 }
@@ -333,7 +325,6 @@ void SalesRecordServiceSession::Handle_AppendWatermark(SpReqAnsContext<SalesReco
 
 CServerSessionBase * CSalesRecorderEntity::OnNewSession( const char* pszRemoteEntityName, const char * pszClass )
 {
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s connected class = %s!", pszRemoteEntityName, pszClass);
 	return new SalesRecordServiceSession(this);
 }
 
@@ -386,12 +377,10 @@ ErrorCodeEnum CSalesRecorderEntity::__OnStart( ErrorCodeEnum preOperationError )
 	if (iLogLevel <= RECORD_LOG_ERROR && iLogLevel > 0){
 		m_loglevel = (record_loglevel)iLogLevel;
 	}
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_loglevel:%d", m_loglevel);
 
 	if (iLowestLevel <= RECORD_LOG_ERROR && iLowestLevel > 0){
 		m_lowestlevel = (record_loglevel)iLowestLevel;
 	}
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_lowestlevel:%d", m_lowestlevel);
 
 	SetRecordAudioQuality(iAudioQuality);
 	SetRecordAudioNsPolicy(iAudioNsPolicy);
@@ -408,7 +397,6 @@ ErrorCodeEnum CSalesRecorderEntity::__OnStart( ErrorCodeEnum preOperationError )
 	if (m_bApplyHighQuality != 0 && m_bApplyHighQuality != 1){
 		m_bApplyHighQuality = FALSE;
 	}
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("m_bApplyHighQuality:%d",m_bApplyHighQuality);
 
 	if (preOperationError != Error_Succeed) {
 		return preOperationError;
@@ -450,8 +438,7 @@ ErrorCodeEnum CSalesRecorderEntity::__OnStart( ErrorCodeEnum preOperationError )
 	}
 
 	Error = GetFunction()->RegistSysVarEvent("SessionID", this);
-	if (Error != Error_Succeed) 
-	{
+	if (Error != Error_Succeed) {
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("register sysvar %s failed!", "SessionID");
 	}
 
@@ -513,7 +500,6 @@ void CSalesRecorderEntity::OnSelfTest(EntityTestEnum eTestType,CSmartPointer<ITr
 	if (Test_ShakeHand == eTestType)
 	{
 		if (m_bNeedRestart){
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("[OnSelfTest] entity need restart now.");
 			pTransactionContext->SendAnswer(Error_Unexpect);
 		}
 		else{
@@ -530,14 +516,11 @@ int CSalesRecorderEntity::GetActiveCamera()
 
 int CSalesRecorderEntity::GetCameraState()
 {
-	//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get active camera = %d", m_iCameraState);
 	return m_iCameraState;
 }
 
 void CSalesRecorderEntity::OnRecordFailed(eRvcRecordFailedCase eCase, const char* pszMessage, bool bRecordDevFault )
 {
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("OnSalesRecordFailed for [%d]:%s.", (int)eCase, record_failed_case_table[eCase]);
-
 	if (eCase < eDefault && eCase >= 0) {
 		LogEvent(Severity_Middle, LOG_EVT_UI_RECORDFAILED, record_failed_case_table[eCase]);
 	}
@@ -648,7 +631,6 @@ void CSalesRecorderEntity::OnSysVarEvent( const char *pszKey, const char *pszVal
 {
 	if (_stricmp(pszKey, SYSVAR_CAMERASTATE) == 0)
 	{
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("camera state from : %c to %c", pszOldValue[0], pszValue[0]);
 		m_iCameraState = pszValue[0]; 
 		if (pszValue[0] == 'E')
 		{
@@ -675,7 +657,6 @@ void CSalesRecorderEntity::OnSysVarEvent( const char *pszKey, const char *pszVal
 	}
 	else if (_stricmp(pszKey, SYSVAR_CALLTYPE) == 0)
 	{
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("sys calltype from: %c to %c", pszOldValue[0], pszValue[0]);
 		if(pszValue[0] == CALLTYPE_NORMAL)
 		{
 			m_nSysCallType = 0;
@@ -697,12 +678,10 @@ void CSalesRecorderEntity::OnLog( const CAutoArray<CUUID> &SubIDs, const CUUID n
 	switch (dwUserCode)
 	{
 	case LOG_EVT_UI_RETURNMENU:
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("return menu.");
 		//HandleReturnMenu();
 		break;
 
 	case LOG_EVT_SALESRECORD_ENTITY_EXCEPTION:
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("handle sales record entity exception, and message is %s.", pszMessage);
 		HandleSalesRecordEntityException(pszMessage);
 		break;
 
@@ -749,12 +728,11 @@ void CSalesRecorderEntity::StartOnSiteSalesRecord(const int fps, const char* vid
 		tAudioParams.bIsNsOn = false;
 	}
 
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("init lib video record success! and record type is %s and output audio quality is %s, audio noise suppression flag is %s. noise suppression policy is %d.", record_type_table[eRecordType], audio_quality_type_table[m_eAudioOutQuality], tAudioParams.bIsNsOn ? "true" : "false", tAudioParams.iNsPolicy);
+	//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("init lib video record success! and record type is %s and output audio quality is %s, audio noise suppression flag is %s. noise suppression policy is %d.", record_type_table[eRecordType], audio_quality_type_table[m_eAudioOutQuality], tAudioParams.bIsNsOn ? "true" : "false", tAudioParams.iNsPolicy);
 	if (m_pRecorder->StartVideoRecord(fps, videoquality, eMP4, &tAudioParams, subtitleParam, bWholeSection, false, (LPCSTR)m_TempDir,
 		m_TempDir.GetLength(), videofilename, strlen(videofilename)))
 	{
 		m_bStarted = true;
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Start VideoRecord success!");
 	}
 	else {
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Start VideoRecord failed!");
@@ -763,8 +741,6 @@ void CSalesRecorderEntity::StartOnSiteSalesRecord(const int fps, const char* vid
 
 void CSalesRecorderEntity::StartRecord(const char * videofilename, int videoquality, int audioOutBitRate, SubtitleParam *subtitleParam /* = NULL */, BOOL bWholeSection /* = FALSE */, BOOL bSessionManage /* = FALSE */, eRvcRecordType eRecordType /* = eSingleSide */)
 {
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("videofilename = %s", videofilename);
-
 	StartOnSiteSalesRecord(10, videofilename, videoquality, audioOutBitRate, subtitleParam, bWholeSection, bSessionManage, eRecordType);
 }
 
@@ -815,7 +791,6 @@ ErrorCodeEnum CSalesRecorderEntity::DeleteVideo( const char *videofilename)
 			BOOL bRet = FindMatchedFile((LPCSTR)strPath, (LPCTSTR)strFindFileName, uVideoCount);
 			if(bRet)
 			{
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to get record count while delete video!");
 				CSimpleStringA fileName;
 				BOOL bDeleteSucc = TRUE;
 				for(int i = 0; i != uVideoCount; ++i)
@@ -827,14 +802,13 @@ ErrorCodeEnum CSalesRecorderEntity::DeleteVideo( const char *videofilename)
 						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Error Code %lu while delete %s ", errno, fileName.GetData());
 					}
 				}
-				if (bDeleteSucc) {
-					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to delete videos!");
+				if (!bDeleteSucc) {
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("delete videos failed!");
 				}
 			}
 			else
 			{
 				ErrorCode = Error_NotExist;
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("[DeleteVideo] videos not exist or have been deleted!");
 			}
 		}
 	}
@@ -882,7 +856,6 @@ ErrorCodeEnum CSalesRecorderEntity::SaveVideo( const char * videofilename)
 			if(bRet)
 			{
 				strFindFileName = strFindFileName.SubString(0,strFindFileName.GetLength()-5);
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to get sales record count while save video!");
 				CSimpleStringA destPath;
 				Error = GetFunction()->GetPath("UploadVideo", destPath);
 				if(Error == Error_Succeed)
@@ -892,35 +865,26 @@ ErrorCodeEnum CSalesRecorderEntity::SaveVideo( const char * videofilename)
 					}
 					CSimpleStringA sourFileName, destFileName;
 					BOOL bMoveSucc = TRUE;
-					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("strFindFileName=%s", (LPCSTR)strFindFileName);
 					for(int i = 0; i != uVideoCount; ++i)
 					{
 						sourFileName = CSimpleStringA::Format("%s%s_%d.%s", (LPCSTR)sourPath, (LPCSTR)strFindFileName, i, RECORD_MP4_SUFFIX);
 						destFileName = CSimpleStringA::Format("%s%s_%d.%s", (LPCSTR)destPath, (LPCSTR)strFindFileName, i, RECORD_MP4_SUFFIX);
 						unsigned long ufilesize = GetFileSize(sourFileName.GetData());
-						char strtext[MAX_PATH] = {0};
-						snprintf(strtext, MAX_PATH, "%s file size is %u byte.", (LPCSTR)sourFileName, ufilesize);
-						LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORD_FILESIZE, strtext);
+						LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORD_FILESIZE, CSimpleStringA::Format("%s file size is %u byte.", sourFileName.GetData(), ufilesize).GetData());
 						if(rename(sourFileName.GetData(), destFileName.GetData())) {
 							bMoveSucc = FALSE;
 							ErrorCode = Error_NotImpl;
-							char strinfo[MAX_PATH] = { 0 };
-							snprintf(strinfo, MAX_PATH, "Error Code %lu while move %s.", errno, (LPCSTR)sourFileName);
-							LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORD_SAVED_FAILED, strinfo);
+							LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORD_SAVED_FAILED, CSimpleStringA::Format("Error Code %lu while move %s.", errno, sourFileName.GetData()).GetData());
 						}
 						if (ufilesize > RVC_MIN_FILESIZE){
 
 						}
 						else{
-							char strmsg[MAX_PATH] = {0};
-							snprintf(strmsg, MAX_PATH, "%s file size is %u.", (LPCSTR)sourFileName, ufilesize);
-							LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORD_INVALID_FILE, strmsg);
+							LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORD_INVALID_FILE, CSimpleStringA::Format("%s file size is %u.", sourFileName.GetData(), ufilesize).GetData());
 						}
 					}
 					if (bMoveSucc) {
-						char strmsg[MAX_PATH] = { 0 };
-						snprintf(strmsg, MAX_PATH, "succeed to save sales video, move it from %s to %s.", sourFileName.GetData(), destFileName.GetData());
-						LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORD_SAVED_SUCCESS, strmsg);
+						LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORD_SAVED_SUCCESS, CSimpleStringA::Format("succeed to save sales video, move it from %s to %s.", sourFileName.GetData(), destFileName.GetData()).GetData());
 					}
 				}
 			}
@@ -944,7 +908,6 @@ CSimpleStringA CSalesRecorderEntity::GetTerminalStage()
 	CSmartPointer<IEntityFunction> Func = GetFunction();
 	CSimpleStringA strValue = "";
 	Func->GetSysVar("TerminalStage", strValue);
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("TerminalStage:%s", (LPCTSTR)strValue);
 	return strValue;
 }
 
@@ -974,7 +937,6 @@ ErrorCodeEnum CSalesRecorderEntity::StopRecordVideo()
 		rc = Error_DevConnFailed;
 	}
 	else{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("UIClient connected success!");
 		InteractiveControl::UIService_StopRecordVideo_Req req;
 		InteractiveControl::UIService_StopRecordVideo_Ans ans;
 		rc = (*pUIClient)(EntityResource::getLink().upgradeLink())->StopRecordVideo(req, ans, 5000);
@@ -1114,15 +1076,12 @@ ErrorCodeEnum CSalesRecorderEntity::HandleStartRecord(const char *pszMessage, co
 
 		if(256 == m_audio_out_bitrate){
 			i_audio_out_bitrate = 128;
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("change remote record audio out bitrate to %d.", i_audio_out_bitrate);
 		}
 	} 
 
 	StartRecord(m_SalesVideoName, 90, i_audio_out_bitrate, &subtitleParam, m_bWholeSection, FALSE, eRecordType);
 
-	char strmsg[MAX_PATH] = { 0 };
-	snprintf(strmsg, MAX_PATH, "start remote record %s.", m_SalesVideoName);
-	LogWarn(Severity_Low, Error_Debug, LOG_EVT_START_REMOTERECORD, strmsg);
+	LogWarn(Severity_Low, Error_Debug, LOG_EVT_START_REMOTERECORD, CSimpleStringA::Format("start remote record %s.", m_SalesVideoName).GetData());
 
 	return Error;
 }
@@ -1139,9 +1098,7 @@ ErrorCodeEnum CSalesRecorderEntity::HandleStopRecord(const char *pszMessage)
 
 ErrorCodeEnum CSalesRecorderEntity::HandleDisplayVideo()
 {
-	// 视频播放 libwmpplayer
 	m_bIsShowVideo = TRUE;
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("play record file name is %s!", m_SalesVideoName);
 	ErrorCodeEnum ErrorCode = ShowVideo(m_SalesVideoName);
 	return ErrorCode;
 }
@@ -1149,19 +1106,14 @@ ErrorCodeEnum CSalesRecorderEntity::HandleDisplayVideo()
 
 ErrorCodeEnum CSalesRecorderEntity::HandlePlaySalesRecordVideo(int iWndX, int iWndY, int iWndWidth, int iWndHeight)
 {
-	// 视频播放 libwmpplayer
 	m_bIsShowVideo = TRUE;
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("play sales record video file name is %s!", m_SalesVideoName);
 	ErrorCodeEnum ErrorCode = PlaySalesRecordVideo(m_SalesVideoName, iWndX, iWndY, iWndWidth, iWndHeight);
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("play sales record video return code is 0x%08x.", ErrorCode);
 	return ErrorCode;
 }
 
 
 ErrorCodeEnum CSalesRecorderEntity::HandleStopShowVideo()
 {
-	// 视频播放 libwmpplayer
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("stop show video record file name is %s!", m_SalesVideoName);
 	ErrorCodeEnum ErrorCode = Error_Succeed;
 	return ErrorCode;
 }
@@ -1172,8 +1124,6 @@ ErrorCodeEnum CSalesRecorderEntity::HandleSaveVideo()
 {
 	ErrorCodeEnum ErrorCode = Error_Succeed;
 
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Save Record Name is %s.", m_SalesVideoName);
-
 	// 将视频从tmp移动到uploadvideo
 	ErrorCode = SaveVideo(m_SalesVideoName+2);
 
@@ -1187,7 +1137,6 @@ ErrorCodeEnum CSalesRecorderEntity::HandleDeleteVideo()
 {
 	ErrorCodeEnum ErrorCode = Error_Succeed;
 
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Delete Record Name is %s.", m_SalesVideoName);
 	// 删除tmp中的视频
 	ErrorCode = DeleteVideo(m_SalesVideoName);
 
@@ -1206,7 +1155,6 @@ void CSalesRecorderEntity::HandleReturnMenu()
 		if (m_bStarted) // 如果正在进行客户经理录像
 		{
 			// 停止录像
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("stop record and return menu!");
 			StopRecord();
 		}
 
@@ -1283,16 +1231,12 @@ ErrorCodeEnum CSalesRecorderEntity::RealSelfCheck()
 	ErrorCodeEnum Error = Error_Succeed;
 	SelfChekerClient* pSelfcheckClient = new SelfChekerClient(this);
 	Error = pSelfcheckClient->Connect();
-	if (Error != Error_Succeed)
-	{
+	if (Error != Error_Succeed){
 		pSelfcheckClient->SafeDelete();
 		pSelfcheckClient = NULL;
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SelfcheckClient connect fail!");
 	}
-	else
-	{
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("SelfcheckClient connect success!");
-	}
+
 
 	if (pSelfcheckClient)
 	{
@@ -1301,14 +1245,9 @@ ErrorCodeEnum CSalesRecorderEntity::RealSelfCheck()
 		SelfChecker::SelfCheckerService_RealCheck_Ans ans;
 		DWORD Timeout = 500;
 		Error = pSelfcheckClient->RealCheck(req,ans,Timeout);
-		if (Error!=Error_Succeed)
-		{
+		if (Error!=Error_Succeed){
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("RealSelfcheck fail!");
 		}
-		else
-		{
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("RealSelfcheck success!");
-		}
 	}
 
 	LogWarn(Severity_Middle, Error_Debug, LOG_EVT_ENTITY_RESTART, "sales record entity self restart.");
@@ -1420,6 +1359,7 @@ SYSTEMTIME Time_tToSystemTime(time_t t)
 	return st;
 }
 
+
 bool IsMatchedVideo(LPCTSTR path, struct dirent* file)
 {
 	bool bRet = false;
@@ -1434,7 +1374,6 @@ bool IsMatchedVideo(LPCTSTR path, struct dirent* file)
 		if (stat(ttp, &fileInfo) == 0) {
 			SYSTEMTIME sysTime;
 			sysTime = Time_tToSystemTime(fileInfo.st_mtime);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("File %s create data info is %d %d %d.", file->d_name, sysTime.wYear, sysTime.wMonth, sysTime.wDay);
 			if ((2020 == sysTime.wYear) && (sysTime.wMonth == 1)) {
 				if (sysTime.wDay >= 3 && sysTime.wDay <= 10) {
 					bRet = true;
@@ -1472,20 +1411,15 @@ void CSalesRecorderEntity::UploadTempPathVideos() {
 
 		while ((pFile = readdir(pDir)) != NULL) {
 			if (pFile->d_type & DT_DIR) {
-				//m_pHostApi->Debug("MoveTempPathVideos DIR name: %s.", pFile->d_name);
 				continue;
 			}
 			else {
-				//m_pHostApi->Debug("MoveTempPathVideos FILE name: %s.", pFile->d_name);
 				if (IsMatchedVideo((LPCSTR)sourPath, pFile)) {
 					CSimpleStringA sourFileName = CSimpleStringA::Format("%s%s", (LPCSTR)sourPath, pFile->d_name);
 					CSimpleStringA destFileName = CSimpleStringA::Format("%sBAK_%s", (LPCSTR)destPath, pFile->d_name);
 					if (rename(sourFileName.GetData(), destFileName.GetData())) {
 						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Error Code %lu while move %s.", errno, sourFileName.GetData());
 					}
-					else {
-						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Move File %s success.", sourFileName.GetData());
-					}
 				}
 				else {
 					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("File (%s) is not matched.", pFile->d_name);
@@ -1502,7 +1436,6 @@ void CSalesRecorderEntity::UploadTempPathVideos() {
 ErrorCodeEnum CSalesRecorderEntity::SetRecordAudioQuality(int iAudioQuality)
 {
 	ErrorCodeEnum eRet = Error_Succeed;
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("iAudioQuality == %d.", iAudioQuality);
 
 	switch (iAudioQuality)
 	{
@@ -1530,7 +1463,6 @@ ErrorCodeEnum CSalesRecorderEntity::SetRecordAudioQuality(int iAudioQuality)
 ErrorCodeEnum CSalesRecorderEntity::SetRecordAudioNsPolicy(int iNsPolicy)
 {
 	ErrorCodeEnum eRet = Error_Succeed;
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("iNsPolicy == %d.", iNsPolicy);
 
 	if (1 == iNsPolicy || 3 == iNsPolicy){
 		m_iAudioNsPolicy = iNsPolicy;
@@ -1547,12 +1479,8 @@ ErrorCodeEnum CSalesRecorderEntity::SetRecordAudioChannles(int iAudioChannles)
 {
 	ErrorCodeEnum eRet = Error_Succeed;
 
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Get iAudioChannles == %d.", iAudioChannles);
-
 	m_iAudioChannels = 2;
 
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Set AudioChannles == %d.", m_iAudioChannels);
-
 	return eRet;
 }
 
@@ -1575,15 +1503,6 @@ DeviceTypeEnum CSalesRecorderEntity::RvcGetDeviceType()
 			eType = ePadtype;
 		}
 	}
-	else if (stricmp(stStaticinfo.strMachineType, "RVC.Desk2S") == 0) {
-		eType = eDesk2SType;
-		WORD nMajor = stStaticinfo.MachineVersion.GetMajor();
-		WORD nMinor = stStaticinfo.MachineVersion.GetMinor();
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("MachineVersion is %d.%d", nMajor, nMinor);
-		if (2 == nMajor) {
-			eType = eDesk2SIntegratedType;
-		}
-	}
 	else if (stricmp(stStaticinfo.strMachineType, "RPM.Stand1S") == 0) {
 		eType = eRpm1sType;
 	}

+ 2 - 7
Module/mod_assistantchannel/mod_assistantchannel.cpp

@@ -423,12 +423,6 @@ void CBizChannelEntity::on_connect(int error, const char *remote_ip, int remote_
 						REC_COMMON_VIDEO_FPS_MOBILE_AGENT, local_view_x, local_view_y, local_view_cx, local_view_cy, 
 						remote_view_x, remote_view_y, remote_view_cx, remote_view_cy);
 				}
-				else if((ePadtype == m_eDeviceType)||(eDesk2SType == m_eDeviceType)||(eDesk1SType == m_eDeviceType) || (eDesk2SIntegratedType == m_eDeviceType))
-				{
-					param = BuildVideoDesc(remote_ip, remote_video_rtp, remote_video_width, remote_video_height, 
-						REC_COMMON_VIDEO_FPS_MOBILE, local_view_x, local_view_y, local_view_cx, local_view_cy, 
-						remote_view_x, remote_view_y, remote_view_cx, remote_view_cy);
-				}
 				else
 				{
 					param = BuildVideoDesc(remote_ip, remote_video_rtp, remote_video_width, remote_video_height, 
@@ -437,7 +431,8 @@ void CBizChannelEntity::on_connect(int error, const char *remote_ip, int remote_
 				}
 
 				ChangeState(eChannelState_Connected, (LPCSTR)param);
-			} else {
+			} 
+			else {
 				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get VideoWindowInitializeParam failed!");
 				bizchan_start_close(m_pChan);
 			}

+ 36 - 81
Module/mod_counterconnector/ConnectorFSM.cpp

@@ -88,9 +88,7 @@ public:
 
 			if (ePhone_Terminated == Msg.state){
 				if (!m_bSipConnected){
-					char strmsg[MAX_PATH] = { 0 };
-					snprintf(strmsg, MAX_PATH, "sip connect failed for %s.", Msg.status.GetData());
-					LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_SIP_CONNECT_FAILED,strmsg);
+					LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_SIP_CONNECT_FAILED, CSimpleStringA::Format("sip connect failed for %s.", Msg.status.GetData()).GetData());
 				}
 			}
 		}
@@ -174,18 +172,18 @@ ErrorCodeEnum ACMCallFSM::OnInit()
 		goto on_error;
 	}
 		
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("LoadConfig success");
 	GetEntityBase()->GetFunction()->SetSysVar("CallState", "O"); // set to offline state 
 	Error = LoadTerminalId();
 	if (Error != Error_Succeed) {
 		goto on_error;
 	}
 		
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("sip proxy ip1:%s,num1:%s,port1:%d;ip2:%s,num2:%s,port2:%d", (LPCSTR)m_strSIPProxyIP[0],(LPCSTR)m_strSIPCallNum[0], m_iSIPProxyPort[0],(LPCSTR)m_strSIPProxyIP[1],(LPCSTR)m_strSIPCallNum[1], m_iSIPProxyPort[1]);
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("chan proxy ip1:%s,num1:%s,port1:%d;ip2:%s,num2:%s,port2:%d", (LPCSTR)m_strChanProxyIP[0],(LPCSTR)m_strChanCallNum[0], m_iChanProxyPort[0],(LPCSTR)m_strChanProxyIP[1],(LPCSTR)m_strChanCallNum[1], m_iChanProxyPort[1]);
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("TerminalId: %s", (LPCSTR)m_strTerminalId);
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("default_voip_server: %s", m_strDefaultServer.GetData());
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("HttpCallRouteAddr: %s", m_strHttpCallRouteAddr.GetData());
+	//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("sip proxy ip1:%s,num1:%s,port1:%d;ip2:%s,num2:%s,port2:%d", (LPCSTR)m_strSIPProxyIP[0],(LPCSTR)m_strSIPCallNum[0], m_iSIPProxyPort[0],(LPCSTR)m_strSIPProxyIP[1],(LPCSTR)m_strSIPCallNum[1], m_iSIPProxyPort[1]);
+	//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("chan proxy ip1:%s,num1:%s,port1:%d;ip2:%s,num2:%s,port2:%d", (LPCSTR)m_strChanProxyIP[0],(LPCSTR)m_strChanCallNum[0], m_iChanProxyPort[0],(LPCSTR)m_strChanProxyIP[1],(LPCSTR)m_strChanCallNum[1], m_iChanProxyPort[1]);
+	//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("TerminalId: %s", (LPCSTR)m_strTerminalId);
+	//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("default_voip_server: %s", m_strDefaultServer.GetData());
+	//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("HttpCallRouteAddr: %s", m_strHttpCallRouteAddr.GetData());
+
 	if(m_strDefaultServer.GetLength() > 0){
 		ParseDefaultServer(m_strDefaultServer.GetData());
 	}
@@ -200,8 +198,6 @@ ErrorCodeEnum ACMCallFSM::OnInit()
 
 	m_nSysCallType = 0;
 
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("fsm init ok!");
-
 	AddStateHooker(this);
 
 	return Error;
@@ -218,11 +214,9 @@ BOOL ACMCallFSM::ReConnectionAssistchan()
 	if (m_pChannelClient != NULL){
 		m_pChannelClient->GetFunction()->CloseSession();
 		m_pChannelClient = NULL;
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Close AssistChannel Session ");
 	}
 
 	if (m_pChannelClient == NULL){
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("ReConnection AssistChannel Session");
 		m_pChannelClient = new MyChannelClient(m_pEntity, this);
 		ErrorCodeEnum Error = m_pChannelClient->Connect();
 		if (Error != Error_Succeed) {
@@ -230,9 +224,6 @@ BOOL ACMCallFSM::ReConnectionAssistchan()
 			m_pChannelClient = NULL;
 			return FALSE;
 		}
-		else {
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("m_channelClient connect success!");
-		}
 
 		if (Error == Error_Succeed){
 			ChannelService_BeginState_Sub ChannelSub;
@@ -243,9 +234,6 @@ BOOL ACMCallFSM::ReConnectionAssistchan()
 				m_pChannelClient = NULL;
 				return FALSE;
 			}
-			else {
-				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("BeginState biz channel success!");
-			}
 		}
 	}
 	return TRUE;
@@ -264,7 +252,6 @@ BOOL ACMCallFSM::ReConnectionSipphone(bool bLog)
 		if (Error != Error_Succeed) {
 			if (bLog) {
 				LogWarn(Severity_Low, Error_Debug, EVENT_MOD_CONNECT_SIPPHONE_ERROR, "connect sip phone error");
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_phoneClient connect fail!");
 			}
 			m_pPhoneClient = NULL;
 			return FALSE;
@@ -291,7 +278,6 @@ BOOL ACMCallFSM::ReConnectionSyncService()
 	if (NULL != m_pSyncServiceClient){
 		m_pSyncServiceClient->GetFunction()->CloseSession();
 		m_pSyncServiceClient = NULL;
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Close SyncService Session.");
 	}
 
 	m_pSyncServiceClient = new SyncServiceClient(m_pEntity, this);
@@ -301,9 +287,6 @@ BOOL ACMCallFSM::ReConnectionSyncService()
 		m_pSyncServiceClient = NULL;
 		return FALSE;
 	}
-	else {
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Connect SyncService Success!");
-	}
 
 	return TRUE;
 }
@@ -327,9 +310,7 @@ int ACMCallFSM::GetCallRouteList()
 			http_callinfo.strAddClientLevel = NULL;
 		}
 
-		char strmsg[MAX_PATH] = { 0 };
-		snprintf(strmsg, MAX_PATH, "call type is %d, http call route queue name is %s, and client level is %s.", m_CallingParam.nCallType, http_callinfo.strQueueName.GetData(), http_callinfo.strAddClientLevel.GetData());
-		LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_CALL_QUEUE_INFO, strmsg);
+		LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_CALL_QUEUE_INFO, CSimpleStringA::Format("call type is %d, http call route queue name is %s, and client level is %s.", m_CallingParam.nCallType, http_callinfo.strQueueName.GetData(), http_callinfo.strAddClientLevel.GetData()).GetData());
 
 		http_callinfo.strTerminalNo = m_strTerminalId;
 
@@ -339,9 +320,7 @@ int ACMCallFSM::GetCallRouteList()
 		} while (!m_pCallRouteList && ihttpcount < CALLROUTE_MAX_TRY_COUNT);
 
 		if (ihttpcount > 1) {
-			char strmsg[MAX_PATH] = { 0 };
-			snprintf(strmsg, MAX_PATH, "request http call route address{%s} %d times.", m_strHttpCallRouteAddr.GetData(), ihttpcount);
-			LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_CALLROUTE_TIMES, strmsg);
+			LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_CALLROUTE_TIMES, CSimpleStringA::Format("request http call route address{%s} %d times.", m_strHttpCallRouteAddr.GetData(), ihttpcount).GetData());
 		}
 	}
 
@@ -386,7 +365,7 @@ void ACMCallFSM::SetDelayTime()
 		info.key = "DelayTime";
 		info.data = "0";
 		(*m_pSyncServiceClient)(EntityResource::getLink().upgradeLink())->SetMachineData(info);
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("set delay time to 0");
+		//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("set delay time to 0");
 	}
 }
 
@@ -504,10 +483,6 @@ int ACMCallFSM::ParseDefaultServer(const char* strServer)
 	}
 
 	iRet = m_voipserver.size();
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("default voip server number is %d.", iRet);
-	for (int i = 0; i < iRet; i++){
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("default voip server address is %s", m_voipserver[i].c_str());
-	}
 
 	return iRet;
 }
@@ -586,7 +561,6 @@ int ACMCallFSM::LogFailedWarns(int iFailedCode, const char* strmsg)
 
 void ACMCallFSM::OnStateTrans(int iSrcState, int iDstState)
 {
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("FSM state from state %s to %s", GetStateName(iSrcState), GetStateName(iDstState));
 	if (CheckBeginRing(iSrcState, iDstState)) {
 		StartRing();
 	} else {
@@ -618,10 +592,10 @@ void ACMCallFSM::OnStateTrans(int iSrcState, int iDstState)
 
 					if (eState_Fail == st2){
 						int ierrcode = GetFailedErrorCode(iSrcState);
-						DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("connect_failed_case_table size is %d, and ierrcode = %d.", sizeof(connect_failed_case_table)/ sizeof(char*), ierrcode);
+						//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("connect_failed_case_table size is %d, and ierrcode = %d.", sizeof(connect_failed_case_table)/ sizeof(char*), ierrcode);
 						if (ierrcode >= 0 && ierrcode < sizeof(connect_failed_case_table)/ sizeof(char*)){
 							evt.errinfo = CSimpleStringA2W(connect_failed_case_table[ierrcode]);
-							DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("connect failed for %s.", CSimpleStringW2A(evt.errinfo).GetData());
+							DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("connect failed for %s.", CSimpleStringW2A(evt.errinfo).GetData());
 						}
 
 						char strerrmsg[MAX_PATH] = {0};
@@ -640,9 +614,7 @@ void ACMCallFSM::OnStateTrans(int iSrcState, int iDstState)
 					//LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_BROADCAST_CALL_STATE, strmsg);
 				} 
 				else{
-					char strinfo[MAX_PATH] = {0};
-					snprintf(strinfo, MAX_PATH,"state from %d to %d, auto reconnect, not broadcast state to ui.", st1, st2);
-					LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_AUTO_RECONNECT,strinfo);
+					LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_AUTO_RECONNECT,CSimpleString::Format("state from %d to %d, auto reconnect, not broadcast state to ui.", st1, st2).GetData());
 				}
 
 				if (eState_HandFree == st2 || eState_Pickup == st2){
@@ -675,7 +647,7 @@ ErrorCodeEnum ACMCallFSM::SetCallState(int state)
 	if (0 <= state && state < sizeof(sts)/sizeof(char*)){
 		strCallState = sts[state];
 	}
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("set call state to [%s].", strCallState);
+	//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("set call state to [%s].", strCallState);
 	return GetEntityBase()->GetFunction()->SetSysVar("CallState", strCallState);
 }
 
@@ -721,7 +693,6 @@ unsigned int ACMCallFSM::s0_on_event(FSMEvent* event)
 		//由指令模块触发呼叫
 		GetEntityBase()->GetFunction()->SetSysVar(SYSVAR_CALLTYPE, CALLTYPE_MOBILE); // 设置呼叫模式为手机呼叫
 		m_nSysCallType = 1;
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start command call!");
 	}
 	else if (event->iEvt == USER_EVT_ASSISTCHAN_IDEL)
 	{
@@ -757,7 +728,7 @@ unsigned int ACMCallFSM::s0_on_event(FSMEvent* event)
 		m_CallingParam.nCallType = DOUBLERECORD_CALLTYPE;
 		//GetEntityBase()->GetFunction()->SetSysVar(SYSVAR_CALLTYPE,CALLTYPE_RECORD); // 设置呼叫模式为双录呼叫
 		m_nSysCallType = 0;
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start double record call,call type is %d.", m_CallingParam.nCallType);
+		//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start double record call,call type is %d.", m_CallingParam.nCallType);
 		LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_DOUBLERECORDCALL,"begin double record call");
 	}
 	else if (event->iEvt == USER_EVT_STOPLOACALREMOTEVIDEO) 
@@ -782,7 +753,7 @@ unsigned int ACMCallFSM::s7_on_event(FSMEvent* event)
 {
 	if (event->iEvt == USER_EVT_STOPLOCALVIDEO) 
 	{
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("stop show local video");
+		//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("stop show local video");
 		StopVideo();
 	}
 	else if (event->iEvt == USER_EVT_SIPPHONE_IDEL)
@@ -796,7 +767,7 @@ unsigned int ACMCallFSM::s7_on_event(FSMEvent* event)
 
 void ACMCallFSM::s9_on_entry() 
 {
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start liveness detection.");
+	//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start liveness detection.");
 	m_nLiveDetctionTime = 0;
 	ScheduleTimer(9, 2*LIVEDETECT_CONNECT_INTERVAL);
 }
@@ -812,7 +783,7 @@ unsigned int ACMCallFSM::s9_on_event(FSMEvent* event)
 	if (event->iEvt == USER_EVT_STOPVIDEODISPLAY) 
 	{
 		//ScheduleTimer(9,3000);
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("stop live detection display");
+		//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("stop live detection display");
 		StopVideo();
 		LogEvent(Severity_Middle,LOG_EVT_RELEASELIVEDETECTION,"release live detection");
 	} 
@@ -842,7 +813,6 @@ void ACMCallFSM::s8_on_entry()
 	}
 		
 	int time = GetDelayTime();
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("get Delay time = %d",time);
 
 	if (time > 0){
 		ScheduleTimer(8,time*1000);
@@ -895,7 +865,6 @@ unsigned int ACMCallFSM::s10_on_event(FSMEvent* event)
 	}
 	else if (event->iEvt == USER_EVT_STOPLOACALREMOTEVIDEO) 
 	{
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s:%d, hang up call and stop show local and remote video.", __FUNCTION__, __LINE__);
 		PostEventFIFO(new FSMEvent(USER_EVT_HANGUP));
 		m_bHangup=TRUE;
 		StopVideo();
@@ -953,9 +922,7 @@ void ACMCallFSM::s11_on_entry()
 						m_iChanProxyPort[1] = uport;
 						m_strChanProxyIP[0] = strassistip;
 						m_strChanProxyIP[1] = strassistip;
-						char strmsg[MAX_PATH] = {0};
-						snprintf(strmsg, MAX_PATH, "head office mode no more call router, use default config(call url is %s, assistip is %s).", strcallurl, strassistip);
-						LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_CALLROUTE_CONFIG, strmsg);
+						LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_CALLROUTE_CONFIG, CSimpleStringA::Format("head office mode no more call router, use default config(call url is %s, assistip is %s).", strcallurl, strassistip).GetData());
 					}
 					else {
 						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("GetCallInfoFromConfig failed!");
@@ -972,8 +939,6 @@ void ACMCallFSM::s11_on_entry()
 				(bool)m_nCurSipServer?(m_nCurSipServer= CurServerNum::Error_Server):(m_nCurSipServer= CurServerNum::BACK_SERVER);
 			}
 			m_nCurChanServer = CurServerNum::BACK_SERVER;
-
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("head office make call result:0x%08x", m_LastSipError);
 		} 
 		else
 		{
@@ -995,7 +960,7 @@ void ACMCallFSM::s11_on_entry()
 	if (m_LastSipError != Error_Succeed) 
 	{
 		PostEventFIFO(new FSMEvent(USER_EVT_JMP_FAIL));
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402304Z80201").setResultCode("RTA3421")("send sip failed!");
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402304Z80201").setResultCode("RTA3421")("send sip failed!");
 	}
 	else
 	{
@@ -1016,10 +981,8 @@ unsigned int ACMCallFSM::s11_on_event(FSMEvent* event)
 			m_bHangup = TRUE;
 			DWORD now = GetTickCount();
 			int interval = now - m_nStarttime;
-			char msg[128] = {0};
-			snprintf(msg, 128, "sip connecting, customer active hangup after %d ms.", interval);
-			LogWarn(Severity_Low, Error_Unexpect, LOG_WARN_COUNTERCONNECT_SIPCONNECT_HANGUP, msg);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402304Z80301").setResultCode("RTA3431")("sip connect failed!");
+			LogWarn(Severity_Low, Error_Unexpect, LOG_WARN_COUNTERCONNECT_SIPCONNECT_HANGUP, CSimpleStringA::Format("sip connecting, customer active hangup after %d ms.", interval).GetData());
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402304Z80301").setResultCode("RTA3431")("sip connect failed for user hangup");
 	}
 	else if (event->iEvt == USER_EVT_SIP_STATE_IDLE) 
 	{
@@ -1033,7 +996,7 @@ unsigned int ACMCallFSM::s11_on_event(FSMEvent* event)
 		(bool)m_nCurSipServer?(m_nCurSipServer= CurServerNum::Error_Server):(m_nCurSipServer= CurServerNum::BACK_SERVER);
 		m_nSipErrorNum++;
 		//StopChannel();
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402304Z80301").setResultCode("RTA3432")("sip connect failed!");
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402304Z80301").setResultCode("RTA3432")("sip connect failed for server error.");
 	} 
 	else if (event->iEvt == USER_EVT_ASSISTCHAN_IDEL)
 	{
@@ -1047,7 +1010,6 @@ unsigned int ACMCallFSM::s11_on_event(FSMEvent* event)
 		if (ReConnectionAssistchan()) {
 			m_bConAssist = TRUE;
 		}
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402304Z80301").setResultCode("RTA3433")("sip connect failed!");
 	}
 	else if (event->iEvt == USER_EVT_SIPPHONE_IDEL)
 	{
@@ -1061,7 +1023,7 @@ unsigned int ACMCallFSM::s11_on_event(FSMEvent* event)
 		if (ReConnectionSipphone()) {
 			m_bConSipphone = TRUE;
 		}
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402304Z80301").setResultCode("RTA3434")("sip connect failed!");
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402304Z80301").setResultCode("RTA3434")("sip connect failed for entity error");
 	}
 	else if (event->iEvt == EVT_TIMER)
 	{
@@ -1074,7 +1036,7 @@ unsigned int ACMCallFSM::s11_on_event(FSMEvent* event)
 		}
 		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("sip call timeout,release call");
 		m_nSipErrorNum++;
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402304Z80301").setResultCode("RTA3435")("sip connect failed!");
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402304Z80301").setResultCode("RTA3435")("sip connect failed for timeout");
 	}
 	else if (event->iEvt == USER_EVT_JMP_FAIL)
 	{
@@ -1086,11 +1048,10 @@ unsigned int ACMCallFSM::s11_on_event(FSMEvent* event)
 			LogWarn(Severity_Low, Error_Unexpect, LOG_WARN_COUNTERCONNECT_SIPCONNECT_FUNC_FAILED,"sipphone connect func failed, error server");
 		}
 		m_nSipErrorNum++;
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402304Z80301").setResultCode("RTA3436")("sip connect failed!");
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402304Z80301").setResultCode("RTA3436")("sip connect failed for entity error");
 	}
 	else if (event->iEvt == USER_EVT_STOPLOACALREMOTEVIDEO) 
 	{
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s:%d, hang up call and stop show local and remote video.", __FUNCTION__, __LINE__);
 		PostEventFIFO(new FSMEvent(USER_EVT_HANGUP));
 		m_bHangup=TRUE;
 		StopVideo();
@@ -1111,7 +1072,6 @@ void ACMCallFSM::s12_on_entry()
 	Sleep(200);
 	if (m_LastAssistError == Error_Succeed) 
 	{
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("begin start channel,m_nCurChanServer=%d",m_nCurChanServer);
 		if (m_CallingParam.nCallType == NORMAL_CALLTYPE  && m_CallingParam.nCallType != DOUBLERECORD_CALLTYPE)
 		{
 			m_LastAssistError = StartChannel((int)m_nCurChanServer);
@@ -1126,26 +1086,24 @@ void ACMCallFSM::s12_on_entry()
 			//	}
 			//}
 		}
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start channel result:0x%08x", m_LastAssistError);
+
 		if (m_LastAssistError != Error_Succeed) 
 		{
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start channel failed:0x%08x,start hangup", m_LastAssistError);
 			HangupCall();
 			(bool)m_nCurChanServer?(m_nCurChanServer= CurServerNum::Error_Server):(m_nCurChanServer= CurServerNum::BACK_SERVER);
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("hangup call result:0x%08x", m_LastAssistError);
 		}
 	}
 
 	if (m_LastAssistError != Error_Succeed) {
 		PostEventFIFO(new FSMEvent(USER_EVT_JMP_FAIL));
 		if (Error_NetBroken == m_LastAssistError) {
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402304Z80401").setResultCode("RTA3441")("assistant channel connect failed!");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402304Z80401").setResultCode("RTA3441")("assistant channel connect failed for net broken");
 		}
 		else if (Error_Param == m_LastAssistError) {
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402304Z80401").setResultCode("RTA3442")("assistant channel connect failed!");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402304Z80401").setResultCode("RTA3442")("assistant channel connect failed error param");
 		}
 		else {
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402304Z80401").setResultCode("RTA3443")("assistant channel connect failed!");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402304Z80401").setResultCode("RTA3443")("assistant channel connect failed!");
 		}
 	}
 	else {
@@ -1162,10 +1120,8 @@ unsigned int ACMCallFSM::s12_on_event(FSMEvent* event)
 		m_bHangup = TRUE;
 		DWORD now = GetTickCount();
 		int interval = now - m_nStarttime;
-		char msg[128] = {0};
-		snprintf(msg, 128, "chan connecting, customer active hangup after %d ms.", interval);
-		LogWarn(Severity_Low, Error_Unexpect, LOG_WARN_COUNTERCONNECT_CHANCONNECT_HANGUP, msg);
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402304Z80501").setResultCode("RTA3451")("assistant channel bridge failed!");
+		LogWarn(Severity_Low, Error_Unexpect, LOG_WARN_COUNTERCONNECT_CHANCONNECT_HANGUP, CSimpleStringA::Format("chan connecting, customer active hangup after %d ms.", interval).GetData());
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402304Z80501").setResultCode("RTA3451")("assistant channel bridge failed for user hangup");
 	}
 	else if (event->iEvt == USER_EVT_SIP_STATE_IDLE) 
 	{
@@ -1191,7 +1147,7 @@ unsigned int ACMCallFSM::s12_on_event(FSMEvent* event)
 				LogWarn(Severity_Low, Error_Unexpect, LOG_WARN_COUNTERCONNECT_CHANCONNECT_CHANSTATE_IDLE,"chan connect server failed, error server");
 			}
 			(bool)m_nCurChanServer?(m_nCurChanServer= CurServerNum::Error_Server):(m_nCurChanServer= CurServerNum::BACK_SERVER);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402304Z80501").setResultCode("RTA3452")("assistant channel bridge failed!");
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402304Z80501").setResultCode("RTA3452")("assistant channel bridge failed for server error");
 		}
 		HangupCall();
 		//StopVideo();
@@ -1214,6 +1170,7 @@ unsigned int ACMCallFSM::s12_on_event(FSMEvent* event)
 		if (ReConnectionAssistchan()) {
 			m_bConAssist = TRUE;
 		}
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402304Z80501").setResultCode("RTA3453")("assistant channel bridge failed for entity restart");
 	}
 	else if (event->iEvt == USER_EVT_SIPPHONE_IDEL)
 	{
@@ -1230,7 +1187,6 @@ unsigned int ACMCallFSM::s12_on_event(FSMEvent* event)
 	}
 	else if (event->iEvt == USER_EVT_STOPLOACALREMOTEVIDEO) 
 	{
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s:%d, hang up call and stop show local and remote video.", __FUNCTION__, __LINE__);
 		PostEventFIFO(new FSMEvent(USER_EVT_HANGUP));
 		m_bHangup=TRUE;
 		StopVideo();
@@ -1244,6 +1200,7 @@ unsigned int ACMCallFSM::s12_on_event(FSMEvent* event)
 		}else{
 			LogWarn(Severity_Low, Error_Unexpect, LOG_WARN_COUNTERCONNECT_CHANCONNECT_FUNC_FAILED,"chan connect func failed, error server");
 		}
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402304Z80501").setResultCode("RTA3454")("assistant channel bridge failed for entity error");
 	}
 	
 	return 0;
@@ -1294,12 +1251,11 @@ unsigned int ACMCallFSM::s14_on_event(FSMEvent* event)
 {
 	if (event->iEvt == USER_EVT_STOPLOACALREMOTEVIDEO) 
 	{
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s:%d, stop show local and remote video.", __FUNCTION__, __LINE__);
 		StopVideoRender();
 	}
 	else if (event->iEvt == USER_EVT_STOP_RECORD_BROADCAST)
 	{
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("stop double record broadcast.");
+
 	}
 	else if (event->iEvt == USER_EVT_SIPPHONE_IDEL)
 	{
@@ -1488,7 +1444,6 @@ void ACMCallFSM::s3_on_exit() {}
 
 unsigned int ACMCallFSM::s3_on_event(FSMEvent* event)
 {
-	//LOG_TRACE("ACMCallFSM::s3_on_event, id = %d", event->iEvt);
 	if (event->iEvt == USER_EVT_TO_HANDFREE)
 	{
 		//m_bHandFree = TRUE;

+ 16 - 26
Module/mod_counterconnector/ConnectorFSM.h

@@ -392,7 +392,7 @@ public:
 
 	ErrorCodeEnum StartVideo(const char *param)
 	{
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Start Video");
+		//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Start Video");
 		if (!m_pPhoneClient)
 			return Error_NetBroken;
 		PhoneService_StartVideo_Info Info;
@@ -402,10 +402,11 @@ public:
 			Info.remote_view_x, Info.remote_view_y, Info.remote_view_cx, Info.remote_view_cy);
 			Info.local_hwd_move = 0;
 			Info.remote_hwd_move = 1;
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start video, remote width:%d, remote height:%d, local(%d,%d,%d,%d),remote(%d,%d,%d,%d), remote_fps:%d",
-			Info.remote_width, Info.remote_height,
-			Info.local_view_x, Info.local_view_y, Info.local_view_cx, Info.local_view_cy,
-			Info.remote_view_x, Info.remote_view_y, Info.remote_view_cx, Info.remote_view_cy, Info.remote_fps);
+
+		//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start video, remote width:%d, remote height:%d, local(%d,%d,%d,%d),remote(%d,%d,%d,%d), remote_fps:%d",
+		//	Info.remote_width, Info.remote_height,
+		//	Info.local_view_x, Info.local_view_y, Info.local_view_cx, Info.local_view_cy,
+		//	Info.remote_view_x, Info.remote_view_y, Info.remote_view_cx, Info.remote_view_cy, Info.remote_fps);
 
 		if (Error == Error_Succeed) {
 			Error = (*m_pPhoneClient)(EntityResource::getLink().upgradeLink())->StartVideo(Info);
@@ -418,7 +419,7 @@ public:
 
 	ErrorCodeEnum StopVideo()
 	{
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Stop Video");
+		//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Stop Video");
 		if (!m_pPhoneClient)
 			return Error_NetBroken;
 		return (*m_pPhoneClient)(EntityResource::getLink().upgradeLink())->StopVideo();
@@ -426,7 +427,7 @@ public:
 
 	ErrorCodeEnum StartVideoRender(const char* param)
 	{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Start Record Video Render, and param is %s.", param);
+		//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Start Record Video Render, and param is %s.", param);
 		if (!m_pPhoneClient)
 			return Error_NetBroken;
 		PhoneService_StartVideoRender_Info Info;
@@ -435,9 +436,9 @@ public:
 			Info.remote_view_x, Info.remote_view_y, Info.remote_view_cx, Info.remote_view_cy);
 			Info.local_hwd_move = 0;
 			Info.remote_hwd_move = 1;
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start record video render,local(%d,%d,%d,%d),remote(%d,%d,%d,%d)",
-			Info.local_view_x, Info.local_view_y, Info.local_view_cx, Info.local_view_cy,
-			Info.remote_view_x, Info.remote_view_y, Info.remote_view_cx, Info.remote_view_cy);
+			//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start record video render,local(%d,%d,%d,%d),remote(%d,%d,%d,%d)",
+			//Info.local_view_x, Info.local_view_y, Info.local_view_cx, Info.local_view_cy,
+			//Info.remote_view_x, Info.remote_view_y, Info.remote_view_cx, Info.remote_view_cy);
 		if (Error == Error_Succeed) {
 			Error = (*m_pPhoneClient)(EntityResource::getLink().upgradeLink())->StartVideoRender(Info);
 		}
@@ -449,7 +450,7 @@ public:
 
 	ErrorCodeEnum StopVideoRender()
 	{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Stop Record Video Render");
+		/*DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Stop Record Video Render");*/
 		if (!m_pPhoneClient)
 			return Error_NetBroken;
 		return (*m_pPhoneClient)(EntityResource::getLink().upgradeLink())->StopVideoRender();
@@ -457,7 +458,7 @@ public:
 
 	ErrorCodeEnum RealSipErrorCheck()
 	{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Sip connect Fail 6 times,RealSipErrorCheck!");
+		//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Sip connect Fail 6 times,RealSipErrorCheck!");
 		if (!m_pPhoneClient)
 			return Error_NetBroken;
 		return (*m_pPhoneClient)(EntityResource::getLink().upgradeLink())->RealErrorCheck();
@@ -465,10 +466,9 @@ public:
 
 	ErrorCodeEnum SetCallingType(CallingTypeEnum eType)
 	{
-		if (!m_pPhoneClient)
+		if (!m_pPhoneClient) {
 			return Error_NetBroken;
-
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("SetCallingType = %d.", eType);
+		}
 
 		PhoneService_SetCallingParam_Info info;
 		info.CallType = eType;
@@ -486,9 +486,7 @@ public:
 		}
 		else
 		{
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("MSClient connected success!");
 			rc = (*pMSClient)(EntityResource::getLink().upgradeLink())->StopSpeakerRender();
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("pMSClient StopSpeakerRender rc:0x%08x",rc);
 			if(rc != Error_Succeed){
 				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Stop Speaker Render failed return 0x%08x", rc);
 			}
@@ -545,7 +543,6 @@ private:
 					if (p[0] != '0') {
 						if (strstr(p, "198.168.") == NULL && 0 != strncmp(p, "2.0.0.1", strlen("2.0.0.1"))) {
 							strcpy(buff, p);
-							DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("local ip == %s", buff);
 							return Error_Succeed;
 						}
 					}
@@ -570,12 +567,10 @@ private:
 		for (int i = (ifconf.ifc_len / sizeof(struct ifreq)); i > 0; i--) {
 			if (ifreq->ifr_flags == AF_INET) { //for ipv4
 				char* strIP = inet_ntoa(((struct sockaddr_in*)&(ifreq->ifr_addr))->sin_addr);
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("name = %s, local addr = %s", ifreq->ifr_name, strIP);
 				ifreq++;
 				if (NULL != strIP) {
 					if (NULL == strstr(strIP, "198.168.") && NULL == strstr(strIP, "127.0.0.1")) {
 						strcpy(buff, strIP);
-						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("local ip == %s", buff);
 						error = Error_Succeed;
 						break;
 					}
@@ -609,7 +604,6 @@ private:
 		}
 		(*m_pPhoneClient)(EntityResource::getLink().upgradeLink())->SetCallingParam(info);
 
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("before make call, call type is %d, to_uri:%s", info.CallType, Req.to_uri.GetData());
 		ErrorCodeEnum Error = (*m_pPhoneClient)(EntityResource::getLink().upgradeLink())->MakeCall(Req, Ans, 10000);
 		return Error;
 	}
@@ -634,7 +628,6 @@ private:
 		info.connect_ip = callingparam.connect_ip;
 		info.connect_port = callingparam.connect_port;
 		(*m_pPhoneClient)(EntityResource::getLink().upgradeLink())->SetCallingParam(info);
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("before make call, call type is %d, to_uri:%s, from_uri:%s, call_id:%s", info.CallType, to_uri, from_uri, call_id);
 
 		ErrorCodeEnum Error = (*m_pPhoneClient)(EntityResource::getLink().upgradeLink())->MakeCall(Req, Ans, 10000);
 
@@ -643,7 +636,6 @@ private:
 
 	ErrorCodeEnum HangupCall()
 	{
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Hangup Call!");
 		if (!m_pPhoneClient) {
 			return Error_NetBroken;
 		}
@@ -652,12 +644,10 @@ private:
 		PhoneService_HangupCall_Ans Ans;
 		if (!m_SessionParam.connect_session.IsNullOrEmpty()){
 			Req.session_num = m_SessionParam.connect_session;
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Hangup Call connect_session = %s", m_SessionParam.connect_session.GetData());
 		}
 
 		if (!m_SessionParam.connect_ip.IsNullOrEmpty()){
 			Req.branch_server_ip = m_SessionParam.connect_ip;
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Hangup Call connect_ip = %s", m_SessionParam.connect_ip.GetData());
 		}
 
 		if (m_SessionParam.event_port){
@@ -730,7 +720,6 @@ private:
 
 	ErrorCodeEnum StopChannel()
 	{
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("stop channel");
 		if (!m_pPhoneClient) {
 			return Error_NetBroken;
 		}
@@ -883,6 +872,7 @@ private:
 	int ParseDefaultServer(const char* strServer);
 	int GetFailedErrorCode(int iSrcState);
 	int LogFailedWarns(int iFailedCode, const char* strmsg);
+
 public:
 	BOOL m_bHandFree;
 	//坐席控制话筒的当前状态

+ 0 - 1
Module/mod_livenessdetection/unix/mod_livenessdetection.cpp

@@ -102,7 +102,6 @@ ErrorCodeEnum CLivenessDetectionEntity::__OnStart(ErrorCodeEnum preOperationErro
 		m_eDeviceType = eStand1SPlusType;
 	}
 	else{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("the type is standard");
 		m_eDeviceType = eStand2sType;
 	}
 

+ 6 - 51
Module/mod_localmediaplay/mod_localmediaplay.cpp

@@ -1048,10 +1048,7 @@ void CLocalMediaPlayEntity::OnStarted()
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create qryMeia thread success, %d.", m_scanThread);
 #else
 	int err = pthread_create(&m_scanThreadId, NULL, queryMedia, this);
-	if (0 == err) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create queryMedia thread success, %u.", m_scanThreadId);
-	}
-	else {
+	if (0 != err) {
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create queryMedia thread failed.");
 	}
 
@@ -1147,7 +1144,6 @@ ErrorCodeEnum CLocalMediaPlayEntity::HandleRemoteRecord(const char* pszMessage)
 				result[i] = const_cast<LPSTR>(arr2[i].GetData());
 			}
 			if (arr1.GetCount() > 4) {
-				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("record swift number is %s.", result[4]);
 #ifdef RVC_OS_WIN
 				_snprintf(strSwiftName, MAX_PATH, "%s", result[4]);
 #else
@@ -1641,16 +1637,10 @@ DWORD WINAPI StartMediaPlayFunc(LPVOID param)
 void* StartAudioPlayingThreadFunc(void* param)
 {
 	CLocalMediaPlayEntity* entity = (CLocalMediaPlayEntity*)param;
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Enter StartAudioPlayingThreadFunc");
 	const char* pAudioNames = entity->m_lastPlayAudio.c_str();
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Begin StartAudio, and Audio Info is %s.", pAudioNames);
-	if (0 == entity->m_pMediaAudioPlayer->PlayLocalAudio(pAudioNames)) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Succeed to StartAudio, and Audio Info is %s.", pAudioNames);
-	}
-	else {
+	if (0 != entity->m_pMediaAudioPlayer->PlayLocalAudio(pAudioNames)) {
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("StartAudio failed, for %s is not exsit.", pAudioNames);
 	}
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Leave StartAudioPlayingThreadFunc");
 	entity->m_uMediaPlayThreadId = 0;
 
 	return 0;
@@ -1663,7 +1653,6 @@ void* StartMediaPlayFunc(void* param)
 	if (NULL == param) {
 		return (void*)&iRet;
 	}
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Enter Media Play Function.");
 
 	CLocalMediaPlayEntity* entity = (CLocalMediaPlayEntity*)param;
 	while (entity->GetPlayFlag())
@@ -1749,7 +1738,6 @@ void* StartMediaPlayFunc(void* param)
 			}
 			else if ('P' == item.type)
 			{//play Image
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Begin new Image play, entity->m_mediaParam.nCfgInx = %d.", entity->m_mediaParam.nCfgInx);
 				CPicPlayConfig config = { 0 };
 				config.bFullScreen = IS_DEBUG ? false : item.fullScreen;
 				config.bPrimMonitor = IS_DEBUG ? true : item.primMonitor;
@@ -1769,11 +1757,8 @@ void* StartMediaPlayFunc(void* param)
 						iRet = -1;
 						return (void*)&iRet;
 					}
-					else {
-						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Image Media Player Thread id is %u.", playThreadId);
-					}
+
 					if (0 == pthread_join(playThreadId, NULL)) {
-						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("pthread join thread id %u success.", playThreadId);
 						iRet = 0;
 					}
 					else {
@@ -1785,12 +1770,10 @@ void* StartMediaPlayFunc(void* param)
 			}
 		}
 		unsigned int uend_time = y2k_time_now();
-		//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("uend_time - ustart_time = %u.", uend_time - ustart_time);
 		if (uend_time - ustart_time < RVC_MIN_LOCALPLAYER_TIME) {
 			Sleep(30 * DEFAULT_SLEEP_TIME);
 		}
 	}
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Leave Media Play Function.");
 	entity->m_uMediaPlayThreadId = 0;
 	return (void*)&iRet;
 }
@@ -1800,15 +1783,10 @@ void* StartNoticePlayThreadFunc(void* param)
 {
 	int iRet = -1;
 	CLocalMediaPlayEntity* entity = (CLocalMediaPlayEntity*)param;
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Enter NoticePlayThreadFunc");
 	const char* pVideoName = entity->m_lastPlayVideo.c_str();
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Begin Start Notice Play, and Video Notice Info is %s.", pVideoName);
 
 	Clibmediaplayer* player = entity->m_pMediaPlayer[entity->m_mediaParam.nCfgInx];
 	player->PlayVideoNotice(entity->m_mediaParam.nWndX, entity->m_mediaParam.nWndY, entity->m_mediaParam.nWndWidth, entity->m_mediaParam.nWndHeight, pVideoName);
-
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Succeed to Start Notice Play, and Video Notice Info is %s.", pVideoName);
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Leave NoticePlayThreadFunc");
 	entity->m_uNoticePlayThreadId = 0;
 
 	iRet = 0;
@@ -1895,10 +1873,7 @@ void CLocalMediaPlayEntity::StartVideo(int nCfgInx, int nWndX, int nWndY, int nW
 #else
 		m_badplayflag = true;
 		int err = pthread_create(&m_uMediaPlayThreadId, NULL, StartMediaPlayFunc, this);
-		if (0 == err) {
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create media play thread[%u] success.", m_uMediaPlayThreadId);
-		}
-		else {
+		if (0 != err) {
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create media play thread failed.");
 		}
 #endif // RVC_OS_WIN
@@ -1966,7 +1941,6 @@ void CLocalMediaPlayEntity::StartAudio(const char *pAudioNames)
 	}
 #else
 	if (m_pMediaAudioPlayer->checkIsPlay()) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("current is playing, close it.");
 		if (0 != m_uMediaPlayThreadId) {
 			m_pMediaAudioPlayer->Close();
 			m_uMediaPlayThreadId = 0;
@@ -1981,10 +1955,7 @@ void CLocalMediaPlayEntity::StartAudio(const char *pAudioNames)
 	m_lastPlayAudio = pAudioNames;
 
 	int err = pthread_create(&m_uMediaPlayThreadId, NULL, StartAudioPlayingThreadFunc, this);
-	if (0 == err) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create audio play thread[%u] success.", m_uMediaPlayThreadId);
-	}
-	else {
+	if (0 != err) {
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create audio play thread failed.");
 	}
 
@@ -1992,7 +1963,6 @@ void CLocalMediaPlayEntity::StartAudio(const char *pAudioNames)
 
 	auto audioRet = GetLocalAudioVolume();
 	m_pMediaAudioPlayer->SetVolume(audioRet.second);
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Succeed to set audio volume %d!", audioRet.second);
 #endif
 }
 
@@ -2052,7 +2022,6 @@ void CLocalMediaPlayEntity::StopVideo(int nCfgInx)
 			m_pMediaPlayer[nCfgInx]->Close();
 			m_pPicturePlayer[nCfgInx]->Close();
 			pthread_join(m_uMediaPlayThreadId, NULL);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Succeed to StopVideo!");
 		}
 #endif
 	}
@@ -2078,7 +2047,6 @@ void CLocalMediaPlayEntity::StopAudio()
 		m_pMediaAudioPlayer->Close();
 		m_buserstopaudio = true;
 	}
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Succeed to StopAudio!");
 #endif
 }
 
@@ -2106,7 +2074,6 @@ void CLocalMediaPlayEntity::StopImage(int nCfgInx)
 #else
 		if (false == m_pPicturePlayer[nCfgInx]->checkIsStop()) {
 			m_pPicturePlayer[nCfgInx]->Close();
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Succeed to StopImage!");
 		}
 #endif
 	}
@@ -2132,7 +2099,6 @@ bool CLocalMediaPlayEntity::GetLocalVideoVolume(int nCfgInx, int &nVolume)
 		Error = spConfig->ReadConfigValueInt("LocalVideo", "Volume", nVolume);
 		if (Error == Error_Succeed && nVolume >= 0 && nVolume <= 100)
 		{
-			//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to get local video volume with nCfgInx:%d, nVolume:%d", nCfgInx, nVolume);
 			return true;
 		}
 	}
@@ -2145,7 +2111,6 @@ bool CLocalMediaPlayEntity::GetLocalVideoVolume(int nCfgInx, int &nVolume)
 
 std::pair<bool, int> CLocalMediaPlayEntity::GetLocalAudioVolume()
 {
-	//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("get local audio volume req.");
 	CSmartPointer<IConfigInfo> spConfig;
 	int nVolume = 0;
 	ErrorCodeEnum Error = GetFunction()->OpenConfig(Config_Run, spConfig);
@@ -2156,11 +2121,9 @@ std::pair<bool, int> CLocalMediaPlayEntity::GetLocalAudioVolume()
 		{
 			nVolume = 50;
 			spConfig->WriteConfigValueInt("LocalAudio", "Volume", nVolume);
-			//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("read nVolume 0, set default 50");
 		}
 		if (Error == Error_Succeed && nVolume >= 0 && nVolume <= 100)
 		{
-			//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("succeed to get local audio volume with nVolume:%d", nVolume);
 			return std::make_pair(true, nVolume);
 		}
 	}
@@ -2172,7 +2135,6 @@ std::pair<bool, int> CLocalMediaPlayEntity::GetLocalAudioVolume()
 
 bool CLocalMediaPlayEntity::SetLocalAudioVolume(int nVolume)
 {
-	//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("set local video audio req.");
 	if (nVolume < 0 || nVolume > 100){
 		return false;
 	}
@@ -2184,7 +2146,6 @@ bool CLocalMediaPlayEntity::SetLocalAudioVolume(int nVolume)
 		Error = spConfig->WriteConfigValueInt("LocalAudio", "Volume", nVolume);
 		if (Error == Error_Succeed)
 		{
-			//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("succeed to set local audio volume with nVolume:%d!", nVolume);
 #ifdef RVC_OS_WIN
 			if (0 == m_iPlayType) {
 				m_pAudioPlayer->SetVolume(nVolume);
@@ -2207,7 +2168,6 @@ bool CLocalMediaPlayEntity::SetLocalAudioVolume(int nVolume)
 
 bool CLocalMediaPlayEntity::SetLocalVideoVolume(int nCfgInx, int nVolume)
 {
-	//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("set local video volume req.");
 	if (nVolume < 0 || nVolume > 100){
 		return false;
 	}
@@ -2219,7 +2179,6 @@ bool CLocalMediaPlayEntity::SetLocalVideoVolume(int nCfgInx, int nVolume)
 		Error = spConfig->WriteConfigValueInt("LocalVideo", "Volume", nVolume);
 		if (Error == Error_Succeed)
 		{
-			//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("succeed to set local video volume with nCfgInx:%d, nVolume:%d!", nCfgInx, nVolume);
 			for (int i = 0; i < MAX_PLAY_CHANNELS; ++i)
 			{
 #ifdef RVC_OS_WIN
@@ -2406,7 +2365,6 @@ ErrorCodeEnum CLocalMediaPlayEntity::StartFFPlayerNotice(int nCfgInx, int nWndX,
 #else
 				int err = pthread_create(&m_uNoticePlayThreadId, NULL, StartNoticePlayThreadFunc, this);
 				if (0 == err) {
-					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create notice play thread[%u] success.", m_uNoticePlayThreadId);
 					LogWarn(Severity_Low, Error_Debug, LOG_EVT_START_NOTICE_PLAY, CSimpleStringA::Format("start play video notice %s", strNoticeFileName.GetData()).GetData());
 				}
 				else {
@@ -2483,15 +2441,12 @@ ErrorCodeEnum CLocalMediaPlayEntity::StopNotice(int nCfgInx)
 			}
 		}
 #else
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_pPlayer = 0x%08x while play!", m_pMediaPlayer[nCfgInx]);
 		m_pMediaPlayer[nCfgInx]->Close();
 
 		if (m_uNoticePlayThreadId > 0) {
 			if (0 == pthread_join(m_uNoticePlayThreadId, NULL)) {
 				if (m_lastPlayVideo.length() > 0) {
-					char strmsg[MAX_PATH] = { 0 };
-					snprintf(strmsg, MAX_PATH, "%s%s", "success to stop play notice ", m_lastPlayVideo.c_str());
-					LogWarn(Severity_Low, Error_Debug, LOG_EVT_STOP_NOTICE_PLAY, strmsg);
+					LogWarn(Severity_Low, Error_Debug, LOG_EVT_STOP_NOTICE_PLAY, CSimpleStringA::Format("%s%s", "success to stop play notice ", m_lastPlayVideo.c_str()).GetData());
 				}
 			}
 			m_uNoticePlayThreadId = 0;

+ 1 - 2
Module/mod_mediacontroller/unix/capture.cpp

@@ -1270,8 +1270,7 @@ static void video_capture_destroy(video_capture_t *video_cap)
 static int get_video_capture_fps(int icapfps)
 {
 	int ifps = REC_COMMON_VIDEO_PADRAW_FPS;
-	if ((ePadtype == g_eDeviceType) || (eMobilePadType == g_eDeviceType) || (eDesk2SType == g_eDeviceType) 
-	|| (eDesk1SType == g_eDeviceType) || (eDesk2SIntegratedType == g_eDeviceType)){
+	if (eMobilePadType == g_eDeviceType){
 		ifps = REC_COMMON_VIDEO_PADRAW_FPS;
 	}
 	else{

+ 1 - 7
Module/mod_mediacontroller/unix/mod_mediacontroller.cpp

@@ -352,9 +352,6 @@ DeviceTypeEnum CMediaControllerEntity::RvcGetDeviceType()
 		if (_stricmp(stStaticinfo.strSite, "CMB.FLB") == 0) {
 			eType = eMobilePadType;
 		}
-		else {
-			eType = ePadtype;
-		}
 	}
 	else if (_stricmp(stStaticinfo.strMachineType, "RPM.Stand1S") == 0) {
 		eType = eRpm1sType;
@@ -597,7 +594,6 @@ void CMediaControllerEntity::OnTimeout(DWORD dwTimerID)
 			if (Error_Succeed == GetFunction()->GetSysVar(SYSVAR_CALLSTATE, strCallState)) {
 				if (strCallState.Compare("O") == 0) {
 					OnCameraStopped();
-					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop camera.");
 					if (m_capture) {
 						GetFunction()->KillTimer(1);
 						capture_stop(m_capture);
@@ -623,13 +619,12 @@ void CMediaControllerEntity::OnTimeCameraStatusCheck()
 	bool bOptTimeout = false;
 
 	BOOL bIsPadType = FALSE;
-	if ((ePadtype == m_eDeviceType)||(eMobilePadType == m_eDeviceType)||(eDesk2SType == m_eDeviceType)||(eDesk1SType == m_eDeviceType)||(eDesk2SIntegratedType == m_eDeviceType)){
+	if (eMobilePadType == m_eDeviceType){
 		bIsPadType = TRUE;
 	}
 
 	capture_detect_camera_bug(m_capture, &env_n, &opt_n, bIsPadType);
 
-	//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("capture_detect_camera_bug env_n = %d, opt_n = %d.",env_n, opt_n);
 
 	capture_get_last_frametime(m_capture, &nLastEnvTime, &nLastOptTime, bIsPadType);
 
@@ -651,7 +646,6 @@ void CMediaControllerEntity::OnTimeCameraStatusCheck()
 	//env图像是否超时
 	if(nLastEnvTime > 0)
 	{
-		//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("now=%d,nLastEnvTime=%d",y2k_time_now(),nLastEnvTime);
 		if(((y2k_time_now()-nLastEnvTime) > m_iCamTimeout)&&!bEnvTimeout)
 		{
 			bEnvTimeout = true;

+ 0 - 1
Module/mod_recorder/mod_recorder.h

@@ -87,7 +87,6 @@ namespace Recorder {
 		int HandleFinishedVideoRecord(const char* videofilename);
 		int SaveExceptionRecordVideos();
 		int HandleEncryptVideoRecord(const char* videofilename);
-		bool IsCurrentTerminalMathed();
 		int DeleteExceptionLogFiles();
 		ErrorCodeEnum LoadEntityConfig();
 		ErrorCodeEnum PostVideoRecordInfos();

+ 22 - 176
Module/mod_recorder/unix/mod_recorder.cpp

@@ -51,10 +51,7 @@ static const char* GetFileName(const char* pfilename)
 static void LogVideoSizeInfo(const char* pszMessage)
 {
 	unsigned long ufilesize = GetFileSize(pszMessage);
-	char strmsg[MAX_PATH] = { 0 };
-	snprintf(strmsg, MAX_PATH, "%s file size is %u byte.", pszMessage, ufilesize);
-
-	LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORDER_VIDEO_SIZE, strmsg);
+	LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORDER_VIDEO_SIZE, CSimpleStringA::Format("%s file size is %u byte.", pszMessage, ufilesize).GetData());
 }
 
 
@@ -62,17 +59,12 @@ void RecordServiceSession::Handle_StartTransactionRecord(SpReqAnsContext<Recorde
 {
 	DbgToBeidou(ctx->link, __FUNCTION__)();
 	if (m_pEntity->GetStartFlag()) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Current is recording, stop it.");
 		m_pEntity->StopRecord();
 	}
 
-	char strVideoName[MAX_PATH] = { 0 };
-	snprintf(strVideoName, MAX_PATH, "%s%s",RVC_TRANSATCION_RECORD_SUFFIX, ctx->Req.VideoName.GetData());
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("StartRecord and video name is %s.", strVideoName);
-
 	m_pEntity->SetRecordSessionID(ctx->Req.VideoName.GetData());
 
-	m_pEntity->StartRecord(strVideoName);
+	m_pEntity->StartRecord(CSimpleStringA::Format("%s%s", RVC_TRANSATCION_RECORD_SUFFIX, ctx->Req.VideoName.GetData()).GetData());
 
 	ctx->Answer(Error_Succeed);
 }
@@ -181,8 +173,6 @@ void CRecorderEntity::OnStarted()
 		m_strAppVersion = si.InstallVersion.ToString();
 		m_strTerminalId = si.strTerminalID;
 	}
-	
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("TerminalID is %s, Application Version is %s", m_strTerminalId.GetData(), m_strAppVersion.GetData());
 
 	LoadEntityConfig();
 	//DeleteExceptionLogFiles();
@@ -207,8 +197,6 @@ bool CRecorderEntity::InitRecorder()
 			REC_COMMON_VIDEO_ENV_SHM_RTP_QUEUE, REC_COMMON_VIDEO_OPT_SHM_RTP_QUEUE);
 	}
 
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("init libvideorecord success!");
-
 	return bRet;
 }
 
@@ -245,7 +233,6 @@ ErrorCodeEnum CRecorderEntity::__OnClose(ErrorCodeEnum preOperationError)
 
 CServerSessionBase* CRecorderEntity::OnNewSession(const char* pszRemoteEntityName, const char* pszClass)
 {
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s connected class = %s!", pszRemoteEntityName, pszClass);
 	return new RecordServiceSession(this);
 }
 
@@ -323,8 +310,6 @@ ErrorCodeEnum CRecorderEntity::LoadEntityConfig()
 		Error = Error_Failed;
 	}
 
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Encryption flag is %d, and EncMtype is 0x%08x.", iEncrytion, uMtype);
-
 #ifdef RVC_OS_WIN
 	if (1 == iEncrytion && (uMtype & GetDeviceTypeValue(m_eDeviceType))) {
 		m_bEncFlag = true;
@@ -339,8 +324,6 @@ ErrorCodeEnum CRecorderEntity::LoadEntityConfig()
 		m_strHttpServerAddr = strHttpServerAddr;
 	}
 
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Record Mode is %d, HttpServerAddr is %s.", m_iRecordMode, m_strHttpServerAddr.GetData());
-
 	if (eMobilePadType != m_eDeviceType) {
 		if (0 != iRecordType) {
 			m_eRecordType = eMP4;
@@ -351,8 +334,6 @@ ErrorCodeEnum CRecorderEntity::LoadEntityConfig()
 		m_iHttpTimeOut = iTimeOut;
 	}
 
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("EncFlag is %s, video format is %s, and http timeout is %d.", m_bEncFlag ? "true" : "false", m_eRecordType == eMP4 ? RECORD_MP4_SUFFIX : RECORD_WMV_SUFFIX, m_iHttpTimeOut);
-
 	return Error;
 }
 
@@ -416,19 +397,17 @@ ErrorCodeEnum CRecorderEntity::HandleExceptionRecordVideos()
 		return Error;
 	}
 
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("videofilename = %s, strSession = [%s], iSeriesNum = %d.", videofilename, strSession, iSeriesNum);
 
 	SetRecordSessionID(strSession + strlen(RVC_TRANSATCION_RECORD_SUFFIX));
 
 	while (--iSeriesNum >= 0) {
-		char strFilePath[MAX_PATH] = { 0 };
-		snprintf(strFilePath, MAX_PATH, "%s%s_%d.%s", m_RecordSaveDir.GetData(), strSession, iSeriesNum, strFormat);
-		if (ExistsFile(strFilePath)) {
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("File {%s} is exist, add to video record list.", strFilePath);
-			AddToVideoRecordList(strFilePath);
+		CSimpleStringA strFilePath("");
+		strFilePath = CSimpleStringA::Format("%s%s_%d.%s", m_RecordSaveDir.GetData(), strSession, iSeriesNum, strFormat);
+		if (ExistsFile(strFilePath.GetData())) {
+			AddToVideoRecordList(strFilePath.GetData());
 		}
 		else {
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("File {%s} is not exist.", strFilePath);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("File {%s} is not exist.", strFilePath.GetData());
 		}
 	}
 }
@@ -454,49 +433,45 @@ ErrorCodeEnum CRecorderEntity::AddToVideoRecordList(const char* videofilename)
 
 	m_vRecordList.push_back(*item);
 
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_vRecordList size = %d.", m_vRecordList.size());
-
 	Error = Error_Succeed;
 
 	return Error;
 }
+
+
 void CRecorderEntity::OnRecordFailed(eRvcRecordFailedCase eCase, const char *pszMessage, bool bRecordDevFault)
 {
 	m_eBusinessStatus = eFailed;
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("OnRecordFailed!");
 	if (!bRecordDevFault){
 		LogEvent(Severity_Middle,LOG_EVT_RECORDFAILED,"0");
-		char strmsg[MAX_PATH] = {0};
-		snprintf(strmsg, MAX_PATH, "{%s} 本地录音录像失败,已停止!", pszMessage ? pszMessage : " ");
-		LogWarn(Severity_Middle, Error_Debug, LOG_EVT_RECORDING_FAILED, strmsg);
+		LogWarn(Severity_Middle, Error_Debug, LOG_EVT_RECORDING_FAILED, CSimpleStringA::Format("{%s} 本地录音录像失败,已停止!", pszMessage ? pszMessage : " ").GetData());
 	}
 	else{
 		LogEvent(Severity_Middle,LOG_EVT_RECORDFAILED,"1");
-		char strinfo[MAX_PATH] = {0};
-		snprintf(strinfo, MAX_PATH, "{%s} 本地录音录像设备故障,尝试恢复中(预计10s内),请稍等", pszMessage ? pszMessage : " ");
-		LogWarn(Severity_Middle, Error_Debug, LOG_EVT_RECORDING_FAILED, strinfo);
+		LogWarn(Severity_Middle, Error_Debug, LOG_EVT_RECORDING_FAILED, CSimpleStringA::Format("{%s} 本地录音录像设备故障,尝试恢复中(预计10s内),请稍等", pszMessage ? pszMessage : " ").GetData());
 	}
 }
 
+
 void CRecorderEntity::OnRecordEntityExcption()
 {
 	LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORD_ENTITY_EXCEPTION, "OnRecordEntityExcption!");
 }
 
+
 void CRecorderEntity::OnRecordFinished()
 {
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("OnRecordFinished!");
+
 }
 
-int CRecorderEntity::GetCameraState()
+int CRecorderEntity:: GetCameraState()
 {
 	return m_iCameraState;
 }
 
 
-void CRecorderEntity::OnASectionFinished(const char* pszMessage, int iSerialNum, bool bfinished)
+void CRecorderEntity::OnASectionFinished(const char *pszMessage, int iSerialNum, bool bfinished)
 {
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("file %s finished.(SerialNum %d)", pszMessage, iSerialNum);
 	m_iSeriesNum = iSerialNum;
 	if (false == bfinished){
 		LogEvent(Severity_Middle, LOG_EVT_RECORDER_SECTION_FINISHED, pszMessage);
@@ -511,50 +486,14 @@ void CRecorderEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,
 	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 EVENT_MOD_BEGIN_RECORD:
-		if (0 == m_iRecordMode) {
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start record!");
-			StartRecord(pszMessage);
-		}
-		break;
-
-	case EVENT_MOD_END_RECORD:
-		if (0 == m_iRecordMode) {
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop record!");
-			StopRecord();
-		}
-		break;
-
-	case LOG_EVT_UI_RETURNMENU:
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("exit to main!");
-		if (0 == m_iRecordMode) {
-			//本地录像,退回到首页关闭当前文件,重新开始录制
-			if (m_bStarted) {
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("return menu,close video file!");
-				m_pRecorder->CloseVideoFile();
-			}
-		}
-		break;
-
-	case EVENT_MOD_PAUSE_RECORD:
-		if (m_bStarted && (0 == m_iRecordMode)){
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("manipulate media device function called, pause record!");
-			m_pRecorder->PauseRecord();
-			m_pRecorder->CloseVideoFile();
-		}
-		break;
-
 	case EVENT_MOD_CONTINUE_RECORD:
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("manipulate media device function called, continue record!");
 		m_pRecorder->ContinueRecord();
 		break;
 
 	case LOG_EVT_RECORDER_SECTION_FINISHED:
 		{
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recorder section finished, and message is %s.", pszMessage);
 			if (m_iRecordMode) {
 				LogVideoSizeInfo(pszMessage);
 			}
@@ -567,7 +506,6 @@ void CRecorderEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,
 
 	case LOG_EVT_RECORDER_WHOLE_FINISHED:
 		{
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recorder whole finished, and message is %s.", pszMessage);
 			if (m_iRecordMode) {
 				LogVideoSizeInfo(pszMessage);
 			}
@@ -594,13 +532,9 @@ void CRecorderEntity::OnSysVarEvent(const char *pszKey, const char *pszValue,con
 {	
 	if (_stricmp(pszKey, SYSVAR_CAMERASTATE) == 0)
 	{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("camera state from : %c to %c", pszOldValue[0], pszValue[0]);
 		m_iCameraState = pszValue[0]; 
 		if (pszValue[0] == 'E'){
 			m_iActiveCamera = CAMERA_TYPE_OPT;
-			if (eDesk1SType == m_eDeviceType || eDesk2SIntegratedType == m_eDeviceType){
-				m_iActiveCamera = CAMERA_TYPE_ERROR;
-			}
 		}
 		else if (pszValue[0] == 'O'){
 			m_iActiveCamera = CAMERA_TYPE_ENV;
@@ -623,18 +557,6 @@ void CRecorderEntity::OnSysVarEvent(const char *pszKey, const char *pszValue,con
 			}
 		}
 	}
-	else if(_stricmp(pszKey,"SessionID")==0)
-	{
-		CSimpleStringA strSessionID;
-		GetFunction()->GetSysVar("SessionID",strSessionID);
-		//如果sessionid改变且不为空,切换录像文件
-		if(_stricmp(strSessionID,"N")!=0){
-			if (m_bStarted && (0 == m_iRecordMode)){
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Session Id change to %s, close record and start new video file.",strSessionID.GetData());
-				m_pRecorder->ReNameVideoFile(strSessionID);
-			}
-		} 			
-	}
 }
 
 
@@ -648,8 +570,6 @@ void CRecorderEntity::OnSelfTest(EntityTestEnum eTestType,CSmartPointer<ITransac
 
 void CRecorderEntity::StartRecord(const char *videofilename)
 {
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("videofilename = %s", videofilename);
-
 	int fps = 5;
 	Rvc_RecordAudioParam_t tAudioParams;
 	tAudioParams.eRecordType = eSingleSide;
@@ -706,18 +626,6 @@ DeviceTypeEnum CRecorderEntity::RvcGetDeviceType()
 		if (_stricmp(stStaticinfo.strSite, "CMB.FLB") == 0) {
 			eType = eMobilePadType;
 		}
-		else {
-			eType = ePadtype;
-		}
-	}
-	else if (_stricmp(stStaticinfo.strMachineType, "RVC.Desk2S") == 0) {
-		eType = eDesk2SType;
-		WORD nMajor = stStaticinfo.MachineVersion.GetMajor();
-		WORD nMinor = stStaticinfo.MachineVersion.GetMinor();
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("MachineVersion is %d.%d", nMajor, nMinor);
-		if (2 == nMajor) {
-			eType = eDesk2SIntegratedType;
-		}
 	}
 	else if (_stricmp(stStaticinfo.strMachineType, "RPM.Stand1S") == 0) {
 		eType = eRpm1sType;
@@ -764,13 +672,10 @@ int CRecorderEntity::HandleFinishedVideoRecord(const char* videofilename)
 		BOOL bRet = FALSE;
 		if (ExistsFile(srcfile.GetData())){
 			if(rename(srcfile.GetData(), dstfile.GetData())) {
-				char strmsg[MAX_PATH] = {0};
-				snprintf(strmsg, MAX_PATH, "Error Code %u while move %s ", GetLastError(), srcfile.GetData());
-				LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORDER_MOVE_FAILED, strmsg);
+				LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORDER_MOVE_FAILED, CSimpleStringA::Format("Error Code %u while move %s ", GetLastError(), srcfile.GetData()).GetData());
 			}
 			else {
 				AddToVideoRecordList(dstfile.GetData());
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("record finished move file form %s to %s success.", srcfile.GetData(), dstfile.GetData());
 			}
 		}
 
@@ -778,13 +683,10 @@ int CRecorderEntity::HandleFinishedVideoRecord(const char* videofilename)
 		dstfile = CSimpleStringA::Format("%s%s_%d.%s",(LPCTSTR)m_RecordSaveDir,(LPCTSTR)strSession, iSeriesNum-1, strFormat);
 		if (ExistsFile(srcfile.GetData())){
 			if(rename(srcfile.GetData(), dstfile.GetData())) {
-				char strinfo[MAX_PATH] = {0};
-				snprintf(strinfo, MAX_PATH, "Error Code %u while move %s ", GetLastError(), srcfile.GetData());
-				LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORDER_MOVE_FAILED, strinfo);
+				LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORDER_MOVE_FAILED, CSimpleStringA::Format("Error Code %u while move %s ", GetLastError(), srcfile.GetData()).GetData());
 			}
 			else {
 				AddToVideoRecordList(dstfile.GetData());
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("record finished move file form %s to %s success.", srcfile.GetData(), dstfile.GetData());
 			}
 		}
 	}
@@ -845,8 +747,6 @@ int CRecorderEntity::HandleEncryptVideoRecord(const char* videofilename)
 	}
 #endif // RVC_OS_WIN
 
-
-
 	return iRet;
 }
 
@@ -873,13 +773,10 @@ int CRecorderEntity::HandleSaveVideoRecord(const char* videofilename)
 		CSimpleStringA dstfile = CSimpleStringA::Format("%s%s_%d.%s", (LPCTSTR)m_RecordSaveDir, (LPCTSTR)strSession, iSeriesNum, strFormat);
 		if (ExistsFile(srcfile.GetData())) {
 			if (rename(srcfile.GetData(), dstfile.GetData())) {
-				char strmsg[MAX_PATH] = { 0 };
-				snprintf(strmsg, MAX_PATH, "Error Code %u while move %s ", GetLastError(), srcfile.GetData());
-				LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORDER_MOVE_FAILED, strmsg);
+				LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORDER_MOVE_FAILED, CSimpleStringA::Format("Error Code %u while move %s ", GetLastError(), srcfile.GetData()).GetData());
 			}
 			else {
 				AddToVideoRecordList(dstfile.GetData());
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("section finished move file form %s to %s success.", srcfile.GetData(), dstfile.GetData());
 			}
 		}
 	}
@@ -889,12 +786,7 @@ int CRecorderEntity::HandleSaveVideoRecord(const char* videofilename)
 			CSimpleStringA dstfile = CSimpleStringA::Format("%s%s_%d.%s", (LPCTSTR)m_RecordSaveDir, (LPCTSTR)strSession, iSeriesNum - 1, strFormat);
 			if (ExistsFile(srcfile.GetData())) {
 				if (rename(srcfile.GetData(), dstfile.GetData())) {
-					char strmsg[MAX_PATH] = { 0 };
-					snprintf(strmsg, MAX_PATH, "Error Code %u while move %s ", GetLastError(), srcfile.GetData());
-					LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORDER_MOVE_FAILED, strmsg);
-				}
-				else {
-					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("section finished move file form %s to %s success.", srcfile.GetData(), dstfile.GetData());
+					LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORDER_MOVE_FAILED, CSimpleStringA::Format("Error Code %u while move %s ", GetLastError(), srcfile.GetData()).GetData());
 				}
 				m_iMovedSeriesNum = iSeriesNum - 1;
 			}
@@ -902,7 +794,6 @@ int CRecorderEntity::HandleSaveVideoRecord(const char* videofilename)
 		else {
 			if (0 == m_iMovedSeriesNum) {
 				if (false == m_bMoveFlag) {
-					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("First record video, ignore it.");
 					m_bMoveFlag = true;
 				}
 				else {
@@ -910,12 +801,9 @@ int CRecorderEntity::HandleSaveVideoRecord(const char* videofilename)
 					if (ExistsFile(srcfile.GetData())) {
 						CSimpleStringA dstfile = CSimpleStringA::Format("%s%s_%d_end.%s", (LPCTSTR)m_RecordSaveDir, (LPCTSTR)m_LastSaveSessionId, 0, strFormat);
 						if (rename(srcfile.GetData(), dstfile.GetData())) {
-							char strtext[MAX_PATH] = { 0 };
-							snprintf(strtext, MAX_PATH, "Error Code %u while move %s ", GetLastError(), srcfile.GetData());
-							LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORDER_MOVE_FAILED, strtext);
+							LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORDER_MOVE_FAILED, CSimpleStringA::Format("Error Code %u while move %s ", GetLastError(), srcfile.GetData()).GetData());
 						}
 						else {
-							DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("section finished move file form %s to %s success.", srcfile.GetData(), dstfile.GetData());
 							AddToVideoRecordList(dstfile.GetData());
 						}
 					}
@@ -926,20 +814,15 @@ int CRecorderEntity::HandleSaveVideoRecord(const char* videofilename)
 				if (ExistsFile(srcfile.GetData())) {
 					CSimpleStringA dstfile = CSimpleStringA::Format("%s%s_%d_end.%s", (LPCTSTR)m_RecordSaveDir, (LPCTSTR)m_LastSaveSessionId, m_iMovedSeriesNum + 1, strFormat);
 					if (rename(srcfile.GetData(), dstfile.GetData())) {
-						char strinfo[MAX_PATH] = { 0 };
-						snprintf(strinfo, MAX_PATH, "Error Code %u while move %s ", GetLastError(), srcfile.GetData());
-						LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORDER_MOVE_FAILED, strinfo);
+						LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORDER_MOVE_FAILED, CSimpleStringA::Format("Error Code %u while move %s ", GetLastError(), srcfile.GetData()).GetData());
 					}
 					else {
-						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("section finished move file form %s to %s success.", srcfile.GetData(), dstfile.GetData());
 						AddToVideoRecordList(dstfile.GetData());
 					}
 				}
 				m_iMovedSeriesNum = 0;
 			}
-
 			m_LastSaveSessionId = strSession;
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("New set last save session id is %s ", m_LastSaveSessionId.GetData());
 		}
 	}
 
@@ -1003,8 +886,6 @@ int CRecorderEntity::GetRecordVideoInfo(const char* videofilename, char* strSess
 
 	iRet = 0;
 
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("video name info:(session is %s, series number is %d, video format is %s).", strSession, *iSeriesNum, strFormat);
-
 	return iRet;
 }
 
@@ -1155,41 +1036,6 @@ on_next:
 }
 
 
-bool CRecorderEntity::IsCurrentTerminalMathed()
-{
-	bool bRet = false;
-	CSimpleStringA TerminalList ="";
-	CSmartPointer<IEntityFunction> spFunction = GetFunction();
-	CSmartPointer<IConfigInfo> spConfig;
-
-	ErrorCodeEnum Error = spFunction->OpenConfig(Config_CenterSetting, spConfig);
-	Error = spConfig->ReadConfigValue("Recorder", "TerminalList", TerminalList);
-	if (Error_Succeed == Error){
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get TerminalList=%s from CenterSetting.ini", TerminalList);
-		if (TerminalList.GetLength() > 0){
-			CSystemStaticInfo systemStaticInfo;
-			auto rc =  GetFunction()->GetSystemStaticInfo(systemStaticInfo);
-			CAutoArray<CSimpleStringA> tList = TerminalList.Split('|');
-			for(int i=0; i<tList.GetCount(); i++){
-				if(tList[i] == systemStaticInfo.strTerminalID){
-					bRet = true;
-					break;
-				}
-			}
-		}
-		else{
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("TerminalList length from CenterSetting.ini is zero.");
-			bRet = true;
-		}
-	} 
-	else{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get TerminalList section from CenterSetting.ini failed!");
-		bRet = true;
-	}
-
-	return bRet;
-};
-
 SP_BEGIN_ENTITY_MAP()
 	SP_ENTITY(CRecorderEntity)
 SP_END_ENTITY_MAP()

+ 1 - 36
Module/mod_recorder/win/mod_recorder.cpp

@@ -1074,42 +1074,7 @@ on_next:
 }
 
 
-bool CRecorderEntity::IsCurrentTerminalMathed()
-{
-	bool bRet = false;
-	CSimpleStringA TerminalList ="";
-	CSmartPointer<IEntityFunction> spFunction = GetFunction();
-	CSmartPointer<IConfigInfo> spConfig;
-
-	ErrorCodeEnum Error = spFunction->OpenConfig(Config_CenterSetting, spConfig);
-	Error = spConfig->ReadConfigValue("Recorder", "TerminalList", TerminalList);
-	if (Error_Succeed == Error){
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get TerminalList=%s from CenterSetting.ini", TerminalList);
-		if (TerminalList.GetLength() > 0){
-			CSystemStaticInfo systemStaticInfo;
-			auto rc =  GetFunction()->GetSystemStaticInfo(systemStaticInfo);
-			CAutoArray<CSimpleStringA> tList = TerminalList.Split('|');
-			for(int i=0; i<tList.GetCount(); i++){
-				if(tList[i] == systemStaticInfo.strTerminalID){
-					bRet = true;
-					break;
-				}
-			}
-		}
-		else{
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("TerminalList length from CenterSetting.ini is zero.");
-			bRet = true;
-		}
-	} 
-	else{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get TerminalList section from CenterSetting.ini failed!");
-		bRet = true;
-	}
-
-	return bRet;
-};
-
 SP_BEGIN_ENTITY_MAP()
-SP_ENTITY(CRecorderEntity)
+	SP_ENTITY(CRecorderEntity)
 SP_END_ENTITY_MAP()
 

+ 20 - 21
Other/unix/libbizchan/bizchan.cpp

@@ -481,7 +481,7 @@ static int on_recv(bizchan_t *chan, SOCKET conn)
 				//Dbg(chan, "on_recv, i:%d offset:%d, recv_length:%d", i,  ri->offset, n);
 				//bizlog(chan, "on_recv, encrypt:%u, type:%u, sub_type:%u, length:%lu, compress:%u", hdr->encrypt, hdr->type, hdr->sub_type, hdr->length, hdr->compress);
 				if (hdr->length == 0) {
-					printf("broken");
+					//printf("broken");
 				}
 				if (ri->offset-i >= hdr->length+sizeof(acm_hdr)) {
 					if (hdr->encrypt) 
@@ -503,8 +503,8 @@ static int on_recv(bizchan_t *chan, SOCKET conn)
 							if (check_hash(unzip_buf, len, hdr->hash)) 
 							{
 								invoke_on_recv_pkt(chan, hdr->type, hdr->sub_type, hdr->id, unzip_buf, len);
-							} else {
-								//OutputDebugStringA("pkt hash failed!\n");
+							} 
+							else {
 								bizlog(chan, "encrypt compress pkt hash failed! type:%u, sub_type:%u, length:%lu, hash:%lu, unzip:%d", hdr->type, hdr->sub_type, hdr->length, hdr->hash, len);
 							}
 							free(unzip_buf);
@@ -514,7 +514,6 @@ static int on_recv(bizchan_t *chan, SOCKET conn)
 								invoke_on_recv_pkt(chan, hdr->type, hdr->sub_type, hdr->id, dec_buf, dec_length);
 							}
 							else {
-								//OutputDebugStringA("pkt hash failed!\n");
 								bizlog(chan, "encrypt uncompress pkt hash failed! type:%u, sub_type:%u, length:%lu, hash:%lu", hdr->type, hdr->sub_type, hdr->length, hdr->hash);
 							}
 						}
@@ -526,16 +525,16 @@ static int on_recv(bizchan_t *chan, SOCKET conn)
 							len = qlz_decompress((const char*)&hdr->data[0], unzip_buf, &ri->decompress_state);
 							if (check_hash(unzip_buf, len, hdr->hash)) {
 								invoke_on_recv_pkt(chan, hdr->type, hdr->sub_type, hdr->id, unzip_buf, len);
-							} else {
-								//OutputDebugStringA("pkt hash failed!\n");
+							} 
+							else {
 								bizlog(chan, "compress pkt hash failed! type:%u, sub_type:%u, length:%lu, hash:%lu, unzip:%d", hdr->type, hdr->sub_type, hdr->length, hdr->hash, len);
 							}
 							free(unzip_buf);
 						} else {
 							if (check_hash((char*)&hdr->data[0], hdr->length, hdr->hash)) {
 								invoke_on_recv_pkt(chan, hdr->type, hdr->sub_type, hdr->id, (const char*)&hdr->data[0], hdr->length);
-							} else {
-								//OutputDebugStringA("pkt hash failed!\n");
+							} 
+							else {
 								bizlog(chan, "uncompress pkt hash failed! type:%u, sub_type:%u, length:%lu, hash:%lu", hdr->type, hdr->sub_type, hdr->length, hdr->hash);
 							}
 						}
@@ -960,7 +959,7 @@ static void do_shake_send(bizchan_t* chan, SOCKET conn, int* error) {
 #if ENCRYPT_CHINA
 	EncWithSM4_ECB(seed_key, (unsigned char*)&chan->local_pwd[0], KEY_LEN / 2,
 		(unsigned char*)&hdr.encrypt_key[0], &enc_length);
-	bizlog(chan, "use SM4 password_crypt_type");
+	//bizlog(chan, "use SM4 password_crypt_type");
 #else
 	encodefun((unsigned char*)&hdr.encrypt_key[0], sizeof(hdr.encrypt_key), (unsigned char*)&chan->local_pwd[0], sizeof(chan->local_pwd));
 	bizlog(chan, "use old password_crypt_type");
@@ -1009,17 +1008,17 @@ static void do_shake_recv(bizchan_t* chan, SOCKET conn, int* error) {
 				int result = DecWithSM4_ECB(seed_key,
 					(unsigned char*)&ack_hdr.encrypt_key[0], sizeof(ack_hdr.encrypt_key),
 					(unsigned char*)&chan->remote_pwd[0], &dec_length);
-				bizlog(chan, "use SM4 Decode password result:%d", result);
+				//bizlog(chan, "use SM4 Decode password result:%d", result);
 				if (result != 0) {
 					result = decodefun((unsigned char*)&chan->remote_pwd[0], sizeof(chan->remote_pwd), (unsigned char*)&ack_hdr.encrypt_key[0], sizeof(ack_hdr.encrypt_key));
-					bizlog(chan, "use old Decode password result:%d", result);
+					//bizlog(chan, "use old Decode password result:%d", result);
 				}
 				if (check_hash(chan->remote_pwd, sizeof(chan->remote_pwd), ack_hdr.encrypt_keyhash)) {
 					chan->remote_video_rtp_port = ack_hdr.rtp_port;
 					chan->remote_video_desc = ack_hdr.media_desc;
 					memcpy(chan->remote_client_id, ack_hdr.client_id, sizeof(chan->remote_client_id));
 					chan->remote_version = ack_hdr.version;
-					bizlog(chan, "remote_acm_version:%d", chan->remote_version);
+					//bizlog(chan, "remote_acm_version:%d", chan->remote_version);
 					chan->connected = TRUE;
 					break;
 				}
@@ -1102,7 +1101,7 @@ SOCKET connect_server(bizchan_t* chan, char* server, int port, int timeout)
 	addrSrv.sin_port = htons(port);
 	int ret = connect(m_hSocket, (struct sockaddr*)&addrSrv, sizeof(addrSrv));
 	if (ret == 0) {
-		bizlog(chan, "connect_server connect success 1.");
+		//bizlog(chan, "connect_server connect success 1.");
 		return m_hSocket;
 	}
 #ifdef RVC_OS_WIN
@@ -1137,7 +1136,7 @@ SOCKET connect_server(bizchan_t* chan, char* server, int port, int timeout)
 		return INVALID_SOCKET;
 	}
 
-	bizlog(chan, "connect_server connect success 2.");
+	//bizlog(chan, "connect_server connect success 2.");
 	return m_hSocket;
 }
 
@@ -1192,8 +1191,8 @@ static void process(bizchan_t* chan) {
 			}
 			else if (activity == 0) {
 				// timeout
-				printf("select() returns 0.\n");
-				bizlog(chan, "process shake select 0");
+				//printf("select() returns 0.\n");
+				//bizlog(chan, "process shake select 0");
 				goto on_error;
 			}else {
 				/* All fd_set's should be checked. */
@@ -1242,7 +1241,7 @@ static void process(bizchan_t* chan) {
 			}
 			else if (activity == 0) {
 				// timeout 
-				printf("select() returns 0, timeout.\n");
+				//printf("select() returns 0, timeout.\n");
 				//Dbg(chan, 0, "select() returns 0, timeout.");
 				LARGE_INTEGER now;
 				GetTick(&chan->last_remote_active_time, &now);
@@ -1339,7 +1338,7 @@ static void* work_proc(void* arg)
 		//....
 	}
 #else
-	bizlog(chan, "work_proc start");
+	//bizlog(chan, "work_proc start");
 	process(chan);
 #endif
 	return 0;
@@ -1569,7 +1568,7 @@ BIZCHAN_API(int) bizchan_start_connect(bizchan_t *chan)
 #ifdef RVC_OS_WIN
 	WSAResetEvent(chan->evt);
 #endif
-	bizlog(chan, "bizchan_start_connect 2");
+	//bizlog(chan, "bizchan_start_connect 2");
 
 	chan->stop_flag = 0;
 	chan->connected = 0;
@@ -1582,7 +1581,7 @@ BIZCHAN_API(int) bizchan_start_connect(bizchan_t *chan)
 #else
 	int err = pthread_create(&chan->work_thread, NULL, work_proc, chan);
 	if (0 == err) {
-		bizlog(chan, "create work thread success, %lu.", chan->work_thread);
+		//bizlog(chan, "create work thread success, %lu.", chan->work_thread);
 	}
 	else {
 		bizlog(chan, "create work thread failed.");
@@ -1590,7 +1589,7 @@ BIZCHAN_API(int) bizchan_start_connect(bizchan_t *chan)
 #endif // RVC_OS_WIN
 
 	// we now return, when connected, on_connect will invoked in work_proc thread
-	bizlog(chan, "bizchan_start_connect success");
+	//bizlog(chan, "bizchan_start_connect success");
 
 	return 0;
 }

+ 19 - 19
Other/unix/libfacecapture/libfacecapture.cpp

@@ -1494,7 +1494,7 @@ private:
 					{
 						if((m_eMonitorState == NoBody) || (m_eMonitorState == SomebodyFar))
 						{
-							m_pHostApi->Debug("有人靠近!");
+							//m_pHostApi->Debug("有人靠近!");
 							m_eMonitorState = SomebodyClose;		//进入有人靠近状态
 
 							//截取人脸图像,放大截取区域,截取半身头像
@@ -1511,7 +1511,7 @@ private:
 					{
 						if(m_eMonitorState != SomebodyOperate)
 						{
-							m_pHostApi->Debug("有人进入操作距离!");
+							//m_pHostApi->Debug("有人进入操作距离!");
 							m_eMonitorState = SomebodyOperate;			//进入有人靠近状态
 							//截取人脸图像,放大截取区域,截取半身头像
 							pFaceRect->y		= m_stObjTrackRslt.ObjRect[i].y+pFaceRect->y;
@@ -1529,7 +1529,7 @@ private:
 							 m_stAllFaceInfo.astFaceInfo[0].stRegion.stUpperBodyRect.width = m_nImgWidth/2;
 							 m_stAllFaceInfo.astFaceInfo[0].stRegion.stUpperBodyRect.x = m_nImgWidth/4;
 							 m_stAllFaceInfo.astFaceInfo[0].stRegion.stUpperBodyRect.y = m_nImgHeight/4;
-							 m_pHostApi->Debug("有人出现!");
+							//m_pHostApi->Debug("有人出现!");
 							 m_eMonitorState = SomebodyFar;			//进入远距离有人状态
 						 }
 						 m_pHostEvent->GenerateAppearEvent();	//产生有人出现事件
@@ -1593,7 +1593,7 @@ private:
 					if((m_eMonitorState == NoBody) || (m_eMonitorState == SomebodyFar))
 					{
 						nCurafaceSerial = nFaceNum;
-						m_pHostApi->Debug("有人靠近!");
+						//m_pHostApi->Debug("有人靠近!");
 						m_eMonitorState = SomebodyClose;		//进入有人靠近状态
 					}
 					m_pHostEvent->GenerateCloseEvent();		//产生有人靠近事件
@@ -1603,7 +1603,7 @@ private:
 					if(m_eMonitorState != SomebodyOperate)
 					{
 						nCurafaceSerial = nFaceNum;
-						m_pHostApi->Debug("有人进入操作距离!");
+						//m_pHostApi->Debug("有人进入操作距离!");
 						m_eMonitorState = SomebodyOperate;			//进入有人靠近状态
 					}
 					m_pHostEvent->GenerateEnterOperateEvent();	//产生有人进入操作距离事件
@@ -1613,12 +1613,12 @@ private:
 					if(m_eMonitorState == NoBody)
 					{
 						nCurafaceSerial = nFaceNum;
-						m_pHostApi->Debug("有人出现!");
+						//m_pHostApi->Debug("有人出现!");
 						m_eMonitorState = SomebodyFar;			//进入远距离有人状态
 					}
 					else
 					{
-						m_pHostApi->Debug("远距离,有人出现!");
+						//m_pHostApi->Debug("远距离,有人出现!");
 						m_eMonitorState = SomebodyFar;			//进入远距离有人状态
 					}
 					m_pHostEvent->GenerateAppearEvent();	//产生有人出现事件
@@ -1776,7 +1776,7 @@ private:
 				m_eMonitorState = SomebodyOperate;
 				m_stAllFaceInfo.astFaceInfo[0].eScene = ForwardScened;
 				m_pHostEvent->GenerateEnterOperateEvent();  //产生有人进入操作距离事件
-				m_pHostApi->Debug("有人进入操作距离!");
+				//m_pHostApi->Debug("有人进入操作距离!");
 				//获取UUID
 				if (m_stAllFaceInfo.astFaceInfo[0].FaceID == 0)
 				{
@@ -1806,7 +1806,7 @@ private:
 				m_stAllFaceInfo.astFaceInfo[0].stRegion.stUpperBodyRect.x = m_nImgHeight/4;
 				m_stAllFaceInfo.astFaceInfo[0].stRegion.stUpperBodyRect.y = m_nImgWidth/4;
 				m_pHostEvent->GenerateLeaveEvent();		//产生客户离开事件
-				m_pHostApi->Debug("客户离开!");
+				//m_pHostApi->Debug("客户离开!");
 				//清除UUID
 				m_stAllFaceInfo.astFaceInfo[0].FaceID = 0;
 			}
@@ -1818,13 +1818,13 @@ private:
 				m_stAllFaceInfo.astFaceInfo[0].eScene = BackwardScened;
 				m_eMonitorState = SomebodyClose;
 				m_pHostEvent->GenerateBackToCloseEvent();  //产生客户退回到接近距离事件
-				m_pHostApi->Debug("客户退回到接近距离!");
+				//m_pHostApi->Debug("客户退回到接近距离!");
 			} 
 			else if(SomebodyFar == m_eMonitorState)
 			{
 				m_stAllFaceInfo.astFaceInfo[0].eScene = ForwardScened;
 				m_eMonitorState = SomebodyClose;
-				m_pHostApi->Debug("有人靠近!");
+				//m_pHostApi->Debug("有人靠近!");
 				//获取UUID
 				if (m_stAllFaceInfo.astFaceInfo[0].FaceID == 0)
 				{
@@ -2145,7 +2145,7 @@ private:
 				}
 				else if (SomebodyFar == m_eMonitorState) //if somebody space 2.5m
 				{
-					m_pHostApi->Debug("SomebodyFar");
+					//m_pHostApi->Debug("SomebodyFar");
 					//RecordError("Enter far distance search Face ");
 					bRst = GetImage(m_eCamera);
 					if (bRst)
@@ -2177,7 +2177,7 @@ private:
 				}
 				else if (SomebodyClose == m_eMonitorState) //close distance,1.5m
 				{
-					m_pHostApi->Debug("SomebodyClose");
+					//m_pHostApi->Debug("SomebodyClose");
 					//RecordError("close distance,search Face by operatorCamera");
 					bRst = FaceDetect(m_eCamera);
 					if(!bRst)
@@ -2198,7 +2198,7 @@ private:
 									SetUpperbodyToCenter();								
 									m_eMonitorState = NoBody;
 									m_pHostEvent->GenerateLeaveEvent();
-									m_pHostApi->Debug("客户离开!");
+									//m_pHostApi->Debug("客户离开!");
 									nSearchFailNum = 0;
 									FSleep(m_stFaceConfig.nSleepLong);
 								}
@@ -2226,7 +2226,7 @@ private:
 								SetUpperbodyToCenter();
 								m_eMonitorState = NoBody;
 								m_pHostEvent->GenerateLeaveEvent();
-								m_pHostApi->Debug("客户离开!");
+								//m_pHostApi->Debug("客户离开!");
 								nSearchFailNum = 0;
 								FSleep(m_stFaceConfig.nSleepLong);
 							}
@@ -2273,7 +2273,7 @@ private:
 				}
 				else if (SomebodyOperate == m_eMonitorState)	//当有人进入操作距离时
 				{
-					m_pHostApi->Debug("SomebodyOperate");
+					//m_pHostApi->Debug("SomebodyOperate");
 					//如果是双相机模式
 					if (m_pOperatorVideoQueue != NULL)
 					{
@@ -2399,7 +2399,7 @@ private:
 									m_eMonitorState = SomebodyClose;
 									m_stAllFaceInfo.astFaceInfo[0].eScene = UnLockScene;
 									m_pHostEvent->GenerateLoseFaceEvent();  //发送失去人脸事件
-									m_pHostApi->Debug("人脸失去锁定!");
+									//m_pHostApi->Debug("人脸失去锁定!");
 									nDetectFailNum = 0;
 								}
 								FSleep(m_stFaceConfig.nSleepShort);
@@ -2414,7 +2414,7 @@ private:
 								m_eMonitorState = SomebodyClose;
 								m_stAllFaceInfo.astFaceInfo[0].eScene = UnLockScene;
 								m_pHostEvent->GenerateLoseFaceEvent();  //发送失去人脸事件
-								m_pHostApi->Debug("人脸失去锁定!");
+								//m_pHostApi->Debug("人脸失去锁定!");
 								nDetectFailNum = 0;
 							}
 							FSleep(m_stFaceConfig.nSleepShort);
@@ -2496,7 +2496,7 @@ public:
 #else
 		sem_post(&m_semt);
 		if (0 == pthread_join(m_videomonitorthreadid, NULL)) {
-			m_pHostApi->Debug("thread join video monitor thread %u success!", m_videomonitorthreadid);
+			//m_pHostApi->Debug("thread join video monitor thread %u success!", m_videomonitorthreadid);
 			m_videomonitorthreadid = 0;
 		}
 		else{