Dynamic Route affected by 2 Time Conditions

We do seasonal work so when a customer calls in I have an announcement that plays telling the customer we are done for the season (calendar time condition). Next, the system checks if it is a holiday (calendar time condition). And finally, the system checks our hours to see if we are open (calendar time condition). If it is not a holiday and we are open then it rings our phones.

We would like to change the seasonal announcement based on if we are closed or open. Doesn’t matter if we are closed because of a holiday or we are closed because of our open hours.

I am trying to create a Dynamic Route that checks my 2 time conditions but I don’t know how to check time conditions with dynamic routes. I assume I use a Source Type of Asterisk variable but I am not sure what the variable would be.

Anyone able to help me figure that out?

Do you mean:

  • Make a new calendar that is just your hours of operation.
  • Setup a new time condition tied to your standard close message or your first existing dynamic route
  • Change your inbound route to point at your new frontloaded time condition
  • The rest should continue to work as you have originally designed.

If I am understanding correctly I would need to have another calendar to maintain? It does should like it would work, but I was hoping of not adding another step the the process when adjusting our hours and adding holidays. If the dynamic route option doesn’t work then this might be the way I go, I was just hoping to make it more automictic with my current setup.

You’re going to have to take some action to differentiate between the time conditions, since you want different messaging for different conditions. If it is what is proposed above, custom dialplan, another dynamic route, etc you are going to have to do something more than what you do right now.

If the time conditions are static, it almost seems like a one and done type of thing (until an hours change).

To simplify the question, can I determine if a time condition is a match or non-match from a dynamic route Asterisk variable? Something similar to what is in the attached screenshot but instead of QUEUE_MEMBER it would be for time condition?

You can look at AstDB families to see if what you need exists:
Overview - Asterisk Documentation

No. Time conditions are evaluated against a time expression every time there is a call. You can determine if an override is set from an Asterisk var in a dynroute, but that won’t help you here.

I think the solution here is more time conditions.

@lgaetz can time conditions to set Asterisk variables?

Yes, of course, by sending to a custom destination and kicking off your own dial plan, you can do anything, really. Once you are in custom dial plan, I would think you wouldn’t need the additional time condition anymore.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.