Development

Development.Design-Opensips-Script-Preprocessing History

Hide minor edits - Show changes to output

December 13, 2018, at 05:08 PM by 109.99.227.30 -
Changed line 1 from:
!!!!! [[Development.Development|Development]] -> [[Development.Topics|Topics]] -> [[Development.Design-Opensips-Script-Preprocessing|OpenSIPS Script Preprocessor Design]]
to:
!!!!! [[Development.Development|Development]] -> [[Development.Planning|Planning]] -> [[Development.Design-Opensips-Script-Preprocessing|OpenSIPS Script Preprocessor Design]]
September 17, 2018, at 02:24 PM by liviu -
Changed line 1 from:
!!!!! Development -> Topics -> [[Development.Design-Opensips-Script-Preprocessing|OpenSIPS Script Preprocessor Design]]
to:
!!!!! [[Development.Development|Development]] -> [[Development.Topics|Topics]] -> [[Development.Design-Opensips-Script-Preprocessing|OpenSIPS Script Preprocessor Design]]
September 08, 2018, at 09:51 AM by liviu -
Changed line 15 from:
* the ''opensips.cfg'' error log lines do not have a 1:1 correspondance with the ''opensips.cfg.m4'' file. For example, OpenSIPS may report an ''opensips.cfg'' error at line 432, which actually corresponds to line 391 in ''opensips.cfg.m4'' due to some '''foreach''' templating statement which generated additional LoC.
to:
* the ''opensips.cfg'' error log lines do not have a 1:1 correspondence with the ''opensips.cfg.m4'' file. For example, OpenSIPS may report an ''opensips.cfg'' error at line 432, which actually corresponds to line 391 in ''opensips.cfg.m4'' due to some '''foreach''' templating statement which generated additional LoC.
September 06, 2018, at 06:34 PM by liviu -
Changed line 1 from:
!!!!! Development -> [[Development.Design-Opensips-Script-Preprocessing|OpenSIPS Script Preprocessor Design]]
to:
!!!!! Development -> Topics -> [[Development.Design-Opensips-Script-Preprocessing|OpenSIPS Script Preprocessor Design]]
September 05, 2018, at 06:58 PM by liviu -
Changed line 13 from:
There are two major inconveniences when working with added tools such as '''GNU m4''':
to:
There are two major inconveniences when working with external tools such as '''GNU m4''':
September 05, 2018, at 06:57 PM by liviu -
Changed line 9 from:
There is not a shade of doubt that real-life systems based on OpenSIPS require a templating language or a preprocessor to be used in order to generate the ''opensips.cfg'' file. When you have to deploy almost identical ''opensips.cfg'' files to tens of servers which only differ by a few IP addresses, having a macro to encompass these variable pieces of text goes a long way. But why isn't a solution like the '''GNU m4''' preprocessor (which offers the above) the perfect fit for this task?
to:
There is not a shade of doubt that real-life systems based on OpenSIPS require a templating language or a preprocessor to be used in order to generate the ''opensips.cfg'' file. When you have to deploy almost identical ''opensips.cfg'' files to tens of servers which only differ by a few IP addresses, ports, unique IDs, etc., having a macro to encompass these variable pieces of text goes a long way. But why isn't a solution like the '''GNU m4''' preprocessor (which offers the above) the perfect fit for this task?
September 05, 2018, at 06:55 PM by liviu -
Changed line 35 from:
* GNU m4 (does it have C-level bindings? Forking an ''m4'' process is not an answer!)
to:
* GNU m4 (does it have C language bindings? Forking an ''m4'' process is not an answer!)
September 05, 2018, at 06:55 PM by liviu -
Changed line 29 from:
We require a C library or framework which would allow us to build the above features '''directly''' into the OpenSIPS scripting language. This way, OpenSIPS will be able to internally preprocess the "opensips.cfg" file without breaking the line numbering or introducing additional cumbersome files to work with!
to:
We ultimately require a C library or framework which would allow us to build the above features '''directly''' into the OpenSIPS scripting language. This way, OpenSIPS will be able to internally preprocess the "opensips.cfg" file without breaking the line numbering or introducing additional cumbersome files to work with!
September 05, 2018, at 06:52 PM by liviu -
Changed lines 45-49 from:
If you have ideas which help solve the core problems, we are here to listen! Please feel free to reply below, or on the [[http://lists.opensips.org/cgi-bin/mailman/listinfo/users| users mailing list]] thread!
to:
If you have ideas which help solve the core problems, we are here to listen! Please feel free to reply below, or on the [[http://lists.opensips.org/cgi-bin/mailman/listinfo/users| users mailing list]] thread!

----

(:commentboxchrono:)
September 05, 2018, at 06:09 PM by liviu -
Changed lines 36-37 from:
* .erb (Embedded Ruby)
* .j2 (Jinja2)
to:
* .erb (Embedded Ruby. Any C bindings?)
* .j2 (Jinja2. Any C bindings?)
September 05, 2018, at 06:09 PM by liviu -
Changed line 27 from:
!!!! Solutions Under Scrutiny
to:
!!!! Directions Under Scrutiny
September 05, 2018, at 06:08 PM by liviu -
Added line 23:
* conditional groups (e.g. "ifdef ... <code> ... endif")
Added lines 29-34:
We require a C library or framework which would allow us to build the above features '''directly''' into the OpenSIPS scripting language. This way, OpenSIPS will be able to internally preprocess the "opensips.cfg" file without breaking the line numbering or introducing additional cumbersome files to work with!

\\

Currently, we're looking at the following directions:
Changed line 45 from:
Any suggestions which help solve the core problems are welcome! Please feel free to reply below, or on the [[http://lists.opensips.org/cgi-bin/mailman/listinfo/users| users mailing list]] thread!
to:
If you have ideas which help solve the core problems, we are here to listen! Please feel free to reply below, or on the [[http://lists.opensips.org/cgi-bin/mailman/listinfo/users| users mailing list]] thread!
September 05, 2018, at 05:55 PM by liviu -
Changed line 16 from:
* you have to work with two files: ''opensips.cfg.m4'' and ''opensips.cfg''. Sometimes, the user mistakenly performs configuration changes on the ''opensips.cfg'' file then restarts the ''opensips'' instance, thus losing all the work, since ''opensips.cfg'' gets re-generated.
to:
* you have to pay extra attention when working with two files: ''opensips.cfg.m4'' and ''opensips.cfg''. Sometimes, the user mistakenly performs configuration changes on the ''opensips.cfg'' file then restarts the ''opensips'' instance, thus losing all the work, since ''opensips.cfg'' gets re-generated.
September 05, 2018, at 05:55 PM by liviu -
Changed line 15 from:
* the ''opensips.cfg'' error log lines do not have a 1:1 correspondance with the ''opensips.m4'' file. For example, OpenSIPS may report an ''opensips.cfg'' error at line 432, which actually corresponds to line 391 in ''opensips.m4'' due to some '''foreach''' templating statement which generated additional LoC.
to:
* the ''opensips.cfg'' error log lines do not have a 1:1 correspondance with the ''opensips.cfg.m4'' file. For example, OpenSIPS may report an ''opensips.cfg'' error at line 432, which actually corresponds to line 391 in ''opensips.cfg.m4'' due to some '''foreach''' templating statement which generated additional LoC.
September 05, 2018, at 05:54 PM by liviu -
Changed line 9 from:
There is not a shade of doubt that real-life systems based on OpenSIPS require a templating language or a preprocessor to be used in order to generate the ''opensips.cfg'' file. When you have to deploy an almost identical ''opensips.cfg'' to tens of servers which only differs by a few IP addresses, having a macro to encompass these variable pieces of text goes a long way. But why isn't a solution like the '''GNU m4''' preprocessor (which offers the above) the perfect fit for this task?
to:
There is not a shade of doubt that real-life systems based on OpenSIPS require a templating language or a preprocessor to be used in order to generate the ''opensips.cfg'' file. When you have to deploy almost identical ''opensips.cfg'' files to tens of servers which only differ by a few IP addresses, having a macro to encompass these variable pieces of text goes a long way. But why isn't a solution like the '''GNU m4''' preprocessor (which offers the above) the perfect fit for this task?
September 05, 2018, at 05:53 PM by liviu -
Changed lines 5-38 from:
----
to:
----

!!!! Motivation

There is not a shade of doubt that real-life systems based on OpenSIPS require a templating language or a preprocessor to be used in order to generate the ''opensips.cfg'' file. When you have to deploy an almost identical ''opensips.cfg'' to tens of servers which only differs by a few IP addresses, having a macro to encompass these variable pieces of text goes a long way. But why isn't a solution like the '''GNU m4''' preprocessor (which offers the above) the perfect fit for this task?

\\

There are two major inconveniences when working with added tools such as '''GNU m4''':

* the ''opensips.cfg'' error log lines do not have a 1:1 correspondance with the ''opensips.m4'' file. For example, OpenSIPS may report an ''opensips.cfg'' error at line 432, which actually corresponds to line 391 in ''opensips.m4'' due to some '''foreach''' templating statement which generated additional LoC.
* you have to work with two files: ''opensips.cfg.m4'' and ''opensips.cfg''. Sometimes, the user mistakenly performs configuration changes on the ''opensips.cfg'' file then restarts the ''opensips'' instance, thus losing all the work, since ''opensips.cfg'' gets re-generated.

!!!! Often-Required Features

Below is a community-sourced summary of commonly required templating features to be used on top of ''opensips.cfg'':

* simple macro definitions (textual substitution)
* parameterized macro definitions
* generative loops (e.g. "for each <address> in <list_of_interfaces>, plug in <this code>")

!!!! Solutions Under Scrutiny

* GNU m4 (does it have C-level bindings? Forking an ''m4'' process is not an answer!)
* .erb (Embedded Ruby)
* .j2 (Jinja2)

!!!! Confirmed Solutions

TBD

!!!! Have a Better Idea?

Any suggestions which help solve the core problems are welcome! Please feel free to reply below, or on the [[http://lists.opensips.org/cgi-bin/mailman/listinfo/users| users mailing list]] thread!
September 05, 2018, at 04:31 PM by liviu -
Changed line 1 from:
!!!!! Development -> [[Development.Design-Opensips-Script-Preprocessing|Design-Opensips-Script-Preprocessing]]
to:
!!!!! Development -> [[Development.Design-Opensips-Script-Preprocessing|OpenSIPS Script Preprocessor Design]]
September 05, 2018, at 04:31 PM by liviu -
Added lines 1-5:
!!!!! Development -> [[Development.Design-Opensips-Script-Preprocessing|Design-Opensips-Script-Preprocessing]]
(:title OpenSIPS Script Preprocessor Design:)
This page has been visited {$PageCount} times.
(:toc-float Table of Content:)
----

Page last modified on December 13, 2018, at 05:08 PM