Browse code

dialog: do not require dlg_flag parameter to be set

- using dlg_manage() should be enough for tracking dialogs

(cherry picked from commit 404f403786478a917637186446bb285e8e32cc59)
(cherry picked from commit 563f1d6af3123485ed25cc58bb3badd68e7793a4)

Daniel-Constantin Mierla authored on 09/01/2019 13:15:37
Showing 2 changed files
... ...
@@ -494,8 +494,8 @@ static int mod_init(void)
494 494
 		return -1;
495 495
 
496 496
 	/* param checkings */
497
-	if (dlg_flag>MAX_FLAG) {
498
-		LM_ERR("invalid dlg flag %d!!\n",dlg_flag);
497
+	if (dlg_flag!=-1 && dlg_flag>MAX_FLAG) {
498
+		LM_ERR("invalid dlg flag %d!!\n", dlg_flag);
499 499
 		return -1;
500 500
 	}
501 501
 
... ...
@@ -761,8 +761,10 @@ void dlg_onreq(struct cell* t, int type, struct tmcb_params *param)
761 761
 		}
762 762
 	}
763 763
 	if (dlg==NULL) {
764
-		if((req->flags&dlg_flag_mask)!=dlg_flag_mask)
764
+		if((dlg_flag_mask==0) || (req->flags&dlg_flag_mask)!=dlg_flag_mask) {
765
+			LM_DBG("flag not set for creating a new dialog\n");
765 766
 			return;
767
+		}
766 768
 		LM_DBG("dialog creation on config flag\n");
767 769
 		dlg_new_dialog(req, t, 1);
768 770
 		dlg = dlg_get_ctx_dialog();