DavidLiu 3 months ago
parent
commit
710b80177f
1 changed files with 6 additions and 2 deletions
  1. 6 2
      src/core/voip/bot.py

+ 6 - 2
src/core/voip/bot.py

@@ -368,7 +368,12 @@ class MyCall(pj.Call):
             registry.BOT_INTERACTION_ROUNDS.labels(self.taskId).observe(self.inter_action_total)
 
     def release(self):
-        # self.hangup()
+        self.asr.close()
+        try:
+            self.hangup()
+        except:
+            traceback.print_exc()
+
         if self.audio_port:
             # self.audio_port.stopTransmit()
             self.audio_port = None  # 或调用相关销毁方法
@@ -379,7 +384,6 @@ class MyCall(pj.Call):
             # self.audio_media.stopTransmit()
             self.aud_media = None
 
-        self.asr.close()
         # 远程挂机之后要将分机号回收
         self.agent.release(self.user_part)
         self.end_statistics()