[asterisk-commits] murf: branch murf/bug8221-1.4 r48289 - in /team/murf/bug8221-1.4: apps/ chann...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Dec 5 21:06:11 MST 2006


Author: murf
Date: Tue Dec  5 22:06:10 2006
New Revision: 48289

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48289
Log:
Added some more debug for the inevitable complaints I'll get from testers about unwanted CDRs.

Modified:
    team/murf/bug8221-1.4/apps/app_followme.c
    team/murf/bug8221-1.4/channels/chan_agent.c
    team/murf/bug8221-1.4/main/pbx.c
    team/murf/bug8221-1.4/res/res_features.c
    team/murf/bug8221-1.4/res/res_monitor.c

Modified: team/murf/bug8221-1.4/apps/app_followme.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221-1.4/apps/app_followme.c?view=diff&rev=48289&r1=48288&r2=48289
==============================================================================
--- team/murf/bug8221-1.4/apps/app_followme.c (original)
+++ team/murf/bug8221-1.4/apps/app_followme.c Tue Dec  5 22:06:10 2006
@@ -433,6 +433,7 @@
 		outbound = tmpuser->ochan;
 		if (!outbound->cdr) {
 			outbound->cdr = ast_cdr_alloc();
+			ast_log(LOG_NOTICE, "CREATED CDR in follome/clear_caller1....\n");
 			if (outbound->cdr)
 				ast_cdr_init(outbound->cdr, outbound);
 		}
@@ -835,8 +836,10 @@
 					if (option_verbose > 2) 
 						ast_verbose(VERBOSE_PREFIX_3 "couldn't reach at this number.\n"); 
 					if (outbound) {
-						if (!outbound->cdr) 
+						if (!outbound->cdr) { 
 							outbound->cdr = ast_cdr_alloc();
+							ast_log(LOG_NOTICE, "CREATED CDR in follome/exec....\n");
+						}
 						if (outbound->cdr) {
 							char tmp[256];
 

Modified: team/murf/bug8221-1.4/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221-1.4/channels/chan_agent.c?view=diff&rev=48289&r1=48288&r2=48289
==============================================================================
--- team/murf/bug8221-1.4/channels/chan_agent.c (original)
+++ team/murf/bug8221-1.4/channels/chan_agent.c Tue Dec  5 22:06:10 2006
@@ -417,8 +417,10 @@
 #if 0
 		ast_verbose("name is %s, link is %s\n",tmp, tmp2);
 #endif
-		if (!ast->cdr)
+		if (!ast->cdr) {
 			ast->cdr = ast_cdr_alloc();
+			ast_log(LOG_NOTICE, "CREATED CDR in chan_agent....\n");
+		}
 		ast_cdr_setuserfield(ast, tmp2);
 		res = 0;
 	} else

Modified: team/murf/bug8221-1.4/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221-1.4/main/pbx.c?view=diff&rev=48289&r1=48288&r2=48289
==============================================================================
--- team/murf/bug8221-1.4/main/pbx.c (original)
+++ team/murf/bug8221-1.4/main/pbx.c Tue Dec  5 22:06:10 2006
@@ -2300,6 +2300,7 @@
 	if (c->amaflags) {
 		if (!c->cdr) {
 			c->cdr = ast_cdr_alloc();
+			ast_log(LOG_NOTICE, "=====__PBX_RUN ALLOCS CHANNEL CDR for %s\n", c->name);
 			if (!c->cdr) {
 				ast_log(LOG_WARNING, "Unable to create Call Detail Record\n");
 				free(c->pbx);
@@ -4889,7 +4890,10 @@
 	if (!chan)
 		return -1;  /* failure */
 
-	chan->cdr = ast_cdr_alloc();   /* allocate a cdr for the channel */
+	if (!chan->cdr) {
+		chan->cdr = ast_cdr_alloc();   /* allocate a cdr for the channel */
+		ast_log(LOG_NOTICE, "=====PBX_OUTGOING_CDR_FAILED ALLOCS CHANNEL CDR for %s\n", chan->name);
+	}
 
 	if (!chan->cdr) {
 		/* allocation of the cdr failed */
@@ -4929,6 +4933,7 @@
 				ast_log(LOG_WARNING, "%s already has a call record??\n", chan->name);
 			} else {
 				chan->cdr = ast_cdr_alloc();   /* allocate a cdr for the channel */
+				ast_log(LOG_NOTICE, "====CDR Allocated via ast_variable for chan %s\n", chan->name);
 				if (!chan->cdr) {
 					/* allocation of the cdr failed */
 					free(chan->pbx);
@@ -5101,6 +5106,7 @@
 				ast_log(LOG_WARNING, "%s already has a call record??\n", chan->name);
 			} else {
 				chan->cdr = ast_cdr_alloc();   /* allocate a cdr for the channel */
+				ast_log(LOG_NOTICE, "====CDR Allocated via PBX_OUTGOING_APP for chan %s\n", chan->name);
 				if(!chan->cdr) {
 					/* allocation of the cdr failed */
 					free(chan->pbx);

Modified: team/murf/bug8221-1.4/res/res_features.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221-1.4/res/res_features.c?view=diff&rev=48289&r1=48288&r2=48289
==============================================================================
--- team/murf/bug8221-1.4/res/res_features.c (original)
+++ team/murf/bug8221-1.4/res/res_features.c Tue Dec  5 22:06:10 2006
@@ -1142,7 +1142,7 @@
 			chan->cdr=ast_cdr_alloc();
 			ast_cdr_init(chan->cdr, chan); /* initilize our channel's cdr */
 			ast_cdr_start(chan->cdr);
-			ast_log(LOG_NOTICE,"Creating cdr in channel %s:%x\n", chan->name, (int)chan->cdr);
+			ast_log(LOG_NOTICE,"=====Creating cdr in channel %s:%x\n", chan->name, (int)chan->cdr);
 		}
 			
 		if (!ast_call(chan, data, timeout)) {
@@ -1284,7 +1284,10 @@
 	if (chan && res <= 0) {
 		if (chan->cdr || (chan->cdr = ast_cdr_alloc())) {
 			char tmp[256];
+			ast_log(LOG_NOTICE,"+++++Initing a CDR in channel %s:%x\n", chan->name, (int)chan->cdr);
 			ast_cdr_init(chan->cdr, chan);
+			ast_log(LOG_NOTICE,"+++++Inited a CDR cdr to channel %s:%x\n", chan->name, (int)chan->cdr);
+			
 			snprintf(tmp, 256, "%s/%s", type, (char *)data);
 			ast_cdr_setapp(chan->cdr,"Dial",tmp);
 			ast_cdr_update(chan);
@@ -1293,6 +1296,9 @@
 			/* If the cause wasn't handled properly */
 			if (ast_cdr_disposition(chan->cdr,chan->hangupcause))
 				ast_cdr_failed(chan->cdr);
+			ast_log(LOG_NOTICE,"+++++Hangup/fail a CDR cdr to channel %s:%x app:Dial, start=%d, stop=%d, dispos=%d\n", chan->name, (int)chan->cdr, 
+					(int)chan->cdr->start.tv_sec,
+					(int)chan->cdr->end.tv_sec, (int)chan->cdr->disposition);
 		} else {
 			ast_log(LOG_WARNING, "Unable to create Call Detail Record\n");
 		}
@@ -1372,8 +1378,8 @@
 	/* arrange the cdrs */
 	bridge_object.cdr = ast_cdr_alloc();
 	if (chan->cdr && peer->cdr) { /* both of them? merge */
-		ast_log(LOG_NOTICE,"Bridging call with BOTH sides holding a CDR!\n");
-		ast_log(LOG_NOTICE,"chan.cdr.name=%s, .dstchan=%s, .lastapp=%s, .start=%d, .answer=%d, .end=%d, dispos=%d\n", 
+		ast_log(LOG_NOTICE,"_________Bridging call with BOTH sides holding a CDR!\n");
+		ast_log(LOG_NOTICE,"---chan.cdr.name=%s, .dstchan=%s, .lastapp=%s, .start=%d, .answer=%d, .end=%d, dispos=%d\n", 
 				chan->cdr->channel, 
 				chan->cdr->dstchannel, 
 				chan->cdr->lastapp, 
@@ -1381,7 +1387,7 @@
 				(int)chan->cdr->answer.tv_sec,
 				(int)chan->cdr->end.tv_sec,
 				(int)chan->cdr->disposition);
-		ast_log(LOG_NOTICE,"peer.cdr.name=%s, .dstchan=%s, .lastapp=%s, .start=%d, .answer=%d, .end=%d, .dispos=%d\n", peer->cdr->channel, 
+		ast_log(LOG_NOTICE,"---peer.cdr.name=%s, .dstchan=%s, .lastapp=%s, .start=%d, .answer=%d, .end=%d, .dispos=%d\n", peer->cdr->channel, 
 				peer->cdr->dstchannel, 
 				peer->cdr->lastapp, 
 				(int)peer->cdr->start.tv_sec, 
@@ -1392,7 +1398,7 @@
 		ast_cdr_start(bridge_object.cdr); /* now is the time to start */
 		/* absorb the channel cdr */
 		ast_cdr_merge(bridge_object.cdr, chan->cdr);
-		ast_log(LOG_NOTICE,"Discarding answered chan cdr.name=%s, .dstchan=%s, .lastapp=%s, .start=%d, .answer=%d, .end=%d, .dispos=%d\n", chan->cdr->channel, 
+		ast_log(LOG_NOTICE,"====Discarding answered chan cdr.name=%s, .dstchan=%s, .lastapp=%s, .start=%d, .answer=%d, .end=%d, .dispos=%d\n", chan->cdr->channel, 
 				chan->cdr->dstchannel, 
 				chan->cdr->lastapp, 
 				(int)chan->cdr->start.tv_sec, 
@@ -1404,7 +1410,7 @@
 		
 		/* absorb the peer cdr */
 		ast_cdr_merge(bridge_object.cdr, peer->cdr);
-		ast_log(LOG_NOTICE,"Discarding answered peer cdr.name=%s, .dstchan=%s, .lastapp=%s, .start=%d, .answer=%d, .end=%d, .dispos=%d\n", peer->cdr->channel, 
+		ast_log(LOG_NOTICE,"====Discarding answered peer cdr.name=%s, .dstchan=%s, .lastapp=%s, .start=%d, .answer=%d, .end=%d, .dispos=%d\n", peer->cdr->channel, 
 				peer->cdr->dstchannel, 
 				peer->cdr->lastapp, 
 				(int)peer->cdr->start.tv_sec, 

Modified: team/murf/bug8221-1.4/res/res_monitor.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8221-1.4/res/res_monitor.c?view=diff&rev=48289&r1=48288&r2=48289
==============================================================================
--- team/murf/bug8221-1.4/res/res_monitor.c (original)
+++ team/murf/bug8221-1.4/res/res_monitor.c Tue Dec  5 22:06:10 2006
@@ -421,6 +421,8 @@
 	if (urlprefix) {
 		snprintf(tmp,sizeof(tmp) - 1,"%s/%s.%s",urlprefix,fname_base,
 			((strcmp(format,"gsm")) ? "wav" : "gsm"));
+		if (!chan->cdr)
+			ast_log(LOG_NOTICE, "=====RES/MONITOR/start_monitor ALLOCS CHANNEL CDR for %s\n", chan->name);
 		if (!chan->cdr && !(chan->cdr = ast_cdr_alloc()))
 			return -1;
 		ast_cdr_setuserfield(chan, tmp);



More information about the asterisk-commits mailing list