Browse Source

acd,分机取消注册时,清理视频话机资源

baiwenju 3 years ago
parent
commit
e6e3ad5f45

+ 3 - 2
MidWare_WinStandard1.0-zmd/ACD/AcdCore.cpp

@@ -613,8 +613,10 @@ void CAcdCore::__onCmdCtiExtenInfo( CPduEntity* a_pCmd )
613 613
 			if (Agentid != 0)
614 614
 				__removeAgent(Agentid, ExtID, 0);			// 迁出坐席
615 615
 
616
-			//删除分机
616
+			// 删除分机
617 617
 			m_ExtenCtrl.removeExten(ExtID);
618
+			// 2023-01-17 分机取消注册时,清理分机使用资源
619
+			m_VideoOffice.recoverVideoExten(ExtID, true);
618 620
 		}
619 621
 	}
620 622
 	else
@@ -858,7 +860,6 @@ bool CAcdCore::stage1Start( void )
858 860
 	{
859 861
 		IOtlConnection::getInstance()->Disconnect();
860 862
 		AfxMessageBox("加载分机部门信息失败");
861
-		return false;
862 863
 	}
863 864
 	std::cout << m_DepttelextOffice.GetAllDeptTelext() << std::endl;
864 865
 	return true;

+ 6 - 2
MidWare_WinStandard1.0-zmd/ACD/VideoOffice.cpp

@@ -58,14 +58,18 @@ bool CVideoOffice::findVideoExten(uint32_t & a_VideoExtId, std::string & a_Video
58 58
 	return false;
59 59
 }
60 60
 
61
-bool CVideoOffice::recoverVideoExten(uint32_t a_VideoExtId)
61
+bool CVideoOffice::recoverVideoExten(uint32_t a_VideoExtId, bool bIsRm)
62 62
 {
63 63
 	std::unique_lock<std::mutex> lock(mut);
64 64
 	auto it = m_VideoExtens.find(a_VideoExtId);
65 65
 	if (it != m_VideoExtens.end())
66 66
 	{
67 67
 		it->second->isUsed() = false;
68
-		ILogger::getInstance().log(LOG_CLASS_BUSI, LOG_LEVEL_NORMAL, _T("{CVideoOffice}: 释放视频分机号[%lu]状态[%s]"), a_VideoExtId, it->second->isUsed() ? "不可用" : "可用");
68
+		if (!bIsRm)
69
+			ILogger::getInstance().log(LOG_CLASS_BUSI, LOG_LEVEL_NORMAL, _T("{CVideoOffice}: 释放视频分机号[%lu]状态[%s]"), a_VideoExtId, it->second->isUsed() ? "不可用" : "可用");
70
+		else
71
+			ILogger::getInstance().log(LOG_CLASS_BUSI, LOG_LEVEL_NORMAL, _T("{CVideoOffice}: 释放视频分机号[%lu]状态[%s],话机取消注册"), a_VideoExtId, it->second->isUsed() ? "不可用" : "可用");
72
+
69 73
 	}
70 74
 	
71 75
 	{

+ 1 - 1
MidWare_WinStandard1.0-zmd/ACD/VideoOffice.h

@@ -11,7 +11,7 @@ public:
11 11
 
12 12
 	bool initVideoExten();
13 13
 	bool findVideoExten(uint32_t &a_VideoExtId,std::string &a_VideoExtPwd);
14
-	bool recoverVideoExten(uint32_t a_VideoExtId);
14
+	bool recoverVideoExten(uint32_t a_VideoExtId, bool bIsRm = false);
15 15
 
16 16
 	void close();
17 17