Hello all, Has anyone found an elegant solution to using time conditions with multiple locations? For example suppose you have a multi tenant system with time conditions, is there any way to set the call time zone on a per call basis? Thanks, Spencer
Can you expand upon this question a bit? My guess is that "anything's possible" but I'd like to know more about what you're doing before making any suggestions. -MC On Thu, Nov 3, 2011 at 2:11 AM, Spencer Thomason <spencer@5ninesolutions.com
wrote:
Hello all, Has anyone found an elegant solution to using time conditions with multiple locations? For example suppose you have a multi tenant system with time conditions, is there any way to set the call time zone on a per call basis?
Thanks, Spencer
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
The general thing is a GUI that allows users to create a time condition. If you're running an ITSP, rather than a PBX for one company, then your customers will likely be spanning across time zones. It's one thing to normalize the times to your local time zones.. But that doesn't take DST into account. So basically, the best way would seem to be to pass the time zone to the condition that evaluates TOD. When I looked at this a while ago, I couldn't figure out how to do it.. -Avi On Fri, Nov 4, 2011 at 7:20 PM, Michael Collins <msc@freeswitch.org> wrote:
Can you expand upon this question a bit? My guess is that "anything's possible" but I'd like to know more about what you're doing before making any suggestions.
-MC
On Thu, Nov 3, 2011 at 2:11 AM, Spencer Thomason < spencer@5ninesolutions.com> wrote:
Hello all, Has anyone found an elegant solution to using time conditions with multiple locations? For example suppose you have a multi tenant system with time conditions, is there any way to set the call time zone on a per call basis?
Thanks, Spencer
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
How are you passing the timezone info to the dialplan? Are you using an offset? Are you using the timezone name? These are important questions. If you use the timezone name then the strftime_tz API command will let you compute the local time for the given time zone using the time zone database, including any known DST values. From there it's just some basic string manipulation and calculations. Note: The dialplan TOD conditions do not account for TZ so you'd need to do your own calculations. It's completely doable, though, as long as there is a valid TZ name supplied somehow. -MC On Sat, Nov 5, 2011 at 9:12 AM, Avi Marcus <avi@avimarcus.net> wrote:
The general thing is a GUI that allows users to create a time condition. If you're running an ITSP, rather than a PBX for one company, then your customers will likely be spanning across time zones. It's one thing to normalize the times to your local time zones.. But that doesn't take DST into account. So basically, the best way would seem to be to pass the time zone to the condition that evaluates TOD. When I looked at this a while ago, I couldn't figure out how to do it..
-Avi
On Fri, Nov 4, 2011 at 7:20 PM, Michael Collins <msc@freeswitch.org>wrote:
Can you expand upon this question a bit? My guess is that "anything's possible" but I'd like to know more about what you're doing before making any suggestions.
-MC
On Thu, Nov 3, 2011 at 2:11 AM, Spencer Thomason < spencer@5ninesolutions.com> wrote:
Hello all, Has anyone found an elegant solution to using time conditions with multiple locations? For example suppose you have a multi tenant system with time conditions, is there any way to set the call time zone on a per call basis?
Thanks, Spencer
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
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? -Avi On Mon, Nov 7, 2011 at 9:32 PM, Michael Collins <msc@freeswitch.org> wrote:
How are you passing the timezone info to the dialplan? Are you using an offset? Are you using the timezone name? These are important questions. If you use the timezone name then the strftime_tz API command will let you compute the local time for the given time zone using the time zone database, including any known DST values. From there it's just some basic string manipulation and calculations. Note: The dialplan TOD conditions do not account for TZ so you'd need to do your own calculations. It's completely doable, though, as long as there is a valid TZ name supplied somehow. -MC
On Sat, Nov 5, 2011 at 9:12 AM, Avi Marcus <avi@avimarcus.net> wrote:
The general thing is a GUI that allows users to create a time condition. If you're running an ITSP, rather than a PBX for one company, then your customers will likely be spanning across time zones. It's one thing to normalize the times to your local time zones.. But that doesn't take DST into account. So basically, the best way would seem to be to pass the time zone to the condition that evaluates TOD. When I looked at this a while ago, I couldn't figure out how to do it.. -Avi
On Fri, Nov 4, 2011 at 7:20 PM, Michael Collins <msc@freeswitch.org> wrote:
Can you expand upon this question a bit? My guess is that "anything's possible" but I'd like to know more about what you're doing before
making
any suggestions. -MC
On Thu, Nov 3, 2011 at 2:11 AM, Spencer Thomason <spencer@5ninesolutions.com> wrote:
Hello all, Has anyone found an elegant solution to using time conditions with multiple locations? For example suppose you have a multi tenant
system with
time conditions, is there any way to set the call time zone on a per call basis?
Thanks, Spencer
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
On Mon, Nov 7, 2011 at 11:37 AM, Avi Marcus <avi@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
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@freeswitch.org> wrote:
On Mon, Nov 7, 2011 at 11:37 AM, Avi Marcus <avi@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@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@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
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@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@freeswitch.org>wrote:
On Mon, Nov 7, 2011 at 11:37 AM, Avi Marcus <avi@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@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@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
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@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@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@freeswitch.org>wrote:
On Mon, Nov 7, 2011 at 11:37 AM, Avi Marcus <avi@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@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@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
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@gmail.com <mailto:anthony.minessale@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@gmail.com <mailto:anthony.minessale@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@freeswitch.org <mailto:msc@freeswitch.org>> wrote:
On Mon, Nov 7, 2011 at 11:37 AM, Avi Marcus <avi@avimarcus.net <mailto:avi@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@lists.freeswitch.org <mailto:FreeSWITCH-users@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@hotmail.com <mailto:MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com <mailto:PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <mailto:sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org <mailto:googletalk%3Aconf%2B888@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@hotmail.com <mailto:MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com <mailto:PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <mailto:sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900 <tel:%2B19193869900>
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <mailto:FreeSWITCH-users@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (5)
-
Abaci
-
Anthony Minessale
-
Avi Marcus
-
Michael Collins
-
Spencer Thomason