Hey All, I need to forward an extension to an other depending on the current time but I could not get it done with GotoIfTime. What I'm trying to do is ring on the extension 1 if time is between 8:00AM and 2:00PM and on extension 2 if is between 2:01PM 11:00PM. exten => 111,1,GotoIfTime(8:00-14:00|*|*|1-12?333) exten => 111,2,Dial(${Person1}) exten => 111,3,Dial(Hangup) exten => 333,1,Dial(${Person2}) exten => 333,2,Dial(Hangup) When I ring on the extension 111, the call is not being forward to the extension 333.. And the extensions are all in the same context. regards Oz
about GotoIfTime you have: >show application GotoIfTime -= Info about application 'GotoIfTime' =- [Synopsis]: Conditional goto on current time [Description]: GotoIfTime(<times>|<weekdays>|<mdays>|<months>?[[context|]extension|]pri): If the current time matches the specified time, then branch to the specified extension. Each of the elements may be specified either as '*' (for always) or as a range. See the include syntax. and it have to be something like that: [default] exten => 111,1,GotoIfTime(08:00:00-14:00:00,*,*,*?extension_1,1,1) exten => 111,2,GotoIfTime(14:00:01-23:00:00,*,*,*?extension_1,101,1) exten => 111,3,Hangup [extension_1] exten => 1,1,Dial(${Person1}) exten => 1,2,Hangup exten => 101,1,Dial(${Person2}) exten => 101,2,Hangup Lubo Osvaldo Mundim wrote:> Hey All, > > I need to forward an extension to an other depending on the current time > but I could not get it done with GotoIfTime. > > What I'm trying to do is ring on the extension 1 if time is between > 8:00AM and 2:00PM and on extension 2 if is between > 2:01PM 11:00PM. > > exten => 111,1,GotoIfTime(8:00-14:00|*|*|1-12?333) > exten => 111,2,Dial(${Person1}) > exten => 111,3,Dial(Hangup) > > exten => 333,1,Dial(${Person2}) > exten => 333,2,Dial(Hangup) > > When I ring on the extension 111, the call is not being forward to the > extension 333.. > > And the extensions are all in the same context. > > regards > Oz > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users >
Hi! gotoif usually takes a priority as label, not an extension! See below. Never tried if you can also use the notation "context,extension,priority" instead of just "priority", but it might work. Just try it.> I need to forward an extension to an other depending on the current > time but I could not get it done with GotoIfTime. > > What I'm trying to do is ring on the extension 1 if time is between > 8:00AM and 2:00PM and on extension 2 if is between > 2:01PM 11:00PM. > > exten => 111,1,GotoIfTime(8:00-14:00|*|*|1-12?333) > exten => 111,2,Dial(${Person1}) > exten => 111,3,Dial(Hangup) > > exten => 333,1,Dial(${Person2}) > exten => 333,2,Dial(Hangup)exten => 111,1,GotoIfTime(8:00-14:00|*|*|1-12?4:2) exten => 111,2,Dial(${Person1}) exten => 111,3,Dial(Hangup) exten => 111,4,Goto(default,333,1) exten => 333,1,Dial(${Person2}) exten => 333,2,Dial(Hangup) Note: If you use goto() or gotoif() with just one label then you'll see a warning in /var/log/asterisk/messages about the 2nd label missing. That's why I prefer to always specify both labels. Cheers, Philipp