[asterisk-commits] kpfleming: branch 1.4 r132571 - /branches/1.4/channels/chan_dahdi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 21 17:45:17 CDT 2008


Author: kpfleming
Date: Mon Jul 21 17:45:16 2008
New Revision: 132571

URL: http://svn.digium.com/view/asterisk?view=rev&rev=132571
Log:
teach chan_dahdi how to find the D-channel on BRI spans, and don't attempt to use channel 24 as a D-channel on spans of unexpected sizes

Modified:
    branches/1.4/channels/chan_dahdi.c

Modified: branches/1.4/channels/chan_dahdi.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_dahdi.c?view=diff&rev=132571&r1=132570&r2=132571
==============================================================================
--- branches/1.4/channels/chan_dahdi.c (original)
+++ branches/1.4/channels/chan_dahdi.c Mon Jul 21 17:45:16 2008
@@ -7089,10 +7089,19 @@
 			ast_log(LOG_WARNING, "Unable to use span %d implicitly since it is already part of trunk group %d\n", *span, pris[*span].mastertrunkgroup);
 			*span = -1;
 		} else {
-			if (si->totalchans == 31) { /* if it's an E1 */
+			if (si->totalchans == 31) {
+				/* E1 */
 				pris[*span].dchannels[0] = 16 + offset;
+			} else if (si->totalchans == 24) {
+				/* T1 or J1 */
+				pris[*span].dchannels[0] = 24 + offset;
+			} else if (si->totalchans == 3) {
+				/* BRI */
+				pris[*span].dchannels[0] = 3 + offset;
 			} else {
-				pris[*span].dchannels[0] = 24 + offset;
+				ast_log(LOG_WARNING, "Unable to use span %d, since the D-channel cannot be located (unexpected span size of %d channels)\n", *span, si->totalchans);
+				*span = -1;
+				return 0;
 			}
 			pris[*span].dchanavail[0] |= DCHAN_PROVISIONED;
 			pris[*span].offset = offset;




More information about the asterisk-commits mailing list