774056846 5 mesiacov pred
rodič
commit
480daf51e5
1 zmenil súbory, kde vykonal 3 pridanie a 0 odobranie
  1. 3 0
      src/core/voip/bot.py

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

@@ -342,8 +342,11 @@ class MyCall(pj.Call):
         if action_code == 'hang':  # 挂断
             action_content = action.action_content
             print(f'todo 挂电话:{action_content}')
+            self.agent.hangup(self.user_part)
         elif action_code == 'transfer':  # 转人工
             print('todo 转人工')
+            sip_headers = {'bye_h_X-CIN-HangUpReason':'transferToAgent'}
+            self.agent.hangup(self.user_part, sip_headers=sip_headers)
 
 class ToTextBotAgent:
     def __init__(self, user_asr_text, call_agent):