[svn-commits] russell: trunk r67458 - in /trunk: ./ channels/chan_zap.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue Jun 5 12:50:05 MST 2007


Author: russell
Date: Tue Jun  5 14:50:04 2007
New Revision: 67458

URL: http://svn.digium.com/view/asterisk?view=rev&rev=67458
Log:
Merged revisions 67457 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r67457 | russell | 2007-06-05 14:48:02 -0500 (Tue, 05 Jun 2007) | 2 lines

Suppress a bunch of debug output unless option_debug is on

........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_zap.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_zap.c?view=diff&rev=67458&r1=67457&r2=67458
==============================================================================
--- trunk/channels/chan_zap.c (original)
+++ trunk/channels/chan_zap.c Tue Jun  5 14:50:04 2007
@@ -1569,10 +1569,8 @@
 			if (option_debug)
 				ast_log(LOG_DEBUG, "Enabled echo cancellation on channel %d\n", p->channel);
 		}
-	} else {
-		if (option_debug)
-			ast_log(LOG_DEBUG, "No echo cancellation requested\n");
-	}
+	} else if (option_debug)
+		ast_log(LOG_DEBUG, "No echo cancellation requested\n");
 }
 
 static void zt_train_ec(struct zt_pvt *p)
@@ -1603,10 +1601,8 @@
 		res = ioctl(p->subs[SUB_REAL].zfd, ZT_ECHOCANCEL, &x);
 		if (res)
 			ast_log(LOG_WARNING, "Unable to disable echo cancellation on channel %d\n", p->channel);
-		else {
-			if (option_debug)
-				ast_log(LOG_DEBUG, "disabled echo cancellation on channel %d\n", p->channel);
-		}
+		else if (option_debug)
+			ast_log(LOG_DEBUG, "disabled echo cancellation on channel %d\n", p->channel);
 	}
 	p->echocanon = 0;
 }
@@ -3877,9 +3873,12 @@
 	struct zt_pvt *p = ast->tech_pvt;
 	struct ast_frame *f = *dest;
 
-	ast_log(LOG_DEBUG, "DTMF digit: %c on %s\n", f->subclass, ast->name);
+	if (option_debug)
+		ast_log(LOG_DEBUG, "DTMF digit: %c on %s\n", f->subclass, ast->name);
+
 	if (p->confirmanswer) {
-		ast_log(LOG_DEBUG, "Confirm answer on %s!\n", ast->name);
+		if (option_debug)
+			ast_log(LOG_DEBUG, "Confirm answer on %s!\n", ast->name);
 		/* Upon receiving a DTMF digit, consider this an answer confirmation instead
 		   of a DTMF digit */
 		p->subs[index].f.frametype = AST_FRAME_CONTROL;
@@ -3889,7 +3888,8 @@
 		p->confirmanswer = 0;
 	} else if (p->callwaitcas) {
 		if ((f->subclass == 'A') || (f->subclass == 'D')) {
-			ast_log(LOG_DEBUG, "Got some DTMF, but it's for the CAS\n");
+			if (option_debug)
+				ast_log(LOG_DEBUG, "Got some DTMF, but it's for the CAS\n");
 			if (p->cidspill)
 				free(p->cidspill);
 			send_cwcidspill(p);
@@ -3915,9 +3915,9 @@
 						ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", ast->name, target_context);
 				} else
 					ast_log(LOG_NOTICE, "Fax detected, but no fax extension\n");
-			} else
+			} else if (option_debug)
 				ast_log(LOG_DEBUG, "Already in a fax extension, not redirecting\n");
-		} else
+		} else if (option_debug)
 				ast_log(LOG_DEBUG, "Fax already handled\n");
 		zt_confmute(p, 0);
 		p->subs[index].f.frametype = AST_FRAME_NULL;
@@ -4879,10 +4879,8 @@
 		f = &p->subs[index].f;
 		return f;
 	}
-	if (!(p->radio || (p->oprmode < 0))) {
-		if (option_debug)
-			ast_log(LOG_DEBUG, "Exception on %d, channel %d\n", ast->fds[0],p->channel);
-	}
+	if (!(p->radio || (p->oprmode < 0)) && option_debug) 
+		ast_log(LOG_DEBUG, "Exception on %d, channel %d\n", ast->fds[0],p->channel);
 	/* If it's not us, return NULL immediately */
 	if (ast != p->owner) {
 		ast_log(LOG_WARNING, "We're %s, not %s\n", ast->name, p->owner->name);



More information about the svn-commits mailing list