How do conf files get generated


Can anyone point out for me where I can find anything on how conf files are generated. (I’m a .NET developer primarily, so I have a hard time finding my way around here yet.) If you could tell me the name of the source file which contains the logic, that would be quite enough.

thx in advance

Read the description of this area. It says this is not a support forum. You need to post under the installation section. This may be moved by the moderator but I’ll answer anyway. You have an option to creat sample files when you compile. You may be using a precompiled distro. Thats another thing. When you post, please be specific as to how you are using Free PBX. As you have probably found out, there are multitudes of configurations.

you misunderstand me. My question is in the right place.

I’m not intrested in installation. What I’d like to know is the algorythm. I need to map freepbx features to asterisk dialplans and settings, that’s why I need information from a developer’s view and not as a regular user. And that’s why I posted here, instead of the support topic.

I need to know (at least) which files are changed if I modify something on the User Interface ( e.g. changing the SIP alias of an extension changes extensions-additional.conf in the [ext-local] context).

And that is why I asked if anyone could point me to the right place in the source code, cuz I can figure out myself, it’s just kinda hard to find my way around the source code.


I’m not a developer, but I think you would have to be very knowledgeable of the source code to be able to determine which files are changed. I don’t see how you could do it without going through the code in the modules you are working with. Here is a little information, however it doesn’t tell you what you want to know If you go to the documentation page in this URL it is a good place to start. Maybe someone else can help.

I found it. Would have been nice, though, if someone had saved me some painful hours.

@mstults: thx for trying to help

I write it down here in case someone else needs this:

  • When the “Apply Configuration Changes” button is pressed, it posts back to admin/config.php, with data: ‘reload’
  • it then calls function do_reload(), in admin/functions.ini.php
  • it executes the shell command file: retrieve_conf, which is actually php code interpreted by linux.

In retrieve_conf:

  • loads modules

  • calls the [modulename]_get_config() function of all active modules found in admin\modules[modulename]\ (“core” is last)

  • this populates the $ext global variable which is an extension class instance (admin/extensions.class.php) (and partly $core_conf global var, too [see modules/core/ -> class core_conf ])

  • writes $ext to extensions_additional.conf

  • calls the generateConf function of every active modules class ([modulename]_conf::generateConf)

  • writes out to file(s). ($classname->get_filename())


I’ll try to reload like when the “Apply configuration changes” button but with a php script and all i try don’t work.

Thanks for your discribe of the differents step but if you have some advice for my php script it was helpful !

if you post the script where you try to reload, and describe how it doesn’t work (what happens), then i can try to help you.

I would stess “try”, cuz i’m not a freepbx developer.