aboutsummaryrefslogtreecommitdiffstats
path: root/main/cdr.c
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-21 13:00:39 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-21 13:00:39 +0000
commit7126d5f7a9dbde4cdb7e0b2713fb3b8e9130c871 (patch)
tree8b5f1ae4518038a97c20bbcce44a43493ab6cf7d /main/cdr.c
parent46864467526e2f426b758d2f2e01e2604e5f4ce5 (diff)
Via complaints aired in asterisk-users, I submit these changes, which allow cdr updates to see macro context/exten, whether hung up or not
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@70656 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/cdr.c')
-rw-r--r--main/cdr.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/main/cdr.c b/main/cdr.c
index baa1165f8..f5693e6c6 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -772,8 +772,8 @@ int ast_cdr_init(struct ast_cdr *cdr, struct ast_channel *c)
cdr->amaflags = c->amaflags ? c->amaflags : ast_default_amaflags;
ast_copy_string(cdr->accountcode, c->accountcode, sizeof(cdr->accountcode));
/* Destination information */
- ast_copy_string(cdr->dst, c->exten, sizeof(cdr->dst));
- ast_copy_string(cdr->dcontext, c->context, sizeof(cdr->dcontext));
+ 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));
/* Unique call identifier */
ast_copy_string(cdr->uniqueid, c->uniqueid, sizeof(cdr->uniqueid));
}
@@ -888,11 +888,10 @@ int ast_cdr_update(struct ast_channel *c)
/* Copy account code et-al */
ast_copy_string(cdr->accountcode, c->accountcode, sizeof(cdr->accountcode));
- 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));
- }
+
+ /* 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));
}
}