|
@@ -131,15 +131,15 @@ class ChannelHangupHandler(EslEventHandler):
|
|
|
records.append(value.record) if value.record else None
|
|
|
self.logger.info("get_call_info_record: %s", records)
|
|
|
if records:
|
|
|
- merge_record= self.merge_audio_files(records) if len(records) > 1 else records[0]
|
|
|
- threading.Thread(target=self._update_record_in_thread, args=(call_info.call_id, merge_record)).start()
|
|
|
+ threading.Thread(target=self._update_record_in_thread, args=(call_info.call_id, records)).start()
|
|
|
else:
|
|
|
self.logger.warning("没有找到有效的录音文件")
|
|
|
|
|
|
- def _update_record_in_thread(self, call_id, merge_record):
|
|
|
+ def _update_record_in_thread(self, call_id, records):
|
|
|
"""用于在独立线程中执行 update_record"""
|
|
|
try:
|
|
|
- self.dataHandleServer.update_record(call_id, time_end=datetime.now(), record=merge_record)
|
|
|
+ merge_record = self.merge_audio_files(records) if len(records) > 1 else records[0]
|
|
|
+ self.dataHandleServer.update_record(call_id, time_end=datetime.now(), url=merge_record)
|
|
|
self.logger.info("更新录音记录完成: call_id=%s", call_id)
|
|
|
except Exception as e:
|
|
|
self.logger.error("更新录音记录失败: call_id=%s, error=%s", call_id, str(e))
|