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

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Jun 11 14:40:37 MST 2007


Author: murf
Date: Mon Jun 11 16:40:36 2007
New Revision: 68819

URL: http://svn.digium.com/view/asterisk?view=rev&rev=68819
Log:
Yanked some of the code, Now, the zap driver doesn't detach any CDR's. Everything in Scenarios 1-19 looks good, except maybe 14,15, and the park scenarios, but that is OK for now

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=68819&r1=68818&r2=68819
==============================================================================
--- team/murf/CDRfix5/channels/chan_zap.c (original)
+++ team/murf/CDRfix5/channels/chan_zap.c Mon Jun 11 16:40:36 2007
@@ -4564,7 +4564,9 @@
 						} else {
 							struct ast_channel *other = ast_bridged_channel(p->subs[SUB_THREEWAY].owner);
 							int way3bridge = 0, cdr3way = 0;
+#ifdef CDR_FIX_NOT_ANYMORE
 							struct ast_cdr *x2;
+#endif
 							
 							if (!other) {
 								other = ast_bridged_channel(p->subs[SUB_REAL].owner);
@@ -4576,7 +4578,7 @@
 							
 							if (option_verbose > 2)
 								ast_verbose(VERBOSE_PREFIX_3 "Started three way call on channel %d\n", p->channel);
-								
+#ifdef CDR_FIX_NOT_ANYMORE
 							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);
 								
@@ -4602,7 +4604,7 @@
 									p->subs[SUB_REAL].owner->cdr->answer = ast_tvnow();
 								}
 							}
-							
+#endif
 							/* 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,
@@ -4624,6 +4626,7 @@
 							swap_subs(p, SUB_THREEWAY, SUB_REAL);
 							p->owner = p->subs[SUB_REAL].owner;
 						}
+#ifdef CDR_FIX_NOT_ANYMORE
 						if (p->subs[SUB_THREEWAY].owner->cdr) {
 							struct ast_cdr *x2 = ast_cdr_dup(p->subs[SUB_THREEWAY].owner->cdr);
 							ast_cdr_end(x2);
@@ -4631,6 +4634,7 @@
 							p->subs[SUB_THREEWAY].owner->cdr->start = ast_tvnow();
 							p->subs[SUB_THREEWAY].owner->cdr->answer = ast_tvnow();
 						}
+#endif
 						/* 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);
@@ -4644,7 +4648,9 @@
 							int otherindex = SUB_THREEWAY;
 							struct ast_channel *other = ast_bridged_channel(p->subs[SUB_THREEWAY].owner);
 							int way3bridge = 0, cdr3way = 0;
+#ifdef CDR_FIX_NOT_ANYMORE
 							struct ast_cdr *x2;
+#endif
 							
 							if (!other) {
 								other = ast_bridged_channel(p->subs[SUB_REAL].owner);
@@ -4657,10 +4663,10 @@
 							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);
+#ifdef CDR_FIX_NOT_ANYMORE
 							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 */
@@ -4694,7 +4700,7 @@
 									p->subs[SUB_REAL].owner->cdr->answer = ast_tvnow();
 								}
 							}
-
+#endif
 							p->subs[SUB_THREEWAY].inthreeway = 1;
 							p->subs[SUB_REAL].inthreeway = 1;
 							if (ast->_state == AST_STATE_UP) {

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=68819&r1=68818&r2=68819
==============================================================================
--- team/murf/CDRfix5/res/res_features.c (original)
+++ team/murf/CDRfix5/res/res_features.c Mon Jun 11 16:40:36 2007
@@ -1676,7 +1676,9 @@
 	struct ast_option_header *aoh;
 	struct ast_bridge_config backup_config;
 	struct ast_cdr *bridge_cdr;
+#ifdef CDR_FIX_NOT_ANYMORE
 	struct ast_cdr *threewaycdr = 0;
+#endif
 
 	memset(&backup_config, 0, sizeof(backup_config));
 
@@ -1712,22 +1714,6 @@
 	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];
-		if (!ast_strlen_zero(chan->cdr->userfield)) {
-			snprintf(tmp, sizeof(tmp), "%s;%s", chan->cdr->userfield, peer->cdr->userfield);
-			ast_cdr_appenduserfield(chan, tmp);
-		} else
-			ast_cdr_setuserfield(chan, peer->cdr->userfield);
-		/* free the peer's cdr without ast_cdr_free complaining */
-		ast_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);
@@ -1927,6 +1913,11 @@
 
 	ast_cdr_end(bridge_cdr);
 
+#ifdef CDR_FIX_NOT_ANYMORE
+	/* I'm not going to ask the channel drivers to track transfers -- That will come with 
+	   the "new" event-based cdr system someday -- I get the main facts by just generating
+	   a CDR for a bridge. This'll simplify life considerably, I hope */
+
 	/* 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 && (strlen(chan->name) <= 8 || strcmp(chan->name+strlen(chan->name)-8 ,"<ZOMBIE>") != 0)) {
@@ -1964,7 +1955,8 @@
 			}
 		}
 	}
-	
+#endif
+
 	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)
@@ -1982,8 +1974,8 @@
 	ast_cdr_sortof_reset(chan->cdr,0);
 	ast_cdr_sortof_reset(peer->cdr,0);
 
+#ifdef OLDCDR
 	/* 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 */



More information about the asterisk-commits mailing list