Hi Klaus,
the current implementation of modules_s/usrloc does not require any additional DB-Lookup. The data is simply kept with all the other data of a contact. The stored AVP's are serialized to a string and stored in an extra column together with all the other data.... I thought about this implicit loading as well, but you should consider the following point (which at least applies for my usecase): I need to access those values for both originating (from the CPE to server) and terminating (from the server to the CPE) case. So probably the implicit loading of the AVP's might be a good thing... I think it is not a good idea to store all AVP's automatically. In some setups we used to make quite a lot use of the AVPs with about having 40 AVP's for a dialog....
Carsten
2011/2/8 Klaus Darilion klaus.mailinglists@pernau.at:
Carsten Bock wrote:
In order to save a param into usrloc:
$test = "Something"; setvarflag($test, "name_of_avp_flag"); save("location");
Restore the parameters: lookup("location"); read_reg_avps("location", "$fU") (where $fU is user, for which the parameters will be loaded. It will then take the modified URI of the current message, to get the contact, for which the parameters will be loaded).
Does this require additional database lookups on write and read (DB-mode 3)?
I wonder why the AVP need to be loaded explicitly? IMO either the stored/restored AVPs should be configured as module parameter, or if done dynamically, all the stored AVPs should be restored automatically.
regards klaus