[asterisk-commits] murf: branch murf/CDRfix5 r66978 - in /team/murf/CDRfix5: channels/ include/a...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Jun 1 19:42:54 MST 2007


Author: murf
Date: Fri Jun  1 21:42:53 2007
New Revision: 66978

URL: http://svn.digium.com/view/asterisk?view=rev&rev=66978
Log:
Checkpoint commit. Scenarios 1-5 report sensible results... 14 scenarios to go (the number keeps growing)

Modified:
    team/murf/CDRfix5/channels/chan_zap.c
    team/murf/CDRfix5/include/asterisk/cdr.h
    team/murf/CDRfix5/main/cdr.c
    team/murf/CDRfix5/main/channel.c
    team/murf/CDRfix5/main/pbx.c
    team/murf/CDRfix5/res/res_features.c

Modified: team/murf/CDRfix5/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/murf/CDRfix5/channels/chan_zap.c?view=diff&rev=66978&r1=66977&r2=66978
==============================================================================
--- team/murf/CDRfix5/channels/chan_zap.c (original)
+++ team/murf/CDRfix5/channels/chan_zap.c Fri Jun  1 21:42:53 2007
@@ -4556,8 +4556,44 @@
 							zt_enable_ec(p);
 							ast_hangup(chan);
 						} else {
-							if (option_verbose > 2)	
+							struct ast_channel *other = ast_bridged_channel(p->subs[SUB_THREEWAY].owner);
+							int way3bridge = 0, cdr3way = 0;
+							struct ast_cdr *x2;
+							
+							if (!other) {
+								other = ast_bridged_channel(p->subs[SUB_REAL].owner);
+							} else
+								way3bridge = 1;
+							
+							if (p->subs[SUB_THREEWAY].owner->cdr)
+								cdr3way = 1;
+							
+							if (option_verbose > 2)
 								ast_verbose(VERBOSE_PREFIX_3 "Started three way call on channel %d\n", p->channel);
+								
+							if (other && other->cdr && ast_test_flag(other->cdr, AST_CDR_FLAG_MAIN)) {
+								
+								x2 = ast_cdr_dup(other->cdr);
+								ast_cdr_end(x2);
+								ast_cdr_detach(x2);
+								other->cdr->start = ast_tvnow();
+								other->cdr->answer = ast_tvnow();
+							} else {
+								if (cdr3way) {
+									x2 = ast_cdr_dup(p->subs[SUB_THREEWAY].owner->cdr);
+									ast_cdr_end(x2);
+									ast_cdr_detach(x2);
+									p->subs[SUB_THREEWAY].owner->cdr->start = ast_tvnow();
+									p->subs[SUB_THREEWAY].owner->cdr->answer = ast_tvnow();
+								} else {
+									x2 = ast_cdr_dup(p->subs[SUB_REAL].owner->cdr);
+									ast_cdr_end(x2);
+									ast_cdr_detach(x2);
+									p->subs[SUB_REAL].owner->cdr->start = ast_tvnow();
+									p->subs[SUB_REAL].owner->cdr->answer = ast_tvnow();
+								}
+							}
+							
 							/* 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,
@@ -4579,6 +4615,13 @@
 							swap_subs(p, SUB_THREEWAY, SUB_REAL);
 							p->owner = p->subs[SUB_REAL].owner;
 						}
+						if (p->subs[SUB_THREEWAY].owner->cdr) {
+							struct ast_cdr *x2 = ast_cdr_dup(p->subs[SUB_THREEWAY].owner->cdr);
+							ast_cdr_end(x2);
+							ast_cdr_detach(x2);
+							p->subs[SUB_THREEWAY].owner->cdr->start = ast_tvnow();
+							p->subs[SUB_THREEWAY].owner->cdr->answer = ast_tvnow();
+						}
 						/* Drop the last call and stop the conference */
 						if (option_verbose > 2)
 							ast_verbose(VERBOSE_PREFIX_3 "Dropping three-way call on %s\n", p->subs[SUB_THREEWAY].owner->name);
@@ -4590,10 +4633,59 @@
 						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;
+							struct ast_cdr *x2;
+							
+							if (!other) {
+								other = ast_bridged_channel(p->subs[SUB_REAL].owner);
+							} else
+								way3bridge = 1;
+							
+							if (p->subs[SUB_THREEWAY].owner->cdr)
+								cdr3way = 1;
 
 							if (option_verbose > 2)
-								ast_verbose(VERBOSE_PREFIX_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 */
+								ast_verbose(VERBOSE_PREFIX_3 "Building conference on call on %s and %s\n",
+											p->subs[SUB_THREEWAY].owner->name, p->subs[SUB_REAL].owner->name);
+							if (other)
+								ast_verbose(VERBOSE_PREFIX_3 "way3bridge is %d, and bridged to %s\n",
+											way3bridge, other->name);
+
+							if (other && other->cdr && ast_test_flag(other->cdr, AST_CDR_FLAG_MAIN)) {
+								x2 = ast_cdr_dup(other->cdr);
+								strcpy(x2->lastapp,"MOH"); /* it turns out, that this CDR would time from HF1 to HF2 */
+								strcpy(x2->lastdata,"");
+								ast_cdr_end(x2);
+								ast_cdr_detach(x2);
+								strcpy(other->cdr->lastapp,"3WAY"); /* it turns out, that this CDR would time from HF1 to HF2 */
+								ast_copy_string(other->cdr->lastdata,p->subs[SUB_THREEWAY].owner->name,sizeof(other->cdr->lastdata));
+								other->cdr->start = ast_tvnow();
+								other->cdr->answer = ast_tvnow();
+							} else {
+								if (cdr3way) {
+									x2 = ast_cdr_dup(p->subs[SUB_THREEWAY].owner->cdr);
+									strcpy(x2->lastapp,"MOH"); /* it turns out, that this CDR would time from HF1 to HF2 */
+									strcpy(x2->lastdata,"");
+									ast_cdr_end(x2);
+									ast_cdr_detach(x2);
+									strcpy(p->subs[SUB_THREEWAY].owner->cdr->lastapp,"3WAY"); /* it turns out, that this CDR would time from HF1 to HF2 */
+									ast_copy_string(p->subs[SUB_THREEWAY].owner->cdr->lastdata,p->subs[SUB_THREEWAY].owner->name,sizeof(p->subs[SUB_THREEWAY].owner->cdr->lastdata));
+									p->subs[SUB_THREEWAY].owner->cdr->start = ast_tvnow();
+									p->subs[SUB_THREEWAY].owner->cdr->answer = ast_tvnow();
+								} else {
+									x2 = ast_cdr_dup(p->subs[SUB_REAL].owner->cdr);
+									strcpy(x2->lastapp,"MOH"); /* it turns out, that this CDR would time from HF1 to HF2 */
+									strcpy(x2->lastdata,"");
+									ast_cdr_end(x2);
+									ast_cdr_detach(x2);
+									strcpy(p->subs[SUB_REAL].owner->cdr->lastapp,"3WAY"); /* it turns out, that this CDR would time from HF1 to HF2 */
+									ast_copy_string(p->subs[SUB_REAL].owner->cdr->lastdata,p->subs[SUB_THREEWAY].owner->name,sizeof(p->subs[SUB_REAL].owner->cdr->lastdata));
+									p->subs[SUB_REAL].owner->cdr->start = ast_tvnow();
+									p->subs[SUB_REAL].owner->cdr->answer = ast_tvnow();
+								}
+							}
+
 							p->subs[SUB_THREEWAY].inthreeway = 1;
 							p->subs[SUB_REAL].inthreeway = 1;
 							if (ast->_state == AST_STATE_UP) {

Modified: team/murf/CDRfix5/include/asterisk/cdr.h
URL: http://svn.digium.com/view/asterisk/team/murf/CDRfix5/include/asterisk/cdr.h?view=diff&rev=66978&r1=66977&r2=66978
==============================================================================
--- team/murf/CDRfix5/include/asterisk/cdr.h (original)
+++ team/murf/CDRfix5/include/asterisk/cdr.h Fri Jun  1 21:42:53 2007
@@ -29,6 +29,7 @@
 #define AST_CDR_FLAG_LOCKED			(1 << 2)
 #define AST_CDR_FLAG_CHILD			(1 << 3)
 #define AST_CDR_FLAG_POST_DISABLED		(1 << 4)
+#define AST_CDR_FLAG_MAIN		(1 << 5)
 
 #define AST_CDR_NULL                0
 #define AST_CDR_FAILED				(1 << 0)
@@ -275,6 +276,14 @@
  */
 void ast_cdr_reset(struct ast_cdr *cdr, struct ast_flags *flags);
 
+/*! Reset the detail record times, flags */
+/*!
+ * \param cdr which cdr to act upon
+ * \param flags |AST_CDR_FLAG_POSTED whether or not to post the cdr first before resetting it
+ *              |AST_CDR_FLAG_LOCKED whether or not to reset locked CDR's
+ */
+void ast_cdr_sortof_reset(struct ast_cdr *cdr, struct ast_flags *flags);
+
 /*! Flags to a string */
 /*!
  * \param flags binary flag

Modified: team/murf/CDRfix5/main/cdr.c
URL: http://svn.digium.com/view/asterisk/team/murf/CDRfix5/main/cdr.c?view=diff&rev=66978&r1=66977&r2=66978
==============================================================================
--- team/murf/CDRfix5/main/cdr.c (original)
+++ team/murf/CDRfix5/main/cdr.c Fri Jun  1 21:42:53 2007
@@ -754,7 +754,7 @@
 int ast_cdr_setcid(struct ast_cdr *cdr, struct ast_channel *c)
 {
 	for (; cdr; cdr = cdr->next) {
-		if (ast_test_flag(cdr, AST_CDR_FLAG_LOCKED))
+		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) /* I may be shooting myself here, but why on earth would we ever want to just the cid's of locked CDR's ???? */
 			set_one_cid(cdr, c);
 	}
 	return 0;
@@ -892,7 +892,7 @@
 
 			/* Copy account code et-al */	
 			ast_copy_string(cdr->accountcode, c->accountcode, sizeof(cdr->accountcode));
-			if (!ast_check_hangup(c)) {
+			if (!ast_check_hangup(c) && strcmp(S_OR(c->macroexten, c->exten),"h") != 0) {
 				/* 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));
@@ -975,6 +975,31 @@
 		}
 	}
 }
+
+void ast_cdr_sortof_reset(struct ast_cdr *cdr, struct ast_flags *_flags)
+{
+	struct ast_flags flags = { 0 };
+
+	if (_flags)
+		ast_copy_flags(&flags, _flags, AST_FLAGS_ALL);
+
+	for ( ; cdr ; cdr = cdr->next) {
+		/* Detach if post is requested */
+		if (ast_test_flag(&flags, AST_CDR_FLAG_LOCKED) || !ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
+
+			/* Reset to initial state */
+			ast_clear_flag(cdr, AST_FLAGS_ALL);	
+			memset(&cdr->start, 0, sizeof(cdr->start));
+			memset(&cdr->end, 0, sizeof(cdr->end));
+			memset(&cdr->answer, 0, sizeof(cdr->answer));
+			cdr->billsec = 0;
+			cdr->duration = 0;
+			ast_cdr_start(cdr);
+			cdr->disposition = AST_CDR_NULL;
+		}
+	}
+}
+
 
 struct ast_cdr *ast_cdr_append(struct ast_cdr *cdr, struct ast_cdr *newcdr) 
 {

Modified: team/murf/CDRfix5/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/murf/CDRfix5/main/channel.c?view=diff&rev=66978&r1=66977&r2=66978
==============================================================================
--- team/murf/CDRfix5/main/channel.c (original)
+++ team/murf/CDRfix5/main/channel.c Fri Jun  1 21:42:53 2007
@@ -1647,11 +1647,13 @@
 			chan->generator->release(chan, chan->generatordata);
 	chan->generatordata = NULL;
 	chan->generator = NULL;
+#ifdef OLDCDR
 	if (chan->cdr) {		/* End the CDR if it hasn't already */
 		ast_cdr_end(chan->cdr);
 		ast_cdr_detach(chan->cdr);	/* Post and Free the CDR */
 		chan->cdr = NULL;
 	}
+#endif
 	if (ast_test_flag(chan, AST_FLAG_BLOCKING)) {
 		ast_log(LOG_WARNING, "Hard hangup called by thread %ld on %s, while fd "
 					"is blocked by thread %ld in procedure %s!  Expect a failure\n",

Modified: team/murf/CDRfix5/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/murf/CDRfix5/main/pbx.c?view=diff&rev=66978&r1=66977&r2=66978
==============================================================================
--- team/murf/CDRfix5/main/pbx.c (original)
+++ team/murf/CDRfix5/main/pbx.c Fri Jun  1 21:42:53 2007
@@ -542,7 +542,7 @@
 	const char *saved_c_appl;
 	const char *saved_c_data;
 
-	if (c->cdr &&  !ast_check_hangup(c))
+	if (c->cdr &&  !ast_check_hangup(c) && strcmp(c->exten,"h") != 0)
 		ast_cdr_setapp(c->cdr, app->name, data);
 
 	/* save channel values */

Modified: team/murf/CDRfix5/res/res_features.c
URL: http://svn.digium.com/view/asterisk/team/murf/CDRfix5/res/res_features.c?view=diff&rev=66978&r1=66977&r2=66978
==============================================================================
--- team/murf/CDRfix5/res/res_features.c (original)
+++ team/murf/CDRfix5/res/res_features.c Fri Jun  1 21:42:53 2007
@@ -1614,6 +1614,50 @@
 	return chan;
 }
 
+void ast_cdr_log(char *title, struct ast_cdr *cdr);
+
+void ast_cdr_log(char *title, struct ast_cdr *cdr)
+{
+	if (!cdr) {
+		ast_log(LOG_NOTICE, "===== %s ==== NO CDR!!!\n", title);
+		return;
+	}
+	
+	ast_log(LOG_NOTICE, "===== %s ====\n", title);
+	ast_log(LOG_NOTICE, "CDR: clid: %s;  src: %s;  dst: %s; dcontext: %s;\n",
+			cdr->clid, cdr->src, cdr->dst, cdr->dcontext);
+	ast_log(LOG_NOTICE, "CDR: channel: %s;  dstchannel: %s;  lastapp: %s; lastdata: %s;\n",
+			cdr->channel, cdr->dstchannel, cdr->lastapp, cdr->lastdata);
+	ast_log(LOG_NOTICE, "CDR: start: %d;  answer: %d;  end: %d;\n",
+			(int)cdr->start.tv_sec, (int)cdr->answer.tv_sec, (int)cdr->end.tv_sec);
+	ast_log(LOG_NOTICE, "CDR: duration: %ld;  billsec: %ld;  disposition: %ld; amaflags: %ld;\n",
+			cdr->duration, cdr->billsec, cdr->disposition, cdr->amaflags);
+	ast_log(LOG_NOTICE, "CDR: acctcode: %s;  flags: %x;  uniqueid: %s; userfield: %s;\n",
+			cdr->accountcode, cdr->flags, cdr->uniqueid, cdr->userfield);
+	ast_log(LOG_NOTICE, "CDR: next: %x;\n",
+			(unsigned int)cdr->next);
+	ast_log(LOG_NOTICE, "===== done ====\n");
+}
+
+
+void ast_channel_log(char *title, struct ast_channel *chan);
+
+void ast_channel_log(char *title, struct ast_channel *chan)
+{
+	ast_log(LOG_NOTICE, "______ %s ______\n", title);
+	ast_log(LOG_NOTICE, "CHAN: name: %s;  appl: %s; data: %s; contxt: %s;  exten: %s; pri: %d;\n",
+			chan->name, chan->appl, chan->data, chan->context, chan->exten, chan->priority);
+	ast_log(LOG_NOTICE, "CHAN: acctcode: %s;  dialcontext: %s; amaflags: %x; maccontxt: %s;  macexten: %s; macpri: %d;\n",
+			chan->accountcode, chan->dialcontext, chan->amaflags, chan->macrocontext, chan->macroexten, chan->macropriority);
+	ast_log(LOG_NOTICE, "CHAN: masq: %x;  masqr: %x; _bridge: %x; uniqueID: %s;\n",
+			(unsigned int)chan->masq, (unsigned int)chan->masqr, (unsigned int)chan->_bridge, chan->uniqueid);
+	if (chan->masqr)
+		ast_log(LOG_NOTICE, "CHAN: masquerading as: %s;  cdr: %x;\n",
+				chan->masqr->name, (unsigned int)chan->masqr->cdr);
+		
+	ast_log(LOG_NOTICE, "===== done ====\n");
+}
+
 int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast_bridge_config *config)
 {
 	/* Copy voice back and forth between the two channels.  Give the peer
@@ -1622,6 +1666,8 @@
 	struct ast_channel *who;
 	char chan_featurecode[FEATURE_MAX_LEN + 1]="";
 	char peer_featurecode[FEATURE_MAX_LEN + 1]="";
+	char orig_channame[AST_MAX_EXTENSION];
+	char orig_peername[AST_MAX_EXTENSION];
 	int res;
 	int diff;
 	int hasfeatures=0;
@@ -1629,6 +1675,7 @@
 	struct ast_option_header *aoh;
 	struct ast_bridge_config backup_config;
 	struct ast_cdr *bridge_cdr;
+	struct ast_cdr *threewaycdr = 0;
 
 	memset(&backup_config, 0, sizeof(backup_config));
 
@@ -1663,9 +1710,10 @@
 	/* Answer if need be */
 	if (ast_answer(chan))
 		return -1;
+
+#ifdef CDR_OLD
 	peer->appl = "Bridged Call";
 	peer->data = chan->name;
-
 	/* copy the userfield from the B-leg to A-leg if applicable */
 	if (chan->cdr && peer->cdr && !ast_strlen_zero(peer->cdr->userfield)) {
 		char tmp[256];
@@ -1678,7 +1726,47 @@
 		free(peer->cdr);
 		peer->cdr = NULL;
 	}
-
+#endif
+	/* show the two channels and cdrs involved in the bridge for debug & devel purposes */
+	ast_channel_log("Pre-bridge CHAN Channel info", chan);
+	ast_channel_log("Pre-bridge PEER Channel info", peer);
+	ast_cdr_log("CDR attached to CHAN", chan->cdr);
+	ast_cdr_log("CDR attached to PEER", peer->cdr);
+
+	ast_copy_string(orig_channame,chan->name,sizeof(orig_channame));
+	ast_copy_string(orig_peername,peer->name,sizeof(orig_peername));
+	
+	if (chan->cdr)
+		ast_set_flag(chan->cdr, AST_CDR_FLAG_MAIN);
+	
+	if (chan->cdr) {
+		bridge_cdr = ast_cdr_dup(chan->cdr);
+	} else {
+		/* better yet, in a xfer situation, find out why the chan cdr got zapped (pun unintentional) */
+		bridge_cdr = ast_cdr_alloc(); /* this should be really, really rare/impossible? */
+		ast_copy_string(bridge_cdr->channel, chan->name, sizeof(bridge_cdr->channel));
+		ast_copy_string(bridge_cdr->dstchannel, peer->name, sizeof(bridge_cdr->dstchannel));
+		ast_copy_string(bridge_cdr->uniqueid, chan->uniqueid, sizeof(bridge_cdr->uniqueid));
+		ast_copy_string(bridge_cdr->lastapp, chan->appl, sizeof(bridge_cdr->lastapp));
+		ast_copy_string(bridge_cdr->lastdata, chan->data, sizeof(bridge_cdr->lastdata));
+		ast_cdr_setcid(bridge_cdr, chan);
+		bridge_cdr->disposition = (chan->_state == AST_STATE_UP) ?  AST_CDR_ANSWERED : AST_CDR_NULL;
+		bridge_cdr->amaflags = chan->amaflags ? chan->amaflags :  ast_default_amaflags;
+		ast_copy_string(bridge_cdr->accountcode, chan->accountcode, sizeof(bridge_cdr->accountcode));
+		/* Destination information */
+		ast_copy_string(bridge_cdr->dst, chan->exten, sizeof(bridge_cdr->dst));
+		ast_copy_string(bridge_cdr->dcontext, chan->context, sizeof(bridge_cdr->dcontext));
+		if (peer->cdr) {
+			bridge_cdr->start = peer->cdr->start;
+			ast_copy_string(bridge_cdr->userfield, peer->cdr->userfield, sizeof(bridge_cdr->userfield));
+		} else {
+			ast_cdr_start(bridge_cdr);
+		}
+	}
+
+	ast_cdr_answer(bridge_cdr);
+	
+	
 	for (;;) {
 		struct ast_channel *other;	/* used later */
 
@@ -1835,7 +1923,53 @@
 			ast_frfree(f);
 
 	}
-	/* arrange the cdrs */
+	ast_channel_log("XXXXXXXXXXX  Post-bridge CHAN Channel info XXXXXXXXXXX", chan);
+	ast_channel_log("XXXXXXXXXXX  Post-bridge PEER Channel info XXXXXXXXXXX", peer);
+
+	ast_cdr_end(bridge_cdr);
+
+	/* last minute mods -- a transfer will change the CHAN to point to a different
+	   channel; recopy the src, clid info for CHAN into the bridge cdr now */
+	if (strcmp(orig_channame,chan->name) != 0) {
+		ast_copy_string(bridge_cdr->channel, chan->name, sizeof(bridge_cdr->channel));
+		ast_copy_string(bridge_cdr->uniqueid, chan->uniqueid, sizeof(bridge_cdr->uniqueid));
+		ast_cdr_setcid(bridge_cdr, chan);
+		ast_copy_string(bridge_cdr->accountcode, chan->accountcode, sizeof(bridge_cdr->accountcode));
+	}
+	
+	if (chan->masqr) {
+		/* push threewaycdr to the end of the list */
+		for (threewaycdr = chan->masqr->cdr; threewaycdr; threewaycdr=threewaycdr->next)
+		{
+			if (strcmp(threewaycdr->lastapp,"3WAY")==0) {
+				strcpy(bridge_cdr->lastapp, threewaycdr->lastapp);
+				strcpy(bridge_cdr->lastdata, threewaycdr->lastdata);
+				bridge_cdr->start = threewaycdr->start;
+				bridge_cdr->answer = threewaycdr->answer;
+				strcpy(bridge_cdr->uniqueid, threewaycdr->uniqueid);
+			}
+		}
+	}
+	
+	ast_cdr_log("Closing CDR attached to CHAN", chan->cdr);
+	ast_cdr_log("Closing CDR attached to PEER", peer->cdr);
+	if (chan->masqr && chan->masqr->cdr)
+		ast_cdr_log("Closing CDR attached to Masqueraded CHAN", chan->masqr->cdr);
+	if (chan->masqr && chan->masqr->cdr && chan->masqr->cdr->next)
+		ast_cdr_log("Closing NEXT CDR attached to Masqueraded CHAN", chan->masqr->cdr->next);
+	if (chan->masqr && chan->masqr->cdr && chan->masqr->cdr->next && chan->masqr->cdr->next->next)
+		ast_cdr_log("Closing NEXT NEXT CDR attached to Masqueraded CHAN", chan->masqr->cdr->next->next);
+	if (chan->masqr && chan->masqr->cdr && chan->masqr->cdr->next && chan->masqr->cdr->next->next && chan->masqr->cdr->next->next->next)
+		ast_cdr_log("Closing NEXT NEXT NEXT CDR attached to Masqueraded CHAN", chan->masqr->cdr->next->next->next);
+
+	ast_cdr_detach(bridge_cdr);
+
+	/* just in case, these channels get bridged again before hangup */
+	ast_cdr_sortof_reset(chan->cdr,0);
+	ast_cdr_sortof_reset(peer->cdr,0);
+
+	/* arrange the cdrs: thoughts: leave CDRS in place, use a third cdr to publish; re-init the two cdrs, except for some items...*/
+#ifdef OLDCDR
 	bridge_cdr = ast_cdr_alloc();
 	if (bridge_cdr) {
 		if (chan->cdr && peer->cdr) { /* both of them? merge */
@@ -1878,6 +2012,7 @@
 				ast_cdr_setdestchan(bridge_cdr, chan->name);
 		}
 	}
+#endif
 	return res;
 }
 



More information about the asterisk-commits mailing list