standard opensips.cfg but include local config

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

standard opensips.cfg but include local config

Gareth Blades
We have a couple of opensips servers and are using SVN to maintain the
configuration so we wish to have a single opensips.cfg file.
This means that there is some local config for the specific server that
we have to somehow pull in from another file.

modparam("stun","primary_ip","x.x.x.33")
modparam("stun","primary_port","5060")
modparam("stun","alternate_ip","x.x.x.53")
modparam("stun","alternate_port","5060")

Any tips on the best way to do this?

Can you set a variable by checking the machines hostname or ip address
and then pass a variable to the modparam function?

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: standard opensips.cfg but include local config

Vlad Paiu
Hello,

You could use m4 along side with your .cfg. Basically, your .cfg would
essentially be the same for all your servers, but it would contain some
macros that would expand differently for each one of your servers.

Vlad Paiu
OpenSIPS Developer


On 10/25/2011 01:31 PM, Gareth Blades wrote:

> We have a couple of opensips servers and are using SVN to maintain the
> configuration so we wish to have a single opensips.cfg file.
> This means that there is some local config for the specific server
> that we have to somehow pull in from another file.
>
> modparam("stun","primary_ip","x.x.x.33")
> modparam("stun","primary_port","5060")
> modparam("stun","alternate_ip","x.x.x.53")
> modparam("stun","alternate_port","5060")
>
> Any tips on the best way to do this?
>
> Can you set a variable by checking the machines hostname or ip address
> and then pass a variable to the modparam function?
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: standard opensips.cfg but include local config

Gareth Blades
I saw some examples of that but when I have looked into m4 before its
used to regenerate a new configuration file based upon a standard
template. That would mean its the template which would be in the version
control and not the actual running config which might lead to an issue
later on so not an ideal solution but would do the job.

Thanks


On 10/26/2011 02:36 PM, Vlad Paiu wrote:

> Hello,
>
> You could use m4 along side with your .cfg. Basically, your .cfg would
> essentially be the same for all your servers, but it would contain
> some macros that would expand differently for each one of your servers.
>
> Vlad Paiu
> OpenSIPS Developer
>
>
> On 10/25/2011 01:31 PM, Gareth Blades wrote:
>> We have a couple of opensips servers and are using SVN to maintain
>> the configuration so we wish to have a single opensips.cfg file.
>> This means that there is some local config for the specific server
>> that we have to somehow pull in from another file.
>>
>> modparam("stun","primary_ip","x.x.x.33")
>> modparam("stun","primary_port","5060")
>> modparam("stun","alternate_ip","x.x.x.53")
>> modparam("stun","alternate_port","5060")
>>
>> Any tips on the best way to do this?
>>
>> Can you set a variable by checking the machines hostname or ip
>> address and then pass a variable to the modparam function?
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: standard opensips.cfg but include local config

Bogdan-Andrei Iancu-2
Hi Gareth,

actually using m4 does not complicate thinks at all - we are using or
more than 5 years and never run into difficulties or problem - even more
it brings more power in doing text pre-processing  (not only "include"
directive, but macros, defines, ifdef, loops ,etc ). Instead of keeping
in SVN the .cfg file, keep the .m4 file(s) - and we added in the
opensips init script the m4 triggering to generate the cfg file when
starting opensips.

Regards,
Bogdan

On 10/28/2011 01:08 PM, Gareth Blades wrote:

> I saw some examples of that but when I have looked into m4 before its
> used to regenerate a new configuration file based upon a standard
> template. That would mean its the template which would be in the
> version control and not the actual running config which might lead to
> an issue later on so not an ideal solution but would do the job.
>
> Thanks
>
>
> On 10/26/2011 02:36 PM, Vlad Paiu wrote:
>> Hello,
>>
>> You could use m4 along side with your .cfg. Basically, your .cfg
>> would essentially be the same for all your servers, but it would
>> contain some macros that would expand differently for each one of
>> your servers.
>>
>> Vlad Paiu
>> OpenSIPS Developer
>>
>>
>> On 10/25/2011 01:31 PM, Gareth Blades wrote:
>>> We have a couple of opensips servers and are using SVN to maintain
>>> the configuration so we wish to have a single opensips.cfg file.
>>> This means that there is some local config for the specific server
>>> that we have to somehow pull in from another file.
>>>
>>> modparam("stun","primary_ip","x.x.x.33")
>>> modparam("stun","primary_port","5060")
>>> modparam("stun","alternate_ip","x.x.x.53")
>>> modparam("stun","alternate_port","5060")
>>>
>>> Any tips on the best way to do this?
>>>
>>> Can you set a variable by checking the machines hostname or ip
>>> address and then pass a variable to the modparam function?
>>>
>>> _______________________________________________
>>> Users mailing list
>>> [hidden email]
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>


--
Bogdan-Andrei Iancu
OpenSIPS eBootcamp - 19th of September 2011
OpenSIPS solutions and "know-how"


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: standard opensips.cfg but include local config

klpauba
I use m4 for our OpenSIPs configuration file -- it allows me to maintain one file for 18 different OpenSIPs servers.

Works great!

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Bogdan-Andrei Iancu
Sent: Friday, October 28, 2011 6:56 AM
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] standard opensips.cfg but include local config

Hi Gareth,

actually using m4 does not complicate thinks at all - we are using or
more than 5 years and never run into difficulties or problem - even more
it brings more power in doing text pre-processing  (not only "include"
directive, but macros, defines, ifdef, loops ,etc ). Instead of keeping
in SVN the .cfg file, keep the .m4 file(s) - and we added in the
opensips init script the m4 triggering to generate the cfg file when
starting opensips.

Regards,
Bogdan



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: standard opensips.cfg but include local config

SamyGo
Hey kevin, 
Can you direct to any URL or any hints on how you've done that. It'd be great help.
Thanks,
Regards,
Sammy

On Fri, Oct 28, 2011 at 7:21 PM, Pauba, Kevin L <[hidden email]> wrote:
I use m4 for our OpenSIPs configuration file -- it allows me to maintain one file for 18 different OpenSIPs servers.

Works great!

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Bogdan-Andrei Iancu
Sent: Friday, October 28, 2011 6:56 AM
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] standard opensips.cfg but include local config

Hi Gareth,

actually using m4 does not complicate thinks at all - we are using or
more than 5 years and never run into difficulties or problem - even more
it brings more power in doing text pre-processing  (not only "include"
directive, but macros, defines, ifdef, loops ,etc ). Instead of keeping
in SVN the .cfg file, keep the .m4 file(s) - and we added in the
opensips init script the m4 triggering to generate the cfg file when
starting opensips.

Regards,
Bogdan



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users