Module: kamailio
Branch: master
Commit: 9317175c71c2c4a613e3b25a401f27c6316fcb34
URL:
https://github.com/kamailio/kamailio/commit/9317175c71c2c4a613e3b25a401f27c…
Author: Julien Chavanton <jchavanton(a)gmail.com>
Committer: Henning Westerholt <henningw(a)users.noreply.github.com>
Date: 2018-06-18T23:17:25+02:00
dialog: dlg stats incremented twice
---
Modified: src/modules/dialog/dialog.c
Modified: src/modules/dialog/dlg_db_handler.c
---
Diff:
https://github.com/kamailio/kamailio/commit/9317175c71c2c4a613e3b25a401f27c…
Patch:
https://github.com/kamailio/kamailio/commit/9317175c71c2c4a613e3b25a401f27c…
---
diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c
index 9ae2ce8090..83883a4fac 100644
--- a/src/modules/dialog/dialog.c
+++ b/src/modules/dialog/dialog.c
@@ -130,8 +130,6 @@ int dlg_h_id_step = 1;
/* statistic variables */
int dlg_enable_stats = 1;
-int active_dlgs_cnt = 0;
-int early_dlgs_cnt = 0;
int detect_spirals = 1;
int dlg_send_bye = 0;
int dlg_timeout_noreset = 0;
@@ -768,11 +766,6 @@ static int child_init(int rank)
}
}
- if (rank==1) {
- if_update_stat(dlg_enable_stats, active_dlgs, active_dlgs_cnt);
- if_update_stat(dlg_enable_stats, early_dlgs, early_dlgs_cnt);
- }
-
if ( ((dlg_db_mode==DB_MODE_REALTIME || dlg_db_mode==DB_MODE_DELAYED) &&
(rank>0 || rank==PROC_TIMER || rank==PROC_RPC)) ||
(dlg_db_mode==DB_MODE_SHUTDOWN && (rank==PROC_MAIN)) ) {
diff --git a/src/modules/dialog/dlg_db_handler.c b/src/modules/dialog/dlg_db_handler.c
index eb1d97d7b7..d759140018 100644
--- a/src/modules/dialog/dlg_db_handler.c
+++ b/src/modules/dialog/dlg_db_handler.c
@@ -80,8 +80,6 @@ static db1_con_t* dialog_db_handle = 0; /* database connection handle
*/
static db_func_t dialog_dbf;
extern int dlg_enable_stats;
-extern int active_dlgs_cnt;
-extern int early_dlgs_cnt;
extern int dlg_h_id_start;
extern int dlg_h_id_step;
@@ -414,10 +412,8 @@ int load_dialog_info_from_db(int dlg_hash_size, int fetch_num_rows,
dlg->state = VAL_INT(values+8);
if (dlg->state==DLG_STATE_CONFIRMED_NA ||
dlg->state==DLG_STATE_CONFIRMED) {
- active_dlgs_cnt++;
if_update_stat(dlg_enable_stats, active_dlgs, 1);
} else if (dlg->state==DLG_STATE_EARLY) {
- early_dlgs_cnt++;
if_update_stat(dlg_enable_stats, early_dlgs, 1);
}