24 lines
883 B
Python
Executable File
24 lines
883 B
Python
Executable File
# 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" |