|
|
@@ -132,7 +132,7 @@ void CAgentOffice::clearAgent( void )
|
|
132
|
132
|
}
|
|
133
|
133
|
|
|
134
|
134
|
m_AgentMap.RemoveAll();
|
|
135
|
|
-
|
|
|
135
|
+ m_GroupMap.clear(); // 2023-06-19
|
|
136
|
136
|
}
|
|
137
|
137
|
|
|
138
|
138
|
/*****************************************************************
|
|
|
@@ -157,6 +157,14 @@ BOOL CAgentOffice::insertAgent( UINT a_AgentID, UINT a_ExtID, LPCTSTR a_GroupID,
|
|
157
|
157
|
CAgent* pAgent = new CAgent(a_AgentID, a_ExtID, a_GroupID, a_AgentType, a_TimePostProcessing);
|
|
158
|
158
|
m_AgentMap.SetAt(pAgent->id(), pAgent); // 座席添加到全体座席索引
|
|
159
|
159
|
|
|
|
160
|
+ auto ret = m_GroupMap.equal_range(a_GroupID);
|
|
|
161
|
+ for (auto it = ret.first; it != ret.second; ++it) {
|
|
|
162
|
+ if (it->second->id() == a_AgentID) {
|
|
|
163
|
+ m_GroupMap.erase(it);
|
|
|
164
|
+ }
|
|
|
165
|
+ }
|
|
|
166
|
+ m_GroupMap.insert(std::make_pair(a_GroupID, pAgent)); // 2023-06-19 保存坐席组-坐席
|
|
|
167
|
+
|
|
160
|
168
|
CAcdCore::GetInstance().getQueueMgr().addAgent(pAgent);
|
|
161
|
169
|
|
|
162
|
170
|
pAgent->onAssoExtStatusUpdated(a_ExtStatus);// 设置座席当前状态
|
|
|
@@ -200,10 +208,18 @@ BOOL CAgentOffice::removeAgent( UINT a_AgentID, UINT a_HostAgent )
|
|
200
|
208
|
|
|
201
|
209
|
CSingleLock Lock(&m_Cs4AgentMap, TRUE);
|
|
202
|
210
|
|
|
|
211
|
+
|
|
203
|
212
|
if(m_AgentMap.Lookup(a_AgentID, pAgent))
|
|
204
|
213
|
{
|
|
205
|
214
|
CAcdCore::GetInstance().getQueueMgr().delAgent(pAgent);
|
|
206
|
215
|
|
|
|
216
|
+ // 2023-06-19 视频电话相关
|
|
|
217
|
+ auto ret = m_GroupMap.equal_range(pAgent->group());
|
|
|
218
|
+ for (auto it = ret.first; it != ret.second; ++it) {
|
|
|
219
|
+ m_GroupMap.erase(it);
|
|
|
220
|
+ break;
|
|
|
221
|
+ }
|
|
|
222
|
+
|
|
207
|
223
|
m_AgentMap.RemoveKey(a_AgentID); // 从全体座席索引中删除
|
|
208
|
224
|
pAgent->release(a_HostAgent);
|
|
209
|
225
|
delete pAgent;
|
|
|
@@ -365,6 +381,22 @@ bool CAgentOffice::getFreeAgent(uint32_t & AgentId, uint32_t & ExtenId)
|
|
365
|
381
|
return false;
|
|
366
|
382
|
}
|
|
367
|
383
|
|
|
|
384
|
+bool CAgentOffice::getFreeAgentByGroup(uint32_t & AgentId, uint32_t & ExtenId, const LPCTSTR & a_GroupID)
|
|
|
385
|
+{
|
|
|
386
|
+ auto ret = m_GroupMap.equal_range(a_GroupID);
|
|
|
387
|
+ for (auto it = ret.first; it != ret.second; ++it) {
|
|
|
388
|
+ auto pAgent = it->second;
|
|
|
389
|
+ if (pAgent&&pAgent->isFree() && pAgent->lock()) {
|
|
|
390
|
+ m_GroupMap.erase(it);
|
|
|
391
|
+ m_GroupMap.insert(std::make_pair(a_GroupID, pAgent));
|
|
|
392
|
+ AgentId = pAgent->id();
|
|
|
393
|
+ ExtenId = pAgent->assoExten();
|
|
|
394
|
+ return true;
|
|
|
395
|
+ }
|
|
|
396
|
+ }
|
|
|
397
|
+ return false;
|
|
|
398
|
+}
|
|
|
399
|
+
|
|
368
|
400
|
/*****************************************************************
|
|
369
|
401
|
**【函数名称】 getStateSpecAgentList
|
|
370
|
402
|
**【函数功能】 获取指定状态的座席列表
|