Anurag Rana
Anurag Rana

Reputation: 1466

timeout extension is not working in asterisk 11

I am designing a dialplan as below. Everything is working fine but the timeout extension is not working.
autofallthrough=no is commented in extension.conf file.

subContinueOrNot is a subroutine called from a context named as 'study4'. dialplan waits for 10 seconds after playing files 'notCallPress2' and then return empty value. Invalid extension is working fine. But it is not going to timeout extension.

[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,)

Below is the output on asterisk console.

 -- <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"

Upvotes: 1

Views: 2820

Answers (1)

arheops
arheops

Reputation: 15257

It work as expected by developers.

Timeout options will work only if you have no next extension or all extensions non-blocking in dialplan

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)

http://www.voip-info.org/wiki/view/Asterisk+tips+ivr+menu

Upvotes: 2

Related Questions