TimeConditions bug (creates new id and featurecode)

Hi,

I’ve noticed that when a new timecondition gets created and then deleted, somehow the system keeps track of the ID and featurecode because when I create a new one again (considering no time conditions exist in the system) the new Time Condition gets created with a new feature code and ID instead of using the first one available (0 & *270).

This must be a bug because otherwise such behavior wouldn’t make sense to me. I’ve looked into the timeconditions SQL table and there are no existing time conditions when I create a new one, so this information must be stored somewhere else. Same goes with featurecode table. I’ve also looked up for any old config left under /etc/asterisk but there do not seem to be existing time conditions that could prevent freepbx from reutilizing the first available feature code.

It can be considered a cosmetic issue but I’m a bit picky about this - could a developer waste some time and look into this? I would troubleshoot the php code and see where it goes to check for pre-existing id’s & featurecodes when creating a new time condition but I have no dev skills unfortunately.

PS: I’ve tried to raise a bug in the tracker system but I’m unable to login, doh!

Thanks!

This is the behavior that has existed for years. It has never caused me any problems. Are you experiencing an issue or problem (besides cosmetic) that is hindering your use of the system?

I agree with you that it would be better if it reused the old ID. Better yet why do I even need to see the ID, give it a name and hide the underling ID from view.

Well the issue is that the timecondition featurecode changes while I might want it to stay the same (*280). I’ve tried changing the values directly in the database but then freepbx loses the featurecode for the timecondition and somehow it doesn’t work anymore (even if I update the reference in the call flow, which is where this timecondition is used). Question is: where does freepbx keep track of ID’s and featurecodes for timeconditions if both tables have no entry? This would be a mystery someone from the dev team could help to solve :slight_smile:

Please file a report at http://issues.freepbx.org

Bug FREEPBX-8567 raised.

Regards