diff options
author | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-03 17:16:44 +0000 |
---|---|---|
committer | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-03 17:16:44 +0000 |
commit | 951887da445006e6ac705fcba33efbe320900fdc (patch) | |
tree | a77cff63683081423e7cec350273f6142ec986c8 /channels/chan_dahdi.c | |
parent | 9e8f80f3a0894a2780bfcb16b46abfc8b52295e1 (diff) |
Merged revisions 127663 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r127663 | murf | 2008-07-02 18:16:25 -0600 (Wed, 02 Jul 2008) | 30 lines
The CDRfix4/5/6 omnibus cdr fixes.
(closes issue #10927)
Reported by: murf
Tested by: murf, deeperror
(closes issue #12907)
Reported by: falves11
Tested by: murf, falves11
(closes issue #11849)
Reported by: greyvoip
As to 11849, I think these changes fix the core problems
brought up in that bug, but perhaps not the more global
problems created by the limitations of CDR's themselves
not being oriented around transfers.
Reopen if necc, but bug reports are not the best
medium for enhancement discussions. We need to start
a second-generation CDR standardization effort to cover
transfers.
(closes issue #11093)
Reported by: rossbeer
Tested by: greyvoip, murf
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@127793 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r-- | channels/chan_dahdi.c | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index af68b7c1e..b00bd239e 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -4080,18 +4080,6 @@ static int attempt_transfer(struct dahdi_pvt *p) if (p->subs[SUB_THREEWAY].owner->_state == AST_STATE_RING) { tone_zone_play_tone(p->subs[SUB_THREEWAY].zfd, DAHDI_TONE_RINGTONE); } - if (p->subs[SUB_REAL].owner->cdr) { - /* Move CDR from second channel to current one */ - p->subs[SUB_THREEWAY].owner->cdr = - ast_cdr_append(p->subs[SUB_THREEWAY].owner->cdr, p->subs[SUB_REAL].owner->cdr); - p->subs[SUB_REAL].owner->cdr = NULL; - } - if (ast_bridged_channel(p->subs[SUB_REAL].owner)->cdr) { - /* Move CDR from second channel's bridge to current one */ - p->subs[SUB_THREEWAY].owner->cdr = - ast_cdr_append(p->subs[SUB_THREEWAY].owner->cdr, ast_bridged_channel(p->subs[SUB_REAL].owner)->cdr); - ast_bridged_channel(p->subs[SUB_REAL].owner)->cdr = NULL; - } if (ast_channel_masquerade(p->subs[SUB_THREEWAY].owner, ast_bridged_channel(p->subs[SUB_REAL].owner))) { ast_log(LOG_WARNING, "Unable to masquerade %s as %s\n", ast_bridged_channel(p->subs[SUB_REAL].owner)->name, p->subs[SUB_THREEWAY].owner->name); @@ -4108,18 +4096,6 @@ static int attempt_transfer(struct dahdi_pvt *p) if (p->subs[SUB_REAL].owner->_state == AST_STATE_RING) { tone_zone_play_tone(p->subs[SUB_REAL].zfd, DAHDI_TONE_RINGTONE); } - if (p->subs[SUB_THREEWAY].owner->cdr) { - /* Move CDR from second channel to current one */ - p->subs[SUB_REAL].owner->cdr = - ast_cdr_append(p->subs[SUB_REAL].owner->cdr, p->subs[SUB_THREEWAY].owner->cdr); - p->subs[SUB_THREEWAY].owner->cdr = NULL; - } - if (ast_bridged_channel(p->subs[SUB_THREEWAY].owner)->cdr) { - /* Move CDR from second channel's bridge to current one */ - p->subs[SUB_REAL].owner->cdr = - ast_cdr_append(p->subs[SUB_REAL].owner->cdr, ast_bridged_channel(p->subs[SUB_THREEWAY].owner)->cdr); - ast_bridged_channel(p->subs[SUB_THREEWAY].owner)->cdr = NULL; - } if (ast_channel_masquerade(p->subs[SUB_REAL].owner, ast_bridged_channel(p->subs[SUB_THREEWAY].owner))) { ast_log(LOG_WARNING, "Unable to masquerade %s as %s\n", ast_bridged_channel(p->subs[SUB_THREEWAY].owner)->name, p->subs[SUB_REAL].owner->name); @@ -4855,7 +4831,19 @@ static struct ast_frame *dahdi_handle_event(struct ast_channel *ast) dahdi_enable_ec(p); ast_hangup(chan); } else { + struct ast_channel *other = ast_bridged_channel(p->subs[SUB_THREEWAY].owner); + int way3bridge = 0, cdr3way = 0; + + if (!other) { + other = ast_bridged_channel(p->subs[SUB_REAL].owner); + } else + way3bridge = 1; + + if (p->subs[SUB_THREEWAY].owner->cdr) + cdr3way = 1; + ast_verb(3, "Started three way call on channel %d\n", p->channel); + /* Start music on hold if appropriate */ if (ast_bridged_channel(p->subs[SUB_THREEWAY].owner)) { ast_queue_control_data(p->subs[SUB_THREEWAY].owner, AST_CONTROL_HOLD, @@ -4886,6 +4874,16 @@ static struct ast_frame *dahdi_handle_event(struct ast_channel *ast) if (((ast->pbx) || (ast->_state == AST_STATE_UP)) && (p->transfertobusy || (ast->_state != AST_STATE_BUSY))) { int otherindex = SUB_THREEWAY; + struct ast_channel *other = ast_bridged_channel(p->subs[SUB_THREEWAY].owner); + int way3bridge = 0, cdr3way = 0; + + if (!other) { + other = ast_bridged_channel(p->subs[SUB_REAL].owner); + } else + way3bridge = 1; + + if (p->subs[SUB_THREEWAY].owner->cdr) + cdr3way = 1; ast_verb(3, "Building conference on call on %s and %s\n", p->subs[SUB_THREEWAY].owner->name, p->subs[SUB_REAL].owner->name); /* Put them in the threeway, and flip */ |