- modified pv_parse_hep_name() and pv_get_hep() to expose the HEP's packet source ip address on replies. The associated pv $hep(src_ip), i.e.:
onreply_route { ... xlog("[onreply_route] Source IP: $hep(src_ip)\n"); ...
} You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/879
-- Commit Summary --
* sipcapture: expose pv $hep(src_ip)
-- File Changes --
M modules/sipcapture/sipcapture.c (15)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/879.patch https://github.com/kamailio/kamailio/pull/879.diff
@adubovikov I hope this is better. If you find I'm not adhering in any way to guidelines, please point them out as it's my first time contributing.
Many thanks! David
miconda commented on this pull request.
the declaraton of buf_ip has to be static because you return the pointer to it. Right now it is allocated on the stack and the pointer becomes invalid when the function finishes its execution. It has to be like:
``` static char buf_ip ... ```
Alternative is to use the core buffer for pvs, that you can retrieve with pv_get_buffer()
@davidcsi pushed 1 commit.
fb6328e sipcapture: Set char buf_ip as static
Changed "char buf_ip" as static
@adubovikov - is this pull ok to merge? If yes, then let me do it manually this time, because I am going to work on restructuring of the source code tree and don't want to mess it.
@davidcsi - for the future pull requests, do not do reformatting (indentation changes, renaming, etc.) in a pull request with new features, because it is hard to review the additions to the code. We value a lot the pull requests for beautification, they are very welcome, but do them as separate patches. In this specific case, your addition seems not to have coherent indentation, but you tried to do for other parts of existing code.
I am ok for this. Of course ideally will be add more "aliases" but it's ok for start! :-)
Yes, sorry about those beautifications... vim (spf13 mod) did it automatically.. i'll be more careful in the future.
I reworked the patch to use buffered print of ip address in order to avoid the str copy.
Test and if any issue is found, open a bug report.
Closed #879.