<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Wrong there is no wrap around time.. There is only ranges of time on a day...</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">Look back at the code i pasted again.</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">If start time > end time then we check to see if current time < end time OR > start time again i. Seconds and for symplicity we'll use just 60 of them</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">If the rand is 45 through 15 then we do the false part of the exp?true:false which is (<span style="background-color: rgba(255, 255, 255, 0); font-size: 0.8em;">val >= range_start || val <= range_end)</span></div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">So now start is 45 and end is 15 so we look for the time to >= 45 or <= 15 again on day 1 or day 2 assuming wday="1-2"</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">So there is no "wrap around time" there is no wday=1-2" and timeofday="9p-5a" and an expectation of that only working from 9p on day 1 to 9p on day 2 thats day 1 from 00:00 to 05:00 and from 21:00 til 23:59:59 then the same thing on day 2.</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature"><br>Sent from my iPhone</div><div><br>On Sep 4, 2016, at 10:33 AM, Bipin Patel <<a href="mailto:bipin@xbipin.com">bipin@xbipin.com</a>> wrote:<br><br></div><blockquote type="cite"><div>
<meta content="text/html; charset=windows-1252" http-equiv="Content-Type">
<font size="-1"><font face="Arial">thanks for the detailed
explanation :)<br>
<br>
so what i make of this is if u use a wrap around time or u want
full 24 hours either in same day or across days then u need to
set one second lower so "5:00-5:00" should actually be
"5:00:00-4:59:59" which would be 5am from today to 4:59:59am
tomorrow and same goes for "00:00:00-00:00:00" which should be
"00:00:00-23:59:59"<br>
<br>
now same if u combine with wday then again u need to specify a
second lower in the max time for it to work properly if the
start and end time is set same or it will read it as 0<br>
<br>
<br>
</font></font>
<div class="moz-signature">
<style>
body {
font-family: Verdana, sans-serif;
font-size: 0.8em;
color:#484848;
}
h1, h2, h3 { font-family: "Trebuchet MS", Verdana, sans-serif; margin:0in; margin-bottom:.0001pt; }
p.footr { font-family: "Trebuchet MS", Verdana, sans-serif; margin:0in; margin-bottom:.0001pt; }
h1 { font-size: 1.2em; }
h2, h3 { font-size: 1.1em; }
a, a:link, a:visited { color: #2A5685;}
a:hover, a:active { color: #c61a1a; }
a.wiki-anchor { display: none; }
hr {
width: 100%;
height: 1px;
background: #ccc;
border: 0;
}
</style>Regards,<br>
Bipin<br>
<br>
<br>
<hr>
</div>
<div class="moz-cite-prefix">-------- Original Message --------<br>
Subject: Re: [Freeswitch-users] week day and time condition
possible bug<br>
From: Ken Rice <a class="moz-txt-link-rfc2396E" href="mailto:krice@freeswitch.org"><krice@freeswitch.org></a><br>
To: FreeSWITCH Users Help
<a class="moz-txt-link-rfc2396E" href="mailto:freeswitch-users@lists.freeswitch.org"><freeswitch-users@lists.freeswitch.org></a><br>
Date: 9/4/2016, 7:14:25 PM<br>
</div>
<blockquote cite="mid:CAPcNkdcSgRdgR+mMK=po+JjWf5u89jvaJjVWqY=wf=6eNs51dQ@mail.gmail.com" type="cite">
<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>
>><font size="-1"><font face="Arial">
<condition wday="1-2"
time-of-day="00:00:00-00:00:<wbr>00"
break="never"><br>
<br>
</font></font></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="gmail_extra"><br>
</div>
</blockquote>
<br>
</div></blockquote><blockquote type="cite"><div><span>_________________________________________________________________________</span><br><span>Professional FreeSWITCH Consulting Services: </span><br><span><a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a></span><br><span><a href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a></span><br><span></span><br><span>Official FreeSWITCH Sites</span><br><span><a href="http://www.freeswitch.org">http://www.freeswitch.org</a></span><br><span><a href="http://confluence.freeswitch.org">http://confluence.freeswitch.org</a></span><br><span><a href="http://www.cluecon.com">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">FreeSWITCH-users@lists.freeswitch.org</a></span><br><span><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a></span><br><span>UNSUBSCRIBE:http://<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">lists.freeswitch.org/mailman/options/freeswitch-users</a></span><br><span><a href="http://www.freeswitch.org">http://www.freeswitch.org</a></span></div></blockquote></body></html>