|
@@ -134,7 +134,7 @@ class ChannelHangupHandler(EslEventHandler):
|
|
|
# 全部挂机以后推送挂机状态
|
|
|
# self.logger.info('yushanghui::call_info.device_list %s', call_info.device_list)
|
|
|
if len(call_info.device_list) == 0:
|
|
|
- self.get_call_info_record(call_info)
|
|
|
+ self.get_call_info_record(call_info, device_info)
|
|
|
|
|
|
# 判断挂机方向 && 更新缓存
|
|
|
self.hangup_dir(call_info, device_info, cause)
|
|
@@ -143,21 +143,21 @@ class ChannelHangupHandler(EslEventHandler):
|
|
|
except:
|
|
|
traceback.print_exc()
|
|
|
|
|
|
- def get_call_info_record(self, call_info):
|
|
|
+ def get_call_info_record(self, call_info, device_info):
|
|
|
records = []
|
|
|
for value in call_info.device_info_map.values():
|
|
|
records.append(value.record) if value.record else None
|
|
|
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)).start()
|
|
|
+ threading.Thread(target=self._update_record_in_thread, args=(call_info.call_id, records, device_info.sip_status, device_info.hangup_cause)).start()
|
|
|
else:
|
|
|
self.logger.warning("没有找到有效的录音文件")
|
|
|
|
|
|
- def _update_record_in_thread(self, call_id, records):
|
|
|
+ def _update_record_in_thread(self, call_id, records, sip_status, hangup_cause):
|
|
|
"""用于在独立线程中执行 update_record"""
|
|
|
try:
|
|
|
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.dataHandleServer.update_record(call_id, time_end=datetime.now(), url=merge_record, sip_status=sip_status, sip_hangup_cause=hangup_cause)
|
|
|
self.logger.info("更新录音记录完成: call_id=%s", call_id)
|
|
|
except Exception as e:
|
|
|
self.logger.error("更新录音记录失败: call_id=%s, error=%s", call_id, str(e))
|