- GH #2459
#### 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: - [x] PR should be backported to stable branches - [x] Tested changes locally - [x] Related to issue #2459
#### Description fix_nated_sdp() function with flags 0x02 and 0x08 and an IP address as argument (or without one) does modify the media line and the connection line. In addition it will modify IP address in "a=rtcp" parameter (rfc3605) in case if there is one. If a=rtcp param is not found the function doesn't return -1, but prints a DBG message and continues to execute (changing c= or o= lines) You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2497
-- Commit Summary --
* nathelper: fix_nated_sdp added support for a=rtcp param RFC3605
-- File Changes --
M src/modules/nathelper/nathelper.c (49)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2497.patch https://github.com/kamailio/kamailio/pull/2497.diff
Great! Thank you! Just checking - do you handle all variants of "a=rtcp"? From the RFC:
``` m=audio 49170 RTP/AVP 0 a=rtcp:53020
m=audio 49170 RTP/AVP 0 a=rtcp:53020 IN IP4 126.16.64.4
m=audio 49170 RTP/AVP 0 a=rtcp:53020 IN IP6 2001:2345:6789:ABCD:EF01:2345:6789:ABCD
```
https://tools.ietf.org/html/rfc3605
Hi Olle,
internally function acts the same way as before, so for the above cases it yields the following results:
If there is no IP address in the rtcp attribute - nothing will be changed.
If param has an IPv4 - it will be replaced with the msg source IP address - if only the first argument (flags 0x02, 0x08, 0x10) is passed. Or with the IP address passed as the second argument.
If param contains IPv6 - nothing will be changed.
a possible issue, I have found in my tests, is that it is possible to pass IPv6 as a second argument to the function and it will replace IPv4 address leading to address family mismatch. (e.g c=IN IP4 2001:2345:6789:ABCD:EF01:2345:6789:ABCD) Probably should be mentioned in the nathelper admin guide.
@arsperger - you can make a PR to update the docs with a remark about being careful to not replace IP address with one from a different family.
@arsperger pushed 2 commits.
ccc69d0b24af27ec36250a094f8273429540153b Merge branch 'master' of https://github.com/kamailio/kamailio c0f21a3de66fba455d3a505b576f6e916dc534ca nathelper: docs - updated notes for fix_nated_sdp. few typos fixed [skip ci]
Thanks!
Merged #2497 into master.