|
@@ -348,8 +348,8 @@ class MyCall(pj.Call):
|
|
ToTextBotAgent(user_asr_text,self)
|
|
ToTextBotAgent(user_asr_text,self)
|
|
|
|
|
|
def say_end_action(self, action):
|
|
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': # 挂断
|
|
if action_code == 'hang': # 挂断
|
|
action_content = action.action_content
|
|
action_content = action.action_content
|
|
print(f'todo 挂电话:{action_content}')
|
|
print(f'todo 挂电话:{action_content}')
|
|
@@ -360,7 +360,7 @@ class MyCall(pj.Call):
|
|
|
|
|
|
class ToTextBotAgent:
|
|
class ToTextBotAgent:
|
|
def __init__(self, user_asr_text, call_agent):
|
|
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文本为空,终止执行。")
|
|
print("ASR文本为空,终止执行。")
|
|
return
|
|
return
|
|
self.call_agent = call_agent
|
|
self.call_agent = call_agent
|