我正在设计一个拨号方案,如下所示。一切正常,但超时延长无效
autofallthrough=no
在extension.conf文件中进行了注释。
subContinueOrNot是一个从名为' study4'的上下文调用的子程序。 拨号文件播放文件后等待10秒钟#notcallPress2'然后返回空值。无效的扩展程序正常工作。但它不会超时延长。
[subContinueOrNot]
exten=>s,1,Playback(study4/okCallPress1)
exten=>s,n,Playback(study4/notCallPress2)
exten=>s,n,Set(PARAM=)
exten=>s,n,WaitExten(10)
exten=>s,n(ret),Return(${PARAM})
exten=>1,1,Set(PARAM=1)
exten=>1,n,Goto(s,ret)
exten=>2,1,Set(PARAM=2)
exten=>2,n,Goto(s,ret)
exten=>i,1,GoSub(subInvalid,s,1(${INVALID_EXTEN}))
exten=>i,n,Set(PARAM=${GOSUB_RETVAL})
exten=>i,n,Goto(s,ret)
exten=>t,1,GoSub(subTimeout,s,1())
exten=>t,n,Set(PARAM=timeOut)
exten=>t,n,Goto(s,ret)
exten=>h,1,Goto(study4,h,1,)
以下是星号控制台的输出。
-- <SIP/101-0000000f> Playing 'study4/weAsk.slin' (language 'en')
-- Executing [s@study4:10] Gosub("SIP/101-0000000f", "subContinueOrNot,s,1()") in new stack
-- Executing [s@subContinueOrNot:1] Playback("SIP/101-0000000f", "study4/okCallPress1") in new stack
-- <SIP/101-0000000f> Playing 'study4/okCallPress1.slin' (language 'en')
-- Executing [s@subContinueOrNot:2] Playback("SIP/101-0000000f", "study4/notCallPress2") in new stack
-- <SIP/101-0000000f> Playing 'study4/notCallPress2.slin' (language 'en')
-- Executing [s@subContinueOrNot:3] Set("SIP/101-0000000f", "PARAM=") in new stack
-- Executing [s@subContinueOrNot:4] WaitExten("SIP/101-0000000f", "10") in new stack
-- Timeout on SIP/101-0000000f, continuing...
-- Executing [s@subContinueOrNot:5] Return("SIP/101-0000000f", "") in new stack
-- Executing [s@study4:11] Set("SIP/101-0000000f", "RV=") in new stack
-- Executing [s@study4:12] GotoIf("SIP/101-0000000f", "0?s,cont1:s,stop1") in new stack
-- Goto (study4,s,13)
-- Executing [s@study4:13] Playback("SIP/101-0000000f", "study4/callAgain2") in new stack
-- <SIP/101-0000000f> Playing 'study4/callAgain2.slin' (language 'en')
-- Executing [s@study4:14] Goto("SIP/101-0000000f", "s,hang") in new stack
-- Goto (study4,s,57)
-- Executing [s@study4:57] Hangup("SIP/101-0000000f", "") in new stack
== Spawn extension (study4, s, 57) exited non-zero on 'SIP/101-0000000f'
-- Executing [h@study4:1] Verbose("SIP/101-0000000f", "2,"Hanging Up now"") in new stack
== "Hanging Up now"
答案 0 :(得分:0)
开发人员按预期工作。
只有在拨号方案中没有下一个分机或所有分机无阻塞时,超时选项才有效
exten=>s,n,WaitExten(10)
exten=>i,1,Noop(invalid here)
exten=>t,1,Noop(timeout here)
OR
exten=>s,n,Background(somefile);non-blocking playback
exten=>i,1,Noop(invalid here)
exten=>t,1,Noop(timeout here)