<div dir="ltr"><div style="font-size:12.8px"><font size="-1"><font face="Arial">&gt; 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&#39;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">&lt;<a href="mailto:krice@freeswitch.org" target="_blank">krice@freeswitch.org</a>&gt;</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="">&gt;&gt;<font size="-1"><font face="Arial">
              &lt;condition wday=&quot;1-2&quot; time-of-day=&quot;00:00:00-00:00:00<wbr>&quot;
        break=&quot;never&quot;&gt;<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=&quot;1-2&quot;<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 &gt;= wday-min || today &lt;= 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 &lt;= range_end ? (val &gt;= range_start &amp;&amp; val &lt;= range_end) : (val &gt;= range_start || val &lt;= 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 &lt;= range_end (in fact its 0) so ... we&#39;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 &gt;= range_start &amp;&amp; val &lt;= 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">&lt;<a href="mailto:bipin@xbipin.com" target="_blank">bipin@xbipin.com</a>&gt;</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 &#39;a&#39; hour is higher than &#39;b&#39;
        in a &quot;a-b&quot; time span because if u specify a range of
        &quot;05:00-05:00&quot; then this would also be zero even though u set a
        weekday of &quot;1-2&quot;<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">&lt;krice@freeswitch.org&gt;</a><br>
      To: FreeSWITCH Users Help
      <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">&lt;freeswitch-users@lists.freesw<wbr>itch.org&gt;</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 &lt;<a href="mailto:bipin@xbipin.com" target="_blank">bipin@xbipin.com</a>&gt;
        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">&lt;krice@freeswitch.org&gt;</a><br>
            To: FreeSWITCH Users Help <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">&lt;freeswitch-users@lists.freesw<wbr>itch.org&gt;</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 &lt;<a href="mailto:bipin@xbipin.com" target="_blank">bipin@xbipin.com</a>&gt;
              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>
                          &lt;condition wday=&quot;1-2&quot;
                    time-of-day=&quot;00:00:00-00:00:00<wbr>&quot; break=&quot;never&quot;&gt;<br>
                              &lt;action application=&quot;set&quot;
                    data=&quot;out-prefix=777&quot; inline=&quot;true&quot;/&gt;<br>
                          &lt;/condition&gt;<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>
                          &lt;condition wday=&quot;2-7&quot;
                    time-of-day=&quot;7:00-21:00&quot; break=&quot;never&quot;&gt;<br>
                              &lt;action application=&quot;set&quot;
                    data=&quot;out-prefix=888&quot; inline=&quot;true&quot;/&gt;<br>
                          &lt;/condition&gt;<br>
                          &lt;condition wday=&quot;2-7&quot;
                    time-of-day=&quot;21:00:00-7:00:00&quot; break=&quot;never&quot;&gt;<br>
                              &lt;action application=&quot;set&quot;
                    data=&quot;out-prefix=777&quot; inline=&quot;true&quot;/&gt;<br>
                          &lt;/condition&gt;<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>