shanghui 3 달 전
부모
커밋
11b7f0ab47
1개의 변경된 파일2개의 추가작업 그리고 5개의 파일을 삭제
  1. 2 5
      src/core/callcenter/esl/handler/channel_hangup_handler.py

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

@@ -157,17 +157,14 @@ class ChannelHangupHandler(EslEventHandler):
             sip_status.append(value.sip_status)
             hangup_cause.append(value.hangup_cause)
         self.logger.info("get_call_info_record: %s", records)
-        if records:
-           threading.Thread(target=self._update_record_in_thread, args=(call_info.call_id, records, ",".join(sip_status), ",".join(hangup_cause),call_info.answer_count)).start()
-        else:
-            threading.Thread(target=self._update_record_in_thread, args=(call_info.call_id, records, ",".join(sip_status), ",".join(hangup_cause),call_info.answer_count)).start()
-            self.logger.warning("没有找到有效的录音文件")
+        threading.Thread(target=self._update_record_in_thread, args=(call_info.call_id, records, ",".join(sip_status), ",".join(hangup_cause),call_info.answer_count)).start()
 
     def _update_record_in_thread(self, call_id, records, sip_status, hangup_cause, answer_count):
         """用于在独立线程中执行 update_record"""
         try:
             status = 0 if answer_count <= 0 else 1
             if len(records) == 0:
+                self.logger.warning("没有录音文件,直接更新记录: call_id=%s, sip_status=%s, hangup_cause=%s", call_id, sip_status, hangup_cause)
                 self.dataHandleServer.update_record(call_id, time_end=datetime.now(), sip_status=sip_status, sip_hangup_cause=hangup_cause, status=status)
                 return
             merge_record = self.merge_audio_files(records) if len(records) > 1 else records[0]