[sr-dev] git:4.3:a58c136c: dialog: safety check not to store dialog vars and data when state initial
Daniel-Constantin Mierla
miconda at gmail.com
Thu Sep 10 14:01:48 CEST 2015
Module: kamailio
Branch: 4.3
Commit: a58c136c3abad48b2d01a4b54b1e56e0901b8246
URL: https://github.com/kamailio/kamailio/commit/a58c136c3abad48b2d01a4b54b1e56e0901b8246
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-09-10T13:59:16+02:00
dialog: safety check not to store dialog vars and data when state initial
- acc callbacks for cdrs can trigger setting dialog vars in initial
state, which then try to save in db, however, initial state might not
have all required fields for a proper db reload, storing being
desinged to be done when all mandatory fields are set
(cherry picked from commit cecdd0817052046e634152d6e512165451b5f6d4)
---
Modified: modules/dialog/dlg_db_handler.c
---
Diff: https://github.com/kamailio/kamailio/commit/a58c136c3abad48b2d01a4b54b1e56e0901b8246.diff
Patch: https://github.com/kamailio/kamailio/commit/a58c136c3abad48b2d01a4b54b1e56e0901b8246.patch
---
diff --git a/modules/dialog/dlg_db_handler.c b/modules/dialog/dlg_db_handler.c
index 117db20..aaa8ff4 100644
--- a/modules/dialog/dlg_db_handler.c
+++ b/modules/dialog/dlg_db_handler.c
@@ -711,6 +711,11 @@ int update_dialog_dbinfo_unsafe(struct dlg_cell * cell)
&sflags_column, &toroute_name_column, &req_uri_column,
&xdata_column, &iflags_column };
+ if(cell->state<DLG_STATE_EARLY) {
+ LM_DBG("not storing dlg in db during initial state\n");
+ return 0;
+ }
+
i = 0;
if( (cell->dflags & DLG_FLAG_NEW) != 0
|| (cell->dflags & DLG_FLAG_CHANGED_VARS) != 0) {
More information about the sr-dev
mailing list