#### Pre-Submission Checklist - [x] Commit message has the format required by CONTRIBUTING guide - [x] Commits are split per component (core, individual modules, libs, utils, ...) - [x] Each component has a single commit (if not, squash them into one commit) - [x] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated)
#### 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: - [ ] PR should be backported to stable branches - [x] Tested changes locally - [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description added 1. $siptrace(src_addr) 2. $siptrace(src_host) 3. $siptrace(src_port) 4. $siptrace(src_proto) 5. $siptrace(dst_addr) 6. $siptrace(dst_host) 7. $siptrace(dst_port) 8. $siptrace(dst_proto)
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2777
-- Commit Summary --
* siptrace: added extra params to $siptrace() pseudo-variable
-- File Changes --
M src/modules/siptrace/siptrace.c (74)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2777.patch https://github.com/kamailio/kamailio/pull/2777.diff
How I can remove brackets from IPv6 address? Example Now `$siptrace(src_host)` returns `[::1]` I want get `::1` from `$siptrace(src_host)`.
How I can remove brackets from IPv6 address? Example Now `$siptrace(src_host)` returns `[::1]` I want get `::1` from `$siptrace(src_host)`.
@sergey-safarov - use sr-users mailing list for questions about operations that can be done in kamailio.cfg, the comments on PR should be related to the changes proposed by it.
@miconda no I want to call `C` function to strip brackets. I will dev mail list
@sergey-safarov pushed 1 commit.
21454a3698f865ed3e62d4f28cab1da8ab32eba1 siptrace: removed brackets from IPv6 address [skip ci]
I finished PR
Does it make sense to return ipv6 host without square brackets instead of the full value? There is {s.unbracket} transformation if one needs it to remove the brackets:
* https://www.kamailio.org/wiki/cookbooks/5.5.x/transformations#sunbracket
I am thinking from the perspective that host/domain parts of URI variables just return the value as it is, like $rd returns `host` as it is in `sip:user@host`.
Maybe you can add another variable like $siptrace(src_hostip) which return bare IP, without brackets for IPv6 case and $siptrace(src_host) will return the full value as it is in `proto:host:port`.
`$siptrace(src_host)` and `$siptrace(dst_host)` now returns value without brackets.
`$siptrace(src_host)` and `$siptrace(dst_host)` now returns value without brackets.
But that is not coherent with the rest of variables returning host part of various uri or socket values, that's the reason I proposed that `$siptrace(src_host)` and `$siptrace(dst_host)` to return the values as it is and introduce new ones `$siptrace(src_hostip)` and `$siptrace(dst_hostip)` to return the values without brackets.
Hi Daniel @miconda siptrace PR update as you have suggested.
Thanks! Will be merged!
Don't forget to update the pv cookbook on the wiki site, if you haven't done it yet.
Merged #2777 into master.
Wiki updated