Browse code

dialog: renamed ignore_non_local_dlg to dlg_filter_mode

Daniel-Constantin Mierla authored on 11/02/2022 15:06:38
Showing 4 changed files
... ...
@@ -104,7 +104,7 @@ str dlg_extra_hdrs = {NULL,0};
104 104
 static int db_fetch_rows = 200;
105 105
 static int db_skip_load = 0;
106 106
 static int dlg_keep_proxy_rr = 0;
107
-int dlg_ignore_non_local_dlg = 0;
107
+int dlg_filter_mode = 0;
108 108
 int initial_cbs_inscript = 1;
109 109
 int dlg_wait_ack = 1;
110 110
 static int dlg_timer_procs = 0;
... ...
@@ -328,7 +328,7 @@ static param_export_t mod_params[]={
328 328
 	{ "h_id_start",            PARAM_INT, &dlg_h_id_start           },
329 329
 	{ "h_id_step",             PARAM_INT, &dlg_h_id_step            },
330 330
 	{ "keep_proxy_rr",         INT_PARAM, &dlg_keep_proxy_rr        },
331
-	{ "ignore_non_local_dlg",  INT_PARAM, &dlg_ignore_non_local_dlg },
331
+	{ "dlg_filter_mode",       INT_PARAM, &dlg_filter_mode          },
332 332
 	{ 0,0,0 }
333 333
 };
334 334
 
... ...
@@ -71,7 +71,7 @@ extern int       dlg_send_bye;
71 71
 extern int       dlg_event_rt[DLG_EVENTRT_MAX];
72 72
 extern int       dlg_wait_ack;
73 73
 extern int       dlg_enable_dmq;
74
-extern int       dlg_ignore_non_local_dlg;
74
+extern int       dlg_filter_mode;
75 75
 int              spiral_detected = -1;
76 76
 
77 77
 extern struct rr_binds d_rrb;		/*!< binding to record-routing module */
... ...
@@ -1582,7 +1582,7 @@ void dlg_ontimeout(struct dlg_tl *tl)
1582 1582
 	dlg = ((struct dlg_cell*)((char *)(tl) -
1583 1583
 			(unsigned long)(&((struct dlg_cell*)0)->tl)));
1584 1584
 
1585
-	if (dlg_ignore_non_local_dlg) {
1585
+	if (dlg_filter_mode & DLG_FILTER_LOCALONLY) {
1586 1586
 		if (dlg->bind_addr[0] == NULL) {
1587 1587
 			LM_DBG("skipping dialog without bind address\n");
1588 1588
 			return;
... ...
@@ -1593,7 +1593,7 @@ void dlg_ontimeout(struct dlg_tl *tl)
1593 1593
 			return;
1594 1594
 		}
1595 1595
 	}
1596
-	
1596
+
1597 1597
 	/* mark dialog as expired */
1598 1598
 	dlg->dflags |= DLG_FLAG_EXPIRED;
1599 1599
 
... ...
@@ -92,6 +92,9 @@
92 92
 #define DLG_EVENTRT_FAILED   2
93 93
 #define DLG_EVENTRT_MAX      3
94 94
 
95
+/* flags for filtering dialogs processing */
96
+#define DLG_FILTER_LOCALONLY (1<<0) /*!< processing only local dialogs */
97
+
95 98
 /*! internal unique ide per dialog */
96 99
 typedef struct dlg_iuid {
97 100
 	unsigned int         h_id;		/*!< id in the hash table entry (seq nr in slot) */
... ...
@@ -53,7 +53,7 @@
53 53
 extern str dlg_extra_hdrs;
54 54
 extern str dlg_lreq_callee_headers;
55 55
 extern int dlg_ka_failed_limit;
56
-extern int dlg_ignore_non_local_dlg;
56
+extern int dlg_filter_mode;
57 57
 
58 58
 /**
59 59
  *
... ...
@@ -453,7 +453,7 @@ int dlg_send_ka(dlg_cell_t *dlg, int dir)
453 453
 	int result;
454 454
 	dlg_iuid_t *iuid = NULL;
455 455
 
456
-	if (dlg_ignore_non_local_dlg) {
456
+	if (dlg_filter_mode & DLG_FILTER_LOCALONLY) {
457 457
 		if (dlg->bind_addr[dir] == NULL) {
458 458
 			LM_DBG("skipping dialog without bind address\n");
459 459
 			return 0;