[OpenSIPS-Devel] [ opensips-Patches-3513177 ] Substitutions in configuration file

Rudy rudy at dynamicpacket.com
Mon Apr 2 19:01:50 CEST 2012


Bogdan,

 Hey buddy! Conditionals are important too and m4 is a great tool,
don't get me wrong. It ends up being case of many ways to skin the cat
as they say. I think whats happening is just a result of OpenSIPs
continued growth. There is a demand not simply for OpenSIPs as a
component, but more as a platform for building solutions. This is
something we should all keep in mind when continuing to push in
different directions when extending OpenSIPs.

 Perhaps there is a happy medium for everyone here... maybe Nick can
write a patch for opensipsctl where it would run m4 against
<config>.m4 if it exists and compile it into <config> before starting
opensips. Nick, keep in mind, you should handle not just opensips.cfg
but any file passed as a -f argument in STARTOPTIONS env variable.
What do you think about this Bogdan? I would be in support of such a
change and it should be seamless to everyone else.

Thanks in advance,
--Rudy
Dynamic Packet
Toll-Free: 888.929.VOIP ( 8647 )



On Mon, Apr 2, 2012 at 11:52 AM, Bogdan-Andrei Iancu
<bogdan at opensips.org> wrote:
> ups...forgot the most important - the conditionals ;)
>
> Regards,
> Bogdan
>
>
>
> On 04/02/2012 06:49 PM, Bogdan-Andrei Iancu wrote:
>>
>> Hi Rudy,
>>
>> Even if you asked Saul, let me tell you I'm using m4 for - not only for
>> "define" like replacement, but also for more advanced stuff like simulating
>> functions, simple functions, or loops (to repeat blocks of scripts with
>> different input, just to make it nicer).
>>
>> Regards,
>> Bogdan
>>
>> On 03/30/2012 10:00 PM, Rudy wrote:
>>>
>>> Hi All,
>>>
>>>  Not that I particularly support the addition of "substitutions"
>>> inside the current config parser, but one thing I have wanted myself
>>> is something similar to defines. Flipping the question to Saul,
>>> assuming we are all familiar with m4, what kind of parser additions
>>> would you need to completely omit m4 from your current configurations?
>>> This seems to be like an opportunity to brainstorm some new ideas, not
>>> only for 1.x branch, but possibly for 2.0 configuration files.
>>>
>>> Thanks in advance,
>>> --Rudy
>>> Dynamic Packet
>>> Toll-Free: 888.929.VOIP ( 8647 )
>>>
>>>
>>>
>>> On Fri, Mar 30, 2012 at 1:43 PM, Saúl Ibarra Corretgé
>>> <saul at ag-projects.com>  wrote:
>>>>
>>>> Hi,
>>>>
>>>> On Mar 30, 2012, at 4:22 PM, Nick Altmann wrote:
>>>>
>>>>> I'm not agree with you, because I use m4 now.
>>>>>
>>>>> Such functionality was really useful together with include
>>>>> functionality.
>>>>> For example, when I have errors with m4 it's hard to understand in
>>>>> what line these errors occurred.
>>>>>
>>>>> m4 is not always convenient,
>>>>> I should compile my configuration every time, but I don't need all
>>>>> power of m4, I need only substitutions.
>>>>> m4 is not a panacea for all occasions.
>>>>>
>>>> I agree with Vlad here. I maintain a huge configuration file consisting
>>>> of several m4 files and never felt the need to stretch the configuration
>>>> file syntax.
>>>>
>>>>
>>>> Regards,
>>>>
>>>> --
>>>> Saúl Ibarra Corretgé
>>>> AG Projects
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Devel mailing list
>>>> Devel at lists.opensips.org
>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
>>>
>>> _______________________________________________
>>> Devel mailing list
>>> Devel at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
>>>
>>
>>
>
>
> --
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developer
> http://www.opensips-solutions.com
>
>
> _______________________________________________
> Devel mailing list
> Devel at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel



More information about the Devel mailing list