|
@@ -11,6 +11,8 @@ from src.core.callcenter.api import CallInfo, AgentActionRequest
|
|
from apscheduler.schedulers.background import BackgroundScheduler
|
|
from apscheduler.schedulers.background import BackgroundScheduler
|
|
from concurrent.futures import ThreadPoolExecutor, wait, ALL_COMPLETED, FIRST_COMPLETED
|
|
from concurrent.futures import ThreadPoolExecutor, wait, ALL_COMPLETED, FIRST_COMPLETED
|
|
|
|
|
|
|
|
+from src.core.callcenter.constant import saasId
|
|
|
|
+
|
|
|
|
|
|
class AcdService:
|
|
class AcdService:
|
|
def __init__(self, client, logger):
|
|
def __init__(self, client, logger):
|
|
@@ -28,7 +30,7 @@ class AcdService:
|
|
# 1. hold住并且播放等待音
|
|
# 1. hold住并且播放等待音
|
|
self.call_service.hold(call_info, device_id)
|
|
self.call_service.hold(call_info, device_id)
|
|
# 获得空闲坐席
|
|
# 获得空闲坐席
|
|
- agent_number = self.agent_service.assign(AgentActionRequest())
|
|
|
|
|
|
+ agent_number = self.agent_service.assign(AgentActionRequest(saas_id=saasId, service_id=service_id))
|
|
if not agent_number:
|
|
if not agent_number:
|
|
# 如果没有空闲坐席,播放等待音
|
|
# 如果没有空闲坐席,播放等待音
|
|
self.logger.info("AcdService transferToAgent agentNumber is empty serviceId:%s,called:%s,callId:%s",
|
|
self.logger.info("AcdService transferToAgent agentNumber is empty serviceId:%s,called:%s,callId:%s",
|
|
@@ -61,7 +63,7 @@ class AcdService:
|
|
call_info = Cache.get_call_info(call_id)
|
|
call_info = Cache.get_call_info(call_id)
|
|
if not call_info or not call_info.device_list:
|
|
if not call_info or not call_info.device_list:
|
|
continue
|
|
continue
|
|
- agent_number = self.agent_service.assign(AgentActionRequest())
|
|
|
|
|
|
+ agent_number = self.agent_service.assign(AgentActionRequest(saas_id=saasId, service_id=task_service_id))
|
|
if not agent_number:
|
|
if not agent_number:
|
|
self.logger.info("AcdService tryTransferAgent agentNumber is Empty %s", call_id)
|
|
self.logger.info("AcdService tryTransferAgent agentNumber is Empty %s", call_id)
|
|
tmp_arr.append(call_id)
|
|
tmp_arr.append(call_id)
|