DavidLiu 3 months ago
parent
commit
51ef6686cc
1 changed files with 5 additions and 5 deletions
  1. 5 5
      src/core/voip/bot.py

+ 5 - 5
src/core/voip/bot.py

@@ -369,10 +369,7 @@ class MyCall(pj.Call):
 
     def release(self):
         self.asr.close()
-        try:
-            self.hangup()
-        except:
-            traceback.print_exc()
+        self.agent.hangup(self.user_part)
 
         if self.audio_port:
             # self.audio_port.stopTransmit()
@@ -601,7 +598,10 @@ class BotAgent:
         acc = self.accounts.get(user_part)
         if acc:
             for k, v in acc.calls.items():
-                v.hangup(call_op_param)
+                try:
+                    v.hangup(call_op_param)
+                except:
+                    traceback.print_exc()
             # 机器人主动挂机回收分机号
             self.release(user_part)