[Kamailio-Users] [SR-Users] support for 'include' in cfg file

Daniel-Constantin Mierla miconda at gmail.com
Thu Sep 3 13:09:28 CEST 2009


Hello,

note: following most of opinions expressed on devel list regarding the 
directive name (to be more suggestive about what it does), "include" has 
been replaced with "include_file". See:
http://sip-router.org/wiki/cookbooks/core-cookbook/devel#include_file

Cheers,
Daniel

On 25.08.2009 20:15 Uhr, 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
>

-- 
Daniel-Constantin Mierla
* http://www.asipto.com/




More information about the Users mailing list