[Home]

Summary:ASTERISK-13173: [patch] allow multi-timezone GotoIfTime & ExecIfTime
Reporter:Mostyn Bramley-Moore (mostyn)Labels:
Date Opened:2008-12-08 05:27:27.000-0600Date Closed:2008-12-16 16:57:24.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Applications/NewFeature
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) timezone-v1.patch
( 1) timezone-v2.patch
Description:This is the beginnings of a patch that will allow users to optionally specify the timezone to use in GotoIfTime and ExecIfTime calls.  
Comments:By: Mostyn Bramley-Moore (mostyn) 2008-12-08 05:30:55.000-0600

Erk, I put this in the wrong category obviously.

By: Tilghman Lesher (tilghman) 2008-12-08 14:24:32.000-0600

This patch is going to need some work, clearly, but we're not wild about the syntax to start with.  We're thinking that perhaps CHANNEL(tz) should be used to set the timezone and use that setting everywhere.

However, a clear use case for why you've added this functionality would help us greatly.  Would the syntax as described above work for you?

By: Mostyn Bramley-Moore (mostyn) 2008-12-08 15:45:23.000-0600

Before I re-work this, what do people think of this possible syntax?  My examples below only mention GotoIfTime, but can be applied to ExecIfTime in the same manner.  

Original syntax:
GotoIfTime(<times>,<weekdays>,<mdays>,<months>?[[context,]exten,]priority[:[[context,]exten,]priority])

Proposed syntax:
GotoIfTime(<times>,<weekdays>,<mdays>,<months>[,<timezone>]?[[context,]exten,]priority[:[[context,]exten,]priority])

Example use case:

[urgent-support]
exten => s,1,NoOp(Urgent: locate some support staff )

   ; this asterisk install runs on Melbourne time, so we can omit the timezone
exten => s,n,GotoIfTime(9:00-17:00,mon-fri,*,*?melbourne-support,s,1)

   ; this state (QLD) does not have DST
exten => s,n,GotoIfTime(9:00-17:00,mon-fri,*,*,Australia/Brisbane?brisbane-support,s,1)

   ; this state (WA) has different start/end dates for DST
exten => s,n,GotoIfTime(9:00-17:00,mon-fri,*,*,Australia/Perth?perth-support,s,1)

   ; finally call mobiles- put this last to avoid unneccessarily waking people up
exten => s,n,Goto(support-mobiles,s,1)

By: Tilghman Lesher (tilghman) 2008-12-10 12:29:25.000-0600

This syntax works fine for us, as we indicated on IRC.

By: Tilghman Lesher (tilghman) 2008-12-11 11:10:06.000-0600

Setting to feedback to indicate waiting for a new patch from the reporter.

By: Mostyn Bramley-Moore (mostyn) 2008-12-12 16:27:32.000-0600

In the second version of my patch, I have moved the processing into ast_build_timing and ast_check_timing - so the new functionality should apply to GotoIfTime, ExecIfTime and IFTIME.

I have not modified utils/extconf.c - which appears to have its own internal copy of both ast_build_timing and ast_check_timing.

By: Digium Subversion (svnbot) 2008-12-16 16:57:23.000-0600

Repository: asterisk
Revision: 164976

U   trunk/CHANGES
U   trunk/configs/extensions.conf.sample
A   trunk/doc/api-1.6.2-changes.txt
U   trunk/funcs/func_logic.c
U   trunk/include/asterisk/pbx.h
U   trunk/main/pbx.c
U   trunk/utils/extconf.c

------------------------------------------------------------------------
r164976 | tilghman | 2008-12-16 16:57:23 -0600 (Tue, 16 Dec 2008) | 7 lines

Add timezone to the possible fields in a timespec.
(closes issue ASTERISK-13173)
Reported by: mostyn
Patches:
      timezone-v2.patch uploaded by mostyn (license 398)
      (with additional code guideline fixes and a memory leak fix by me - license 14)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=164976