Pārlūkot izejas kodu

cti去除部分无用代码

baiwenju 3 gadi atpakaļ
vecāks
revīzija
8fa7dbfadc

+ 24 - 69
NetLib/CTI/NetworkCti.cpp

20
 	auto devList = a_PduEntity.GetDataString(0);
20
 	auto devList = a_PduEntity.GetDataString(0);
21
 	CString dev;
21
 	CString dev;
22
 	dev.Format("|%d|", PDU_DEV_TYPE_IVR);
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
 	dev.Format("|%d|", PDU_DEV_TYPE_ACD);
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
 
159
 
143
 void CNetworkCti::__onHeartMonitorDrop(int devType)
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
 	// 连接信息日志显示
172
 	// 连接信息日志显示
184
 	LOG_LEVEL nLogLevel = LOG_LEVEL_WARNING;
173
 	LOG_LEVEL nLogLevel = LOG_LEVEL_WARNING;
185
 	CString Msg;
174
 	CString Msg;
186
-
187
 	switch (linkContent.nLinkState)
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
 	case PDU_LINK_STATE_DISCONNECTED:
181
 	case PDU_LINK_STATE_DISCONNECTED:
197
 	{
182
 	{
198
 		Msg = _T("{Net}: Far End Disconnected, ");
183
 		Msg = _T("{Net}: Far End Disconnected, ");
218
 
203
 
219
 	default:
204
 	default:
220
 	{
205
 	{
221
-		ASSERT(FALSE);
222
 		Msg = _T("{Net}: Unknown Netlink State, ");
206
 		Msg = _T("{Net}: Unknown Netlink State, ");
223
 		nLogLevel = LOG_LEVEL_WARNING;
207
 		nLogLevel = LOG_LEVEL_WARNING;
224
 	}
208
 	}
225
 	break;
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
 	ILogger::getInstance().log(LOG_CLASS_SOCKET, nLogLevel, _T("%s"), Msg);
213
 	ILogger::getInstance().log(LOG_CLASS_SOCKET, nLogLevel, _T("%s"), Msg);
256
 }
214
 }
371
 ****************************************************************/
329
 ****************************************************************/
372
 void CNetworkCti::release(void)
330
 void CNetworkCti::release(void)
373
 {
331
 {
374
-	//CInterfaceWindow::getIocpLinkInstance()->StopAll();
375
 	CNetInterface::getNetInstance()->ClosePduClient(PDU_DEV_TYPE_CTI, 1);
332
 	CNetInterface::getNetInstance()->ClosePduClient(PDU_DEV_TYPE_CTI, 1);
376
 }
333
 }
377
 
334
 
383
 ****************************************************************/
340
 ****************************************************************/
384
 BOOL CNetworkCti::send2ACD(CPduEntity& a_PduEntity)
341
 BOOL CNetworkCti::send2ACD(CPduEntity& a_PduEntity)
385
 {
342
 {
386
-	//return CInterfaceWindow::getIocpCommInstance()->Send(&a_PduEntity, PDU_DEV_TYPE_ACD, m_DevAcd.DevId);
387
 	return CNetInterface::getNetInstance()->Send(&a_PduEntity, PDU_DEV_TYPE_ACD, m_DevAcd.DevId);
343
 	return CNetInterface::getNetInstance()->Send(&a_PduEntity, PDU_DEV_TYPE_ACD, m_DevAcd.DevId);
388
 }
344
 }
389
 
345
 
395
 ****************************************************************/
351
 ****************************************************************/
396
 BOOL CNetworkCti::send2IVR(CPduEntity& a_PduEntity)
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
 {
65
 {
66
 	PduEntity.SetToExecReturn();
66
 	PduEntity.SetToExecReturn();
67
 	PduEntity.SetDataBool(0, false);
67
 	PduEntity.SetDataBool(0, false);
68
-	// 2022-10-31
69
-	//CInterfaceWindow::getIocpCommInstance()->Send(&PduEntity, PduEntity.GetLocalDevType(), PduEntity.GetLocalDevId());
70
 	CNetInterface::getNetInstance()->Send(&PduEntity, PduEntity.GetLocalDevType(), PduEntity.GetLocalDevId());
68
 	CNetInterface::getNetInstance()->Send(&PduEntity, PduEntity.GetLocalDevType(), PduEntity.GetLocalDevId());
71
 	return FALSE;
69
 	return FALSE;
72
 }
70
 }
211
 	}
209
 	}
212
 	m_CurrCmd.SetToExecReturn();
210
 	m_CurrCmd.SetToExecReturn();
213
 	m_CurrCmd.SetDataBool(0, Result ? true : false);
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
 	bool t_rnt = CNetInterface::getNetInstance()->Send(&m_CurrCmd, m_CurrCmd.GetLocalDevType(), m_CurrCmd.GetLocalDevId());
212
 	bool t_rnt = CNetInterface::getNetInstance()->Send(&m_CurrCmd, m_CurrCmd.GetLocalDevType(), m_CurrCmd.GetLocalDevId());
217
 	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);
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
 	{
167
 	{
168
 		PduEntity.SetToExecReturn();
168
 		PduEntity.SetToExecReturn();
169
 		PduEntity.SetDataBool(0, false);
169
 		PduEntity.SetDataBool(0, false);
170
-		// 2022-10-31
171
-		//CInterfaceWindow::getIocpCommInstance()->Send(&PduEntity, PduEntity.GetLocalDevType(), PduEntity.GetLocalDevId());
172
 		CNetInterface::getNetInstance()->Send(&PduEntity, PduEntity.GetLocalDevType(), PduEntity.GetLocalDevId());
170
 		CNetInterface::getNetInstance()->Send(&PduEntity, PduEntity.GetLocalDevType(), PduEntity.GetLocalDevId());
173
 		return FALSE;
171
 		return FALSE;
174
 	}
172
 	}

+ 0 - 4
NetLib/CTI/TaskMgr.cpp

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