[asterisk-commits] murf: branch murf/CDRfix5 r67159 - in /team/murf/CDRfix5: channels/ res/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Jun 4 16:32:22 MST 2007


Author: murf
Date: Mon Jun  4 18:32:21 2007
New Revision: 67159

URL: http://svn.digium.com/view/asterisk?view=rev&rev=67159
Log:
in midst of resolving scen. 4 and 5

Modified:
    team/murf/CDRfix5/channels/chan_zap.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=67159&r1=67158&r2=67159
==============================================================================
--- team/murf/CDRfix5/channels/chan_zap.c (original)
+++ team/murf/CDRfix5/channels/chan_zap.c Mon Jun  4 18:32:21 2007
@@ -4572,6 +4572,7 @@
 								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)) {
+								ast_verbose(VERBOSE_PREFIX_3 "Other set (%s) and has FLAG_MAIN\n", other->name);
 								
 								x2 = ast_cdr_dup(other->cdr);
 								ast_cdr_end(x2);
@@ -4579,6 +4580,8 @@
 								other->cdr->start = ast_tvnow();
 								other->cdr->answer = ast_tvnow();
 							} else {
+								ast_verbose(VERBOSE_PREFIX_3 "Other[%x] NOT set, or has NOT FLAG_MAIN\n", 
+											(unsigned int)other);
 								if (cdr3way) {
 									x2 = ast_cdr_dup(p->subs[SUB_THREEWAY].owner->cdr);
 									ast_cdr_end(x2);

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=67159&r1=67158&r2=67159
==============================================================================
--- team/murf/CDRfix5/res/res_features.c (original)
+++ team/murf/CDRfix5/res/res_features.c Mon Jun  4 18:32:21 2007
@@ -1736,10 +1736,8 @@
 	ast_copy_string(orig_channame,chan->name,sizeof(orig_channame));
 	ast_copy_string(orig_peername,peer->name,sizeof(orig_peername));
 	
-	if (chan->cdr)
+	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) */
@@ -1931,10 +1929,18 @@
 	/* 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_verbose(VERBOSE_PREFIX_3 "EO Bridge: Chan name changed. %s -> %s\n", orig_channame, chan->name);
+
 		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->cdr && strcmp(orig_channame,chan->name) != 0 && !chan->masqr) { /* for when bridge ends after only 1 HF (blind assisted xfer) */
+		ast_verbose(VERBOSE_PREFIX_3 "Chan name change: blind xfer implied, reset start/answer\n");
+		bridge_cdr->start = chan->cdr->start;
+		bridge_cdr->answer = chan->cdr->start; /* the answer time got zeroed?!? */
 	}
 	
 	if (chan->masqr) {
@@ -1942,11 +1948,13 @@
 		for (threewaycdr = chan->masqr->cdr; threewaycdr; threewaycdr=threewaycdr->next)
 		{
 			if (strcmp(threewaycdr->lastapp,"3WAY")==0) {
+				ast_verbose(VERBOSE_PREFIX_3 "Masq: 3WAY found\n");
 				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);
+				break;
 			}
 		}
 	}



More information about the asterisk-commits mailing list