<!-- 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, ...) - [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: <!-- 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 <!-- Describe your changes in detail --> Add a new forward function to the MSRP module that adds the ability to perform MSRP proxying.
The forward function allows frame replaying without multi-path. The frame can be relayed unmodified, or with a custom To/From-Path. If a replacement To-Path is provided, then the From-Path is replace either by the original To-Path or the replacement From-Path. Either the destination must be set prior or a replacement To-Path must be provided. You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3934
-- Commit Summary --
* msrp: add forward support with path replacement
-- File Changes --
M src/modules/msrp/doc/msrp_admin.xml (38) M src/modules/msrp/msrp_mod.c (72) M src/modules/msrp/msrp_netio.c (129) M src/modules/msrp/msrp_netio.h (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3934.patch https://github.com/kamailio/kamailio/pull/3934.diff
@bsantos pushed 1 commit.
ec23dfff672b5eeb0c4c09bec19320aff254a89e msrp: add forward support with path replacement
For our needs, we have a similar functionality to proxy MSRP messages. In our experience, some clients do not support IPv6 addresses, and if Kamailio received an MSRP message using an IPv6 address in the To header, then the forwarded message will be with IPv6 address From the header. Such clients will not be able to parse MSRP messages.
Also if another server can parse IPv6 addresses but does not have connectivity to IPv6 and Kamailio send From with IPv6 address, then this server was not able to respond because does not have connectivity to IPv6 network. Some workaround is possible but in general, Kamailio as an MSRP proxy should use IP address of the outbound interface. Not the From header of the received MSRP message.
On another question. How do you solve SDP message change? We made this by writing the Kamailio route, but it is not simple for understanding and support.
With the ability to replace the To-Path and From-Path headers and as long you replace both, you can relay between IPv4 and IPv6 with no problem.
As for the SDP, I did it in the routing script (using Lua), I used the sdpops.sdp_get_line_startswith to get the original path and textops.subst_body to replace the path and connection ip/port. I also recorded each session and respective replacement paths in htable vars (INVITE and on-reply callback). I use the Session-Expires header to set the expires for the htable stored data. Then on the MSRP route I fetch the stored data in htable data (using the session as key) to get the replace paths and call forward.
Thanks, merging!
Merged #3934 into master.