Hello,

internally, the avp list acts as a stack. When you add a new one, it will be the first.

What happens when you operate over the whole array of AVPs, you delete as you go in list, and add at the top. So, the last in the initial list that was process, will become the first.

Maybe renaming them once again is the workaround for now.

Cheers,
Daniel


On 08/31/07 15:32, Brandon Armstead wrote:
Hello,

Say I have something like the following:

$avp(a[0]) = "27*"
$avp(a[1]) = "22*"

Then I run avp_substr like the following: avp_subst("$avp(a)/g", "/\*/[0-9]/g");

As you would expect it to simply strip * from the avp list values, instead it decides to rewrite the index in numerical order, so the avp's would now look like:

[ BAD RESULTS ]
$avp(a[0]) = "22";
$avp(a[1]) = "27";

however the [ EXPECTED RESULTS ]
$avp(a[0]) = "27";
$avp(a[1]) = "22";

Could someone please elaborate on why OpenSER would re-numerate the list index on a simple avp_substr, also any ideas on how I can get around this and stop this from happening? Thanks!
------------------------------------------------------------------------

_______________________________________________
Users mailing list
Users@openser.org
http://openser.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
Users@openser.org
http://openser.org/cgi-bin/mailman/listinfo/users

Reply via email to