Module: kamailio
Branch: master
Commit: 404f403786478a917637186446bb285e8e32cc59
URL:
https://github.com/kamailio/kamailio/commit/404f403786478a917637186446bb285…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-01-09T14:16:19+01:00
dialog: do not require dlg_flag parameter to be set
- using dlg_manage() should be enough for tracking dialogs
---
Modified: src/modules/dialog/dialog.c
Modified: src/modules/dialog/dlg_handlers.c
---
Diff:
https://github.com/kamailio/kamailio/commit/404f403786478a917637186446bb285…
Patch:
https://github.com/kamailio/kamailio/commit/404f403786478a917637186446bb285…
---
diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c
index ce69fc94ca..497176a760 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();