Kamailio Advanced Training
Click here for more details!

Learn how to build RTC services with Kamailio!

Friday, September 4, 2009

Support for ‘include’ in config file

The configuration file language of Kamailio (OpenSER) and SIP Router supports now a new directive that allow including the content of another file during parsing of routing logic.

This allows splitting big configs for easier maintenance, even modularity — building a library of config snippets that are included and combined to build a full configuration file.

The syntax is:

include_file “file_name”

There is no restriction of what the included file should contain, it must be a valid content for the place where the include directive is used.

Here is an example:

route {
...
include_file "/sr/checks.cfg"
...
}

--- /sr/checks.cfg ---

if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}

---

The feature is documented at:

http://sip-router.org/wiki/cookbooks/core-cookbook/devel

No comments:

Post a Comment