余尚辉 vor 4 Monaten
Ursprung
Commit
526a7d0f33

+ 3 - 10
src/core/callcenter/agent.py

@@ -64,9 +64,9 @@ class AgentOperService:
         self.agent_actionlog_service.insert_check_state(agent_monitor, AgentCheck.IN, AgentLogState.CHECKIN)
         self.agent_state_service.checkin(agent.saas_id, agent.out_id, agent.phone_num)
 
-        if req.scene == AgentScene.MANUAL.code:
-            # 如果是手动外呼增加置闲
-            self._handle_idle(req.scene, agent)
+        # if req.scene == AgentScene.MANUAL.code:
+        #     # 如果是手动外呼增加置忙
+        #     self._handle_idle(req.scene, agent)
         return self._push_event_for_checkin(agent, agent_monitor, phone, req.scene)
     def checkout(self, req: AgentActionRequest):
         agent = _get_agent(req.saas_id, req.agent_id)
@@ -553,7 +553,6 @@ class AgentStateService:
 
     def handle_assign_time(self, saas_id, service_id, choose_phone_num):
         key = self._key(saas_id, service_id)
-        print(1111111)
         cache_agent_map = self.get_cache_agent_map(saas_id, service_id)
         if cache_agent_map and choose_phone_num in cache_agent_map:
             state_data = cache_agent_map[choose_phone_num]
@@ -564,7 +563,6 @@ class AgentStateService:
 
 
     def idle_agents(self, saas_id, service_id):
-        self.logger.info("ceshi5555")
         cache_agent_list = self.get_cache_agent_list(saas_id, service_id)
         if not cache_agent_list:
             return []
@@ -587,7 +585,6 @@ class AgentStateService:
         # self.update_report_state(saas_id, service_id)
 
     def busy_hash(self, saas_id, agent_id, phone_num, service_id):
-        print("busy_hash23232323")
         cache_agent_map = self.get_cache_agent_map(saas_id, service_id)
         state_data = cache_agent_map.get(phone_num)
         key = self._key(saas_id, service_id)
@@ -599,7 +596,6 @@ class AgentStateService:
         # self.update_report_state(saas_id, service_id)
 
     def get_cache_agent_map(self, saas_id, service_id):
-        self.logger.info("ceshi1223")
         cache_agent_list = self.get_cache_agent_list(saas_id, service_id)
         # 检查列表是否为空,如果为空返回空字典
         if not cache_agent_list:
@@ -611,7 +607,6 @@ class AgentStateService:
     def get_cache_agent_list(self, saas_id, service_id):
         redis_key = self._key(saas_id, service_id)
         map_cache_by_key = self.redis_handler.redis.hgetall(redis_key)
-        self.logger.info("ceshi444444")
         self.logger.info("get_cache_agent_list, redis_key=%s, map_cache_by_key=%s"%(redis_key, map_cache_by_key))
         if not map_cache_by_key:  # 检查字典是否为空
             return []  # 返回空列表
@@ -637,7 +632,6 @@ class AgentStateService:
 
     def get_agent_service_idle_size(self, saas_id, service_id):
         idle_agents_size = 0
-        self.logger.info("ceshi3333")
         cache_agent_list = self.get_cache_agent_list(saas_id, service_id)
         if cache_agent_list:  # 检查列表是否非空
             idle_agents = self.get_idle_agents(cache_agent_list)
@@ -646,7 +640,6 @@ class AgentStateService:
 
     def get_agent_service_busy_size(self, saas_id, service_id):
         busy_agents_size = 0
-        self.logger.info("ceshi22222")
         cache_agent_list = self.get_cache_agent_list(saas_id, service_id)
         if cache_agent_list:  # 检查列表是否非空
             idle_agents = self.get_idle_agents(cache_agent_list)

+ 4 - 5
src/core/callcenter/esl/handler/channel_bridge_handler.py

@@ -21,13 +21,12 @@ class ChannelBridgeHandler(EslEventHandler):
         device_id = EslEventUtil.getDeviceId(event)
         call = self.cache.get_call_info(call_id)
         device = call.device_info_map.get(device_id)
+        # 每通电话的第一次写入应答时间
         if not call.answer_time:
             call.answer_time = EslEventUtil.getEventDateTimestamp(event)
             self.cache.add_call_info(call)
-        self.dataHandleServer.update_record(call_id, {"status": 1})
-        self.logger.info("bridge call_info.answer_time:%s,device_info.answer_time%s,device.device_type%s" % (call.answer_time, device.answer_time,device.device_type))
+            self.dataHandleServer.update_record(call_id, {"status": 1})
+            self.logger.info("bridge call_info.answer_time:%s,device_info.answer_time%s,device.device_type%s" % (call.answer_time, device.answer_time,device.device_type))
         if device.device_type == DeviceType.AGENT.code: # 如果是坐席接听 变更坐席状态
-            self.dataHandleServer.update_agent_monitor_service_state(call.agent_key, AgentServiceState.CALLING.code)
             self.push_handler.push_on_agent_work_report(call.saas_id, call.cti_flow_id, call.agent_key, call.call_id, AgentScene.ROBOT, WorkStatus.AGENT_ANSWER_INCOMING)
-
-
+            self.dataHandleServer.update_agent_monitor_service_state(call.agent_key, AgentServiceState.CALLING.code)

+ 0 - 1
src/core/callcenter/esl/handler/channel_originate_handler.py

@@ -20,6 +20,5 @@ class ChannelOriginateHandler(EslEventHandler):
         call = self.cache.get_call_info(call_id)
         device = call.device_info_map.get(device_id)
         self.logger.info('ChannelOriginateHandler::event %s, device.device_type: %s, DeviceType.AGENT.code:%s ', event,device.device_type, DeviceType.AGENT.code)
-        print('ceshisdsdsdsdsdsdsd', device.device_type, DeviceType.AGENT.code, flush=True)
         if device.device_type == DeviceType.AGENT.code: # 如果是坐席接听 变更坐席状态
             self.push_handler.push_on_agent_work_report(call.saas_id, call.cti_flow_id,call.agent_key,call.call_id,AgentScene.ROBOT, WorkStatus.AGENT_RINGING,phone=call.caller)