<!-- 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
#### Description <!-- Describe your changes in detail --> Add in-dialog request's direction to TM callback parameter, so correct URIs are restored for replies on upstream in-dialog requests. You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4303
-- Commit Summary --
* uac: Fix restore for replies on upstream in-dialog requests
-- File Changes --
M src/modules/uac/replace.c (82) M src/modules/uac/uac.c (3) M src/modules/uac/uac_reg.c (1)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4303.patch https://github.com/kamailio/kamailio/pull/4303.diff
miconda left a comment (kamailio/kamailio#4303)
Can you provide more details when it happens the case this PR tries to fix?
Also, do not do formatting and logs changes in a commit that fixes an issue, it makes it harder to understand what is related to what. Do formatting/log changes in a separate PR.
@btriller pushed 1 commit.
2263a1a3b74ef216e352c0813d1487ec15c107ab uac: Fix restore for replies on upstream in-dialog requests
btriller left a comment (kamailio/kamailio#4303)
Can you provide more details when it happens the case this PR tries to fix?
Also, do not do formatting and logs changes in a commit that fixes an issue, it makes it harder to understand what is related to what. Do formatting/log changes in a separate commit.
I updated commit text/description. Is it more clear now? Debug log for broken case ``` {1 16260 INVITE 68366c48-358f-4708-8ade-b9ba966f846d} uac [uac.c:588]: ki_replace_to(): dsp=(nil) (len=0) , uri=0x7ffccaa314c0 (len=24) {1 16260 INVITE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:354]: replace_uri(): uri to replace [sip:02212345@1.2.3.4] {1 16260 INVITE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:355]: replace_uri(): replacement uri is [sip:02212345@example.com] {1 16260 INVITE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:404]: replace_uri(): Stored <_uac_to> var in dialog with value sip:02212345@1.2.3.4 {1 16260 INVITE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:424]: replace_uri(): Stored <_uac_tonew> var in dialog with value sip:02212345@example.com {1 16260 INVITE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:438]: replace_uri(): Stored <_uac_tdp> var in dialog with value {1 16260 INVITE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:453]: replace_uri(): Stored <_uac_tdpne> var in dialog with value {2 16260 INVITE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:787]: restore_uri_reply(): removing <sip:02212345@example.com> {2 16260 INVITE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:795]: restore_uri_reply(): inserting <sip:02212345@1.2.3.4> {2 16260 INVITE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:787]: restore_uri_reply(): removing <sip:02212345@example.com> {2 16260 INVITE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:795]: restore_uri_reply(): inserting <sip:02212345@1.2.3.4> {2 16260 INVITE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:787]: restore_uri_reply(): removing <sip:02212345@example.com> {2 16260 INVITE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:795]: restore_uri_reply(): inserting <sip:02212345@1.2.3.4> {1 16260 ACK 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:567]: restore_uri(): getting 'vsf' Route param {1 16260 ACK 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:570]: restore_uri(): route param 'vsf' not found {1 16260 ACK 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:567]: restore_uri(): getting 'vst' Route param {1 16260 ACK 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:570]: restore_uri(): route param 'vst' not found {1 16260 ACK 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:915]: replace_callback(): DOWNSTREAM direction detected - replacing uri with the new uri {1 16260 ACK 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:937]: replace_callback(): Replace [ sip:02212345@1.2.3.4] with [ sip:02212345@example.com] {1 20434 BYE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:567]: restore_uri(): getting 'vsf' Route param {1 20434 BYE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:570]: restore_uri(): route param 'vsf' not found {1 20434 BYE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:567]: restore_uri(): getting 'vst' Route param {1 20434 BYE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:570]: restore_uri(): route param 'vst' not found {1 20434 BYE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:920]: replace_callback(): UPSTREAM direction detected - replacing uri with the original uri {1 20434 BYE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:937]: replace_callback(): Replace [ sip:02212345@example.com] with [ sip:02212345@1.2.3.4] {2 20434 BYE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:787]: restore_uri_reply(): removing <"02215432" sip:02215432@example.com> {2 20434 BYE 68366c48-358f-4708-8ade-b9ba966f846d} uac [replace.c:795]: restore_uri_reply(): inserting <"02215432" sip:02215432@example.com> ```
miconda left a comment (kamailio/kamailio#4303)
Fine to merge it if no other comments.