DavidLiu 3 mesiacov pred
rodič
commit
22dc4d57bc
1 zmenil súbory, kde vykonal 11 pridanie a 8 odobranie
  1. 11 8
      src/core/voip/bot.py

+ 11 - 8
src/core/voip/bot.py

@@ -614,14 +614,17 @@ class BotAgent:
             self.logger.info('hangup, header_name=%s, header_value=%s'%(k, v))
             sip_header_vector.push_back(_sip_header)
         call_op_param.txOption.headers = sip_header_vector
-
-        acc = self.accounts.get(user_part)
-        if acc:
-            for k, v in acc.calls.items():
-                try:
-                    v.hangup(call_op_param)
-                except:
-                    traceback.print_exc()
+        try:
+            acc = self.accounts.get(user_part)
+            if acc:
+                for k, v in acc.calls.items():
+                    try:
+                        v.hangup(call_op_param)
+                    except:
+                        traceback.print_exc()
+        except:
+            traceback.print_exc()
+        finally:
             # 机器人主动挂机回收分机号
             self.release(user_part)