Bladeren bron

fix: 修改bug

余尚辉 21 uur geleden
bovenliggende
commit
f448665354
1 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
  1. 3 3
      src/core/voip/bot.py

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

@@ -348,8 +348,8 @@ class MyCall(pj.Call):
         ToTextBotAgent(user_asr_text,self)
 
     def say_end_action(self, action):
-        print('handling_release', action.action_code)
-        action_code = action.action_code
+        print('handling_release', action)
+        action_code = action.get("action_code")
         if action_code == 'hang':  # 挂断
             action_content = action.action_content
             print(f'todo 挂电话:{action_content}')
@@ -360,7 +360,7 @@ class MyCall(pj.Call):
 
 class ToTextBotAgent:
     def __init__(self, user_asr_text, call_agent):
-        if not user_asr_text and call_agent.actiont.get("action_code") != "normal":
+        if not user_asr_text or call_agent.action.get("action_code") != "normal":
             print("ASR文本为空,终止执行。")
             return
         self.call_agent = call_agent