<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<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>
</body>
</html>