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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Oct 26 11:07:12 CDT 2009


Author: rmudgett
Date: Mon Oct 26 11:07:09 2009
New Revision: 225872

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=225872
Log:
Make conditionals create previous code when libpri/ss7 are present.

Modified:
    trunk/channels/chan_dahdi.c

Modified: trunk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=225872&r1=225871&r2=225872
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Mon Oct 26 11:07:09 2009
@@ -4097,8 +4097,9 @@
 		return;
 	}
 	if (p->echocancel.head.tap_length) {
+#if defined(HAVE_PRI) || defined(HAVE_SS7)
 		switch (p->sig) {
-#ifdef HAVE_PRI
+#if defined(HAVE_PRI)
 		case SIG_PRI_LIB_HANDLE_CASES:
 			if (((struct sig_pri_chan *) p->sig_pvt)->no_b_channel) {
 				/*
@@ -4107,24 +4108,25 @@
 				 */
 				return;
 			}
-#endif
 			/* Fall through */
-#ifdef HAVE_SS7
+#endif	/* defined(HAVE_PRI) */
+#if defined(HAVE_SS7)
 		case SIG_SS7:
+#endif	/* defined(HAVE_SS7) */
 			{
 				int x = 1;
-				res = ioctl(p->subs[SUB_REAL].dfd, 
-						DAHDI_AUDIOMODE, &x);
+
+				res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_AUDIOMODE, &x);
 				if (res)
-					ast_log(LOG_WARNING, 
-							"Unable to enable audio mode on channel %d (%s)\n",
-							p->channel, strerror(errno));
-			}
-#endif
+					ast_log(LOG_WARNING,
+						"Unable to enable audio mode on channel %d (%s)\n",
+						p->channel, strerror(errno));
+			}
 			break;
 		default:
 			break;
 		}
+#endif	/* defined(HAVE_PRI) || defined(HAVE_SS7) */
 		res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_ECHOCANCEL_PARAMS, &p->echocancel);
 		if (res) {
 			ast_log(LOG_WARNING, "Unable to enable echo cancellation on channel %d (%s)\n", p->channel, strerror(errno));
@@ -4368,29 +4370,32 @@
 	int x, res;
 
 	x = muted;
+#if defined(HAVE_PRI) || defined(HAVE_SS7)
 	switch (p->sig) {
-#ifdef HAVE_PRI
+#if defined(HAVE_PRI)
 	case SIG_PRI_LIB_HANDLE_CASES:
 		if (((struct sig_pri_chan *) p->sig_pvt)->no_b_channel) {
 			/* PRI nobch pseudo channel.  Does not handle ioctl(DAHDI_AUDIOMODE) */
 			break;
 		}
-#endif
 		/* Fall through */
-#ifdef HAVE_SS7
+#endif	/* defined(HAVE_PRI) */
+#if defined(HAVE_SS7)
 	case SIG_SS7:
+#endif	/* defined(HAVE_SS7) */
 		{
 			int y = 1;
+
 			res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_AUDIOMODE, &y);
 			if (res)
-				ast_log(LOG_WARNING, "Unable to set audio mode on %d: %s\n", 
-						p->channel, strerror(errno));
-		}
-#endif
+				ast_log(LOG_WARNING, "Unable to set audio mode on %d: %s\n",
+					p->channel, strerror(errno));
+		}
 		break;
 	default:
 		break;
 	}
+#endif	/* defined(HAVE_PRI) || defined(HAVE_SS7) */
 	res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_CONFMUTE, &x);
 	if (res < 0)
 		ast_log(LOG_WARNING, "DAHDI confmute(%d) failed on channel %d: %s\n", muted, p->channel, strerror(errno));
@@ -6040,13 +6045,13 @@
 		ast_dsp_set_digitmode(p->dsp, ((*cp) ? DSP_DIGITMODE_RELAXDTMF : DSP_DIGITMODE_DTMF) | p->dtmfrelax);
 		break;
 	case AST_OPTION_AUDIO_MODE:  /* Set AUDIO mode (or not) */
-#ifdef HAVE_PRI
+#if defined(HAVE_PRI)
 		if (dahdi_sig_pri_lib_handles(p->sig)
 			&& ((struct sig_pri_chan *) p->sig_pvt)->no_b_channel) {
 			/* PRI nobch pseudo channel.  Does not handle ioctl(DAHDI_AUDIOMODE) */
 			break;
 		}
-#endif
+#endif	/* defined(HAVE_PRI) */
 
 		cp = (char *) data;
 		if (!*cp) {
@@ -6426,7 +6431,7 @@
 		return AST_BRIDGE_RETRY;
 	}
 
-#ifdef HAVE_PRI
+#if defined(HAVE_PRI)
 	if ((dahdi_sig_pri_lib_handles(p0->sig)
 			&& ((struct sig_pri_chan *) p0->sig_pvt)->no_b_channel)
 		|| (dahdi_sig_pri_lib_handles(p1->sig)
@@ -6441,7 +6446,7 @@
 		ast_channel_unlock(c1);
 		return AST_BRIDGE_FAILED_NOWARN;
 	}
-#endif
+#endif	/* defined(HAVE_PRI) */
 
 	if ((oi0 == SUB_REAL) && (oi1 == SUB_REAL)) {
 		if (p0->owner && p1->owner) {




More information about the asterisk-commits mailing list