<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>kamailio -V</div><div>version: kamailio 3.2.2 (x86_64/linux)</div><div><br></div><div>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.</div><div>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).</div><div><br></div><div><div># check if abc.test is defined</div><div>        if (strempty($sel(cfg_get.abc.test))) {</div></div><div><span class="Apple-tab-span" style="white-space:pre">     </span>sql_xquery("ca", "SELECT * from cfg where abc=‚test'", "ra“);</div><div><br></div><div>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</div><div>there is no way to inject cfg values into kamailio, when kamailio is already started.</div><div><br></div><div>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)</div><div><br></div><div>I found <a href="http://kamailio.org/docs/modules/stable/modules/cfg_db.html">http://kamailio.org/docs/modules/stable/modules/cfg_db.html</a> , but documentation is quite bad. Are there any other possibilities for me?</div><div><br></div><div>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.</div><div>The new cfg value is updated into database via XMLRPC again (which works, just for the sake of completeness):</div><div><br></div><div><div>#!ifdef WITH_XMLRPC</div><div>route[XMLRPC] {</div></div><div>…</div><div>…</div><div> # Keeping values for Kamailio Restart</div><div><div> sql_query("ca", "UPDATE cfg set LB01='$sel(cfg_get.abc.test)' where abc=‚test‘");</div></div><div><br></div><div>Mabye of one of you guys have a hint for me to solve this problem?</div><div><br></div><br><div apple-content-edited="true">
<div><div style="font-family: Calibri, sans-serif; font-size: 14px;">Cheers</div><div style="font-family: Calibri, sans-serif; font-size: 14px;"><b><span class="Apple-style-span" style="font-weight: normal;">Daniel </span></b></div></div>
</div>
<br></body></html>