summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorSteve Murphy <murf@digium.com>2008-07-03 17:16:44 +0000
committerSteve Murphy <murf@digium.com>2008-07-03 17:16:44 +0000
commitbc2cfb3e81cbd452f21dbaf9a131b036209fb639 (patch)
treea77cff63683081423e7cec350273f6142ec986c8 /channels
parentf99a310219314b3d13d2e78a351f19c038de0f20 (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: https://origsvn.digium.com/svn/asterisk/trunk@127793 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_dahdi.c46
-rw-r--r--channels/chan_sip.c13
2 files changed, 22 insertions, 37 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 */
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 1e5b927cf..8d6adf4f3 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -17073,19 +17073,6 @@ static int attempt_transfer(struct sip_dual *transferer, struct sip_dual *target
if (peerd)
ast_quiet_chan(peerd);
- /* Fix CDRs so they're attached to the remaining channel */
- if (peera->cdr && peerb->cdr)
- peerb->cdr = ast_cdr_append(peerb->cdr, peera->cdr);
- else if (peera->cdr)
- peerb->cdr = peera->cdr;
- peera->cdr = NULL;
-
- if (peerb->cdr && peerc->cdr)
- peerb->cdr = ast_cdr_append(peerb->cdr, peerc->cdr);
- else if (peerc->cdr)
- peerb->cdr = peerc->cdr;
- peerc->cdr = NULL;
-
ast_debug(4, "SIP transfer: trying to masquerade %s into %s\n", peerc->name, peerb->name);
if (ast_channel_masquerade(peerb, peerc)) {
ast_log(LOG_WARNING, "Failed to masquerade %s into %s\n", peerb->name, peerc->name);