[asterisk-users] Dailplan code for holiday detection?

Steve Murphy murf at digium.com
Mon Dec 29 13:04:31 CST 2008


On Tue, 2008-12-23 at 10:11 -0800, Dan Austin wrote:
> This has been on my ToDo list far too long.
> 
> I have a small call-center setup, with basic
> time of day/day of week validation before putting
> callers in the queues.
> 
> With the holidays upon us, I need to add check to
> see if 'today' is a holiday so I do not put callers
> in unmanned queues.  Due to how the agents work, I have
> to allow joinwhenempty.
> 
> Does anyone have a snippet of dialplan code, perhaps using
> Astdb, to check it 'today' is a listed holiday?
> 
> Thanks,
> Dan
> 


Here is a little script I use on my home system;
There are others on 

http://voip-info.org/wiki/view/AEL+Example+Snippets


               ifTime(*|*|20-25|dec) 
               { 
                       Playback(greetings/christmas); 
               }
               else ifTime(*|*|31|dec) 
               {  
                       Playback(greetings/newyear); 
               }
               else ifTime(*|*|1|jan)
               {
                       Playback(greetings/newyear);
               }
               else ifTime(*|*|14|feb)
               {
                       Playback(greetings/valentines);
               }
               else ifTime(*|*|17|mar) 
               {
                       Playback(greetings/stPat);
               }
               else ifTime(*|*|31|oct) 
               {
                       Playback(greetings/halloween);
               }
               else ifTime(*|mon|15-21|jan) 
               {
                       Playback(greetings/mlkDay);
               }
               else ifTime(*|thu|22-28|nov)
               {
                       Playback(greetings/thanksgiving);
               }
               else ifTime(*|mon|25-31|may)
               {
                       Playback(greetings/memorial);
               }
               else ifTime(*|mon|1-7|sep)
               {
                       Playback(greetings/labor);
               }
               else ifTime(*|mon|15-21|feb)
               {
                       Playback(greetings/president);
               }
               else ifTime(*|sun|8-14|may)
               {
                       Playback(greetings/mothers);
               }
               else ifTime(*|sun|15-21|jun)
               {
                       Playback(greetings/fathers);
               } 
               else 
               {
                       Playback(greetings/hello);   // None of the above? Just a plain hello will do
               }


murf


-- 
     Steve Murphy
Digium, Inc. | Software Developer
57 Lane 17, Cody, WY 82414 USA
direct: +1 256-428-6002
mobile: +1 307-899-5535
fax/home: +1 307-754-5675
irc: codefreeze | jabber: murf at digium.com
Check us out at: www.digium.com & www.asterisk.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3227 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20081229/82d80770/attachment.bin 


More information about the asterisk-users mailing list