Module: kamailio
Branch: master
Commit: 24cfce96a1e9e970ab7661a4e188dab2b3542fd0
URL: https://github.com/kamailio/kamailio/commit/24cfce96a1e9e970ab7661a4e188dab…
Author: Henning Westerholt <hw(a)gilawa.com>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2022-08-19T14:02:16Z
tm: improve comment related to dns failover, add debug output in this case
---
Modified: src/modules/tm/timer.c
---
Diff: https://github.com/kamailio/kamailio/commit/24cfce96a1e9e970ab7661a4e188dab…
Patch: https://github.com/kamailio/kamailio/commit/24cfce96a1e9e970ab7661a4e188dab…
---
diff --git a/src/modules/tm/timer.c b/src/modules/tm/timer.c
index 4c821ba871..8437b4ed40 100644
--- a/src/modules/tm/timer.c
+++ b/src/modules/tm/timer.c
@@ -442,12 +442,14 @@ inline static void final_response_handler(
BLST_ERR_TIMEOUT, &r_buf->dst, r_buf->my_T->uas.request);
#endif
#ifdef USE_DNS_FAILOVER
- /* if this is an invite, the destination resolves to more ips, and
- * it still hasn't passed more than fr_inv_timeout since we
- * started, add another branch/uac */
+ /* if this is an request, the destination resolves to more IPs, and
+ * it still hasn't passed more than max_inv_lifetime or
+ * max_noninv_lifetimesince we started, add another branch/uac */
if(cfg_get(core, core_cfg, use_dns_failover)) {
now = get_ticks_raw();
if((s_ticks_t)(t->end_of_life - now) > 0) {
+ LM_DBG("send on branch %d failed, adding another branch\n",
+ r_buf->branch);
branch_ret = add_uac_dns_fallback(
t, t->uas.request, &t->uac[r_buf->branch], 0);
prev_branch = -1;
Module: kamailio
Branch: master
Commit: d6b1c20d3ad94d9136cf247e67b7fc0d32b18d3b
URL: https://github.com/kamailio/kamailio/commit/d6b1c20d3ad94d9136cf247e67b7fc0…
Author: Henning Westerholt <hw(a)gilawa.com>
Committer: Henning Westerholt <hw(a)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/d6b1c20d3ad94d9136cf247e67b7fc0…
Patch: https://github.com/kamailio/kamailio/commit/d6b1c20d3ad94d9136cf247e67b7fc0…
---
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.