Преглед изворни кода

Merge branch 'dev_20241205' of ssh://gitlab.fuxicarbon.com:1111/client_service/voice-gateway-service into dev_20241205

shanghui пре 3 месеци
родитељ
комит
6f45f13259
1 измењених фајлова са 7 додато и 3 уклоњено
  1. 7 3
      src/core/voip/bot.py

+ 7 - 3
src/core/voip/bot.py

@@ -567,11 +567,15 @@ class BotAgent:
 
         while not self.is_stopping:
             registry.BOT_AGENT_LIVES.set(self.user_part_pool.qsize())
-            if len(self.accounts) == self.user_part_pool.qsize():
-                self.logger.info("------------------>flush register ::%s", len(self.accounts))
-                self.accounts[0].acc.setRegistration(renew=True)
+            self.flush_register_expire()
             self.ep.libHandleEvents(100)
 
+    def flush_register_expire(self):
+        if len(self.accounts) == self.user_part_pool.qsize():
+            self.logger.info("------------------>flush register ::%s", len(self.accounts))
+            user_part = self.user_part_range[0]
+            self.accounts[user_part].setRegistration(renew=True)
+
     def transfer(self, user_part, call_id, device_id, service_id='00000000000000000'):
         if self.acd_service:
             self.acd_service.transfer_to_agent(call_id, device_id, service_id)