Retrieve the number of rows stored in an xavp
As discussed on the mailing list, this is useful to at least two people.
#### Type Of Change - [ ] Small bug fix (non-breaking change which fixes an issue) - [ x ] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist: - [ x ] PR should be backported to stable branches - [ x ] Tested changes locally
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2936
-- Commit Summary --
* pv: new variable $xavp_count
-- File Changes --
M src/modules/pv/pv.c (3) M src/modules/pv/pv_xavp.c (33) M src/modules/pv/pv_xavp.h (3)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2936.patch https://github.com/kamailio/kamailio/pull/2936.diff
If I understand correctly, it works only for `$xavp(key)`, not for `$xavp(key1=>key2)`, right?
Also, I wonder if it is not better to enhance the `$cnt(...)` variable for this purpose, now it is for avps.
If I understand correctly, it works only for `$xavp(key)`, not for `$xavp(key1=>key2)`, right?
Also, I wonder if it is not better to enhance the `$cnt(...)` variable for this purpose, now it is for avps.
Yes… it works only with a single key. This is all I needed.
But you’re right, it would be better to also handle sub-keys. That was a quick PR since I already had the code. Feel free to discard it. :)
I'll do another PR using $cnt(...) as you suggested.
OK, closing this one.
Closed #2936.