[Serusers] how to sort data retrieved from avp_db_load in avpopsmodule

Marian Dumitru marian.dumitru at voice-sistem.ro
Sun Mar 20 20:28:06 CET 2005


Richard wrote:
>>Hi Minh,
>>
>>After loading the AVPs via apv_db_load() function you will have in
>>memory the AVP list exactly in the revert order than in database. Ex: if
>>you had for avp "test" values A, B, C and D, after loading you will have
>>the order D, C, B and A.
> 
> 
> Can anyone think of a way to set the order in the database? I think that it
> is probably impractical, if not impossible.

If you want to have ordering for AVP of same name/ID at load_db time you 
need to relay on some information/order already existing in the DB. At 
the moment, the only available criteria is the DB order itself.

> 
> Is this reverse order by design or by implementation? My ser logic heavily
> relies on the behavior. I wonder if any future upgrade might break it if it
> is just how the code is implemented.

The revert order is a effect of how the AVP core is implemented - the 
AVPs are kept in singled-linked list and any new APV is added at the 
beginning of the list.

Best regards,
Marian

-- 
Voice System
http://www.voice-system.ro




More information about the sr-users mailing list