[sr-dev] git:master:d6b1c20d: tm: restore X/AVP values from initial transaction in DNS failover processing
Henning Westerholt
hw at gilawa.com
Tue Aug 9 16:16:42 CEST 2022
Module: kamailio
Branch: master
Commit: d6b1c20d3ad94d9136cf247e67b7fc0d32b18d3b
URL: https://github.com/kamailio/kamailio/commit/d6b1c20d3ad94d9136cf247e67b7fc0d32b18d3b
Author: Henning Westerholt <hw at gilawa.com>
Committer: Henning Westerholt <hw at gilawa.com>
Date: 2022-08-09T14:11:59Z
tm: restore X/AVP values from initial transaction in DNS failover processing
- restore X/AVP values from initial transaction in DNS failover processing
- the X/AVP context gets lost, so we need to re-create it from the transaction
- otherwise modules that depends on the X/AVPs, e.g. topology hiding will not work
- tested with one load-balancer and two proxy servers
---
Modified: src/modules/tm/t_fwd.c
---
Diff: https://github.com/kamailio/kamailio/commit/d6b1c20d3ad94d9136cf247e67b7fc0d32b18d3b.diff
Patch: https://github.com/kamailio/kamailio/commit/d6b1c20d3ad94d9136cf247e67b7fc0d32b18d3b.patch
---
diff --git a/src/modules/tm/t_fwd.c b/src/modules/tm/t_fwd.c
index fbcf1b3e02..6b26f28f6a 100644
--- a/src/modules/tm/t_fwd.c
+++ b/src/modules/tm/t_fwd.c
@@ -1042,6 +1042,8 @@ int add_uac_dns_fallback(struct cell *t, struct sip_msg* msg,
t->uac[t->nr_of_outgoings].on_branch_failure = old_uac->on_branch_failure;
/* copy branch flags */
t->uac[t->nr_of_outgoings].branch_flags = old_uac->branch_flags;
+ /* restore X/AVP values from initial transaction */
+ tm_xdata_swap(t, 0, 0);
if (cfg_get(tm, tm_cfg, reparse_on_dns_failover)){
/* Reuse the old buffer and only replace the via header.
More information about the sr-dev
mailing list