[asterisk-users] Dailplan code for holiday detection?

Dan Austin Dan_Austin at Phoenix.com
Tue Dec 23 16:26:39 CST 2008


Tilghman wrote:
> Astdb is a nice idea.  Something along the lines of:

> GotoIf(0${DB(holiday/${STRFTIME(,,%Y-%m-%d)})}?holiday,s,1)

> would work.  Holidays are evaluated as "01", which is true.
> Anything not in the database would be evaluated as "0", which
> is false.  This will work both for holidays where the date
> changes every year (e.g. Thanksgiving, Labor Day), as well as
> holidays where it doesn't (e.g. Christmas, Independence Day).

On one hand I am embarrassed that it is that simple, on the other
I am thrilled that it is that simple.

After the Holidays I guess I need to put together a cheesy
web page to allow for adding the dates to Astdb, but for now
this is awesome and much appreciated.

Thanks,
Dan



More information about the asterisk-users mailing list