[Users] avp_db_load(), and multiple avps
Kanakatti Mahesh Subramanya
mahesh at aptela.com
Thu Sep 8 01:08:28 CEST 2005
What I ended up doing was actually
- Load all the AVPs (avp_db_load("$from/username", "i:"))
- Move (i.e. copy&delete) them into temporary values
This way, when I loaded the AVPs later on (avp_db_load("$ruri/username",
"i:")) they didn't conflict with the initial set.
It actually makes quite a bit of sense (for me at least), and I'm down
to 2 db hits per transaction. Which is quite ok...
Bogdan-Andrei Iancu wrote:
> Hi Kanakatti,
> correct, this kind of loading is not possible and because of module
> limitations, but because of DB interface limitations - the DB API does
> not support too complex queries like:
> where user=x and domain=y and (avp_name=avp1 or avp_name=avp2)
> what you can do is to try to sort your avps in different tables and to
> load all user's avps from the tables.
> Kanakatti Mahesh Subramanya wrote:
>> I believe that avp_db_load can load either a specific avp
>> (avp_db_load("$from/username", "i:500")) or all avps of a specific
>> type (avp_db_load("$from/username", "i:"))
>> I dont think that it is possible to load multiple avps as part of a
>> single command, correct? e.g. avp_db_load("$from/username", "i:500,
>> I'm doing a fairly decent amount of manipulation, and I'm trying to
>> cut down on the number of db calls that I have to make, and the 'all
>> or none' approach is starting to constrain me...
>> Users mailing list
>> Users at openser.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 332 bytes
Desc: not available
Url : http://lists.kamailio.org/pipermail/users/attachments/20050907/eb49fd59/attachment.vcf
More information about the Users