… forked INVITEs auths
#### Pre-Submission Checklist - [*] Commit message has the format required by CONTRIBUTING guide - [*] Commits are split per component (core, individual modules, libs, utils, ...) - [*] Each component has a single commit (if not, squash them into one commit) - [*] No commits to README files for modules (changes must be done to docbook files
#### Type Of Change - [ ] 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 --> - [ ] PR should be backported to stable branches - [ *] Tested changes locally - [ ]* Related to issue #[4266](https://github.com/kamailio/kamailio/issues/4266)
#### Description If a Negative reply for forked REGISTER comes after the first 200 response, it won't be ignored by Kamailio and will be processed the same way as replies processed for the INVITEs You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4304
-- Commit Summary --
* tm: allow pending forked REGISTER auths being handled the same way as forked INVITEs auths
-- File Changes --
M src/modules/tm/t_reply.c (15)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4304.patch https://github.com/kamailio/kamailio/pull/4304.diff
@ovoshlook pushed 1 commit.
3f1c45c01fcf981eb949df48c0cb099d70aa4ba1 Merge branch 'master' into ovoshlook/register-auth
@ovoshlook pushed 1 commit.
8de5ff7ece75a08f30087edd21ff0ced909e784d tm: allow pending forked REGISTER auths being handled the same way as forked INVITEs auths
@ovoshlook pushed 1 commit.
c3dd758c47de901afd374487bf620e5a1f9aa3e3 tm: Do not discard late negative replies for forked REGISTER
ovoshlook left a comment (kamailio/kamailio#4304)
Having 4 commits with no lack to resolve formatting for commit and code (profiling failed), is it better to create a new PR with proper changes in one commit, or is it minor? ( BTW, don't get why commit message formatting failed)
linuxmaniac left a comment (kamailio/kamailio#4304)
Having 4 commits with no lack to resolve formatting for commit and code (profiling failed), is it better to create a new PR with proper changes in one commit, or is it minor? ( BTW, don't get why commit message formatting failed)
You just need to rebase and push force your branch
@ovoshlook pushed 1 commit.
f6ceeaeb3a8ee15e5b2a388f6026196268233b2a tm: Do not discard late negative replies for forked REGISTER
@ovoshlook pushed 1 commit.
9200b73df11d1f40412f08760c311e4858e09d39 tm: Do not discard late negative replies for forked REGISTER
miconda left a comment (kamailio/kamailio#4304)
I am not sure I understand exactly the use case. Is it about a REGISTER request getting to a SIP proxy that does parallel forking to many downstream SIP registrars? If yes, what do you want to happen with replies having the code >= 300? To be forwarded back to the initial sender of the REGISTER request?
If it is about authentication, why not only 401/407? Shall a 400 be forwarded as well?
Also, the description does not seem right, for the INVITE, if the transaction uas status is `>= 200`, then only 2xx responses are forwarded (in the code it does not seem that >=300 are still forwarded for the INVITEs). Or I am missing something?
Looking at the overall diff at this moment:
- https://patch-diff.githubusercontent.com/raw/kamailio/kamailio/pull/4304.dif...
The first changed line to the LM_DBG() does not seem useful, just breaks the code formatting. Also, a non-necessary empty line is added.
ovoshlook left a comment (kamailio/kamailio#4304)
The case is a little bit different (it is made in response to this issue https://github.com/kamailio/kamailio/issues/4266):
The case:
When Kamailio receives a REGISTER request, it makes a parallel forking to registrars ( mid-registrar case, let's say ) The Kamailio catches the Auth response (401/407) from Registrars at the branch-failure route. If it authenticates and sends a REGISTER with an authentication header to the Registrar.
However, there are some cases where the first Registrar authenticates and sends a 200 OK response earlier than other Registrars send 401/407 responses.
existing logic doesn't give those responses being handled anyhow and discards them, as the transaction status already changed to 200, and logic hits this point: https://github.com/kamailio/kamailio/blob/master/src/modules/tm/t_reply.c#L1...
goto: discard;
Added code allows handling such responses within failure routes; however, it won't propagate failure replies to UAC, because the new code is >=300 https://github.com/kamailio/kamailio/blob/master/src/modules/tm/t_reply.c#L1... and the status of the transaction is already 200 https://github.com/kamailio/kamailio/blob/master/src/modules/tm/t_reply.c#L1... 200 responses to late parallel registrations also won't be propagated to UAC because the transaction status 200 already exists.
The description of the added code might be indeed messy - I'll try to improve the clarity of the comment
@ovoshlook pushed 1 commit.
6726329887bb8bf26515f78ed9ea51bac58f3050 tm: Do not discard late negative replies for forked REGISTER
@ovoshlook pushed 1 commit.
8f1f5a901902b676f64924248e2dcaa7ae518df5 tm: Do not discard late negative replies for forked REGISTER
@ovoshlook pushed 1 commit.
4979850fd209ec16dafe334382e7231d09dec43c tm: Do not discard late forked REGISTER replies
@ovoshlook pushed 1 commit.
6fd39a352fe1ee059389d0ca81fb67457eac68eb tm: Do not discard late forked REGISTER replies
@ovoshlook pushed 1 commit.
4837fff633d09a1ab8d53bb42b1475241c8c4d39 Revert "tm: Do not discard late forked REGISTER replies"
@ovoshlook pushed 1 commit.
eb2db7710e82806d900bc7af2f2d10cf8ae33007 tm: Do not discard late forked REGISTER replies
ovoshlook left a comment (kamailio/kamailio#4304)
Hi, May I request some help to figure out what is wrong with the formatting checks? It appears that the code and commit messages are now meeting the requirements, but the parsers are still failing.
henningw left a comment (kamailio/kamailio#4304)
I have re-run the checks. The check-commit is failing at an unrelated commit, and can be probably ignored. The check-format is failing at your commit it seems, some whitespace change maybe not correct? Just execute clang-format and force-push again.
gaaf left a comment (kamailio/kamailio#4304)
Why only REGISTER requests? Shouldn't this be more general? At least SUBSCRIBE requests would be similar.
@ovoshlook pushed 2 commits.
1a5dc96f772f884ae5f428ae77bb0755ae432fbe tm: Do not discard late forked REGISTER replies 83903a7f126fe05be1920361f3645509c751aa78 remove unneeded whitespace
@ovoshlook pushed 1 commit.
ba23c1ab6eb13096ecef9e16330fa06b0a9c2b8d tm: Do not discard late forked REGISTER replies
ovoshlook left a comment (kamailio/kamailio#4304)
Thanks for the comment. That's a good point. Initially, I was thinking of covering all initial uncovered requests. However: - `t_should_relay_response` is quite a sensitive function for large changes. - The patch covers a particular edge case related to a particular issue. - Spreading the context may disrupt the clarity of the edge case and code. Moving forward with atomic features was a better approach for me.
According to the questions, it seems the feature's purpose is much clearer now. If no objections, then I'll cover the rest within this feature branch.