Reset Feature Code Time Conditions Nightly?

Hello all,

I tried to search for this but couldn’t find a good answer. I have a locally hosted FreePBX installation in my office with about eight phones. I have a couple of time conditions set for closing early and opening early which are then set to feature codes *280 and *281. Unfortunately we regularly forget to deactivate these feature codes and the phone won’t play the night message or will stay on nights for a couple hours in the morning.

All of that to say, is there a way to program an automated reset of these feature codes to happen each night at a certain time? Basically I want to check if the feature code is activated and then deactivate ever night at say 7 PM. Thanks in advance.

Shawn

Not per se, but you can set up a cron job that performs various “fwconsole” commands to turn these kind of features on and off pretty easily. You could also use the “Time Conditions” feature instead of rolling your own, in which case this “off at 0800” problem is solved for you by the system.

Agreed, time conditions would be best and also has a way of overriding the current state as well.

With that being said, a very hacky way of automating a CFC switch would be running a cron with:

/usr/sbin/asterisk -x"channel originate local/*43@from-internal extension *280@from-internal"

The asteriskbd sqlite3 family that controls time conditions is TC The family that controls DAYNIGHT is as named.

I’m not sure if that updates the hints as well.

Me neither, but nobody has yet complained :wink:

(DAYNIGHT was around before TC)

1 Like

Thank you everyone for the timely replies! I probably wasn’t clear in my initial explaination, but I have the Time Conditions set with normal operating hours. Unfortunately my less tech savvy partner often comes in at the butt crack of dawn and wants the phones to be open before 8:00 when the staff arrives. The feature code “open early” and “close early” is only for overriding the Time Conditions. It’s just that no one is turning off the feature codes.

Or maybe I’m misunderstanding a feature in TC?

Anyways, I really appreciate your help. I’ll probably try the “hacky” cron job route.

Would not recommend manipulating the AstDB directly. This script will allow you do things programatically

If you have a TC, then make BLF on a phone for it. Said butt crack of dawn partner can push the button to take it out of night mode.



image
image

Well I’m dumb. haha. I was doing this the hard way! I had two separate BLF buttons that had special feature codes programmed to override the time condition schedule… when I could have (as suggested), use one BLF to dial the time condition override code that’s built in.

Thanks again for everyone’s help! I’ve been learned. lol

1 Like

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