[sr-dev] git:master:f8398d93: dialog: don't sent ka if dialog is not local

Daniel-Constantin Mierla miconda at gmail.com
Fri Feb 11 15:57:22 CET 2022


Module: kamailio
Branch: master
Commit: f8398d937611c692f87ccc0ddc284442acbf1893
URL: https://github.com/kamailio/kamailio/commit/f8398d937611c692f87ccc0ddc284442acbf1893

Author: Riccardo Villa <riccardo.villa at netaxis.be>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2022-02-11T15:57:17+01:00

dialog: don't sent ka if dialog is not local

---

Modified: src/modules/dialog/dlg_req_within.c

---

Diff:  https://github.com/kamailio/kamailio/commit/f8398d937611c692f87ccc0ddc284442acbf1893.diff
Patch: https://github.com/kamailio/kamailio/commit/f8398d937611c692f87ccc0ddc284442acbf1893.patch

---

diff --git a/src/modules/dialog/dlg_req_within.c b/src/modules/dialog/dlg_req_within.c
index 809834527f..fb81da8066 100644
--- a/src/modules/dialog/dlg_req_within.c
+++ b/src/modules/dialog/dlg_req_within.c
@@ -452,6 +452,16 @@ int dlg_send_ka(dlg_cell_t *dlg, int dir)
 	int result;
 	dlg_iuid_t *iuid = NULL;
 
+	if (dlg->bind_addr[dir] == NULL) {
+		LM_DBG("skipping dialog without bind address\n");
+		return 0;
+	}
+
+	if (lookup_local_socket(&(dlg->bind_addr[dir]->sock_str)) == NULL) {
+		LM_DBG("skipping non local dialog\n");
+		return 0;
+	}
+
 	/* do not send KA request for non-confirmed dialogs (not supported) */
 	if (dlg->state != DLG_STATE_CONFIRMED) {
 		LM_DBG("skipping non-confirmed dialogs\n");




More information about the sr-dev mailing list