Dynamic routes for calendar

As suggested I used Dynamic routes to limit inbound callers number (or better…give them all a busy when channel number exceeded) good move !

Is it possible to use dynamic routes for multiple calendar events instead of nested time conditions (Is it Christmas ? no → is it NYD? no → is it Easter? no-> etc. etc.) in order to get right holyday behavior ??

Yes. Its routing based on a returned result. At its most basic you could write an AGI or MySQL query that looks at today vs a list and returns true/false

Well, write a query from scratch is out of my knowledge, perhaps someone here has a practical example… :slightly_smiling_face:

Someone may volunteer to do the work for you, or if you need, there is a jobs section in this forum.

One basic approach: There is a maria DB that freepbx uses. You could create a table on that DB and populate it with dates that are holidays. Then you would just need a MySQL query that checks if the variable today is in the table, returning a yes/no true/false (1/0). On the dynamic route have an enrty for 0 and an entry for 1.

You could adapt this approach to likely meet your needs: mysql - PHP/SQL - Return boolean result from SQL query between two dates - Stack Overflow

Dynamic Routes User Guide - PBX GUI - Documentation (freepbx.org)

Thank you for tips…
Your suggestion is to write a new set of event (dates) to new SQL table to check against, but isn’t freepbx calendar module already doing so when a new event is created ?
Could one write a dynroute query against already present calendar event ?

Yep. If it already there, it is in that same database. All you need to do if find the table and column and you can use that instead.

You could also create 11 calendars (for each holiday, in a series) and route your calls…or am I wrong?

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