Skip to content

Commit

Permalink
dialog: safety check not to store dialog vars and data when state ini…
Browse files Browse the repository at this point in the history
…tial

- 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
  • Loading branch information
miconda committed Sep 10, 2015
1 parent 7f9194c commit cecdd08
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/dialog/dlg_db_handler.c
Expand Up @@ -712,6 +712,11 @@ int update_dialog_dbinfo_unsafe(struct dlg_cell * cell)
&sflags_column, /*18*/ &toroute_name_column, /*19*/ &req_uri_column, /*20*/
&xdata_column, /*21*/ &iflags_column /*22*/ };

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) {
Expand Down

0 comments on commit cecdd08

Please sign in to comment.