Skip to content

Commit

Permalink
acc: new parameter cdr_on_failed to control writing cds for failed di…
Browse files Browse the repository at this point in the history
…alogs
  • Loading branch information
miconda committed Apr 8, 2015
1 parent 59f1451 commit dde1988
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 8 additions & 5 deletions modules/acc/acc_cdr.c
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 2 additions & 0 deletions modules/acc/acc_mod.c
Expand Up @@ -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;

/*@}*/

Expand Down Expand Up @@ -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}
};

Expand Down

0 comments on commit dde1988

Please sign in to comment.