[SR-Users] AVP assignment question

Klaus Darilion klaus.mailinglists at pernau.at
Thu May 3 11:52:37 CEST 2012


Hi!

For example:
$avp(i:test) = 1;
$avp(i:test) = 2;
# now:            test[0]=2, test[1]=1

I would think that assigning or deleting using an index would overwrite 
the respective element in the AVP list, but assigning $null always 
deletes [0] and assigning a value always add another AVP to the top, e.g:

$(avp(i:test)[1]) = 3;
# I would expect: test[0]=2, test[1]=3
# but it is:      test[0]=3, test[1]=2, test[2]=1

$(avp(i:test)[2]) = $null;
# I would expect: test[0]=3, test[1]=2
# but it is:      test[0]=2, test[1]=1

So, is the current behavior really the correct behavior? It is not what 
I would expect when using indexes.

If it is correct, I will improve the documentation accordingly.

regards
Klaus



More information about the sr-users mailing list