From d877b8ccdb451e2f804042e70b8507931e049ccc Mon Sep 17 00:00:00 2001
From: Iryna Antsyferova <iryna.antsyferova@genexis.eu>
Date: Mon, 24 Mar 2025 14:46:45 +0100
Subject: [PATCH] Fallback to alternative transport immediately if no DNS
 records are found (REF 15147)

---
 res/res_pjsip_outbound_registration.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c
index 52a0259fef..06c1b1c8b8 100644
--- a/res/res_pjsip_outbound_registration.c
+++ b/res/res_pjsip_outbound_registration.c
@@ -1898,8 +1898,9 @@ static int handle_registration_response(void *data)
 
 		if (response->retry_after){
 			waiting_time = response->retry_after;
-		} else if (response->code == 444 || client_state->attempts >= 2 || client_state->waiting_time_upper_bound) {
-			/* failover directly when not received any response(444 from pjsip), or received twice with other response, or under recovery-flow(second round) */
+		} else if (response->code == 444 || client_state->attempts >= 2 || !tdata || !tdata->dest_info.addr.count ||  client_state->waiting_time_upper_bound) {
+			/* failover directly when not received any response(444 from pjsip), or received twice with other response, or under recovery-flow(second round),
+			   or no DNS records are found */
 			client_state->attempts = 0;
 			retry = sip_registration_failover(response);
 		}
-- 
GitLab