[Asterisk-Users] GotoIfTime help

Philipp von Klitzing klitzing at pool.informatik.rwth-aachen.de
Fri Dec 19 13:02:57 MST 2003


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





More information about the asterisk-users mailing list