[sr-dev] git:master:e122c5ee: dialog: fix initialization of slot next_id to avoid colision after restart

Daniel-Constantin Mierla miconda at gmail.com
Wed Feb 11 15:41:41 CET 2015


Module: kamailio
Branch: master
Commit: e122c5ee8c6055c033cc11f14e5308ed94461fe6
URL: https://github.com/kamailio/kamailio/commit/e122c5ee8c6055c033cc11f14e5308ed94461fe6

Author: mikomarrache <mikomarrache at users.noreply.github.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-02-11T10:37:26Z

dialog: fix initialization of slot next_id to avoid colision after restart

- next_id was set to the highest id of a dialog loaded from database,
  next new dialog was reusing the same value

---

Diff:  https://github.com/kamailio/kamailio/commit/e122c5ee8c6055c033cc11f14e5308ed94461fe6.diff
Patch: https://github.com/kamailio/kamailio/commit/e122c5ee8c6055c033cc11f14e5308ed94461fe6.patch

---

diff --git a/modules/dialog/dlg_db_handler.c b/modules/dialog/dlg_db_handler.c
index 2de4e7e..9e8d2c4 100644
--- a/modules/dialog/dlg_db_handler.c
+++ b/modules/dialog/dlg_db_handler.c
@@ -366,7 +366,7 @@ static int load_dialog_info_from_db(int dlg_hash_size, int fetch_num_rows)
 			next_id = d_table->entries[dlg->h_entry].next_id;
 
 			d_table->entries[dlg->h_entry].next_id =
-				(next_id < dlg->h_id) ? (dlg->h_id+1) : next_id;
+				(next_id <= dlg->h_id) ? (dlg->h_id+1) : next_id;
 
 			GET_STR_VALUE(to_tag, values, 6, 1, 1);
 




More information about the sr-dev mailing list