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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 9 19:35:32 CDT 2009


Author: rmudgett
Date: Wed Sep  9 19:35:30 2009
New Revision: 217560

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=217560
Log:
Fix available() for SS7, MFC/R2, and pseudo channels.

Modified:
    trunk/channels/chan_dahdi.c

Modified: trunk/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=217560&r1=217559&r2=217560
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Wed Sep  9 19:35:30 2009
@@ -946,12 +946,12 @@
 	unsigned int inservice:1;
 	/*!
 	 * \brief TRUE if the channel is locally blocked.
-	 * \note Applies to SS7 channels.
+	 * \note Applies to SS7 and MFCR2 channels.
 	 */
 	unsigned int locallyblocked:1;
 	/*!
 	 * \brief TRUE if the channel is remotely blocked.
-	 * \note Applies to SS7 channels.
+	 * \note Applies to SS7 and MFCR2 channels.
 	 */
 	unsigned int remotelyblocked:1;
 #if defined(HAVE_PRI)
@@ -11400,24 +11400,34 @@
 	}
 #endif
 
+	if (p->locallyblocked || p->remotelyblocked) {
+		return 0;
+	}
+
+	/* If no owner definitely available */
+	if (!p->owner) {
 #ifdef HAVE_SS7
-	/* Trust SS7 */
-	if (p->ss7) {
-		if (p->ss7call)
-			return 0;
-		else
-			return 1;
-	}
+		/* Trust SS7 */
+		if (p->ss7) {
+			if (p->ss7call) {
+				return 0;
+			} else {
+				return 1;
+			}
+		}
 #endif
 #ifdef HAVE_OPENR2
-	/* Trust MFC/R2 */
-	if (p->mfcr2) {
-		if (p->mfcr2call)
-			return 0;
-		else
-			return 1;
-	}
+		/* Trust MFC/R2 */
+		if (p->mfcr2) {
+			if (p->mfcr2call) {
+				return 0;
+			} else {
+				return 1;
+			}
+		}
 #endif
+		return 1;
+	}
 
 	return 0;
 }




More information about the asterisk-commits mailing list