[sr-dev] git:master:14348216: dialog: renamed ignore_non_local_dlg to dlg_filter_mode

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


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2022-02-11T16:13:29+01:00

dialog: renamed ignore_non_local_dlg to dlg_filter_mode

---

Modified: src/modules/dialog/dialog.c
Modified: src/modules/dialog/dlg_handlers.c
Modified: src/modules/dialog/dlg_hash.h
Modified: src/modules/dialog/dlg_req_within.c

---

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

---

diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c
index ddcb3b134b..08f0a85882 100644
--- a/src/modules/dialog/dialog.c
+++ b/src/modules/dialog/dialog.c
@@ -104,7 +104,7 @@ str dlg_extra_hdrs = {NULL,0};
 static int db_fetch_rows = 200;
 static int db_skip_load = 0;
 static int dlg_keep_proxy_rr = 0;
-int dlg_ignore_non_local_dlg = 0;
+int dlg_filter_mode = 0;
 int initial_cbs_inscript = 1;
 int dlg_wait_ack = 1;
 static int dlg_timer_procs = 0;
@@ -328,7 +328,7 @@ static param_export_t mod_params[]={
 	{ "h_id_start",            PARAM_INT, &dlg_h_id_start           },
 	{ "h_id_step",             PARAM_INT, &dlg_h_id_step            },
 	{ "keep_proxy_rr",         INT_PARAM, &dlg_keep_proxy_rr        },
-	{ "ignore_non_local_dlg",  INT_PARAM, &dlg_ignore_non_local_dlg },
+	{ "dlg_filter_mode",       INT_PARAM, &dlg_filter_mode          },
 	{ 0,0,0 }
 };
 
diff --git a/src/modules/dialog/dlg_handlers.c b/src/modules/dialog/dlg_handlers.c
index dd8cef6fd8..bf49981b4c 100644
--- a/src/modules/dialog/dlg_handlers.c
+++ b/src/modules/dialog/dlg_handlers.c
@@ -71,7 +71,7 @@ extern int       dlg_send_bye;
 extern int       dlg_event_rt[DLG_EVENTRT_MAX];
 extern int       dlg_wait_ack;
 extern int       dlg_enable_dmq;
-extern int       dlg_ignore_non_local_dlg;
+extern int       dlg_filter_mode;
 int              spiral_detected = -1;
 
 extern struct rr_binds d_rrb;		/*!< binding to record-routing module */
@@ -1582,7 +1582,7 @@ void dlg_ontimeout(struct dlg_tl *tl)
 	dlg = ((struct dlg_cell*)((char *)(tl) -
 			(unsigned long)(&((struct dlg_cell*)0)->tl)));
 
-	if (dlg_ignore_non_local_dlg) {
+	if (dlg_filter_mode & DLG_FILTER_LOCALONLY) {
 		if (dlg->bind_addr[0] == NULL) {
 			LM_DBG("skipping dialog without bind address\n");
 			return;
@@ -1593,7 +1593,7 @@ void dlg_ontimeout(struct dlg_tl *tl)
 			return;
 		}
 	}
-	
+
 	/* mark dialog as expired */
 	dlg->dflags |= DLG_FLAG_EXPIRED;
 
diff --git a/src/modules/dialog/dlg_hash.h b/src/modules/dialog/dlg_hash.h
index ed5cd7bef0..7367a1b783 100644
--- a/src/modules/dialog/dlg_hash.h
+++ b/src/modules/dialog/dlg_hash.h
@@ -92,6 +92,9 @@
 #define DLG_EVENTRT_FAILED   2
 #define DLG_EVENTRT_MAX      3
 
+/* flags for filtering dialogs processing */
+#define DLG_FILTER_LOCALONLY (1<<0) /*!< processing only local dialogs */
+
 /*! internal unique ide per dialog */
 typedef struct dlg_iuid {
 	unsigned int         h_id;		/*!< id in the hash table entry (seq nr in slot) */
diff --git a/src/modules/dialog/dlg_req_within.c b/src/modules/dialog/dlg_req_within.c
index c38d2062cc..bd65d995d2 100644
--- a/src/modules/dialog/dlg_req_within.c
+++ b/src/modules/dialog/dlg_req_within.c
@@ -53,7 +53,7 @@
 extern str dlg_extra_hdrs;
 extern str dlg_lreq_callee_headers;
 extern int dlg_ka_failed_limit;
-extern int dlg_ignore_non_local_dlg;
+extern int dlg_filter_mode;
 
 /**
  *
@@ -453,7 +453,7 @@ int dlg_send_ka(dlg_cell_t *dlg, int dir)
 	int result;
 	dlg_iuid_t *iuid = NULL;
 
-	if (dlg_ignore_non_local_dlg) {
+	if (dlg_filter_mode & DLG_FILTER_LOCALONLY) {
 		if (dlg->bind_addr[dir] == NULL) {
 			LM_DBG("skipping dialog without bind address\n");
 			return 0;




More information about the sr-dev mailing list