余尚辉 4 hónapja
szülő
commit
0ebf3f5162

+ 1 - 0
src/core/callcenter/acd.py

@@ -57,6 +57,7 @@ class AcdService:
         # self.logger.info("AcdService tryTransferAgent start")
         all_task = []
         for k, v in self.holdsQueue.items():
+            self.logger.info("AcdService tryTransferAgent start, queue.k:%s, q.v", k, v.qsize())
             all_task.append(self.pool.submit(self.holds_one_queue, k, v))
         wait(all_task, timeout=6, return_when=ALL_COMPLETED)
 

+ 1 - 0
src/core/callcenter/cache.py

@@ -133,6 +133,7 @@ class Cache:
         members = self.redis_handler.redis.zrangebyscore(key, 0, current_time, start=0, num=DELAY_ACTION_BATCH_SIZE, withscores=True)
         if not members:
             return []
+        self.logger.info('get_delay_message %s %s %s'%(key, action, members))
         # scored_entries = [{"member": entry[0].decode('utf-8'), "score": entry[1]} for entry in members]
         action_list = [entry[0].decode('utf-8') for entry in members]
         if action_list:

+ 1 - 1
src/core/callcenter/call.py

@@ -89,7 +89,7 @@ class CallService:
     def transfer(self, call_info: CallInfo, agent_number, service_id):
         caller = call_info.called
         call_id = call_info.call_id
-        agent = self.cache.get_agent_info(call_info.saas_id, call_info.agent_key)
+        agent = self.cache.get_agent_info(call_info.saas_id, agent_number)
         device_id = 'T' + str(self.snowflake.next_id())
         # now = lambda: int(round(time.time() * 1000))
         now = datetime.utcnow().timestamp()

+ 4 - 3
src/core/callcenter/esl/client.py

@@ -43,15 +43,15 @@ class InboundClient:
         self.logger = app.logger
         self.bot_agent = agent
         self.cache = Cache(app)
+        self.dataHandleServer = DataHandleServer(app)
         self.handler_table = self.scan_esl_event_handlers()
         self.default_event_handler = DefaultEslEventHandler(self, self.bot_agent)
         self.host, self.port, self.password = SERVE_HOST, '8021', '4918257983818884358'
         self.executors = {x: concurrent.futures.ThreadPoolExecutor(max_workers=1) for x in range(self.thread_num)}
         self.delay_action_executor = concurrent.futures.ThreadPoolExecutor(max_workers=5)
         self.delay_action_scheduler = BackgroundScheduler()
-        self.dataHandleServer = DataHandleServer(app)
-        # self.delay_action_scheduler.add_job(self.submit_delay_action, 'interval', seconds=1, max_instances=1)
-        # self.delay_action_scheduler.start()
+        self.delay_action_scheduler.add_job(self.submit_delay_action, 'interval', seconds=1, max_instances=1)
+        self.delay_action_scheduler.start()
         threading.Thread(target=self.start, args=()).start()
 
     def submit_delay_action(self):
@@ -135,6 +135,7 @@ class InboundClient:
     def do_delay_action(self, action, message):
         delay_action = DelayAction.from_json(message)
         flag = self.cache.lock_delay_action(delay_action.uuid)
+        self.logger.info("do_delay_action::action=%s, flag=%s", action, flag)
         if not flag:
             self.logger.info("异步延迟执行操作重复 action:%s msg:%s", action, message)
             return