Browse code

dialog: don't do nothing on timeout if dialog is not local

Riccardo Villa authored on 10/02/2022 17:00:18 • Daniel-Constantin Mierla committed on 11/02/2022 14:57:17
Showing 1 changed files
... ...
@@ -1581,6 +1581,16 @@ void dlg_ontimeout(struct dlg_tl *tl)
1581 1581
 	dlg = ((struct dlg_cell*)((char *)(tl) -
1582 1582
 			(unsigned long)(&((struct dlg_cell*)0)->tl)));
1583 1583
 
1584
+	if (dlg->bind_addr[0] == NULL) {
1585
+		LM_DBG("skipping dialog without bind address\n");
1586
+		return 0;
1587
+	}
1588
+
1589
+	if (lookup_local_socket(&(dlg->bind_addr[0]->sock_str)) == NULL) {
1590
+		LM_DBG("skipping non local dialog\n");
1591
+		return 0;
1592
+	}
1593
+	
1584 1594
 	/* mark dialog as expired */
1585 1595
 	dlg->dflags |= DLG_FLAG_EXPIRED;
1586 1596