[asterisk-commits] rmudgett: branch 1.6.2 r294822 - in /branches/1.6.2: ./ channels/chan_dahdi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Nov 11 20:44:20 CST 2010


Author: rmudgett
Date: Thu Nov 11 20:44:12 2010
New Revision: 294822

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

........
  r294821 | rmudgett | 2010-11-11 20:41:13 -0600 (Thu, 11 Nov 2010) | 11 lines
  
  Asterisk is getting a "No D-channels available!" warning message every 4 seconds.
  
  Asterisk is just whining too much with this message: "No D-channels
  available!  Using Primary channel XXX as D-channel anyway!".
  
  Filtered the message so it only comes out once if there is no D channel
  available without an intervening D channel available period.
  
  (closes issue #17270)
  Reported by: jmls
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/channels/chan_dahdi.c

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

Modified: branches/1.6.2/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_dahdi.c?view=diff&rev=294822&r1=294821&r2=294822
==============================================================================
--- branches/1.6.2/channels/chan_dahdi.c (original)
+++ branches/1.6.2/channels/chan_dahdi.c Thu Nov 11 20:44:12 2010
@@ -548,6 +548,8 @@
 #ifdef HAVE_PRI_INBANDDISCONNECT
 	unsigned int inbanddisconnect:1;				/*!< Should we support inband audio after receiving DISCONNECT? */
 #endif
+	/*! TRUE if we have already whined about no D channels available. */
+	unsigned int no_d_channels:1;
 	time_t lastreset;						/*!< time when unused channels were last reset */
 	long resetinterval;						/*!< Interval (in seconds) for resetting unused channels */
 	/*! \brief ISDN signalling type (SIG_PRI, SIG_BRI, SIG_BRI_PTMP, etc...) */
@@ -4192,10 +4194,14 @@
 	if (newslot < 0) {
 		newslot = 0;
 		/* This is annoying to see on non persistent layer 2 connections.  Let's not complain in that case */
-		if (pri->sig != SIG_BRI_PTMP) {
-			ast_log(LOG_WARNING, "No D-channels available!  Using Primary channel %d as D-channel anyway!\n",
+		if (pri->sig != SIG_BRI_PTMP && !pri->no_d_channels) {
+			pri->no_d_channels = 1;
+			ast_log(LOG_WARNING,
+				"No D-channels available!  Using Primary channel %d as D-channel anyway!\n",
 				pri->dchannels[newslot]);
 		}
+	} else {
+		pri->no_d_channels = 0;
 	}
 	if (old && (oldslot != newslot))
 		ast_log(LOG_NOTICE, "Switching from from d-channel %d to channel %d!\n",
@@ -12886,6 +12892,7 @@
 
 			switch (e->e) {
 			case PRI_EVENT_DCHAN_UP:
+				pri->no_d_channels = 0;
 				if (!pri->pri) pri_find_dchan(pri);
 
 				/* Note presense of D-channel */




More information about the asterisk-commits mailing list