Explorar el Código

ivr挂机删除该来电排队,修改firststep可选择配置动态网关。

USER-20180514DO\Administrator %!s(int64=7) %!d(string=hace) años
padre
commit
0128cb5998
Se han modificado 2 ficheros con 37 adiciones y 5 borrados
  1. 9 2
      CTI/IvrFlow.cpp
  2. 28 3
      FirstStep/ConfigLoader.cpp

+ 9 - 2
CTI/IvrFlow.cpp

@@ -92,14 +92,21 @@ void CIvrFlow::onPduMessage(CPduEntity &PduEntity)
92 92
 		__procCancelQuene(PduEntity);
93 93
 		break;
94 94
 
95
-	case PDU_CMD_IVR_TURN_AGENT:			// 转人工
96 95
 	case PDU_CMD_IVR_HANGUP:				// Ivr挂机
96
+	{
97
+		CPduEntity CmdCancelQuene(PDU_CMD_IVR_QUEUE_CANCEL); // ych 2018.7.3
98
+		CmdCancelQuene.SetDataInt(1, PduEntity.GetDataInt(1));
99
+		CmdCancelQuene.SetDataULong(2, PduEntity.GetDataULong(2));
100
+		__procCancelQuene(CmdCancelQuene);
101
+		ILogger::getInstance().log(LOG_CLASS_BUSI, LOG_LEVEL_NORMAL, "{procLineHangUp}: Ivr挂机前取消掉来电排队"); // ych 2018.5.31
102
+	}
103
+	case PDU_CMD_IVR_TURN_AGENT:			// 转人工	
97 104
 	case PDU_CMD_IVR_PLAY_DTMF:				// IVR通知放音收按键
98 105
 	case PDU_CMD_IVR_CALL_OUT:				// IVR自动外呼
99 106
 	case PDU_CMD_IVR_TURN_OUTLINE:			// IVR呼叫转移
100 107
 	case PDU_CMD_IVR_FAX:					// IVR通知收发传真
101 108
 	case PDU_CMD_IVR_LEAVE_WORD:			// IVR通知留言
102
-		__transmitToTask(PduEntity);				
109
+		__transmitToTask(PduEntity);
103 110
 		break;
104 111
 	}
105 112
 }

+ 28 - 3
FirstStep/ConfigLoader.cpp

@@ -91,7 +91,25 @@ bool CConfigLoader::__loadExtenCfg( void )
91 91
 ****************************************************************/
92 92
 bool CConfigLoader::__loadSipAccountCfg( void )
93 93
 {
94
-	IOtlRecordset* pAccountRcd = IOtlConnection::getInstance()->QueryRecords(_T("SELECT id, account, auth_account, password, proxy_addr, proxy_port, reg, reg_interval, IsDynamicGw FROM conf_sip_account ORDER BY id ASC"));
94
+	long Count=IOtlConnection::getInstance()->GetSingleDataInt(_T("select count(*) from information_schema.columns where table_name = 'conf_sip_account' and column_name = 'IsDynamicGw'"));
95
+	IOtlRecordset* pAccountRcd = NULL;
96
+	BOOL bAddOk = FALSE;
97
+	if (Count == 1)
98
+	{
99
+		pAccountRcd = IOtlConnection::getInstance()->QueryRecords(_T("SELECT id, account, auth_account, password, proxy_addr, proxy_port, reg, reg_interval, IsDynamicGw FROM conf_sip_account ORDER BY id ASC"));
100
+	}
101
+	else if (Count == 0)
102
+	{
103
+		bAddOk = IOtlConnection::getInstance()->ExecCommand(_T("ALTER TABLE conf_sip_account ADD IsDynamicGw VARCHAR (10) NOT NULL DEFAULT 'false'"));
104
+		if (bAddOk == TRUE)
105
+		{
106
+			pAccountRcd = IOtlConnection::getInstance()->QueryRecords(_T("SELECT id, account, auth_account, password, proxy_addr, proxy_port, reg, reg_interval, IsDynamicGw FROM conf_sip_account ORDER BY id ASC"));
107
+		}
108
+		else
109
+		{
110
+			pAccountRcd = IOtlConnection::getInstance()->QueryRecords(_T("SELECT id, account, auth_account, password, proxy_addr, proxy_port, reg, reg_interval FROM conf_sip_account ORDER BY id ASC"));
111
+		}
112
+	}
95 113
 	if (NULL == pAccountRcd)
96 114
 		return false;
97 115
 
@@ -115,10 +133,17 @@ bool CConfigLoader::__loadSipAccountCfg( void )
115 133
 			pSipAccount->IsReg = false;
116 134
 		pSipAccount->RegInterval = pAccountRcd->GetValueIntByIndex(8);
117 135
 
118
-		if (lstrcmp(_T("true"), pAccountRcd->GetValueStrByIndex(9)) == 0)
119
-			pSipAccount->IsDynamicGw = true;
136
+		if (Count == 1 || bAddOk == TRUE)
137
+		{
138
+			if (lstrcmp(_T("true"), pAccountRcd->GetValueStrByIndex(9)) == 0)
139
+				pSipAccount->IsDynamicGw = true;
140
+			else
141
+				pSipAccount->IsDynamicGw = false;
142
+		}
120 143
 		else
144
+		{ 
121 145
 			pSipAccount->IsDynamicGw = false;
146
+		}
122 147
 
123 148
 		Config.m_SipAccount.AddTail(pSipAccount);
124 149
 	} // end while