Background() timing problem

I wrote a simple demo set of istructions in extensions.conf

[incoming]
exten => s,1,Answer()
exten => s,n,Background(vm-enter-num-to-call)
exten => s,n,goto(incoming,s,1)
exten => 1,1,Playback(digits/1)
exten => 1,2,goto(incoming,s,1)
exten => 2,1,Playback(digits/2)
exten => 2,2,goto(incoming,s,1)
exten => i,1,Playback(pbx-invalid)
exten => i,2,goto(incoming,s,1)
exten => t,1,Playback(vm-goodby)
exten => t,2,Hangup()

since i read in the manual that the default timeout should be 10 second i was expecting that after playing the “enter the num” message the system wait me to enter my choice whitin 10 second before reprompting again.
The real behaviour is that the system suddently reprompt me with the enter the num message. It seam that the timeout is not working or wrong.
So i explicitely used the ResponseTimeout() asserting for 5 second or response time as follow

[incoming]
exten => s,1,Answer()
exten => s,n,ResponseTimeout(5)
exten => s,n,Background(vm-enter-num-to-call)
exten => s,n,goto(incoming,s,1)
exten => 1,1,Playback(digits/1)
exten => 1,2,goto(incoming,s,1)
exten => 2,1,Playback(digits/2)
exten => 2,2,goto(incoming,s,1)
exten => i,1,Playback(pbx-invalid)
exten => i,2,goto(incoming,s,1)
exten => t,1,Playback(vm-goodby)
exten => t,2,Hangup()

This time the consolle show me the message
[Jul 20 14:16:00] WARNING[3651]: pbx.c:1797 pbx_extension_helper: No application ‘ResponseTimeout’ for extension (incoming, s, 2)

it seems that the ResponseTimeout() is not compiled or anyhow available in the system. I checked with the consolle command
zap show status
that ztdummy module was loaded… and was ok

So i need help to understand what is wrong.
btw i dont have any telefony card but only zaptel module for allowing ztdummy timing.

Tnx for help.
:smile: Fabio.

fcapozzi
Your dialplan works as expected, BackGround has no timeout. That’s WaitExten that has timeout (and as I remember it’s 10 secs), which is missing in your dialplan.

[incoming]
exten => s,1,Answer()
exten => s,n,Background(vm-enter-num-to-call)
[color=red]exten => s,n,WaitExten();[/color]
exten => s,n,goto(incoming,s,[color=red]2[/color])
exten => 1,1,Playback(digits/1)
exten => 1,2,goto(incoming,s,[color=red]2[/color])
exten => 2,1,Playback(digits/2)
exten => 2,2,goto(incoming,s,[color=red]2[/color])
exten => i,1,Playback(pbx-invalid)
exten => i,2,goto(incoming,s,[color=red]2[/color])
[color=red]exten => t,1,Playback(vm-goodby)
exten => t,2,Hangup()
[/color]
You may optionally set desired timeout -> WaitExten(15)
gotos must be set to 2nd priority as channel is already answered when reaching goto.
There will be t (timeout) for this dialplan as background<->waitexten will loop.

tnx georgy for your help. With your suggestion dialplan work quite as expected. Actually, if i don’t enter any digit the timeout seems not to occur. When WaitExten() run-out the system reprompt me to enter the number again in an infinite loop.

However i wonder why the ResponseTimeout() function listed in pag 272 in the O-reily documentation book is not compiled into the asterisk code. May be the applications are changed respect the print date of that book (31 August 2005)

:smile:

To handle the timeouts now there is the function TIMEOUT(), use cli command “core show function TIMEOUT” for details about.

Bye.

fcapozzi
I am sorry, I have misspelled, I meant There will be no t (timeout) for this dialplan as background<->waitexten will loop. As far as I know, when timeout occurs, dialplan tries to go to next priority, if there is no next priority, only then it goes to ‘t’. In your case it loops by going up and down, that’s why it doesn’t reach ‘t’ :smile:

From Asterisk 1.2 ResponseTimeout() application has been replaced with TIMEOUT(timeouttype=seconds) Function.

voip-info.org/tiki-index.php … nseTimeout