Module: kamailio Branch: 5.5 Commit: deae678810d138d0cb4086c1472e5a4736d209f6 URL: https://github.com/kamailio/kamailio/commit/deae678810d138d0cb4086c1472e5a47...
Author: Henning Westerholt hw@gilawa.com Committer: Henning Westerholt hw@gilawa.com Date: 2023-05-15T15:41:56Z
topos: fix early-dialog b-side UPDATE requests routing (GH #3437)
(cherry picked from commit 091dc9a76bcec5c8a4bc73e863ed10b1b9d76c92) (cherry picked from commit 1b55a80b71bf9a7edfe29eb40627b472565ace69) (cherry picked from commit 0a4d8819b1dccf4404be557278dbd5350eacd156)
---
Modified: src/modules/topos/tps_msg.c
---
Diff: https://github.com/kamailio/kamailio/commit/deae678810d138d0cb4086c1472e5a47... Patch: https://github.com/kamailio/kamailio/commit/deae678810d138d0cb4086c1472e5a47...
---
diff --git a/src/modules/topos/tps_msg.c b/src/modules/topos/tps_msg.c index 83d5f5fddff..20548d16da2 100644 --- a/src/modules/topos/tps_msg.c +++ b/src/modules/topos/tps_msg.c @@ -883,14 +883,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,