diff --git a/main/cdr.c b/main/cdr.c index f037e57804..9b62760c1f 100644 --- a/main/cdr.c +++ b/main/cdr.c @@ -879,9 +879,11 @@ int ast_cdr_update(struct ast_channel *c) /* Copy account code et-al */ ast_copy_string(cdr->accountcode, c->accountcode, sizeof(cdr->accountcode)); - /* Destination information */ /* XXX privilege macro* ? */ - ast_copy_string(cdr->dst, S_OR(c->macroexten, c->exten), sizeof(cdr->dst)); - ast_copy_string(cdr->dcontext, S_OR(c->macrocontext, c->context), sizeof(cdr->dcontext)); + if (!ast_check_hangup(c)) { + /* Destination information */ /* XXX privilege macro* ? */ + ast_copy_string(cdr->dst, S_OR(c->macroexten, c->exten), sizeof(cdr->dst)); + ast_copy_string(cdr->dcontext, S_OR(c->macrocontext, c->context), sizeof(cdr->dcontext)); + } } } diff --git a/main/pbx.c b/main/pbx.c index 22c67f4c49..068b638e42 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -516,7 +516,7 @@ int pbx_exec(struct ast_channel *c, /*!< Channel */ const char *saved_c_appl; const char *saved_c_data; - if (c->cdr && !(c->exten[0] == 'h' && c->exten[1] == 0) ) + if (c->cdr && !ast_check_hangup(c)) ast_cdr_setapp(c->cdr, app->name, data); /* save channel values */