From 134e6180c55d20b8dfa7068397936d0903d60a44 Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Sun, 7 Nov 2004 16:21:01 +0000 Subject: Disable echo canceller for digital calls (bug #2785), fix build on MacOSX (bug #2803) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4170 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- asterisk.c | 1 - channel.c | 1 - channels/chan_zap.c | 8 +++++++- include/asterisk/channel.h | 4 ++++ manager.c | 1 - res/res_agi.c | 1 - 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/asterisk.c b/asterisk.c index f74d0acb2..690ab90c5 100755 --- a/asterisk.c +++ b/asterisk.c @@ -13,7 +13,6 @@ #include #include -#include #include #include #include diff --git a/channel.c b/channel.c index 2b9c877bf..004468a62 100755 --- a/channel.c +++ b/channel.c @@ -19,7 +19,6 @@ #include #include #include /* For PI */ -#include #include #include #include diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 4644bf095..2a8b95d74 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -1213,11 +1213,17 @@ static void zt_enable_ec(struct zt_pvt *p) { int x; int res; + if (!p) + return; if (p->echocanon) { ast_log(LOG_DEBUG, "Echo cancellation already on\n"); return; } - if (p && p->echocancel) { + if (p->digital) { + ast_log(LOG_DEBUG, "Echo cancellation isn't required on digital connection\n"); + return; + } + if (p->echocancel) { if (p->sig == SIG_PRI) { x = 1; res = ioctl(p->subs[SUB_REAL].zfd, ZT_AUDIOMODE, &x); diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 6b514befe..f78c3c158 100755 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -19,7 +19,11 @@ #include #include #include +#if defined(__APPLE__) +#include +#else #include +#endif #if defined(__cplusplus) || defined(c_plusplus) extern "C" { diff --git a/manager.c b/manager.c index a1935ede3..7bfccaa33 100755 --- a/manager.c +++ b/manager.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/res/res_agi.c b/res/res_agi.c index b6f6edebb..a0813289a 100755 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include -- cgit v1.2.3