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)
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?