diff options
author | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-10 05:18:26 +0000 |
---|---|---|
committer | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-10 05:18:26 +0000 |
commit | a6c0a8e6eac6cb7b63c57b08c8cfc5c943722df3 (patch) | |
tree | 3fddefc90fa88ec4c202425e29e32bbea743ae34 /res | |
parent | 12ed3782802cb4a44d421e334bc9a7fc4f6e46c8 (diff) |
Finished up a previous fix to overcome a compiler warning; the app NoCDR() has been updated to mark the channel CDR as POST_DISABLED instead of destroying the CDR; this way its flags are propagated thru a bridge and the CDR is actually dropped. The cases where only one channel in a bridge has a CDR was cleaned up.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@61136 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_features.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/res/res_features.c b/res/res_features.c index 16139c43f..4adb9eab0 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -1436,8 +1436,6 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast } if (res < 0) { ast_log(LOG_WARNING, "Bridge failed on channels %s and %s\n", chan->name, peer->name); - chan->cdr = NULL; - peer->cdr = NULL; return -1; } @@ -1532,10 +1530,10 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast /* arrange the cdrs */ bridge_cdr = ast_cdr_alloc(); if (bridge_cdr) { - ast_log(LOG_NOTICE,"merging the bridged CDRs\n"); - ast_cdr_init(bridge_cdr,chan); /* seems more logicaller to use the destination as a base, but, really, it's random */ if (chan->cdr && peer->cdr) { /* both of them? merge */ + ast_cdr_init(bridge_cdr,chan); /* seems more logicaller to use the destination as a base, but, really, it's random */ ast_cdr_start(bridge_cdr); /* now is the time to start */ + /* absorb the channel cdr */ ast_cdr_merge(bridge_cdr, chan->cdr); ast_cdr_discard(chan->cdr); /* no posting these guys */ @@ -1548,27 +1546,17 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast } else if (chan->cdr) { /* take the cdr from the channel - literally */ ast_cdr_init(bridge_cdr,chan); - if (chan->cdr->disposition==AST_CDR_ANSWERED) { - ast_cdr_end(chan->cdr); - ast_cdr_detach(chan->cdr); /* post the existing cdr, we will be starting a fresh new cdr presently */ - } else { - /* absorb this data */ - ast_cdr_merge(bridge_cdr, chan->cdr); - ast_cdr_discard(chan->cdr); /* no posting these guys */ - } + /* absorb this data */ + ast_cdr_merge(bridge_cdr, chan->cdr); + ast_cdr_discard(chan->cdr); /* no posting these guys */ chan->cdr = bridge_cdr; /* make this available to the rest of the world via the chan while the call is in progress */ } else if (peer->cdr) { /* take the cdr from the peer - literally */ ast_cdr_init(bridge_cdr,peer); - if (peer->cdr->disposition == AST_CDR_ANSWERED) { - ast_cdr_end(peer->cdr); - ast_cdr_detach(peer->cdr); /* post the existing cdr, we will be starting a fresh new cdr presently */ - } else { - /* absorb this data */ - ast_cdr_merge(bridge_cdr, peer->cdr); - ast_cdr_discard(peer->cdr); /* no posting these guys */ - peer->cdr = NULL; - } + /* absorb this data */ + ast_cdr_merge(bridge_cdr, peer->cdr); + ast_cdr_discard(peer->cdr); /* no posting these guys */ + peer->cdr = NULL; peer->cdr = bridge_cdr; /* make this available to the rest of the world via the chan while the call is in progress */ } else { /* make up a new cdr */ |