[Asterisk-Users] feature suggest.: alt. include criteria

asterisk-users.lists.digium.com at tgice.com asterisk-users.lists.digium.com at tgice.com
Fri Dec 3 11:25:49 MST 2004


Hi guys,

I've got a quick feature suggestion to solve a problem that I don't 
think is readily solvable having to do with an "after hours" message, 
playing only during (or rather outside) specified times.

I know all about the helpful feature that already exists which allows 
you to tack on a cron-ish specification of time, date, month, etc. to 
the end of an "include =>" statement to conditionally include it.

However, I've been thinking about a feature that'd be great (and 
possibly not difficult to code, though probably beyond my immediate 
Asterisk coding skills) for helping to implement an after hours w/ 
optional override feature, similar to what this poster mentioned:

  http://lists.digium.com/pipermail/asterisk-users/2004-November/071460.html

I think it'd be great if we had the option to conditionally include 
contexts based *either* on time [the existing capability] *or* based on 
a general Boolean expression [just like the capability in GotoIf's, 
e.g.] or at least something similar to that power, where you could 
examine the contents of a GlobalVar and decide to include a context 
based on the variable.

Am I correct in my understanding that this currently does not exist? 
Does anyone else think this is a good idea?  Has it already been 
suggested (I didn't exactly find a reference anywhere yet)?

For the record, I should mentioned I appreciate there are many ways to 
solve this with existing capabilities, and I have managed to hack 
together a solution that mostly works.  I was just a bit wistful while 
mucking up my previously neat looking extensions.conf with some 
not-so-clear code to handle this.  (I ended up using a combination of 
Macros & GotoIf/Times).  It seems to me that what ended up taking me a 
5-10 extra lines of code, and still doesn't give me perfectly what I 
want would be trivially solved (with like one line of extra code) if we 
had the feature I'm suggesting.

Thanks to all the developers for a wonderful, flexible, robust Open 
Source PBX solution.

John Lawler




More information about the asterisk-users mailing list