[robot_docker] exten => s,1,AGI(agi://${PBX_IP}/robot_request_update?caller=${CALLERID(number)}&callid=${UNIQUEID}&requestid=${UNIQUEID}&status=0) exten => s,n,Set(TIMESTR=${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)}) exten => s,n,Set(talk_times=0) exten => s,n,Set(noinput_times=0) exten => s,n,Set(ttsapi_err_times=0) exten => s,n,Set(use_robot=1) exten => s,n,Set(is_interrupt=0) exten => s,n,Set(NIT_TIMEOUT=5000) exten => s,n,Set(VAD_TIMEOUT=300) exten => s,n,Set(SCT_TIMEOUT=500) exten => s,n,Wait(1) exten => s,n,Set(MONITOR_EXCHANGE=yes) exten => s,n,Monitor(wav,/data/justcall/pbx/spool/monitor/${STRFTIME(${NOW},,%Y/%m/%d)}/${UNIQUEID},m) ;exten => s,n,MixMonitor(/data/justcall/pbx/spool/monitor/${STRFTIME(${NOW},,%Y/%m/%d)}/${UNIQUEID}.wav) ;exten => s,n,Set(file_grammar=/data/justcall/pbx/etc/mrcpgrammer.xml) exten => s,n,Set(file_grammar=builtin:ali) exten => s,n(first),ExecIf($[${talk_times}=0 & "${PROMRTFILE}"=""]?Set(PROMRTFILE=mrcpprompt)) exten => s,n,ExecIf($["${isEnd}"="1"]?Playback(${IF($["${PROMRTFILE:-4}"=".wav"]?${PROMRTFILE:0:-4}:${PROMRTFILE})})) exten => s,n,GotoIf($["${isEnd}"="1"]?hup) exten => s,n,While(1) exten => s,n,Set(tipfile=${IF($["${PROMRTFILE:-4}"=".wav"]?${PROMRTFILE:0:-4}:${PROMRTFILE})}) ;exten => s,n,Wait(1) ;exten => s,n(other),MRCPRecog("${file_grammar}", t=${VAD_TIMEOUT}&spl=zh-CN&f=${tipfile}&sit=2&b=${is_interrupt}&nit=${NIT_TIMEOUT}) exten => s,n(other),MRCPRecog("${file_grammar}", t=${VAD_TIMEOUT}&spl=zh-CN&f=${tipfile}&sit=2&b=${is_interrupt}&nit=${NIT_TIMEOUT}&sct=${SCT_TIMEOUT}&sl=0.22&nif=json) exten => s,n,Set(talk_times=$[${talk_times} + 1]) exten => s,n,Noop(${RECOGSTATUS}, ${RECOG_COMPLETION_CAUSE}, ${RECOG_RESULT}) exten => s,n,GotoIf($["${RECOGSTATUS}" = "ERROR"]?hup) exten => s,n,GotoIf($["${RECOG_COMPLETION_CAUSE}" = "001"]?hup) exten => s,n,Set(noinput_times=${IF($["${RECOG_COMPLETION_CAUSE}" = "002"]?$[${noinput_times} + 1]:0)}) exten => s,n,GotoIf($[${noinput_times} >= 2]?hup) exten => s,n,AGI(agi://${PBX_IP}/parse_mrcp_json?callerid=${UNIQUEID}) ;exten => s,n,Goto(hup) exten => s,n,GotoIf($[${ttsapi_err_times} >= 3]?hup) exten => s,n,EndWhile() exten => s,n(hup),Wait(1) exten => s,n,Set(robothangup=4) exten => s,n,Hangup exten => h,1,Set(TIMEEND=${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)}) exten => h,n,AGI(agi://${PBX_IP}/robot_request_update?caller=${CALLERID(number)}&callid=${UNIQUEID}&requestid=${UNIQUEID}&status=1)