<!-- Kamailio Pull Request Template -->
<!-- IMPORTANT: - for detailed contributing guidelines, read: https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md - pull requests must be done to master branch, unless they are backports of fixes from master branch to a stable branch - backports to stable branches must be done with 'git cherry-pick -x ...' - code is contributed under BSD for core and main components (tm, sl, auth, tls) - code is contributed GPLv2 or a compatible license for the other components - GPL code is contributed with OpenSSL licensing exception -->
#### Pre-Submission Checklist <!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply --> <!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above--> <!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list --> - [x] Commit message has the format required by CONTRIBUTING guide - [x] Commits are split per component (core, individual modules, libs, utils, ...) - [ ] 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) - [ ] New feature (non-breaking change which adds new functionality) - [x] 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 --> - [ ] PR should be backported to stable branches - [x] Tested changes locally - [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description This PR adds support for $hfl(Diversion)[] and $hflc(Diversion).
This parse_diversion.c was inspired by [parse_pai_ppi.c](https://github.com/kamailio/kamailio/blob/master/src/core/parser/parse_ppi_p...). I am not sure if it's breaking the existing implementation and usage.
Any feedback and review is welcome.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3651
-- Commit Summary --
* parser: Extend diversion for multiple bodies * pv: Add hfl and hflc support for Diversion header
-- File Changes --
M src/core/parser/parse_diversion.c (152) M src/core/parser/parse_diversion.h (11) M src/modules/pv/pv_core.c (71)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3651.patch https://github.com/kamailio/kamailio/pull/3651.diff
Just adding the note that chaning the structure of parsed Diversion header may impact cloning to transaction and freeing of the sip message and transaction. Someone has to do a proper review for those parts before merging.
@xkaraman pushed 2 commits.
4ca2837d68923d7f0ce48e3fc826dbdfcbf069ee parser: Extend diversion for multiple bodies 4edb84a96605b781673a27a7f3cb1aad8f539ec1 pv: Add hfl and hflc support for Diversion header
@xkaraman pushed 1 commit.
a36da6659df311bb0cfc0b09e44207125e77b137 parser: Fix free leakage
@xkaraman pushed 5 commits.
088a1002f714c7b11c0e767bf01e1ad004507cf1 parser: Extend diversion for multiple bodies 572eb455ae76902a70a4cb9ad886bdae064fcbff pv: Add hfl and hflc support for Diversion header 1b6b552f69a0139abead40ddc1036b7cc07e38ad parser: Fix free leakage 67ffe24ab0335e803b7885cf92f8b4d860edc2ad parser: Fix diversion leakage ce31601107b7d36a7d93a0037e80461179688144 parser: Explicit cast to required type
Xenofon did a review of the modules that uses diversion (diversion, sipcapture). The diversion module was tested with the PR. The sipcapture does only seems to store the header content in a string database field, so it should be fine. Regarding the SIP msg cloning, I reviewed the sip_msg_clone.c file. The diversion uses the same approach as the PPI and PAI headers, so it seems to be ok. There is no usage of the relevant diversion header types in tm. The main parser free function was adapted.
Thanks!
@miconda pushed 1 commit.
90a12432fe003589aa006f1026c75d1b27dfaa3c Merge branch 'master' into hfl_hflc_diversion_fix
Closed #3651.
Patches applied manually to resolve conflicts.
Great! Thanks for merging! You can find the docs PR in https://github.com/kamailio/kamailio-wiki/pull/45.