DavidLiu vor 4 Monaten
Ursprung
Commit
96752f8864

+ 5 - 3
src/core/callcenter/constant.py

@@ -3,7 +3,7 @@
 
 import json
 
-from src.core.callcenter.enumeration import CallStage
+from src.core.callcenter.enumeration import CallStage, CallType
 
 saasId = "mdj"
 
@@ -121,8 +121,10 @@ def format_time_millis(time_millis, pattern='%Y%m%d'):
 #     return BASE_RECORD_PATH + call.call_type + '/' + call.saas_id + '/' + call.caller + '/' + format_time_millis(call.call_time)
 
 def get_record_prefix(call):
-    # 确保所有的值都是字符串类型
-    return BASE_RECORD_PATH + str(call.call_type) + '/' + str(call.saas_id) + '/' + str(call.caller) + '/' + format_time_millis(call.call_time)
+    if CallType.BOT_CALL.code == call.call_type:
+        return BASE_RECORD_PATH + str(call.call_type) + '/' + str(call.saas_id) + '/' + str(call.called) + '/' + format_time_millis(call.call_time)
+    else:
+        return BASE_RECORD_PATH + str(call.call_type) + '/' + str(call.saas_id) + '/' + str(call.caller) + '/' + format_time_millis(call.call_time)
 
 def get_record_file_name(call_id, stage: CallStage):
     if stage.ROBOT == stage:

+ 1 - 0
src/core/callcenter/esl/handler/channel_answer_handler.py

@@ -175,5 +175,6 @@ class ChannelAnswerHandler(EslEventHandler):
 
     def start_recording(self, device_id, file_name, call: CallInfo):
         record_url = get_record_prefix(call) + '/' + file_name + '.wav'
+        self.logger.info("liuwei::debugger::answer, 5555, %s", record_url)
         self.inbound_client.record(device_id, 'start', record_url, 0)
         return record_url