Przeglądaj źródła

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)
(cherry picked from commit 3720283674cc783bceb64987ec8f27a54a1e1d47)
Daniel-Constantin Mierla 6 lat temu
rodzic
commit
e60e413e3a
2 zmienionych plików z 5 dodań i 3 usunięć
  1. 2 2
      src/modules/dialog/dialog.c
  2. 3 1
      src/modules/dialog/dlg_handlers.c

+ 2 - 2
src/modules/dialog/dialog.c

@@ -482,8 +482,8 @@ static int mod_init(void)
 		return -1;
 
 	/* param checkings */
-	if (dlg_flag>MAX_FLAG) {
-		LM_ERR("invalid dlg flag %d!!\n",dlg_flag);
+	if (dlg_flag!=-1 && dlg_flag>MAX_FLAG) {
+		LM_ERR("invalid dlg flag %d!!\n", dlg_flag);
 		return -1;
 	}
 

+ 3 - 1
src/modules/dialog/dlg_handlers.c

@@ -758,8 +758,10 @@ void dlg_onreq(struct cell* t, int type, struct tmcb_params *param)
 		}
 	}
 	if (dlg==NULL) {
-		if((req->flags&dlg_flag_mask)!=dlg_flag_mask)
+		if((dlg_flag_mask==0) || (req->flags&dlg_flag_mask)!=dlg_flag_mask) {
+			LM_DBG("flag not set for creating a new dialog\n");
 			return;
+		}
 		LM_DBG("dialog creation on config flag\n");
 		dlg_new_dialog(req, t, 1);
 		dlg = dlg_get_ctx_dialog();