<!-- 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 - [x] Small bug fix (non-breaking change which fixes an issue) - [ ] 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 --> - [x] 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 -->
According to RFC 3261 & 3262 CANCEL , PRACK and BYE requests and their associated responses (most of them) must not have contact header You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3149
-- Commit Summary --
* topos: remove contact header for CANCEL,BYE,PRACK REQUESTS
-- File Changes --
M src/modules/topos/tps_msg.c (7)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3149.patch https://github.com/kamailio/kamailio/pull/3149.diff
Thanks for the PR!
I couldn't find an explicit statement about CANCEL and Contact header in the RFC, I haven't searched much, though. IBM site claims it is a SHOULD NOT:
- https://www.ibm.com/support/pages/apar/PM77734
I will think how this could be added with some flexibility around it.
@miconda I think this is the relevant table in section 20 [link](https://datatracker.ietf.org/doc/html/rfc3261#section-20)
Seems to be pretty clear, if I read it correctly.
``` -: The header field is not applicable.
"Not applicable" means that the header field MUST NOT be present in a request. If one is placed in a request by mistake, it MUST be ignored by the UAS receiving the request. Similarly, a header field labeled "not applicable" for a response means that the UAS MUST NOT place the header field in the response, and the UAC MUST ignore the header field in the response. ```
``` Header field where proxy ACK BYE CAN INV OPT REG ___________________________________________________________ Contact R o - - m o o Contact 1xx - - - o - - Contact 2xx - - - m o o Contact 3xx d - o - o o o Contact 485 - o - o o o ```
@henningw: ok -- I made it configurable just in case other methods have same requirements, or one needs the old behaviour for whatever reason.
At the end it didn't break the behaviour due to the must ignore statement:
``` If one is placed in a request by mistake, it MUST be ignored by the UAS receiving the request. ```
Closing this one.
Closed #3149.
Thanks, great solution.