How to include custom conf file dynamically?

I’m using the modulename_conf class in to generate a dialplan in it’s own conf file. It creates the file just fine, however I don’t see any way to #include the file itself in the rest of the dialplan. Am I missing something in the source or is this left up to the developer to implement?

Look at parking to see how we include contexts into from-internal. Which is what you would want to do

I am writing to a new conf file (ex: /etc/asterisk/extensions_mymodule.conf). Including the contexts only helps if the file itself is included. I’m looking for a “clean” way to programmatically include the file (ex: #include extensions_mymodule.conf).

Currently I have a function that reads in extensions_override_freepbx.conf, looks to see if “#include extensions_mymodule.conf” is present, if not it is appended to the file. It works, I was just wondering if there was a more “official” way to do it.


So you want your extensions_mymodule.conf as an #include in extensions.conf?

Looking at retrieve_conf, I can create a config file, specify the filename to write to…but no way to add a #include to actually include it.