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

Daniel-Constantin Mierla miconda at gmail.com
Wed Aug 26 09:47:31 CEST 2009



On 26.08.2009 1:51 Uhr, Klaus Darilion wrote:
> Great!
>
> ...added to wiki ....
> http://sip-router.org/wiki/cookbooks/core-cookbook/devel#include
thanks, I was wondering if this really belongs to parameters section, 
since it can be used in route blocks as well. Maybe a new section is 
better -- not sure how to name it now.

Cheers,
Daniel


>
> 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
>>
>
>
> _______________________________________________
> sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>

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




More information about the Users mailing list