[OpenSIPS-Users] Fwd: How to save avp-values to singal attribute name in cache_store?
bogdan at opensips.org
Wed Sep 21 15:02:55 CEST 2016
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)])");
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.
OpenSIPS Founder and Developer
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
> > The second "while" loop has no sense, as a key (in cache) has only
> one value (cannot be multiple).
> Users mailing list
> Users at lists.opensips.org <mailto:Users at lists.opensips.org>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Users