Hi, So how does one keep this from happening. (note, the following is fake code) exten => s,1,Play(Greeting) exten => s,2,Background(Menu Sound) exten => s,3,goto(s,2) How does one control the number of times s,3 gets executed?? The issue is this. 1. Call comes in via PSTN, * answers the call, starts to play things, caller hangs up. Menu loops for quite some time :) 2. Call comes in via PSTN, * answers the call, start to play things caller does nothing on the first pass thru the menu. I want the menu to repeat X times and then disconnect if no action from the claller. samples of extensions.conf would be really appreciated
I just repeat line 2, e.g. exten => s,1,Play(Greeting) exten => s,2,Background(Menu Sound) exten => s,3,Background(Menu Sound) John Brown wrote:>Hi, > > So how does one keep this from happening. > >(note, the following is fake code) > >exten => s,1,Play(Greeting) >exten => s,2,Background(Menu Sound) >exten => s,3,goto(s,2) > >How does one control the number of times s,3 gets executed?? > >The issue is this. > >1. Call comes in via PSTN, * answers the call, starts to play > things, caller hangs up. Menu loops for quite some time :) > >2. Call comes in via PSTN, * answers the call, start to play things > caller does nothing on the first pass thru the menu. > > I want the menu to repeat X times and then disconnect if no > action from the claller. > > >samples of extensions.conf would be really appreciated > > >_______________________________________________ >Asterisk-Users mailing list >Asterisk-Users@lists.digium.com >http://lists.digium.com/mailman/listinfo/asterisk-users > >
Klaus-Peter Junghanns
2003-Aug-24 02:20 UTC
[Asterisk-Users] fatal embrace control in menus ?
Morning, this is just too simple ;-) Try this if you want to loop 3 times: exten => s,1,Answer() exten => s,2,SetVar(LOOPS=0) exten => s,3,Background(MenuSound) exten => s,4,SetVar(LOOPS=$[${LOOPS} + 1]) exten => s,5,GotoIf($[${LOOPS} < 3]?3:6) exten => s,6,Hangup() regards kapejod -- Klaus-Peter Junghanns CEO,CTO Junghanns.NET GmbH Breite Strasse 13 - 12167 Berlin - Germany fon: +49 30 79705392 fax: +49 30 79705391 iaxtel: 1-700-157-8753 email: kpj@junghanns.net http://www.junghanns.net/asterisk Am Son, 2003-08-24 um 11.08 schrieb Todd Lieberman:> I just repeat line 2, e.g. > > exten => s,1,Play(Greeting) > exten => s,2,Background(Menu Sound) > exten => s,3,Background(Menu Sound) > > > > > > John Brown wrote: > > >Hi, > > > > So how does one keep this from happening. > > > >(note, the following is fake code) > > > >exten => s,1,Play(Greeting) > >exten => s,2,Background(Menu Sound) > >exten => s,3,goto(s,2) > > > >How does one control the number of times s,3 gets executed?? > > > >The issue is this. > > > >1. Call comes in via PSTN, * answers the call, starts to play > > things, caller hangs up. Menu loops for quite some time :) > > > >2. Call comes in via PSTN, * answers the call, start to play things > > caller does nothing on the first pass thru the menu. > > > > I want the menu to repeat X times and then disconnect if no > > action from the claller. > > > > > >samples of extensions.conf would be really appreciated > > > > > >_______________________________________________ > >Asterisk-Users mailing list > >Asterisk-Users@lists.digium.com > >http://lists.digium.com/mailman/listinfo/asterisk-users > > > > > > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users
Ahh, much thanks. Learning more about the programming bit of this system everyday. now if we could only get away from these blasted line numbers, or at least have line numbers like 10 20 30 which would make it easier to insert something quickly On Sun, Aug 24, 2003 at 11:20:27AM +0200, Klaus-Peter Junghanns wrote:> Morning, > > this is just too simple ;-) > Try this if you want to loop 3 times: > > exten => s,1,Answer() > exten => s,2,SetVar(LOOPS=0) > exten => s,3,Background(MenuSound) > exten => s,4,SetVar(LOOPS=$[${LOOPS} + 1]) > exten => s,5,GotoIf($[${LOOPS} < 3]?3:6) > exten => s,6,Hangup() > > regards > > kapejod > > -- > Klaus-Peter Junghanns > > CEO,CTO > Junghanns.NET GmbH > Breite Strasse 13 - 12167 Berlin - Germany > fon: +49 30 79705392 > fax: +49 30 79705391 > iaxtel: 1-700-157-8753 > email: kpj@junghanns.net > http://www.junghanns.net/asterisk > > Am Son, 2003-08-24 um 11.08 schrieb Todd Lieberman: > > I just repeat line 2, e.g. > > > > exten => s,1,Play(Greeting) > > exten => s,2,Background(Menu Sound) > > exten => s,3,Background(Menu Sound) > > > > > > > > > > > > John Brown wrote: > > > > >Hi, > > > > > > So how does one keep this from happening. > > > > > >(note, the following is fake code) > > > > > >exten => s,1,Play(Greeting) > > >exten => s,2,Background(Menu Sound) > > >exten => s,3,goto(s,2) > > > > > >How does one control the number of times s,3 gets executed?? > > > > > >The issue is this. > > > > > >1. Call comes in via PSTN, * answers the call, starts to play > > > things, caller hangs up. Menu loops for quite some time :) > > > > > >2. Call comes in via PSTN, * answers the call, start to play things > > > caller does nothing on the first pass thru the menu. > > > > > > I want the menu to repeat X times and then disconnect if no > > > action from the claller. > > > > > > > > >samples of extensions.conf would be really appreciated > > > > > > > > >_______________________________________________ > > >Asterisk-Users mailing list > > >Asterisk-Users@lists.digium.com > > >http://lists.digium.com/mailman/listinfo/asterisk-users > > > > > > > > > > > > _______________________________________________ > > Asterisk-Users mailing list > > Asterisk-Users@lists.digium.com > > http://lists.digium.com/mailman/listinfo/asterisk-users > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users
> 1. Call comes in via PSTN, * answers the call, starts to play > things, caller hangs up. Menu loops for quite some time :) > > 2. Call comes in via PSTN, * answers the call, start to play things > caller does nothing on the first pass thru the menu. > > I want the menu to repeat X times and then disconnect if no > action from the claller. > > > samples of extensions.conf would be really appreciatedWell one way would be to set an AbsoluteTimeout on the call and then when they actually select options, then set the absolutetimeout to 0 (i.e. no timeout) exten => s,1,AbsoluteTimeout(60) ; Make sure they do something in 60 secs exten => s,2,Background(options) ; Give them options exten => s,3,Goto(2) ; Repeat exten => 1,1,AbsoluteTimeout(0) ; Lose the timeout exten => 1,2,Dial(Zap/1) ; Ring a Phone Another way would be to explicitly list: exten => s,1,Background(options) exten => s,2,Background(options) exten => s,3,Background(options) exten => t,1,Playback(goodbye) exten => t,2,Hangup mark