[OpenSIPS-Devel] SF.net SVN: opensips:[8763] trunk

Bogdan-Andrei Iancu bogdan at opensips.org
Mon Mar 5 19:13:55 CET 2012


Revision: 8763
          http://opensips.svn.sourceforge.net/opensips/?rev=8763&view=rev
Author:   bogdan_iancu
Date:     2012-03-05 18:13:54 +0000 (Mon, 05 Mar 2012)
Log Message:
-----------
This patch adds support for includes and imports within the configuration file(s). These can be nested within each other and recursive up to 10 levels, which is simply a limitation set in the code. All loading is done at config parsing startup and does not effect server performance. The two new core functions added, described in detail below. Enhancements also upgrade error functions to show config file in addition other error details on parsing error(s).

Work derived from the great parser enhancements made by Daniel-Constantin Mierla to the sip-router project.

Purpose of patch/enhancement ::

This patch will make working with large configs much easier. It also hopes to achieve some modularity when working with large projects/installations by abstracting parts of the logic into individual files.

Description of new core functions ::

include_file:
example: include_file "proxy_regs.cfg"
details: Can be called from outside route blocks to load additional routes/blocks or from inside them to simply preform more functions. The file path can be relative or absolute. If it is not an absolute path, first attempt is to locate it relative to current directory. If that fails, second try is relative to directory of the file that includes it. Will throw an error if file is not found.

import_file:
example: import_file "proxy_checks.cfg"
details: Same as include_file but will not throw an error if file is not found.


Provided by Dynamic Packet.
Closes patch 3494189

Modified Paths:
--------------
    trunk/cfg.lex
    trunk/cfg.y

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Devel mailing list