Modifications to ALL extentions in V 2.3.1.3 prevented by inclusions in extensions_additional re app-blacklist-check-custom

Hi there - first time poster - not sure if this is a dev issue, or a support issue, but I think it MAY relate to a bug as I don’t see how the system will work as it exists now.

Originally I was looking for a way to modify the script generated for extensions created automatically by the FreePBX interface - I was looking for a template or other construct that I could add a couple of lines of custom code to to facilitate call accounting of issues such as find-mefollow-me and call forwarding, etc.

After trying to understand the config generation system (and failing) I thought I would look at the existing config files for a way to include a section in every extension using the existing code.

That lead me to the blacklist-check, which includes app-blacklist-check-custom

exten => XXXXXXXXXX,n,Gosub(app-blacklist-check,s,1)

From this gosub, I can see the call to app-blacklist-check, BUT, because the include occurs BEFORE “s,1” I think it is never called and therefore useless?

FROM: extensions_additional.conf
[app-blacklist-check]
include => app-blacklist-check-custom
exten => s,1,LookupBlacklist()

My test code is simply a Noop to echo a string so I know it’s working. I’m unsure how includes work and whether or not extensions_custom.conf (which is included AFTER extensions_additional.conf) would be referenced at this point, so I added my test code to globals_custom.conf which is included earlier in the extensions_additional.conf file.

[app-blacklist-check-custom]
exten => s,1,Noop(XXX TEST MITCH XXX)
exten => s,n,Noop(XXX)

This “include custom” seems to be a common construct in a lot of the apps in existing config, am I misunderstanding how they are supposed to work? From what I can see on the gosub docuemention, gosub requires an extension and priority, so I don’t see how the includes at the begining of these sections could ever be referenced unless they were called as Macro’s or perhaps specifcally referenced by another gosub within the routine itself.

Is there any documentation to set me on the right track or maybe a primer on the config generation so I can add my statements into the template somehow.

Can you point me in the right direction please.

THANKS!!!

mitch.

mitch,
all auto-generated contexts get the include automatically in the generation process. If you understand how context inclusion works in Asterisk, you will see that a large portion of these end up not being useful. The automatic process does not know when it would or would not so it does it everywhere since there is no harm.
In your case, you will need to override the entire macro by defining it in extensions_override_freepbx.conf with your desired modifications.

So if I recreate this definition in the override file it will effectively replace the default one autogenerated and allow me to put my custom code in?

Trying it now…

AWESOME - That works great.

So for all others who may read this post, standard auto-generated macros and gosub routines can be replaced by redefining them in extensions_override_freepbx.conf.

You will of course have to include ALL code to replace the original function as this new function will replace the original entirely - not inherit, chain from it, etc.

THANKS AGAIN PHILLIPE!

m/