kamailio -V version: kamailio 3.2.2 (x86_64/linux)
I am setting different cfg Parameters via XMLRPC. Which is good for changing parameters per runtime and being independent from database lookups when kamailio is running. Unfortunately cfg settings will be lost and empty after Restarting Kamailio if cfg values aren’t set before the request_route. So the idea was to look if cfg value is set, if not look into database and take the last cfg setting which was set. (Last cfg values will updated via SQL Query in the XMLRPC branch).
# check if abc.test is defined if (strempty($sel(cfg_get.abc.test))) { sql_xquery("ca", "SELECT * from cfg where abc=‚test'", "ra“);
The problem is that it seems, that there is no way to read out the values from database and to set the cfg variable again when kamailio is starting, because there is no way to inject cfg values into kamailio, when kamailio is already started.
Here i need something like this: abc.test = "$xavp(ra=>LB01)" desc „TEST“; <<which doesn’t work in this form. (just to make it clear what i want)
I found http://kamailio.org/docs/modules/stable/modules/cfg_db.html , but documentation is quite bad. Are there any other possibilities for me?
The only way it might work for me (which is in my opinion quite dirty), to exec_dset an external command and to inject the new cfg via XMLRPC. The new cfg value is updated into database via XMLRPC again (which works, just for the sake of completeness):
#!ifdef WITH_XMLRPC route[XMLRPC] { … … # Keeping values for Kamailio Restart sql_query("ca", "UPDATE cfg set LB01='$sel(cfg_get.abc.test)' where abc=‚test‘");
Mabye of one of you guys have a hint for me to solve this problem?
Cheers Daniel
Daniel Vukicevic writes:
I am setting different cfg Parameters via XMLRPC. Which is good for changing parameters per runtime and being independent from database lookups when kamailio is running. Unfortunately cfg settings will be lost and empty after Restarting Kamailio if cfg values aren’t set before the request_route. So the idea was to look if cfg value is set, if not look into database and take the last cfg setting which was set. (Last cfg values will updated via SQL Query in the XMLRPC branch).
before my proxy (re)starts, i generate config.cfg from database and include
local.attribute = value
statements into it. i think it would solve your problem too.
-- juha
Nice idea! This would perfectly fit. So are you executing a little script within the kamailio init script before kamailio finally starts, or are you asking the db within the kamailio.cfg anywhere and generating the cfg file (which doesn’t work afaik)?
Am 19.05.2014 um 11:43 schrieb Juha Heinanen jh@tutpro.com:
Daniel Vukicevic writes:
I am setting different cfg Parameters via XMLRPC. Which is good for changing parameters per runtime and being independent from database lookups when kamailio is running. Unfortunately cfg settings will be lost and empty after Restarting Kamailio if cfg values aren’t set before the request_route. So the idea was to look if cfg value is set, if not look into database and take the last cfg setting which was set. (Last cfg values will updated via SQL Query in the XMLRPC branch).
before my proxy (re)starts, i generate config.cfg from database and include
local.attribute = value
statements into it. i think it would solve your problem too.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Works perfectly. Great! Thanks a lot.
Am 19.05.2014 um 14:25 schrieb Juha Heinanen jh@tutpro.com:
Daniel Vukicevic writes:
Nice idea! This would perfectly fit. So are you executing a little script within the kamailio init script before kamailio finally starts,
exactly, juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users