Davidliu 3 months ago
parent
commit
bd12380e33
2 changed files with 11 additions and 10 deletions
  1. 5 4
      src/core/callcenter/esl/handler/channel_hangup_handler.py
  2. 6 6
      src/core/voip/bot.py

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

@@ -183,10 +183,11 @@ class ChannelHangupHandler(EslEventHandler):
     def _ensure_path_permissions(self, file_path):
         """确保文件及其父级目录的权限为 755"""
         current_path = os.path.abspath(file_path)
-        while current_path != "/":  # 遍历到根目录为止
-            if os.path.exists(current_path):
-                os.chmod(current_path, 0o755)  # 设置当前路径权限为 755
-            current_path = os.path.dirname(current_path)  # 获取父目录路径
+        self.logger.info("_ensure_path_permissions::%s", current_path)
+        # while current_path != "/":  # 遍历到根目录为止
+        #     if os.path.exists(current_path):
+        #         os.chmod(current_path, 0o755)  # 设置当前路径权限为 755
+        #     current_path = os.path.dirname(current_path)  # 获取父目录路径
     def merge_audio_files(self,audio_files):
         if not audio_files:
             self.logger.info("没有可合并的音频文件")

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

@@ -498,7 +498,7 @@ class ToTextBotAgent:
 @singleton_keys
 class BotAgent:
 
-    def __init__(self, app, user_part_range=range(1001, 1011), host="192.168.100.159", port="5060", password="slibra@#123456"):
+    def __init__(self, app, user_part_range=range(1001, 1011), host=SIP_SERVER, port="5060", password="slibra@#123456"):
         self.app = app
         self.logger = app.logger
         self.user_part_range, self.host, self.port, self.password = user_part_range, host, port, password
@@ -528,8 +528,8 @@ class BotAgent:
             ep_cfg.uaConfig.maxCalls = 12
             ep_cfg.uaConfig.maxAccounts = 12
             ep_cfg.medConfig.noVad = True
-            ep_cfg.logConfig.level = 4
-            ep_cfg.logConfig.consoleLevel = 4
+            ep_cfg.logConfig.level = 3
+            ep_cfg.logConfig.consoleLevel = 3
             self.ep.libCreate()
             self.ep.libInit(ep_cfg)
 
@@ -560,9 +560,9 @@ class BotAgent:
                 acfg.regConfig.retryIntervalSec = 10  # 重试间隔时间(秒)
                 acfg.regConfig.firstRetryIntervalSec = 10  # 首次重试间隔时间(秒)
 
-                # acfg.natConfig.iceEnabled = True
-                # acfg.natConfig.turnEnabled = True
-                # acfg.natConfig.turnServer = f"stun:{self.host}:3478"
+                acfg.natConfig.iceEnabled = True
+                acfg.natConfig.turnEnabled = True
+                acfg.natConfig.turnServer = f"stun:{self.host}:3478"
                 # acfg.natConfig.turnUsername = "username"
                 # acfg.natConfig.turnPassword = "password"