summaryrefslogtreecommitdiff
path: root/channels/chan_dahdi.c
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-10-26 09:40:49 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-10-26 09:40:49 +0000
commitd36cecd578a9c68e0b68f38a61994aa31595c38c (patch)
tree1861988bff4042add4562fd34755c32f398977c1 /channels/chan_dahdi.c
parentfb0196fce61c78f3b6eddedc540e0b15df620e0c (diff)
Make chan_dahdi build even without PRI / SS7
(Note: still some strange build warnings without SS7 in dev-mode) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225767 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r--channels/chan_dahdi.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index a06665378..65c8e4159 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -4099,6 +4099,7 @@ static void dahdi_enable_ec(struct dahdi_pvt *p)
}
if (p->echocancel.head.tap_length) {
switch (p->sig) {
+#ifdef HAVE_PRI
case SIG_PRI_LIB_HANDLE_CASES:
if (((struct sig_pri_chan *) p->sig_pvt)->no_b_channel) {
/*
@@ -4107,12 +4108,15 @@ static void dahdi_enable_ec(struct dahdi_pvt *p)
*/
return;
}
+#endif
/* Fall through */
+#ifdef HAVE_SS7
case SIG_SS7:
x = 1;
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
break;
default:
break;
@@ -4361,17 +4365,21 @@ static inline int dahdi_confmute(struct dahdi_pvt *p, int muted)
x = muted;
switch (p->sig) {
+#ifdef 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
case SIG_SS7:
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
break;
default:
break;
@@ -6025,11 +6033,13 @@ static int dahdi_setoption(struct ast_channel *chan, int option, void *data, int
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 (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
cp = (char *) data;
if (!*cp) {
@@ -6409,6 +6419,7 @@ static enum ast_bridge_result dahdi_bridge(struct ast_channel *c0, struct ast_ch
return AST_BRIDGE_RETRY;
}
+#ifdef 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)
@@ -6423,6 +6434,7 @@ static enum ast_bridge_result dahdi_bridge(struct ast_channel *c0, struct ast_ch
ast_channel_unlock(c1);
return AST_BRIDGE_FAILED_NOWARN;
}
+#endif
if ((oi0 == SUB_REAL) && (oi1 == SUB_REAL)) {
if (p0->owner && p1->owner) {