Great!
...added to wiki .... http://sip-router.org/wiki/cookbooks/core-cookbook/devel#include
klaus
Daniel-Constantin Mierla wrote:
Hello,
just committed to GIT support for 'include' in config file. Hopefully this helps in nicer structuring and maintenance of your configs.
The syntax is simple:
include path_to_file
The path_to_file can be relative or absolute. If it is not absolute path, first attempt is to locate it relative to current directory, and if fails, relative to directory of the file that includes it. There is no restriction where include can be used or what can contain - any part of config file is ok. There is a limit of maximum 10 includes in depth, otherwise you can use as many includes as you want. Reporting of the cfg file syntax errors prints now the file name for easier troubleshooting. Example:
route { ... include /sr/checks.cfg ... }
--- /sr/checks.cfg ---
if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); exit; }
Testing and feedback is much appreciated.
Cheers, Daniel