[Users] AVPs iteration

tele tele at plexia.com
Tue Nov 14 10:24:45 CET 2006


Hi all,

In the pseudo variables docs page:

$avp(id[N]) - represents the value of N-th AVP identified by 'id'.

This means if i do an avp_db_query that return N avps i can access to
the value of avps with $avp(id[N]).

But if i don't know how many record are returned from the query how can
i iterate over an array of avps ?

I've something like:

avp_db_query("SELECT n.number,n.type,n.translated FROM numerations AS n,
users AS u, associations AS a WHERE a.numeration_id = n.id AND a.user_id
= u.id AND u.lid = '$tU'","$avp(cli);$avp(type);$avp(translated)")

so i can access to the record with $avp(cli[0]) $avp(cli[1]) etc..

i want to append all contact returned to the destination uri and with
the record $avp(translated) "true" i want to do some processing.
but if i can't iterate over array of avps it's difficult.


thanks,


:tele







More information about the sr-users mailing list