Module: kamailio
Branch: 5.2
Commit: 563f1d6af3123485ed25cc58bb3badd68e7793a4
URL:
https://github.com/kamailio/kamailio/commit/563f1d6af3123485ed25cc58bb3badd…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-01-14T12:27:56+01:00
dialog: do not require dlg_flag parameter to be set
- using dlg_manage() should be enough for tracking dialogs
(cherry picked from commit 404f403786478a917637186446bb285e8e32cc59)
---
Modified: src/modules/dialog/dialog.c
Modified: src/modules/dialog/dlg_handlers.c
---
Diff:
https://github.com/kamailio/kamailio/commit/563f1d6af3123485ed25cc58bb3badd…
Patch:
https://github.com/kamailio/kamailio/commit/563f1d6af3123485ed25cc58bb3badd…
---
diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c
index bf2ba96488..6665398742 100644
--- a/src/modules/dialog/dialog.c
+++ b/src/modules/dialog/dialog.c
@@ -515,8 +515,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;
}
diff --git a/src/modules/dialog/dlg_handlers.c b/src/modules/dialog/dlg_handlers.c
index 96406bde35..c80ca7d59f 100644
--- a/src/modules/dialog/dlg_handlers.c
+++ b/src/modules/dialog/dlg_handlers.c
@@ -761,8 +761,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();