Browse code

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

Henning Westerholt authored on 09/08/2022 14:11:59
Showing 1 changed files
... ...
@@ -1042,6 +1042,8 @@ int add_uac_dns_fallback(struct cell *t, struct sip_msg* msg,
1042 1042
 		t->uac[t->nr_of_outgoings].on_branch_failure = old_uac->on_branch_failure;
1043 1043
 		/* copy branch flags */
1044 1044
 		t->uac[t->nr_of_outgoings].branch_flags = old_uac->branch_flags;
1045
+		/* restore X/AVP values from initial transaction */
1046
+		tm_xdata_swap(t, 0, 0);
1045 1047
 
1046 1048
 		if (cfg_get(tm, tm_cfg, reparse_on_dns_failover)){
1047 1049
 			/* Reuse the old buffer and only replace the via header.