<div dir="ltr"><div style="font-size:12.8px"><font size="-1"><font face="Arial">> the proper way to include an entire day is 00:00:00-23:59:59 which covers all possible seconds in a range<br></font></font></div><div><font size="-1"><font face="Arial"><br></font></font></div><div><font size="-1"><font face="Arial">What about 23:59:60? ;)</font></font></div><div><font size="-1"><font face="Arial"><br></font></font></div><div><font size="-1"><font face="Arial">Bipin, if you're matching on the entire day, why do you need the time-of-day attribute at all? wday would be enough on its own.</font></font></div><div style="font-size:12.8px"><div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 4 September 2016 at 16:14, Ken Rice <span dir="ltr"><<a href="mailto:krice@freeswitch.org" target="_blank">krice@freeswitch.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div>Ok lets try to make sense of this.<br><br></div>The time-of-day matching in your initial email <br><span class="">>><font size="-1"><font face="Arial">
<condition wday="1-2" time-of-day="00:00:00-00:00:00<wbr>"
break="never"><br><br></font></font></span></div><font size="-1"><font face="Arial">happens in 2 stages... stage 1) does wday fall in the range of 1-2<br></font></font></div><font size="-1"><font face="Arial">wday="1-2"<br></font></font></div><font size="-1"><font face="Arial">wdaymin = 1<br></font></font></div><font size="-1"><font face="Arial">wdayamx = 2<br></font></font></div><font size="-1"><font face="Arial">so does if (today >= wday-min || today <= wday-max).... if you set this for 0-0 or 1-1 then only day 0 or only day 1 would match. Now the above example is simplified psuedo code just for the sake of explanation...<br><br></font></font></div><div><font size="-1"><font face="Arial">The time-of-day matching works similarly... after the value for the time of day field is parsed the following if statement (actually taken from the code) happens<br><br>if (range_start <= range_end ? (val >= range_start && val <= range_end) : (val >= range_start || val <= range_end)) { ... }<br><br></font></font></div><div><font size="-1"><font face="Arial">so this allos for the range_end to be a lower value... however the same thing happens does the current time val fall in the range of times... so if you set the start and the end time to 00:00:00 the only time it will match is 00:00:00. lets reduce this for the sake of simplicity from the long date to just seconds of the day... 00:00:00 == second 0 for the day... so <br><br><br></font></font></div><div><font size="-1"><font face="Arial">range start is <= range_end (in fact its 0) so ... we'll do the true half of the expression?true:false statement there...<br></font></font></div><div><font size="-1"><font face="Arial">if (val >= range_start && val <= range_end) where val is the current number of seconds into today... <br><br></font></font></div><div><font size="-1"><font face="Arial">so you have told it that the only range that can match is 0 thru 0 inclusive... how can any other time match... <br><br></font></font></div><div><font size="-1"><font face="Arial">so in your example there are only 2 times that will match 00:00:00 on day 1 and 00:00:00 on day 2... <br><br></font></font></div><div><font size="-1"><font face="Arial">the proper way to include an entire day is 00:00:00-23:59:59 which covers all possible seconds in a range<br></font></font></div><div><div><div><div><div><font size="-1"><font face="Arial"><br><br></font></font></div></div></div></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Sep 4, 2016 at 9:35 AM, Bipin Patel <span dir="ltr"><<a href="mailto:bipin@xbipin.com" target="_blank">bipin@xbipin.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<font size="-1"><font face="Arial">well but if u follow the guide of
wrap around time similar to my 3rd condition then doesnt it need
to be true or does it only work when 'a' hour is higher than 'b'
in a "a-b" time span because if u specify a range of
"05:00-05:00" then this would also be zero even though u set a
weekday of "1-2"<br>
<br>
<br>
</font></font>
<div>
Regards,<br>
Bipin<br>
<br>
<br>
<hr>
</div>
<div><span>-------- Original Message --------<br>
Subject: Re: [Freeswitch-users] week day and time condition
possible bug<br>
From: Ken Rice <a href="mailto:krice@freeswitch.org" target="_blank"><krice@freeswitch.org></a><br>
To: FreeSWITCH Users Help
<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank"><freeswitch-users@lists.freesw<wbr>itch.org></a><br></span><div><div>
Date: 9/4/2016, 6:14:44 PM<br>
</div></div></div><div><div>
<blockquote type="cite">
<div>No it tells it second 0 to second 0 on days days 1 and 2</div>
<div><br>
</div>
<div><br>
<br>
Sent from my iPhone</div>
<div><br>
On Sep 4, 2016, at 8:45 AM, Bipin Patel <<a href="mailto:bipin@xbipin.com" target="_blank">bipin@xbipin.com</a>>
wrote:<br>
<br>
</div>
<blockquote type="cite">
<div>
<font size="-1"><font face="Arial">but doesnt specifying 1-2
as weekday tell it Sunday 0 to Monday 0<br>
<br>
<br>
</font></font>
<div>
Regards,<br>
Bipin<br>
<br>
<br>
<hr> </div>
<div>-------- Original Message
--------<br>
Subject: Re: [Freeswitch-users] week day and time condition
possible bug<br>
From: Ken Rice <a href="mailto:krice@freeswitch.org" target="_blank"><krice@freeswitch.org></a><br>
To: FreeSWITCH Users Help <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank"><freeswitch-users@lists.freesw<wbr>itch.org></a><br>
Date: 9/4/2016, 5:35:09 PM<br>
</div>
<blockquote type="cite">
<div>Its a misconfig you are specifying only 1 second where
the first condition can fire 0 thru 0 is just 0<br>
<br>
Sent from my iPhone</div>
<div><br>
On Sep 4, 2016, at 8:24 AM, Bipin Patel <<a href="mailto:bipin@xbipin.com" target="_blank">bipin@xbipin.com</a>>
wrote:<br>
<br>
</div>
<blockquote type="cite">
<div>
<font size="-1"><font face="Arial">i found one bug today
relating to conditions where day and date are used,
just wanted to confirm if its a bug or a misconfig<br>
<br>
i have a condition as below<br>
<br>
<condition wday="1-2"
time-of-day="00:00:00-00:00:00<wbr>" break="never"><br>
<action application="set"
data="out-prefix=777" inline="true"/><br>
</condition><br>
<br>
what this does is if its a Sunday to Monday morning
then set out-prefix variable to 777 but even though
being a Sunday this always parses as fail unless i
set wday to 1 and time-of-day to 00:00:00-23:59:59<br>
<br>
the reason i use the above is because i have more
conditions which r as follows<br>
<br>
<condition wday="2-7"
time-of-day="7:00-21:00" break="never"><br>
<action application="set"
data="out-prefix=888" inline="true"/><br>
</condition><br>
<condition wday="2-7"
time-of-day="21:00:00-7:00:00" break="never"><br>
<action application="set"
data="out-prefix=777" inline="true"/><br>
</condition><br>
<br>
<br>
</font></font>
<div>-- <br>
Regards,<br>
Bipin<br>
<br>
<br>
<hr> </div>
</div>
</blockquote>
<blockquote type="cite">
<div><span>______________________________<wbr>______________________________<wbr>_____________</span><br>
<span>Professional FreeSWITCH Consulting Services: </span><br>
<span><a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a></span><br>
<span><a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions<wbr>.com</a></span><br>
<span></span><br>
<span>Official FreeSWITCH Sites</span><br>
<span><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></span><br>
<span><a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.o<wbr>rg</a></span><br>
<span><a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a></span><br>
<span></span><br>
<span>FreeSWITCH-users mailing list</span><br>
<span><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswi<wbr>tch.org</a></span><br>
<span><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/ma<wbr>ilman/listinfo/freeswitch-user<wbr>s</a></span><br>
<span>UNSUBSCRIBE:<a>http://</a><a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">lists.frees<wbr>witch.org/mailman/options/<wbr>freeswitch-users</a></span><br>
<span><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></span></div>
</blockquote>
<br>
<fieldset></fieldset>
<br>
<pre>______________________________<wbr>______________________________<wbr>_____________
Professional FreeSWITCH Consulting Services:
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions<wbr>.com</a>
Official FreeSWITCH Sites
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.o<wbr>rg</a>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>
FreeSWITCH-users mailing list
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswi<wbr>tch.org</a>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/ma<wbr>ilman/listinfo/freeswitch-user<wbr>s</a>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.frees<wbr>witch.org/mailman/options/<wbr>freeswitch-users</a>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></pre>
</blockquote>
<br>
</div>
</blockquote>
<blockquote type="cite">
<div><span>______________________________<wbr>______________________________<wbr>_____________</span><br>
<span>Professional FreeSWITCH Consulting Services: </span><br>
<span><a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a></span><br>
<span><a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions<wbr>.com</a></span><br>
<span></span><br>
<span>Official FreeSWITCH Sites</span><br>
<span><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></span><br>
<span><a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.o<wbr>rg</a></span><br>
<span><a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a></span><br>
<span></span><br>
<span>FreeSWITCH-users mailing list</span><br>
<span><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswi<wbr>tch.org</a></span><br>
<span><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/ma<wbr>ilman/listinfo/freeswitch-user<wbr>s</a></span><br>
<span>UNSUBSCRIBE:<a>http://</a><a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">lists.frees<wbr>witch.org/mailman/options/<wbr>freeswitch-users</a></span><br>
<span><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></span></div>
</blockquote>
<br>
<fieldset></fieldset>
<br>
<pre>______________________________<wbr>______________________________<wbr>_____________
Professional FreeSWITCH Consulting Services:
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions<wbr>.com</a>
Official FreeSWITCH Sites
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.o<wbr>rg</a>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>
FreeSWITCH-users mailing list
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswi<wbr>tch.org</a>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/ma<wbr>ilman/listinfo/freeswitch-user<wbr>s</a>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.frees<wbr>witch.org/mailman/options/<wbr>freeswitch-users</a>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></pre>
</blockquote>
<br>
</div></div></div>
<br>______________________________<wbr>______________________________<wbr>_____________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions<wbr>.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.o<wbr>rg</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswi<wbr>tch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/ma<wbr>ilman/listinfo/freeswitch-user<wbr>s</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.frees<wbr>witch.org/mailman/options/<wbr>freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div>
</div></div><br>______________________________<wbr>______________________________<wbr>_____________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.<wbr>freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.<wbr>org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.<wbr>freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/<wbr>mailman/listinfo/freeswitch-<wbr>users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.<wbr>freeswitch.org/mailman/<wbr>options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div>