Re: [asterisk-users] Dialplans Holiday Dates

2010-01-05 Thread Danny Nicholas
When it is running, nerdvittles.com is an excellent resource for this kind
of question.  Voip-info.org is almost always up and has more technically
oriented answers to this type of query.

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Myles Wakeham
Sent: Thursday, December 31, 2009 9:46 AM
To: asterisk-users@lists.digium.com
Subject: [asterisk-users] Dialplans  Holiday Dates

I have a working dialplan for our phone system with Mon-Fri, business 
hours identification, etc.  But what I'm lacking right now is support 
for company holiday dates.

What I'd like to do is to create a database of these dates and just 
update them as new years rollover.

I suspect others have done this sort of thing with Asterisk before, but 
I've not found any resources so far.

Does anyone have a suggestion as to how to approach this?  I'm running 
Asterisk 1.4.2.

Thanks
Myles
-- 
===
Myles Wakeham
Director of Engineering
Tech Solutions USA, Inc.
Scottsdale, Arizona  USA
http://www.techsolusa.com
Phone +1-480-451-7440


___
-- 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


___
-- 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


[asterisk-users] Dialplans Holiday Dates

2009-12-31 Thread Myles Wakeham
I have a working dialplan for our phone system with Mon-Fri, business 
hours identification, etc.  But what I'm lacking right now is support 
for company holiday dates.

What I'd like to do is to create a database of these dates and just 
update them as new years rollover.

I suspect others have done this sort of thing with Asterisk before, but 
I've not found any resources so far.

Does anyone have a suggestion as to how to approach this?  I'm running 
Asterisk 1.4.2.

Thanks
Myles
-- 
===
Myles Wakeham
Director of Engineering
Tech Solutions USA, Inc.
Scottsdale, Arizona  USA
http://www.techsolusa.com
Phone +1-480-451-7440


___
-- 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


Re: [asterisk-users] Dialplans Holiday Dates

2009-12-31 Thread Cary Fitch
Perhaps make the dates a database entry?  The fixed dates would stay the
same each year and you would adjust only the floating dates.

Or, there are really few holidays in the year. (Unless you are a government
or a bank)  Simple intercept code in the dialplan would handle most
businesses.  

Just write 5-10 cloned lines of date traps in the code to pass the calls
or send them to a closed handler.  That is less disk/system intensive that
doing a disk access, except they would likely be in cache anyway.

Cary Fitch



-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Myles Wakeham
Sent: Thursday, December 31, 2009 9:46 AM
To: asterisk-users@lists.digium.com
Subject: [asterisk-users] Dialplans  Holiday Dates

I have a working dialplan for our phone system with Mon-Fri, business 
hours identification, etc.  But what I'm lacking right now is support 
for company holiday dates.

What I'd like to do is to create a database of these dates and just 
update them as new years rollover.

I suspect others have done this sort of thing with Asterisk before, but 
I've not found any resources so far.

Does anyone have a suggestion as to how to approach this?  I'm running 
Asterisk 1.4.2.

Thanks
Myles
-- 
===
Myles Wakeham
Director of Engineering
Tech Solutions USA, Inc.
Scottsdale, Arizona  USA
http://www.techsolusa.com
Phone +1-480-451-7440


___
-- 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


___
-- 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


Re: [asterisk-users] Dialplans Holiday Dates

2009-12-31 Thread Doug Lytle




Myles Wakeham wrote:

  

I suspect others have done this sort of thing with Asterisk before, but 
I've not found any resources so far.
  


exten =
317xxx,1,Gosub(holiday_check,s,1)


[holiday_check]

;
;* Break out current 2 digit month
;

exten = s,1,Gosub(todays_date,s,1)

;*
;* Look for database entry for match against
;* month and day. Store sound file name
;* to GREETING variable
;*

exten = s,n,MYSQL(Connect connid localhost anonymous '' holidays)
exten = s,n,GosubIf($["${MYSQL_STATUS}" = "-1"]?mysql_failed,s,6)
exten = s,n,MYSQL(Query resultid ${connid} SELECT greeting FROM
schedule WHERE month = ${MONTH} AND day = ${DAY})
exten = s,n,MYSQL(Fetch fetchid ${resultid} GREETING)
exten = s,n,MYSQL(Disconnect ${connid})
exten = s,n,MYSQL(Clear ${resultid})

;***
;* If GREETING  *BLANK, must be a holiday
;* jump to s,10. Else return from subroutine
;***

exten = s,n,GotoIf($["${GREETING}" != ""]?9:13)

;
;* Play Holiday message and return
;* from subroutine
;

exten = s,n,Wait(2)
exten = s,n,Playback(local/holidays/greet_begin)
exten = s,n,Playback(local/holidays/${GREETING})
exten = s,n,Set(_Holiday=YES)
exten = s,n,Return


[todays_date]

;
;* Break out current 2 digit hour
;

exten = s,1,Set(HOUR=${STRFTIME(${EPOCH},,%H)})

;
;* Break out current 2 digit day
;

exten = s,n,Set(DAY=${STRFTIME(${EPOCH},,%d)})

;
;* Break out current 2 digit month
;

exten = s,n,Set(MONTH=${STRFTIME(${EPOCH},,%m)})

;
;* Break out current 4 digit year
;

exten = s,n,Set(YEAR=${STRFTIME(${EPOCH},,%Y)})

;
;* Set TODAY to DAY/MONTH/YEAR
;

exten = s,n,Set(TODAY=${MONTH}/${DAY}/${YEAR})

exten = s,n,Return()





___
-- 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