Is it possible to use cron to turn off callflow

I have a client who’s employees constantly leave call flow on to over ride the normal call schedule. I’d like to set a cron job to reset the callflow back to off every night at 8pm.

I had though I had found a command line that could do this using asterisk a while ago but can’t seem to find any notes on it.

Is there a command line I can use to toggle or turn on/off callflow?

You could just create a time condition that at 8pm to Y time it sends the calls where they should flow normally (after hours) and then it will route through the call flow when not matching those hours.

No good. I was using 8pm as a general idea. This is a satellite office and only SOMETIMES are they in there off hours. This I think is part of the issue. It’s not something the employees regularly do, so they forget to turn it off.

Basically there are set hours and sometimes they come in early/stay late and want the phones to ring.

So then when do you know when to schedule the cron job? When will you know they are out of the office?

It will be a guess honestly.

I believe that setting e.g. /DAYNIGHT/C0 in the Asterisk database to DAY or NIGHT will set the call flow as desired. You could have a script that runs every few minutes that sets it according to whether the office is occupied.

Things that the script might sense:
Alarm system disarmed
Number of devices connected to office Wi-Fi
Power consumption exceeds some threshold

I think that’s what I had done in the past, ran a query to set the database… @Stewart1

A guess? So you could actually toggle the call flow and stop them from getting calls when they want to get calls?

The simple answer is yes…

You can simply call the function and do it. You simply need to work out the edge cases and nuances mentioned in other replies. Those “but what if’s” don’t affect the ability to actually perform the task

Yup, that will do the trick. The only issue that needs to be solved is knowing when to actually do it. So far it is “a guess” which could actually turn off the call flow when it should be on.

I had started a php script to do this ages ago and never completed it, it uses the internals that James linked. I just threw it up on github with a healthy dose of TODO comments, it works but there is no validation checking.
lgaetz-cftoggle.php · GitHub

1 Like

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