<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [Serusers] how to sort data retrieved from avp_db_load in avpopsmodule</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Hi all,</FONT>
</P>
<P><FONT SIZE=2> Thanks you for your help. I think I can implement a multi-forwarding service now but I think I should spend sometime trying to add some ordering mechanism to avpops module because basing on order from database is not enough for such kind of service.</FONT></P>
<P><FONT SIZE=2>Minh</FONT>
</P>
<BR>
<P><FONT SIZE=2>-----Message d'origine-----</FONT>
<BR><FONT SIZE=2>De: serusers-bounces@lists.iptel.org</FONT>
<BR><FONT SIZE=2>A: Richard</FONT>
<BR><FONT SIZE=2>Cc: serusers@lists.iptel.org</FONT>
<BR><FONT SIZE=2>Date: 20/03/2005 20:28</FONT>
<BR><FONT SIZE=2>Objet: Re: [Serusers] how to sort data retrieved from avp_db_load in avpopsmodule</FONT>
</P>
<P><FONT SIZE=2>Richard wrote:</FONT>
<BR><FONT SIZE=2>>>Hi Minh,</FONT>
<BR><FONT SIZE=2>>></FONT>
<BR><FONT SIZE=2>>>After loading the AVPs via apv_db_load() function you will have in</FONT>
<BR><FONT SIZE=2>>>memory the AVP list exactly in the revert order than in database. Ex:</FONT>
<BR><FONT SIZE=2>if</FONT>
<BR><FONT SIZE=2>>>you had for avp "test" values A, B, C and D, after loading you will</FONT>
<BR><FONT SIZE=2>have</FONT>
<BR><FONT SIZE=2>>>the order D, C, B and A.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Can anyone think of a way to set the order in the database? I think</FONT>
<BR><FONT SIZE=2>that it</FONT>
<BR><FONT SIZE=2>> is probably impractical, if not impossible.</FONT>
</P>
<P><FONT SIZE=2>If you want to have ordering for AVP of same name/ID at load_db time you</FONT>
</P>
<P><FONT SIZE=2>need to relay on some information/order already existing in the DB. At </FONT>
<BR><FONT SIZE=2>the moment, the only available criteria is the DB order itself.</FONT>
</P>
<P><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Is this reverse order by design or by implementation? My ser logic</FONT>
<BR><FONT SIZE=2>heavily</FONT>
<BR><FONT SIZE=2>> relies on the behavior. I wonder if any future upgrade might break it</FONT>
<BR><FONT SIZE=2>if it</FONT>
<BR><FONT SIZE=2>> is just how the code is implemented.</FONT>
</P>
<P><FONT SIZE=2>The revert order is a effect of how the AVP core is implemented - the </FONT>
<BR><FONT SIZE=2>AVPs are kept in singled-linked list and any new APV is added at the </FONT>
<BR><FONT SIZE=2>beginning of the list.</FONT>
</P>
<P><FONT SIZE=2>Best regards,</FONT>
<BR><FONT SIZE=2>Marian</FONT>
</P>
<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>Voice System</FONT>
<BR><FONT SIZE=2><A HREF="http://www.voice-system.ro" TARGET="_blank">http://www.voice-system.ro</A></FONT>
</P>
<P><FONT SIZE=2>_______________________________________________</FONT>
<BR><FONT SIZE=2>Serusers mailing list</FONT>
<BR><FONT SIZE=2>serusers@lists.iptel.org</FONT>
<BR><FONT SIZE=2><A HREF="http://lists.iptel.org/mailman/listinfo/serusers" TARGET="_blank">http://lists.iptel.org/mailman/listinfo/serusers</A></FONT>
</P>
</BODY>
</HTML>