[OpenSIPS-Users] Storing modules parameters on AVP, as much as I can

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Jan 26 13:05:18 CET 2010


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 
> <bogdan at voice-system.ro <mailto:bogdan at voice-system.ro>> 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
>     >>> Users at lists.opensips.org <mailto:Users at lists.opensips.org>
>     >>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>     >>>
>     >>>
>     >>
>     >>
>     >
>     >
>
>
>     _______________________________________________
>     Users mailing list
>     Users at lists.opensips.org <mailto:Users at lists.opensips.org>
>     http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>


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




More information about the Users mailing list