Davidliu 3 月之前
父节点
当前提交
df947425a9
共有 3 个文件被更改,包括 17 次插入12 次删除
  1. 二进制
      src.tar.gz
  2. 1 1
      src/core/callcenter/esl/handler/channel_hangup_handler.py
  3. 16 11
      src/core/voip/asr.py

二进制
src.tar.gz


+ 1 - 1
src/core/callcenter/esl/handler/channel_hangup_handler.py

@@ -96,7 +96,7 @@ class ChannelHangupHandler(EslEventHandler):
             bucket_type = call_info.bucket_type if call_info.bucket_type else "EMPTY"
             registry.CALL_HANGUP_REQUESTS.labels(f"{bucket_type}", f"{device_info.sip_status}").inc()
 
-            self.logger.info('ChannelHangupHandler, device_id=%s, hangup_reason=%s, device_type=%s, cdr_type=%s, end_time=%s, skip_hangup_all=%s, answer_count=%s, hangup_count=%s' % (device_id, hangup_reason, device_info.device_type, device_info.cdr_type, call_info.end_time, skip_hangup_all, call_info.answer_count, call_info.hangup_count))
+            self.logger.info('ChannelHangupHandler, call_id=%s, device_id=%s, hangup_reason=%s, device_type=%s, cdr_type=%s, end_time=%s, skip_hangup_all=%s, answer_count=%s, hangup_count=%s' % (call_id, device_id, hangup_reason, device_info.device_type, device_info.cdr_type, call_info.end_time, skip_hangup_all, call_info.answer_count, call_info.hangup_count))
             # 如果是转人工
             # if 'transferToAgent' == hangup_reason and DeviceType.ROBOT.code == device_info.device_type:
             #     call_info.answer_flag = AnswerFlag.TRANSFER_TO_AGENT.code

+ 16 - 11
src/core/voip/asr.py

@@ -114,17 +114,22 @@ class TestSt:
                 on_close=self.test_on_close,
                 callback_args=[self.__id]
             )
-            self.sr.start(
-                aformat="pcm",
-                sample_rate=8000,
-                enable_intermediate_result=True,
-                enable_punctuation_prediction=True,
-                enable_inverse_text_normalization=True
-            )
-            self.sr.ctrl(ex={'max_sentence_silence': '1200ms', 'disfluency': True,'enable_words': True })
-            self.logger.debug(f"[{self.__id}]ASR session started. {count}")
-            self.__event.wait(timeout=.5)
-            self.logger.debug(f"[{self.__id}]ASR session started. {count}")
+            try:
+                self.sr.start(
+                    aformat="pcm",
+                    sample_rate=8000,
+                    enable_intermediate_result=True,
+                    enable_punctuation_prediction=True,
+                    enable_inverse_text_normalization=True
+                )
+                self.sr.ctrl(ex={'max_sentence_silence': '1200ms', 'disfluency': True,'enable_words': True })
+                self.logger.debug(f"[{self.__id}]ASR session started. {count}")
+                self.__event.wait(timeout=.5)
+                self.logger.debug(f"[{self.__id}]ASR session started. {count}")
+            except Exception as e:
+                traceback.print_exc()
+                self.logger.debug(f"[{self.__id}]ASR session start exception. {e}")
+
             count = count + 1
 
     def test_on_sentence_begin(self, message, *args):