[Freeswitch-users] Timezone with time conditions

Abaci abaci64 at gmail.com
Tue Sep 25 03:13:22 MSD 2012


I try both "tz-offset" (per tag) and "tod_tz_offset" and it doesn't seem 
to have any effect can someone please confirm that I'm doing the right 
thing and is someone else using it successfully?
Here is my test dialplan:
   <section name="dialplan" description="Regex/XML Dialplan">
     <context name="public">
       <extension name="test">
         <condition break="never">
           <action application="set" data="ringback=$${us-ring}"/>
           <action application="set" data="timezone=America/New_York" 
inline="true"/>
           <action application="set" data="tod_tz_offset=-4" inline="true"/>
           <action application="log" data="CRIT 
${strftime_tz(America/New_York %b %d %Y %H:%M:%S)}"/>
         </condition>
         <condition tz-offset="-4" mon="9" mday="24" 
minute-of-day="900-1200"  break="on-true">
           <action application="transfer" data="30 XML default" />
         </condition>
       </extension>
     </context>
   </section>
I see the log logging the correct time, however the second condition is 
never getting matched based on the tod_tz_offset variable or tz-offset 
tag. if anyone can point me in the right direction I will update the 
documentation.


On 11/30/2011 7:10 AM, Avi Marcus wrote:
> Thanks Anthony!
>
> I update the wiki at http://wiki.freeswitch.org/wiki/Tod if anyone 
> else can test and confirm this feature (on git > 2011-11-08 / revision 
> 65a756643a45a9462270a83238a396d742b7103f)
>
> The TOD doc page could be streamlined a bit, too..
>
> -Avi
>
> On Tue, Nov 8, 2011 at 12:39 AM, Anthony Minessale 
> <anthony.minessale at gmail.com <mailto:anthony.minessale at gmail.com>> wrote:
>
>     I looked into what the code would require and decided to push a
>     patch, now you get to test and document it.
>
>     if you get the variable tod_tz_offset set on the channel before it
>     hits the dialplan extension in question it will apply that offset
>     to gmt so you can set it to say, -6 for central time.
>
>     Note, you must have it set first so you either need to use inline
>     set or maybe it will work if you have already defined it in your
>     user directory.
>
>     also on a per-tag basis, you can do tz-offset attr ...
>
>
>
>
>     On Mon, Nov 7, 2011 at 4:20 PM, Anthony Minessale
>     <anthony.minessale at gmail.com <mailto:anthony.minessale at gmail.com>>
>     wrote:
>
>         on multi home you are better off exploring xml_curl to do time
>         of day stuff, what you suggest would require some new code for
>         sure.
>
>
>         On Mon, Nov 7, 2011 at 4:10 PM, Michael Collins
>         <msc at freeswitch.org <mailto:msc at freeswitch.org>> wrote:
>
>
>             On Mon, Nov 7, 2011 at 11:37 AM, Avi Marcus
>             <avi at avimarcus.net <mailto:avi at avimarcus.net>> wrote:
>
>                     Note: The dialplan TOD conditions do not account
>                     for TZ 
>
>                 I think that's the point of this thread. Is there a
>                 point to re-invent the wheel doing TOD conditions
>                 manually?
>
>
>             No, the issue is a matter of supply and demand. The skills
>             needed to add TZ directly into the dialplan are in short
>             supply, whereas doing TZ stuff manually in the dialplan is
>             all but trivial and does not require C coding skills.
>             Also, the demand for TZ checking is relatively low.
>
>             If it's really desired then a bounty should be put up.
>
>             -MC
>
>
>             FreeSWITCH-users mailing list
>             FreeSWITCH-users at lists.freeswitch.org
>             <mailto:FreeSWITCH-users at lists.freeswitch.org>
>             http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>             UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>             http://www.freeswitch.org
>
>
>
>
>         -- 
>         Anthony Minessale II
>
>         FreeSWITCH http://www.freeswitch.org/
>         ClueCon http://www.cluecon.com/
>         Twitter: http://twitter.com/FreeSWITCH_wire
>
>         AIM: anthm
>         MSN:anthony_minessale at hotmail.com
>         <mailto:MSN%3Aanthony_minessale at hotmail.com>
>         GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
>         <mailto:PAYPAL%3Aanthony.minessale at gmail.com>
>         IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch
>
>         FreeSWITCH Developer Conference
>         sip:888 at conference.freeswitch.org
>         <mailto:sip%3A888 at conference.freeswitch.org>
>         googletalk:conf+888 at conference.freeswitch.org
>         <mailto:googletalk%3Aconf%2B888 at conference.freeswitch.org>
>         pstn:+19193869900 <tel:%2B19193869900>
>
>
>
>
>     -- 
>     Anthony Minessale II
>
>     FreeSWITCH http://www.freeswitch.org/
>     ClueCon http://www.cluecon.com/
>     Twitter: http://twitter.com/FreeSWITCH_wire
>
>     AIM: anthm
>     MSN:anthony_minessale at hotmail.com
>     <mailto:MSN%3Aanthony_minessale at hotmail.com>
>     GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
>     <mailto:PAYPAL%3Aanthony.minessale at gmail.com>
>     IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch
>
>     FreeSWITCH Developer Conference
>     sip:888 at conference.freeswitch.org
>     <mailto:sip%3A888 at conference.freeswitch.org>
>     googletalk:conf+888 at conference.freeswitch.org
>     <mailto:googletalk%3Aconf%2B888 at conference.freeswitch.org>
>     pstn:+19193869900 <tel:%2B19193869900>
>
>
>     FreeSWITCH-users mailing list
>     FreeSWITCH-users at lists.freeswitch.org
>     <mailto:FreeSWITCH-users at lists.freeswitch.org>
>     http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>     UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>     http://www.freeswitch.org
>
>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120924/1161e16b/attachment-0001.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list