Browse code

dialog: do not require dlg_flag parameter to be set

- using dlg_manage() should be enough for tracking dialogs

Daniel-Constantin Mierla authored on 09/01/2019 13:15:37
Showing 2 changed files
... ...
@@ -515,8 +515,8 @@ static int mod_init(void)
515 515
 		return -1;
516 516
 
517 517
 	/* param checkings */
518
-	if (dlg_flag>MAX_FLAG) {
519
-		LM_ERR("invalid dlg flag %d!!\n",dlg_flag);
518
+	if (dlg_flag!=-1 && dlg_flag>MAX_FLAG) {
519
+		LM_ERR("invalid dlg flag %d!!\n", dlg_flag);
520 520
 		return -1;
521 521
 	}
522 522
 
... ...
@@ -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();