<!-- Kamailio Pull Request Template --> #### 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: <!-- Go over all points below, and after creating the PR, tick the checkboxes that apply --> - [X] PR should be backported to stable branches - [X] Tested changes locally - [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description <!-- Describe your changes in detail --> adds string transform with optional size parameter to return the slot if supplied
`usage`
- $(var(myvar){s.corehash}) `returns the hash` - $(var(myvar){s.corehash, 32}) `returns the slot`
`would be great if this can be backported to branch 5.0 and included in next week release`
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1218
-- Commit Summary --
* pv: add string corehash transform
-- File Changes --
M src/modules/pv/pv_trans.c (48) M src/modules/pv/pv_trans.h (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1218.patch https://github.com/kamailio/kamailio/pull/1218.diff
Thanks!
Merged #1218.
I merged, then pushed some adjustments.
What I noticed is that the value is returned as a string, while one may expect a number, given that's typically an hash id. Any particular reason for this?
@miconda thanks. the reason was for large numbers not handled properly in script (uint) afaik.