Davidliu 1 månad sedan
förälder
incheckning
8363da3797
1 ändrade filer med 12 tillägg och 7 borttagningar
  1. 12 7
      src/core/voip/bot.py

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

@@ -625,11 +625,15 @@ class BotAgent:
     def _create_pjsua2(self, timeout_sec=86400):
         start_time = time.time()
         try:
+            self.logger.info('11111111111')
             self.cache.set_register_per_hours(expire=timeout_sec - (60*3))
             # Create and initialize the library
             ep_cfg = build_ep_config()
+            self.logger.info('222222222222')
             self.ep.libCreate()
+            self.logger.info('333333333333')
             self.ep.libInit(ep_cfg)
+            self.logger.info('444444444')
 
             aud_dev_mgr = self.ep.audDevManager()
             aud_dev_mgr.setNullDev()  # 使用虚拟音频设备(如果没有实际设备)
@@ -643,6 +647,7 @@ class BotAgent:
             self.ep.transportCreate(pj.PJSIP_TRANSPORT_UDP, sipTpConfig)
             # Start the library
             self.ep.libStart()
+            self.logger.info('55555555555')
 
             for user_part in self.user_part_range:
                 acfg = build_account_config(self.host, self.port, user_part, self.password, timeout_sec)
@@ -664,13 +669,13 @@ class BotAgent:
         #     registry.BOT_AGENT_LIVES.set(self.user_part_pool.qsize())
         #     self.ep.libHandleEvents(200)
 
-        self.logger.info('2222222222222222222222')
-        self.call_players.clear()
-        self.accounts.clear()
-        self.calls.clear()
-        # Destroy the library
-        self.logger.info('3333333333333333333')
-        self.ep.libDestroy()
+        # self.logger.info('2222222222222222222222')
+        # self.call_players.clear()
+        # self.accounts.clear()
+        # self.calls.clear()
+        # # Destroy the library
+        # self.logger.info('3333333333333333333')
+        # self.ep.libDestroy()
         self.logger.info("create pjsua already shutdown")