774056846 4 months ago
parent
commit
ea656f1478
2 changed files with 3 additions and 4 deletions
  1. 1 1
      src/core/callcenter/config.py
  2. 2 3
      src/core/callcenter/esl/client.py

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

@@ -18,7 +18,7 @@ class BaseConfig(object):
 
     SQLALCHEMY_DATABASE_URI = f"{DIALCT}+{DRITVER}://{USERNAME}:{PASSWORD}@{HOST}:{PORT}/{DBNAME}?charset=utf8"
     SQLALCHEMY_TRACK_MODIFICATIONS = True   # Disable track modifications
-    SQLALCHEMY_ECHO = True  # Optional: Log SQL queries
+    SQLALCHEMY_ECHO = False  # Optional: Log SQL queries
     SQLALCHEMY_ENGINE_OPTIONS= {
         'connect_args': {
             'init_command': "SET time_zone = 'Asia/Shanghai'"

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

@@ -531,11 +531,11 @@ class OutboundClient:
                     device_id = info.getHeader("unique-id")
                     caller_number = info.getHeader("Caller-Caller-ID-Number")  # 获取来电号码
                     whitelist = self.server.load_whitelist()
-                    agents = self.server.load_agent_monitor()
-                    # 直接转接到人工坐席
 
                      # 检查白名单
                     if caller_number in whitelist:
+                        # 直接转接到人工坐席
+                        agents = self.server.load_agent_monitor()
                         # 随机取一个坐席号
                         destination = random.choice(agents)
                         # 直接转接到人工坐席
@@ -554,7 +554,6 @@ class OutboundClient:
                     self.build_call_info(call_id, device_id, new_device_id, str(destination), **kwargs)
                     Cache.add_device_user_part(device_id, destination)
                     con.execute("bridge", "{sip_h_P-LIBRA-CallId=%s,sip_h_P-LIBRA-DeviceId=%s,origination_uuid=%s}user/%s"%(call_id, new_device_id, new_device_id, destination), device_id)
-                    # con.bgapi(ORIGINATE, "{sip_h_P-LIBRA-CallId=%s,sip_h_P-LIBRA-DeviceId=%s,origination_uuid=%s}user/%s"%(call_id, new_device_id, new_device_id, destination))
 
                     # destination = "user/1001"
                     # msg = ESL.ESLevent("sendmsg", uuid)