asteriskdialplan

Asterisk - setup hangup after seconds dialplan otpion S(sec)


When you dial 876, asterisk pbx start a call, send some dtmf code but doesn't close the call after 2 seconds. The call need to be closed by the user.

[myplan]
exten => _876,1,NoOp(Now should call 207,3 seconds for answer timeout, send DTMF, close the call)
exten => _876,n,Dial(SIP/207,3,D(ww#2334#),S(2))
exten => _876,n,Hangup()

From the manual:

S(x) Hangs up the call x seconds after the called party has answered the call.

Asterisk 16.13.0 

What am I missing?


Solution

  • I think # mean "wait 1 second" so overal time is over 2 second. So "S" should work after D ends.

    Try following:

    [myplan]
    exten => _876,1,NoOp(Now should call 207,3 seconds for answer timeout, send DTMF, close the call)
    exten => _876,n,Set(TIMEOUT(absolute)=2)
    exten => _876,n,Dial(SIP/207,3,D(ww#2334#)S(2))
    exten => _876,n,Hangup()