Storing modules parameters on AVP, as much as I can

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

Storing modules parameters on AVP, as much as I can

Ricardo Martins
Hi all! Do anybody knows if there is a trick to store the modules
parameters on database/avps? I want to give the opensips administrator
all the flexibility I can without having to edit cfg text file.

I know that there is some specific parameters where you can do that like
fr_inv_timer or fr_timer for tm module but I'm talking about storing
other parameters that don't have an specific avp enable mode like T1 and
T2, for example.

Do anybody has any clue?

Regards! Ricardo.

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

Re: Storing modules parameters on AVP, as much as I can

Bogdan-Andrei Iancu
Hi Ricardo,

there are things here:

1) how to set the value of the parameters (via DB, instead of statically
hardcoding in cfg)

2) dynamic changing of the module params without restart.

What case are you refering at?

Regards,
Bogdan

Ricardo Martins wrote:

> Hi all! Do anybody knows if there is a trick to store the modules
> parameters on database/avps? I want to give the opensips administrator
> all the flexibility I can without having to edit cfg text file.
>
> I know that there is some specific parameters where you can do that like
> fr_inv_timer or fr_timer for tm module but I'm talking about storing
> other parameters that don't have an specific avp enable mode like T1 and
> T2, for example.
>
> Do anybody has any clue?
>
> Regards! Ricardo.
>
> _______________________________________________
> 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: Storing modules parameters on AVP, as much as I can

Ricardo Martins
Hi Bogdan.

The first option would be enough. I don't think that's an issue a
restarting procedure just after changing parameters. DanB just wrote me
indicating an script generator solution. Do you think that would be
possible to use another solution?

About the second option, I know that I can do it with fr_timer_avp or
fr_inv_timer_avp, right?

Regards, Ricardo.


Bogdan-Andrei Iancu escreveu:

> Hi Ricardo,
>
> there are things here:
>
> 1) how to set the value of the parameters (via DB, instead of
> statically hardcoding in cfg)
>
> 2) dynamic changing of the module params without restart.
>
> What case are you refering at?
>
> Regards,
> Bogdan
>
> Ricardo Martins wrote:
>> Hi all! Do anybody knows if there is a trick to store the modules
>> parameters on database/avps? I want to give the opensips
>> administrator all the flexibility I can without having to edit cfg
>> text file.
>>
>> I know that there is some specific parameters where you can do that
>> like fr_inv_timer or fr_timer for tm module but I'm talking about
>> storing other parameters that don't have an specific avp enable mode
>> like T1 and T2, for example.
>>
>> Do anybody has any clue?
>>
>> Regards! Ricardo.
>>
>> _______________________________________________
>> 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
|

Fwd: Storing modules parameters on AVP, as much as I can

DanB-2
In reply to this post by Ricardo Martins
Sorry, I forgot to put yesterday users list  on cc.

For the sake of transparency, doing it now ;-).

DanB

---------- Forwarded message ----------
From: DanB <[hidden email]>
Date: Wed, Jul 22, 2009 at 10:34 AM
Subject: Re: [OpenSIPS-Users] Storing modules parameters on AVP, as much as I can
To: Ricardo Martins <[hidden email]>


Hi Ricardo,

With the current architecture, you cannot load the params from the database. The only "trick" you can do is write your own opensips.cfg script generator which should read your database and edit opensips.cfg before starting up the server (outdated example at http://www.sipwise.com/). Any parameter you will change, it will require you to restart the opensips server. Depending on your specific needs, should be possible to implement most of the flexibility you want for your administrators out of avps or other database stored settings but again, its all based on your specific needs.

DanB


On Tue, Jul 21, 2009 at 10:47 PM, Ricardo Martins <[hidden email]> wrote:
Hi all! Do anybody knows if there is a trick to store the modules
parameters on database/avps? I want to give the opensips administrator
all the flexibility I can without having to edit cfg text file.

I know that there is some specific parameters where you can do that like
fr_inv_timer or fr_timer for tm module but I'm talking about storing
other parameters that don't have an specific avp enable mode like T1 and
T2, for example.

Do anybody has any clue?

Regards! Ricardo.

_______________________________________________
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: Storing modules parameters on AVP, as much as I can

Bogdan-Andrei Iancu
In reply to this post by Ricardo Martins
Hi Ricardo,

For 1) you can simply use M4 plus some perl script.

in you opensips.m4 file, put the params you want to load via DB as m4
macros (defines). using a small perl script you can generate the
rules.m4 file (the file containing the definitions) for DB content:

------------------------
|   parama   |  value  |
------------------------
|  debug     |   3     |
|log_stderror|   no    |
------------------------

going into rules.m4 :

define(`debug', `3')
define(`log_stderror', `no')

So, at a restart, run the script to generate the M4 definition from DB,
and run m4 to generate the final cfg file...

Just an idea how to do it now :)

Regards,
Bogdan

Ricardo Martins wrote:

> Hi Bogdan.
>
> The first option would be enough. I don't think that's an issue a
> restarting procedure just after changing parameters. DanB just wrote
> me indicating an script generator solution. Do you think that would be
> possible to use another solution?
>
> About the second option, I know that I can do it with fr_timer_avp or
> fr_inv_timer_avp, right?
>
> Regards, Ricardo.
>
>
> Bogdan-Andrei Iancu escreveu:
>> Hi Ricardo,
>>
>> there are things here:
>>
>> 1) how to set the value of the parameters (via DB, instead of
>> statically hardcoding in cfg)
>>
>> 2) dynamic changing of the module params without restart.
>>
>> What case are you refering at?
>>
>> Regards,
>> Bogdan
>>
>> Ricardo Martins wrote:
>>> Hi all! Do anybody knows if there is a trick to store the modules
>>> parameters on database/avps? I want to give the opensips
>>> administrator all the flexibility I can without having to edit cfg
>>> text file.
>>>
>>> I know that there is some specific parameters where you can do that
>>> like fr_inv_timer or fr_timer for tm module but I'm talking about
>>> storing other parameters that don't have an specific avp enable mode
>>> like T1 and T2, for example.
>>>
>>> Do anybody has any clue?
>>>
>>> Regards! Ricardo.
>>>
>>> _______________________________________________
>>> 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: Storing modules parameters on AVP, as much as I can

Mouncif Benniane
Bogdan,

How can I use option # 2 to set fr_timer_avp from Mysql DB? any example?
Thanks

On Thu, Jul 23, 2009 at 2:37 AM, Bogdan-Andrei Iancu <[hidden email]> wrote:
Hi Ricardo,

For 1) you can simply use M4 plus some perl script.

in you opensips.m4 file, put the params you want to load via DB as m4
macros (defines). using a small perl script you can generate the
rules.m4 file (the file containing the definitions) for DB content:

------------------------
|   parama   |  value  |
------------------------
|  debug     |   3     |
|log_stderror|   no    |
------------------------

going into rules.m4 :

define(`debug', `3')
define(`log_stderror', `no')

So, at a restart, run the script to generate the M4 definition from DB,
and run m4 to generate the final cfg file...

Just an idea how to do it now :)

Regards,
Bogdan

Ricardo Martins wrote:
> Hi Bogdan.
>
> The first option would be enough. I don't think that's an issue a
> restarting procedure just after changing parameters. DanB just wrote
> me indicating an script generator solution. Do you think that would be
> possible to use another solution?
>
> About the second option, I know that I can do it with fr_timer_avp or
> fr_inv_timer_avp, right?
>
> Regards, Ricardo.
>
>
> Bogdan-Andrei Iancu escreveu:
>> Hi Ricardo,
>>
>> there are things here:
>>
>> 1) how to set the value of the parameters (via DB, instead of
>> statically hardcoding in cfg)
>>
>> 2) dynamic changing of the module params without restart.
>>
>> What case are you refering at?
>>
>> Regards,
>> Bogdan
>>
>> Ricardo Martins wrote:
>>> Hi all! Do anybody knows if there is a trick to store the modules
>>> parameters on database/avps? I want to give the opensips
>>> administrator all the flexibility I can without having to edit cfg
>>> text file.
>>>
>>> I know that there is some specific parameters where you can do that
>>> like fr_inv_timer or fr_timer for tm module but I'm talking about
>>> storing other parameters that don't have an specific avp enable mode
>>> like T1 and T2, for example.
>>>
>>> Do anybody has any clue?
>>>
>>> Regards! Ricardo.
>>>
>>> _______________________________________________
>>> 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: [OpenSIPS-Users] Storing modules parameters on AVP, as much as I can

Bogdan-Andrei Iancu
Hi,

it is nothing fancy, just load the value from DB (via avp_db_load /
avp_db_query - avpops module) and push into the fr_timer_avp before t_relay.

Regards,
Bogdan

Mouncif Benniane wrote:

> Bogdan,
>
> How can I use option # 2 to set fr_timer_avp from Mysql DB? any example?
> Thanks
>
> On Thu, Jul 23, 2009 at 2:37 AM, Bogdan-Andrei Iancu
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     Hi Ricardo,
>
>     For 1) you can simply use M4 plus some perl script.
>
>     in you opensips.m4 file, put the params you want to load via DB as m4
>     macros (defines). using a small perl script you can generate the
>     rules.m4 file (the file containing the definitions) for DB content:
>
>     ------------------------
>     |   parama   |  value  |
>     ------------------------
>     |  debug     |   3     |
>     |log_stderror|   no    |
>     ------------------------
>
>     going into rules.m4 :
>
>     define(`debug', `3')
>     define(`log_stderror', `no')
>
>     So, at a restart, run the script to generate the M4 definition
>     from DB,
>     and run m4 to generate the final cfg file...
>
>     Just an idea how to do it now :)
>
>     Regards,
>     Bogdan
>
>     Ricardo Martins wrote:
>     > Hi Bogdan.
>     >
>     > The first option would be enough. I don't think that's an issue a
>     > restarting procedure just after changing parameters. DanB just wrote
>     > me indicating an script generator solution. Do you think that
>     would be
>     > possible to use another solution?
>     >
>     > About the second option, I know that I can do it with
>     fr_timer_avp or
>     > fr_inv_timer_avp, right?
>     >
>     > Regards, Ricardo.
>     >
>     >
>     > Bogdan-Andrei Iancu escreveu:
>     >> Hi Ricardo,
>     >>
>     >> there are things here:
>     >>
>     >> 1) how to set the value of the parameters (via DB, instead of
>     >> statically hardcoding in cfg)
>     >>
>     >> 2) dynamic changing of the module params without restart.
>     >>
>     >> What case are you refering at?
>     >>
>     >> Regards,
>     >> Bogdan
>     >>
>     >> Ricardo Martins wrote:
>     >>> Hi all! Do anybody knows if there is a trick to store the modules
>     >>> parameters on database/avps? I want to give the opensips
>     >>> administrator all the flexibility I can without having to edit cfg
>     >>> text file.
>     >>>
>     >>> I know that there is some specific parameters where you can do
>     that
>     >>> like fr_inv_timer or fr_timer for tm module but I'm talking about
>     >>> storing other parameters that don't have an specific avp
>     enable mode
>     >>> like T1 and T2, for example.
>     >>>
>     >>> Do anybody has any clue?
>     >>>
>     >>> Regards! Ricardo.
>     >>>
>     >>> _______________________________________________
>     >>> Users mailing list
>     >>> [hidden email] <mailto:[hidden email]>
>     >>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>     >>>
>     >>>
>     >>
>     >>
>     >
>     >
>
>
>     _______________________________________________
>     Users mailing list
>     [hidden email] <mailto:[hidden email]>
>     http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>


--
Bogdan-Andrei Iancu
www.voice-system.ro


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