[asterisk-commits] rmudgett: trunk r324175 - in /trunk: ./ channels/chan_dahdi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 17 13:23:57 CDT 2011


Author: rmudgett
Date: Fri Jun 17 13:23:54 2011
New Revision: 324175

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=324175
Log:
Merged revisions 324174 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r324174 | rmudgett | 2011-06-17 13:23:19 -0500 (Fri, 17 Jun 2011) | 5 lines
  
  Add header string to libpri debug output.
  
  Add header string to libpri debug output so the libpri output can be
  found/extracted easier from huge debug trace files.
........

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

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

Modified: trunk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=324175&r1=324174&r2=324175
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Fri Jun 17 13:23:54 2011
@@ -13933,17 +13933,22 @@
 #endif
 static void dahdi_pri_message(struct pri *pri, char *s)
 {
-	int x, y;
-	int dchan = -1, span = -1, dchancount = 0;
+	int x;
+	int y;
+	int dchan = -1;
+	int span = -1;
+	int dchancount = 0;
 
 	if (pri) {
 		for (x = 0; x < NUM_SPANS; x++) {
 			for (y = 0; y < SIG_PRI_NUM_DCHANS; y++) {
-				if (pris[x].pri.dchans[y])
+				if (pris[x].pri.dchans[y]) {
 					dchancount++;
-
-				if (pris[x].pri.dchans[y] == pri)
+				}
+
+				if (pris[x].pri.dchans[y] == pri) {
 					dchan = y;
+				}
 			}
 			if (dchan >= 0) {
 				span = x;
@@ -13951,14 +13956,18 @@
 			}
 			dchancount = 0;
 		}
-		if (dchancount > 1 && (span > -1))
-			ast_verbose("[Span %d D-Channel %d]%s", span, dchan, s);
-		else if (span > -1)
-			ast_verbose("%d %s", span+1, s);
-		else
-			ast_verbose("%s", s);
-	} else
-		ast_verbose("%s", s);
+		if (-1 < span) {
+			if (1 < dchancount) {
+				ast_verbose("[PRI Span: %d D-Channel: %d] %s", span + 1, dchan, s);
+			} else {
+				ast_verbose("PRI Span: %d %s", span + 1, s);
+			}
+		} else {
+			ast_verbose("PRI Span: ? %s", s);
+		}
+	} else {
+		ast_verbose("PRI Span: ? %s", s);
+	}
 
 	ast_mutex_lock(&pridebugfdlock);
 
@@ -13975,18 +13984,22 @@
 #if defined(HAVE_PRI)
 static void dahdi_pri_error(struct pri *pri, char *s)
 {
-	int x, y;
-	int dchan = -1, span = -1;
+	int x;
+	int y;
+	int dchan = -1;
+	int span = -1;
 	int dchancount = 0;
 
 	if (pri) {
 		for (x = 0; x < NUM_SPANS; x++) {
 			for (y = 0; y < SIG_PRI_NUM_DCHANS; y++) {
-				if (pris[x].pri.dchans[y])
+				if (pris[x].pri.dchans[y]) {
 					dchancount++;
-
-				if (pris[x].pri.dchans[y] == pri)
+				}
+
+				if (pris[x].pri.dchans[y] == pri) {
 					dchan = y;
+				}
 			}
 			if (dchan >= 0) {
 				span = x;
@@ -13994,14 +14007,18 @@
 			}
 			dchancount = 0;
 		}
-		if ((dchancount > 1) && (span > -1))
-			ast_log(LOG_ERROR, "[Span %d D-Channel %d] PRI: %s", span, dchan, s);
-		else if (span > -1)
-			ast_log(LOG_ERROR, "%d %s", span+1, s);
-		else
-			ast_log(LOG_ERROR, "%s", s);
-	} else
-		ast_log(LOG_ERROR, "%s", s);
+		if (-1 < span) {
+			if (1 < dchancount) {
+				ast_log(LOG_ERROR, "[PRI Span: %d D-Channel: %d] %s", span + 1, dchan, s);
+			} else {
+				ast_log(LOG_ERROR, "PRI Span: %d %s", span + 1, s);
+			}
+		} else {
+			ast_log(LOG_ERROR, "PRI Span: ? %s", s);
+		}
+	} else {
+		ast_log(LOG_ERROR, "PRI Span: ? %s", s);
+	}
 
 	ast_mutex_lock(&pridebugfdlock);
 




More information about the asterisk-commits mailing list