Kaynağa Gözat

cti去除部分无用代码

baiwenju 3 yıl önce
ebeveyn
işleme
8fa7dbfadc

+ 24 - 69
NetLib/CTI/NetworkCti.cpp

@@ -20,9 +20,26 @@ void CNetworkCti::__procRegDevListMsg(CPduEntity & a_PduEntity)
20 20
 	auto devList = a_PduEntity.GetDataString(0);
21 21
 	CString dev;
22 22
 	dev.Format("|%d|", PDU_DEV_TYPE_IVR);
23
-	m_IsIvrConnected = devList.Find(dev) < 0 ? false : true;
23
+	bool newIvrConnected = devList.Find(dev) < 0 ? false : true;
24 24
 	dev.Format("|%d|", PDU_DEV_TYPE_ACD);
25
-	m_IsAcdConnected = devList.Find(dev) < 0 ? false : true;
25
+	auto newAcdConnected = devList.Find(dev) < 0 ? false : true;
26
+
27
+	if (!m_IsAcdConnected && newAcdConnected) { // acd 连接
28
+		// 通知线路类Acd连接成功
29
+		CLineHolder::GetInstance().onAcdConnected();
30
+	}
31
+	else if (m_IsAcdConnected && !newAcdConnected) { // acd连接断开
32
+
33
+	}
34
+	m_IsAcdConnected = newAcdConnected;
35
+	if (m_IsIvrConnected && !newIvrConnected) { // ivr掉线
36
+		// 通知IvrFlow IVR连接断开
37
+		CIvrFlowHolder::GetInstance().onIvrDisconnect();
38
+	}
39
+	else if (!m_IsIvrConnected && newIvrConnected) { // ivr上线
40
+
41
+	}
42
+	m_IsIvrConnected = newIvrConnected;
26 43
 }
27 44
 
28 45
 
@@ -142,34 +159,6 @@ void CNetworkCti::__onDisconnect(const PduLinkContent& linkContent)
142 159
 
143 160
 void CNetworkCti::__onHeartMonitorDrop(int devType)
144 161
 {
145
-	//switch (devType)
146
-	//{
147
-	//case 2:
148
-	//case 3:
149
-	//	ILogger::getInstance().log(LOG_CLASS_SOCKET, LOG_LEVEL_WARNING, _T("CTI监听设备[%s]心跳超时"), devType == 2 ? "IVR" : "ACD");
150
-	//	break;
151
-	//default:
152
-	//	break;
153
-	//}
154
-	//return;
155
-	//if (devType == 2) // ivr
156
-	//{
157
-	//	if (m_DevIvr.DevId = -1) return;
158
-	//	CInterfaceWindow::getIocpLinkInstance()->ClosePduClient((PDU_DEV_TYPE)devType, m_DevIvr.DevId);
159
-	//	memset(&m_DevIvr, 0, sizeof(m_DevIvr));
160
-	//	m_DevIvr.DevId = -1;
161
-	//	// 通知IvrFlow IVR连接断开
162
-	//	CIvrFlowHolder::GetInstance().onIvrDisconnect();
163
-	//	m_IsIvrConnected = FALSE;
164
-	//}
165
-	//else if (devType == 3) // acd
166
-	//{
167
-	//	if (m_DevAcd.DevId = -1) return;
168
-	//	CInterfaceWindow::getIocpLinkInstance()->ClosePduClient((PDU_DEV_TYPE)devType, m_DevIvr.DevId);
169
-	//	memset(&m_DevAcd, 0, sizeof(m_DevAcd));
170
-	//	m_DevAcd.DevId = -1;
171
-	//	m_IsAcdConnected = FALSE;
172
-	//}
173 162
 }
174 163
 
175 164
 /*****************************************************************
@@ -183,16 +172,12 @@ void CNetworkCti::OnLinkStateChanged(const PduLinkContent& linkContent)
183 172
 	// 连接信息日志显示
184 173
 	LOG_LEVEL nLogLevel = LOG_LEVEL_WARNING;
185 174
 	CString Msg;
186
-
187 175
 	switch (linkContent.nLinkState)
188 176
 	{
189
-	case PDU_LINK_STATE_ACCEPTED:
190
-	{
191
-		Msg = _T("{Net}: Far End Accepted, ");
192
-		nLogLevel = LOG_LEVEL_NORMAL;
193
-	}
194
-	break;
195
-
177
+	case PDU_LINK_STATE_SUCCESSED:
178
+		break;
179
+	case PDU_LINK_STATE_FAILED:
180
+		break;
196 181
 	case PDU_LINK_STATE_DISCONNECTED:
197 182
 	{
198 183
 		Msg = _T("{Net}: Far End Disconnected, ");
@@ -218,39 +203,12 @@ void CNetworkCti::OnLinkStateChanged(const PduLinkContent& linkContent)
218 203
 
219 204
 	default:
220 205
 	{
221
-		ASSERT(FALSE);
222 206
 		Msg = _T("{Net}: Unknown Netlink State, ");
223 207
 		nLogLevel = LOG_LEVEL_WARNING;
224 208
 	}
225 209
 	break;
226 210
 	}
227 211
 
228
-	// 判断设备类型
229
-	switch (linkContent.nFarType)
230
-	{
231
-	case PDU_DEV_TYPE_ACD:
232
-	{
233
-		CString Temp;
234
-		Temp.Format(_T(" Far End[Type = ACD, Id = %d, Addr = %s:%d]"), linkContent.nFarId, linkContent.szFarIp, linkContent.nFarPort);
235
-		Msg += Temp;
236
-	}
237
-	break;
238
-
239
-	case PDU_DEV_TYPE_IVR:
240
-	{
241
-		CString Temp;
242
-		Temp.Format(_T(" Far End[Type = IVR, Id = %d, Addr = %s:%d]"), linkContent.nFarId, linkContent.szFarIp, linkContent.nFarPort);
243
-		Msg += Temp;
244
-	}
245
-	break;
246
-
247
-	default:
248
-		CString Temp;
249
-		Temp.Format(_T(" Far End[Type = UnKnown, Id = %d, Addr = %s:%d]"), linkContent.nFarId, linkContent.szFarIp, linkContent.nFarPort);
250
-		Msg += Temp;
251
-		break;
252
-	}
253
-
254 212
 	// 通知日志
255 213
 	ILogger::getInstance().log(LOG_CLASS_SOCKET, nLogLevel, _T("%s"), Msg);
256 214
 }
@@ -371,7 +329,6 @@ BOOL CNetworkCti::init()
371 329
 ****************************************************************/
372 330
 void CNetworkCti::release(void)
373 331
 {
374
-	//CInterfaceWindow::getIocpLinkInstance()->StopAll();
375 332
 	CNetInterface::getNetInstance()->ClosePduClient(PDU_DEV_TYPE_CTI, 1);
376 333
 }
377 334
 
@@ -383,7 +340,6 @@ void CNetworkCti::release(void)
383 340
 ****************************************************************/
384 341
 BOOL CNetworkCti::send2ACD(CPduEntity& a_PduEntity)
385 342
 {
386
-	//return CInterfaceWindow::getIocpCommInstance()->Send(&a_PduEntity, PDU_DEV_TYPE_ACD, m_DevAcd.DevId);
387 343
 	return CNetInterface::getNetInstance()->Send(&a_PduEntity, PDU_DEV_TYPE_ACD, m_DevAcd.DevId);
388 344
 }
389 345
 
@@ -395,6 +351,5 @@ BOOL CNetworkCti::send2ACD(CPduEntity& a_PduEntity)
395 351
 ****************************************************************/
396 352
 BOOL CNetworkCti::send2IVR(CPduEntity& a_PduEntity)
397 353
 {
398
-	//return CInterfaceWindow::getIocpCommInstance()->Send(&a_PduEntity, PDU_DEV_TYPE_IVR, m_DevIvr.DevId);
399
-	return CNetInterface::getNetInstance()->Send(&a_PduEntity, PDU_DEV_TYPE_IVR, m_DevIvr.DevId);
354
+   return CNetInterface::getNetInstance()->Send(&a_PduEntity, PDU_DEV_TYPE_IVR, m_DevIvr.DevId);
400 355
 }

+ 0 - 4
NetLib/CTI/Task.cpp

@@ -65,8 +65,6 @@ BOOL CTask::OnCmdOperation(CPduEntity &PduEntity)
65 65
 {
66 66
 	PduEntity.SetToExecReturn();
67 67
 	PduEntity.SetDataBool(0, false);
68
-	// 2022-10-31
69
-	//CInterfaceWindow::getIocpCommInstance()->Send(&PduEntity, PduEntity.GetLocalDevType(), PduEntity.GetLocalDevId());
70 68
 	CNetInterface::getNetInstance()->Send(&PduEntity, PduEntity.GetLocalDevType(), PduEntity.GetLocalDevId());
71 69
 	return FALSE;
72 70
 }
@@ -211,8 +209,6 @@ void CTask::_ProcCmdReturn(BOOL Result, bool FreeRes/* = false*/ )
211 209
 	}
212 210
 	m_CurrCmd.SetToExecReturn();
213 211
 	m_CurrCmd.SetDataBool(0, Result ? true : false);
214
-	// 2022-10-31
215
-	//bool t_rnt = CInterfaceWindow::getIocpCommInstance()->Send(&m_CurrCmd, m_CurrCmd.GetLocalDevType(), m_CurrCmd.GetLocalDevId());
216 212
 	bool t_rnt = CNetInterface::getNetInstance()->Send(&m_CurrCmd, m_CurrCmd.GetLocalDevType(), m_CurrCmd.GetLocalDevId());
217 213
 	ILogger::getInstance().log(LOG_CLASS_SOCKET, LOG_LEVEL_NORMAL, _T("CTI->,CMD Line = %d, IsSuccess = %d "), m_pCurrLine == NULL ? 0 : m_pCurrLine->lineId(), t_rnt);
218 214
 }

+ 0 - 2
NetLib/CTI/TaskAgentConsulCall.cpp

@@ -167,8 +167,6 @@ BOOL CTaskAgentConsulCall::OnCmdOperation(CPduEntity &PduEntity)
167 167
 	{
168 168
 		PduEntity.SetToExecReturn();
169 169
 		PduEntity.SetDataBool(0, false);
170
-		// 2022-10-31
171
-		//CInterfaceWindow::getIocpCommInstance()->Send(&PduEntity, PduEntity.GetLocalDevType(), PduEntity.GetLocalDevId());
172 170
 		CNetInterface::getNetInstance()->Send(&PduEntity, PduEntity.GetLocalDevType(), PduEntity.GetLocalDevId());
173 171
 		return FALSE;
174 172
 	}

+ 0 - 4
NetLib/CTI/TaskMgr.cpp

@@ -122,8 +122,6 @@ void CTaskMgr::__onTaskFailed( CTask* pTask, CPduEntity &PduEntity )
122 122
 	// ÃüÁî·µ»Ø
123 123
 	PduEntity.SetToExecReturn();
124 124
 	PduEntity.SetDataBool(0, false);
125
-	// 2022-10-31
126
-	//CInterfaceWindow::getIocpCommInstance()->Send(&PduEntity, PduEntity.GetLocalDevType(), PduEntity.GetLocalDevId());
127 125
 	CNetInterface::getNetInstance()->Send(&PduEntity, PduEntity.GetLocalDevType(), PduEntity.GetLocalDevId());
128 126
 	// ÒÆ³ýTask
129 127
 	removeTask(reinterpret_cast<LONG>(pTask));
@@ -475,8 +473,6 @@ void CTaskMgr::onTaskPduMsg( UINT LineId, CPduEntity &PduEntity )
475 473
 			// ·µ»ØÃüÁî
476 474
 			PduEntity.SetToExecReturn();
477 475
 			PduEntity.SetDataBool(0, false);
478
-			// 2022-10-31
479
-			//CInterfaceWindow::getIocpCommInstance()->Send(&PduEntity, PduEntity.GetLocalDevType(), PduEntity.GetLocalDevId());
480 476
 			CNetInterface::getNetInstance()->Send(&PduEntity, PduEntity.GetLocalDevType(), PduEntity.GetLocalDevId());
481 477
 		}
482 478
 	}