Number of Day / Night Mode Controls available in FreePBX

Hi all,

Does anyone else have a problem with the number of Day/Night Mode Controls (limited to 10) available in FreePBX?
My idea was to modify the daynight module so that it would support up to 100 Day / Night Mode Controls by replacing the index from a one digit number (0-9) to two digits (00-99).
Anyone else having this need? Or a better idea?


I would question it… Why would you need 100? What exactly are you doing that you feel that you need that many? Maybe you attempting something that might be better served in a different manner?

Why would you need 100?
I don’t need 100, I’m just talking about some more than just 10. Maybe 15 or 20… It just seemed somehow logical to me to go from a one-digit index to a two-digit index…
What exactly are you doing that you feel that you need that many?
I have something like 5+ departements, each needing at least 2 day/night switches, e.g. to switch their switchboard number to some announcement (d/n #1) and to be able to select between two different announcements (d/n #2; for the normal / standard off-hours announcement and an alternate announcement, e.g. for holidays).
Maybe you attempting something that might be better served in a different manner?
Could very well be the case :wink: Maybe, I should rather use Call Forwards or something, but I somehow like the Day/Night Control idea…

Ok, I need more coffee this morning. I follow the need now.

Ok to carry the idea to completion and make a nice patch that could be accepted into the code easily I’d do the following.

  1. Put a selection in the Feature codes page allowing you to select 1,2 or 3 place digits for the control if it is enabled, defaulting to 1 of course.
  2. Based on that setting expand the selections and adjust the dial patterns correctly.
  3. Submit the patches via the bug tracker as a feature request and it could get integrated going forward.

I’ve done some hacking: (referring to fskrotzki’s numbers above)

  1. added a setting to select how many Day/Night controls you want to have. Since I thought that the Feature Code Admin panel didn’t seem to be the right place for this (and not the easyiest way to do it…), I added a setting NUMDAYNIGHT into amp_conf, which can be (virtually) any number. e.g.

The lenght of the feature code is then automatically computed using some simple math.
If the setting ist not present in amp_conf, the code defaults it to 10.
What is currently missing in my code: If you already have Day/Nights configured, their feature code / index is not automatically changed if it needs an additional digit, e.g. if you had the standard 10 Day/night codes and had one already with index 5 and then change NUMDAYNIGHT to 20, the index and feature code won’t be changed to 05. I possibly will have to add some code to take care of this, but don’t really know where… Additionally, I’ll possibly have to add some code to check if NUMDAYNIGHT is changed to some value lower than one of the existing D/N controls. But for the moment, I think we can live with the restriction that you shouldn’t change the number of digits needed if you already have D/N controls configured.
2. The selection on the Day/Night Control page will always show the correct number of (available) Indices. (Except when changing NUMDAYNIGHT so that an additional digit is needed, see above.)
I couldn’t find anywhere where I have to change the dail patterns…
What I also had to change is the text that ist playbacked cause some number might not exist in sounds/digits/ if you have an index larger than 20.
3. Should I Submit the patch to the Issue Tracker already? I wanted to attach it here first, but I think you can’t.



Im keen to try it out, maybe put it online somewhere ?

Sorry, but since I didn’t have any feedback and not much time, I completely forgot this. I’ll try to post a feature request soon.


I submitted a new Feature Request including a Patch for this (hope I grabbed the right diff-file…), see


I was using this patch in Elastix 1.6 and it worked well.

I was wondering if you have a patch for Elastix 2.0?

Hi Sorry our its working on our FreePBX 2.4 but not FreePBX 2.7 as the daynight/ file is different.

Do you have a patch for this file?