From d18d29fe8c0a563ff4067863d06a9dbd13488737 Mon Sep 17 00:00:00 2001 From: Alessio Garzi Date: Thu, 14 Dec 2023 10:12:33 +0100 Subject: [PATCH] MT#58982 topos: fix early-dialog b-side UPDATE requests routing Fix for SIP requests on early dialog stage coming from B not routed correctly to proxy by TOPOS. Change-Id: I72403c0187faf6dbff6df6495276f5d966258d1b --- debian/patches/series | 2 +- ...dialog-b-side-UPDATE-requests-routin.patch | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 debian/patches/upstream/topos-fix-early-dialog-b-side-UPDATE-requests-routin.patch diff --git a/debian/patches/series b/debian/patches/series index dd01181f7..d64239b3b 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -32,7 +32,7 @@ sipwise/sca-debug.patch sipwise/sca-fix-notify-after-bye.patch sipwise/sca-add-pai_avp-parameter.patch ## upstream 5.6 -# +upstream/topos-fix-early-dialog-b-side-UPDATE-requests-routin.patch ## upstream master upstream/dialog-dlg_get_var-ci-ft-tt-key-dst_var.patch upstream/dialog-dlg_set_var-callid-ft-tt-key-value.patch diff --git a/debian/patches/upstream/topos-fix-early-dialog-b-side-UPDATE-requests-routin.patch b/debian/patches/upstream/topos-fix-early-dialog-b-side-UPDATE-requests-routin.patch new file mode 100644 index 000000000..d02dda10c --- /dev/null +++ b/debian/patches/upstream/topos-fix-early-dialog-b-side-UPDATE-requests-routin.patch @@ -0,0 +1,46 @@ +From 0a4d8819b1dccf4404be557278dbd5350eacd156 Mon Sep 17 00:00:00 2001 +From: Henning Westerholt +Date: Mon, 15 May 2023 13:22:09 +0000 +Subject: [PATCH] topos: fix early-dialog b-side UPDATE requests routing (GH + #3437) + +(cherry picked from commit 091dc9a76bcec5c8a4bc73e863ed10b1b9d76c92) +(cherry picked from commit 1b55a80b71bf9a7edfe29eb40627b472565ace69) +--- + src/modules/topos/tps_msg.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/src/modules/topos/tps_msg.c b/src/modules/topos/tps_msg.c +index a3f123b593..45d8aaa39e 100644 +--- a/src/modules/topos/tps_msg.c ++++ b/src/modules/topos/tps_msg.c +@@ -889,14 +889,22 @@ int tps_request_received(sip_msg_t *msg, int dialog) + } + } + +- if(use_branch && direction == TPS_DIR_DOWNSTREAM) { ++ if(use_branch) { ++ LM_DBG("use branch for routing information, request from direction %d\n", direction); + if(tps_reappend_route(msg, &stsd, &stsd.s_rr, 1) < 0) { + LM_ERR("failed to reappend s-route\n"); + return -1; + } +- if(tps_reappend_route(msg, &stsd, &stsd.y_rr, 1) < 0) { +- LM_ERR("failed to reappend b-route\n"); +- return -1; ++ if (direction == TPS_DIR_UPSTREAM) { ++ if(tps_reappend_route(msg, &stsd, &stsd.x_rr, 0) < 0) { ++ LM_ERR("failed to reappend a-route\n"); ++ return -1; ++ } ++ } else { ++ if(tps_reappend_route(msg, &stsd, &stsd.y_rr, 1) < 0) { ++ LM_ERR("failed to reappend b-route\n"); ++ return -1; ++ } + } + } else { + if(tps_reappend_route(msg, &stsd, &stsd.s_rr, +-- +2.25.1 +