Jared Smith <[email protected]> writes:
> Sounds like overkill to me... why not just use a GotoIfTime clause in
> your dialplan?
Because he already has one, but also an override. The override should go
away at midnight, which normally requires a cron job.
A stateless way of doing it is something like:
exten => _X.,1,GotoIf($["${DB(number1/forceopen)}"="STRFTIME(,,%F)"]?open)
exten => _X.,n,GotoIf($["${DB(number1/forceclose)}"="STRFTIME(,,%F)"]?close)
exten => _X.,n,GotoIfTime(...?open)
exten => _X.,n(close),...
exten => _X.,n,Hangup
exten => _X.,n(open),...
exten => _X.,n,Hangup
exten => _198,1,Set(DB(number1/forceopen)=STRFTIME(,,%F))
exten => _199,1,Set(DB(number1/forceclose)=STRFTIME(,,%F))
This should make any overrideopen/overrideclose settings only apply for
the day when they were set. Beware, not tested, not even loaded into an
Asterisk.
I actually feel quite clever for coming up with this :) Of course now
everyone will tell me that they have something twice as clever running
in production since '98...
/Benny
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users