When you add the values in local cache, for each value you have to set a
different key. Instead of :
cache_store("local", "domain", "$(avp(domains)[$var(id)])");
do
cache_store("local", "domain_$var(id)", "$(avp(domains)[$var(id)])");
By doing that, you add one key for each domain value.
Then you can iterate and fetch from cache the domain_$var(id) until
nothing is returned anymore.
Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 21.09.2016 15:00, xiaofeng wrote:
Hi, Bogdan,
> In your script, not sure if it is the indented behavior, but when
looping through the loaded AVPs, you are pushing in cache the same key
("domain") for all the values -> this will overwrite any previous
value and you will end up storing only the last value.
Yes, I want all values bind to the same key. And that's the problem, I
think.
>
> The second "while" loop has no sense, as a key (in cache) has only
one value (cannot be multiple).
Regards,
xiaofeng
_______________________________________________
Users mailing list
[email protected] <mailto:[email protected]>
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users