[Asterisk-Users] Time based call direction

James Armstrong james at thearmstrongs.org
Thu Nov 3 05:51:19 MST 2005


I have a few lines of code that check the current date (20051103) for a 
database entry in HOLIDAYS and if it is there go to the 'Night' 
attendant for business closures on holidays.

exten => s,4,SubString(TODAY=${DATETIME},0,8)
exten => s,5,DBGet(INHOLIDAY=HOLIDAYS/${TODAY})
exten => s,6,GotoIf($[${INHOLIDAY}=1]?from-pstn-afthours,s,1:)

- James

Kyle Hagan wrote:
> Adam Moffett wrote:
> 
>>
>>> include => atlunchcontext|11:00-11:59|mon-fri|*
>>> include => notatlunchcontext|09:00-10:59|mon-fri|*
>>> include => notatlunchcontext|12:00-18:00|mon-fri|*
>>> include => afterhourscontext|18:01--8:59|mon-fri|*
>>>
>>>
>> I wasn't aware that include allowed a time qualifier.  Does that mean 
>> that the specified context will only be included at the specified time?
> 
> 
> 
> Correct. We have been useing that here for some time now.
> 
> Kyle
> _______________________________________________
> --Bandwidth and Colocation sponsored by Easynews.com --
> 
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users



More information about the asterisk-users mailing list