Reset Feature Code Time Conditions Nightly?

Tags: #<Tag:0x00007fb47b418fc0>

(Brisa117) #1

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.


(Dave Burgess) #2

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.

(Itzik) #3

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.

(Itzik) #5

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


Me neither, but nobody has yet complained :wink:

(DAYNIGHT was around before TC)

(Brisa117) #7

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.

(Lorne Gaetz) #8

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

(Jared Busch) #9

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.


(Brisa117) #10

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

(system) closed #11

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