aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-03 19:12:14 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-03 19:12:14 +0000
commit44455eaa6159ac321284b18d6967b03d7f3fb20d (patch)
tree512aecfd45cc7b207c980ae75620c03149811043 /channels
parenta7abb541e3c999e58a1e5c0b06642437fd20c024 (diff)
Merged revisions 127793 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r127793 | murf | 2008-07-03 11:16:44 -0600 (Thu, 03 Jul 2008) | 38 lines 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/branches/1.6.0@127830 f38db490-d61c-443f-a65b-d21fe96a405b
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 41668ac96..fb501c6eb 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -4081,18 +4081,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);
@@ -4109,18 +4097,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);
@@ -4876,7 +4852,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,
@@ -4907,6 +4895,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 e209c72c9..25df97c67 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -15827,19 +15827,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);