Index: include/asterisk/cdr.h =================================================================== --- include/asterisk/cdr.h (revision 61670) +++ include/asterisk/cdr.h (working copy) @@ -29,6 +29,7 @@ #define AST_CDR_FLAG_LOCKED (1 << 2) #define AST_CDR_FLAG_CHILD (1 << 3) #define AST_CDR_FLAG_POST_DISABLED (1 << 4) +#define AST_CDR_FLAG_HUNGUP (1 << 5) #define AST_CDR_NOANSWER (1 << 0) #define AST_CDR_BUSY (1 << 1) Index: main/cdr.c =================================================================== --- main/cdr.c (revision 61670) +++ main/cdr.c (working copy) @@ -880,8 +880,10 @@ /* 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_test_flag(cdr, AST_CDR_FLAG_HUNGUP)) { + 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)); + } } } Index: main/pbx.c =================================================================== --- main/pbx.c (revision 61670) +++ main/pbx.c (working copy) @@ -2504,6 +2504,7 @@ if (!found && !error) ast_log(LOG_WARNING, "Don't know what to do with '%s'\n", c->name); if ((res != AST_PBX_KEEPALIVE) && ast_exists_extension(c, c->context, "h", 1, c->cid.cid_num)) { + ast_set_flag(c->cdr, AST_CDR_FLAG_HUNGUP); if (c->cdr && ast_opt_end_cdr_before_h_exten) ast_cdr_end(c->cdr); set_ext_pri(c, "h", 1);