|
@@ -157,17 +157,14 @@ class ChannelHangupHandler(EslEventHandler):
|
|
sip_status.append(value.sip_status)
|
|
sip_status.append(value.sip_status)
|
|
hangup_cause.append(value.hangup_cause)
|
|
hangup_cause.append(value.hangup_cause)
|
|
self.logger.info("get_call_info_record: %s", records)
|
|
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):
|
|
def _update_record_in_thread(self, call_id, records, sip_status, hangup_cause, answer_count):
|
|
"""用于在独立线程中执行 update_record"""
|
|
"""用于在独立线程中执行 update_record"""
|
|
try:
|
|
try:
|
|
status = 0 if answer_count <= 0 else 1
|
|
status = 0 if answer_count <= 0 else 1
|
|
if len(records) == 0:
|
|
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)
|
|
self.dataHandleServer.update_record(call_id, time_end=datetime.now(), sip_status=sip_status, sip_hangup_cause=hangup_cause, status=status)
|
|
return
|
|
return
|
|
merge_record = self.merge_audio_files(records) if len(records) > 1 else records[0]
|
|
merge_record = self.merge_audio_files(records) if len(records) > 1 else records[0]
|