Module: kamailio
Branch: master
Commit: dde198813953bc722ae5aafecbcea4d2f26c38e8
URL:
https://github.com/kamailio/kamailio/commit/dde198813953bc722ae5aafecbcea4d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-04-08T10:56:58+02:00
acc: new parameter cdr_on_failed to control writing cds for failed dialogs
---
Modified: modules/acc/acc_cdr.c
Modified: modules/acc/acc_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/dde198813953bc722ae5aafecbcea4d…
Patch:
https://github.com/kamailio/kamailio/commit/dde198813953bc722ae5aafecbcea4d…
---
diff --git a/modules/acc/acc_cdr.c b/modules/acc/acc_cdr.c
index bc2e66b..d01beb9 100644
--- a/modules/acc/acc_cdr.c
+++ b/modules/acc/acc_cdr.c
@@ -88,6 +88,7 @@ extern str cdr_end_str;
extern str cdr_duration_str;
extern str acc_cdrs_table;
extern int cdr_log_enable;
+extern int _acc_cdr_on_failed;
/* write all basic information to buffers(e.g. start-time ...) */
static int cdr_core2strar( struct dlg_cell* dlg,
@@ -693,11 +694,13 @@ static void cdr_on_create( struct dlg_cell* dialog,
return;
}
- if( dlgb.register_dlgcb( dialog, DLGCB_FAILED, cdr_on_failed, 0, 0) != 0)
- {
- LM_ERR("can't register create dialog FAILED callback\n");
- return;
- }
+ if(_acc_cdr_on_failed==1) {
+ if( dlgb.register_dlgcb( dialog, DLGCB_FAILED, cdr_on_failed, 0, 0) != 0)
+ {
+ LM_ERR("can't register create dialog FAILED callback\n");
+ return;
+ }
+ }
if( dlgb.register_dlgcb( dialog, DLGCB_TERMINATED, cdr_on_end, 0, 0) != 0)
{
diff --git a/modules/acc/acc_mod.c b/modules/acc/acc_mod.c
index 2939cd3..5412ed1 100644
--- a/modules/acc/acc_mod.c
+++ b/modules/acc/acc_mod.c
@@ -120,6 +120,7 @@ int acc_time_mode = 0;
str acc_time_attr = str_init("time_attr");
str acc_time_exten = str_init("time_exten");
int _acc_clone_msg = 1;
+int _acc_cdr_on_failed = 0;
/*@}*/
@@ -317,6 +318,7 @@ static param_export_t params[] = {
{"cdrs_table", PARAM_STR, &acc_cdrs_table },
{"time_format", PARAM_STRING, &acc_time_format },
{"clone_msg", PARAM_INT, &_acc_clone_msg },
+ {"cdr_on_failed", PARAM_INT, &_acc_cdr_on_failed },
{0,0,0}
};