#215 Substitutions in configuration file

trunk
closed-rejected
core (47)
5
2012-03-30
2012-03-30
Nick Altmann
No

This patch gives very useful feature - support to perform substitutions inside the strings of config.
Work derived from the great parser enhancements made by Daniel-Constantin Mierla to the sip-router project.

For example

!subst
perform substitutions inside the strings of config
!subst offers an easy way to search and replace inside strings before cfg parsing. E.g.,:
!subst "/regexp/subst/flags"
flags is optional and can be: 'i' - ignore case; 'g' - global replacement
Example:
!subst "/DBPASSWD/xyz/"
modparam("acc", "db_url", "mysql://user:DBPASSWD@localhost/db")
will do the substitution of db password in db_url parameter value

Discussion

  • Nick Altmann
    Nick Altmann
    2012-03-30

     
    Attachments
    • assigned_to: nobody --> vladut-paiu
    • status: open --> closed-rejected
     
  • Hello,

    We do not feel such a patch would be very useful.
    You can always implement such functionality with a more advanced tool, like m4, instead of implementing all of this subst logic into the OpenSIPS parser.

    Regards,
    Vlad