Skip to content

Commit

Permalink
cgrates: add DisconnectCause for CDRs
Browse files Browse the repository at this point in the history
  • Loading branch information
bradleyjokinen committed Jul 13, 2017
1 parent 5b9f7d3 commit 56bb241
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/cgrates/cgrates_acc.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ static json_object *cgr_get_cdr_acc_msg(struct sip_msg *msg,
char int2str_buf[INT2STR_MAX_LEN + 1];
static str cmd = str_init("SMGenericV1.ProcessCDR");
struct cgr_acc_sess *si = (struct cgr_acc_sess *)s->acc_info;
struct dlg_cell *dlg = cgr_dlgb.get_dlg();

cmsg = cgr_get_generic_msg(&cmd, s);
if (!cmsg) {
Expand Down Expand Up @@ -526,6 +527,11 @@ static json_object *cgr_get_cdr_acc_msg(struct sip_msg *msg,
}
}

if (dlg && cgr_msg_push_str(cmsg, "DisconnectCause", &dlg->terminate_reason) < 0) {
LM_ERR("cannot add DisconnectCause node\n");
goto error;
}

return cmsg->msg;

error:
Expand Down

0 comments on commit 56bb241

Please sign in to comment.