Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache_store an AVP with multiple values followed by a cache_fetch of that same AVP retrieves only the first value #143

Closed
c1784497 opened this issue Nov 29, 2013 · 1 comment

Comments

@c1784497
Copy link

This is the code snippet:

timer_route[test, 3]
{
...

    set_count("$avp(destinations)", "$var(total_destinations)");
    xlog("$var(total_destinations) destinations found!");

    cache_store("local","destinations","$avp(destinations)");
    cache_fetch("local","destinations", $avp(test));
    avp_print();
}

This is the logging:

opensips[458]: 2 destinations found!
opensips[458]: INFO:avpops:ops_print_avp: p=0x36e47f60, flags=0x0002
opensips[458]: INFO:avpops:ops_print_avp:                  name=<test>
opensips[458]: INFO:avpops:ops_print_avp:                  id=<2>
opensips[458]: INFO:avpops:ops_print_avp:                  val_str=<sip:10.10.10.169:5060 / 21>
opensips[458]: INFO:avpops:ops_print_avp: p=0x36e67d9c, flags=0x0002
opensips[458]: INFO:avpops:ops_print_avp:                  name=<destinations>
opensips[458]: INFO:avpops:ops_print_avp:                  id=<8>
opensips[458]: INFO:avpops:ops_print_avp:                  val_str=<sip:10.10.10.169:5060 / 21>
opensips[458]: INFO:avpops:ops_print_avp: p=0x36e47f9c, flags=0x0002
opensips[458]: INFO:avpops:ops_print_avp:                  name=<destinations>
opensips[458]: INFO:avpops:ops_print_avp:                  id=<8>
opensips[458]: INFO:avpops:ops_print_avp:                  val_str=<sip:10.10.11.169:5060 / 21>

The $avp(destinations) contains 2 values when stored with cache_store.
The $avp(test) contains only the first value when retrieved with cache_fetch.

I use version 1.9.1. Is this a configuration error, bug or by design? Thanks in advance!

@vladpaiu
Copy link
Member

vladpaiu commented Dec 2, 2013

Hello,

cache_store() only stores the topmost value of the AVP, if an AVP is provided.

Best Regards,
Vlad

@vladpaiu vladpaiu closed this as completed Dec 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants