Complex Time Ranges and Nested Rules

Discussion in 'FusionPBX Time Conditions' started by c0reM, Jul 14, 2017.

  1. c0reM

    c0reM New Member

    Hi All!

    My head is about to explode from trying to figure out the logic necessary to set up time conditions. This is what I'm trying to achieve:

    Winter Hours - From 1st Monday of September to June 24th:
    Mon-Thursday 8-5
    Friday 8-4

    Summer Hours - From June 24th to 1st Sunday of September:
    Mon, Tues, Thurs. 8-4:30
    Wed. 8-4
    Friday 8-12

    July 22 2017- August 6 2017
    Closed (recording)

    December 22 12:00 - Jan 7 2018
    Closed (recording)

    My attempted solution is to create 3 time condition extensions:

    99200 summer_winter_holidays
    99201 summer_hours
    99202 winter_hours

    First I land on 99100 and evaluate rules as in the attachment. I then send the user off to the time of day condition based on whether it's summer or winter period.

    Here are my specific questions:

    1) What is the best way to achieve a range such as "From 1st Monday of September to June 24th" Right now I fudged it by using date/time, but this will of course break in a year's time or so. I can't for the life of me figure out how to do a a "complex range" like this.

    2) Does my ordering of the rules make sense, and how does this really work? I'm assuming once there is a match it stops evaluating in order?

    3) Is there a better/simpler/cleaner way to do this that could put all the time conditions into one dialplan?

    4) Is there any way to test the time conditions to know if the rules are OK other than waiting to reach that time of year/month/day/hour?

    Thanks!
     

    Attached Files:

    Last edited: Jul 14, 2017

Share This Page