sdmswitch/sdm/data/nls-cloud-sdm/script/HangupNotifierDemo.py
2023-10-11 04:39:21 +00:00

24 lines
883 B
Python
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# coding=utf-8
import os
import time
import sys
# Demo示例需要在具体项目具体场景下自行实现相关调用逻辑
def hangupNotify(channelId, vendorParams, asrResult, asrBeginTime, asrEndTime):
# channelId 唯一sessionid 是mrcp-server产生的
# vendorParams ivr发送给mrcp-server的RECOGNIZE消息时携带的扩展参数
# asrResult : 识别结果
# asrBeginTime : 识别结果的开始时间
# asrEndTime : 识别结果的结束时间
print "handupNotify = ", channelId, vendorParams, asrResult, asrBeginTime, asrEndTime
if len(asrResult) == 0 or (asrBeginTime < 0 and asrEndTime < 0):
# 说明挂机时没有识别结果
return
# 挂机时可能有识别结果需要将该结果抛给nlu
# TODO
if __name__ == '__main__':
hangupNotify("123f", "ke=1", "hi", 124, -1)
print "Game Over"