<!-- 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) - [ ] 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 - [ ] Tested changes locally - [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
RFC 6665 [says](https://datatracker.ietf.org/doc/html/rfc6665#section-8.3.1):
> Implementations conformant with the current specification MUST treat an incoming 202 response as identical to a 200 response and MUST NOT generate 202 response codes to SUBSCRIBE or NOTIFY requests.
I'm not sure if Kamailio is supposed to conform to the older RFC, so this change might not be _acceptable_. You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2930
-- Commit Summary --
* <a href="https://github.com/kamailio/kamailio/pull/2930/commits/04d51f7c489bce19fdf53095bcde869d9ab55908">presence: return 200 instead of 202</a>
-- File Changes --
M src/modules/presence/subscribe.c (12)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2930.patch https://github.com/kamailio/kamailio/pull/2930.diff
CC @adita76 who asked me to file this. I don't know anything about SIP.
I would suggest to make this a module parameter, so the current behaviour can be preserved and people can configure what response code to used.
@lnicola pushed 1 commit.
2ce7d9314580ff7b07ab9e1ec27a97b2922329bc presence: return 200 instead of 202
If there are no more comments, the documentation (XML) for the newly added parameter is missing and should be added before merging.
@lnicola pushed 1 commit.
4332694e1da7b77a16a23ecc83f529426ba991bc presence: return 200 instead of 202
@lnicola pushed 1 commit.
5b334f3856e67c20c7c7f29e0d215fcf170b31d0 presence: return 200 instead of 202
@lnicola pushed 1 commit.
e08684cb7326bd97b0f4281b46e736ca92bbceb5 presence: add option to return 200 instead of 202 on subscriptions
Added docs.
Thanks for the additions. Just one small thing, could you please remove the README file from the PR. This is done from an automatic job in the repo to ensure consistency.
@lnicola pushed 1 commit.
10d27ab2d7992df04d5da4e8615e16156eb10734 presence: add option to return 200 instead of 202 on subscriptions
Done, sorry. I noticed some `Makefile` targets, but wasn't sure of the process.
Merged #2930 into master.
Thanks, merged. Being a small extensions, further work could be done in git master, if necessary.
@henningw if I backport this to the 5.5 branch, do you think it would be possible to cut a new release?
Thanks for the changes. There will be a new release for 5.5.x next week. Regarding back-porting, technically its a new feature that should not be backported. On the other hand it fixes compliance with RFC 6665 for the module. @miconda what are your thoughts on this?
Henning Westerholt writes:
Thanks for the changes. There will be a new release for 5.5.x next week. Regarding back-porting, technically its a new feature that should not be backported. On the other hand it fixes compliance with RFC 6665 for the module. @miconda what are your thoughts on this?
RFC 6665 tells
Implementations conformant with the current specification MUST treat an incoming 202 response as identical to a 200 response and MUST NOT generate 202 response codes to SUBSCRIBE or NOTIFY requests.
So should default behavior be 200 response. At least new users of the module would expect is it works according to standard out of the box.
I filed a backport PR, we can discuss it there.
I wasn't sure which RFC was implemented. Then we can change the default on `master` -- and _if_ we backport it to 5.5 we can leave the previous behavior as the default.
Laurențiu Nicola writes:
I wasn't sure which RFC was implemented. Then we can change the default on `master` -- and _if_ we backport it to 5.5 we can leave the previous behavior as the default.
Yes, if backport is done, default to 202 for backwards compatibility. In master default to 200 and add release note about the change.
I haven't checked the RFC 6665 in detail, but it is anyhow a new feature that updates the current behaviour, which isbased on older specs, it is not a wrong implementation.
If decided to be backported to stable branches, then it has to preserve the current behaviour.
In master the default can be changed if people consider it better, and the docs updated to reflect that. I assume that many still run old phones for BLF, presence, ...
Regarding the backport, I am fine either way, what people prefer more. At the end we cannot backport implementations of new RFC always to stable branches. Here the patch is minimal, but as practice so far we always have to consider stability of released branches vs new/changed behaviour.
Filed #2949 to change the default.
Regarding the backport to 5.5, is there anything we can do to push this forward?