DavidLiu 3 meses atrás
pai
commit
677ee6b11d
1 arquivos alterados com 6 adições e 3 exclusões
  1. 6 3
      src/core/voip/bot.py

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

@@ -567,11 +567,14 @@ 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))
+            self.accounts[0].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)