In OpenSIPS 1.11 you were able to use the index of -1 on AVP's to put items into an AVP as a FIFO instead of a LIFO.
Here is what I mean. $(avp(list)[-1]) = 1; $(avp(list)[-1]) = 2; $(avp(list)[-1]) = 3; $(avp(list)[-1]) = 4; $(avp(list)[-1]) = 5; this would result the values coming off as a FIFO $avp(list) is 1 $avp(list) = NULL; $avp(list) is 2 $avp(list) = NULL; $avp(list) is 3 $avp(list) = NULL; $avp(list) is 4 $avp(list) = NULL; $avp(list) is 5 Just pushing the items onto the AVP creates a LIFO $avp(list) = 1; $avp(list) = 2; $avp(list) = 3; $avp(list) = 4; $avp(list) = 5; this would result the values coming off as $avp(list) is 5 $avp(list) = NULL; $avp(list) is 4 $avp(list) = NULL; $avp(list) is 3 $avp(list) = NULL; $avp(list) is 2 $avp(list) = NULL; $avp(list) is 1 So my question is how do I create a FIFO without having to keep an index to ensure that I am adding the item to the end. When porting the code from 1.11 to 2.2 I get an error "ERROR:core:replace_avp: Index with negative value" when I use the -1. Regards, Pat Burke
_______________________________________________ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users