Disable echo canceller for digital calls (bug #2785), fix build on MacOSX (bug #2803)
authorMark Spencer <markster@digium.com>
Sun, 7 Nov 2004 16:21:01 +0000 (16:21 +0000)
committerMark Spencer <markster@digium.com>
Sun, 7 Nov 2004 16:21:01 +0000 (16:21 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4170 65c4cc65-6c06-0410-ace0-fbb531ad65f3

asterisk.c
channel.c
channels/chan_zap.c
include/asterisk/channel.h
manager.c
res/res_agi.c

index f74d0ac..690ab90 100755 (executable)
@@ -13,7 +13,6 @@
 
 #include <unistd.h>
 #include <stdlib.h>
-#include <sys/poll.h>
 #include <asterisk/logger.h>
 #include <asterisk/options.h>
 #include <asterisk/cli.h>
index 2b9c877..004468a 100755 (executable)
--- a/channel.c
+++ b/channel.c
@@ -19,7 +19,6 @@
 #include <errno.h>
 #include <unistd.h>
 #include <math.h>                      /* For PI */
-#include <sys/poll.h>
 #include <asterisk/pbx.h>
 #include <asterisk/frame.h>
 #include <asterisk/sched.h>
index 4644bf0..2a8b95d 100755 (executable)
@@ -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);
index 6b514be..f78c3c1 100755 (executable)
 #include <asterisk/chanvars.h>
 #include <unistd.h>
 #include <setjmp.h>
+#if defined(__APPLE__)
+#include <asterisk/poll-compat.h>
+#else
 #include <sys/poll.h>
+#endif
 
 #if defined(__cplusplus) || defined(c_plusplus)
 extern "C" {
index a1935ed..7bfccaa 100755 (executable)
--- a/manager.c
+++ b/manager.c
@@ -24,7 +24,6 @@
 #include <signal.h>
 #include <errno.h>
 #include <unistd.h>
-#include <sys/poll.h>
 #include <asterisk/channel.h>
 #include <asterisk/file.h>
 #include <asterisk/manager.h>
index b6f6ede..a081328 100755 (executable)
@@ -31,7 +31,6 @@
 #include <stdlib.h>
 #include <signal.h>
 #include <sys/time.h>
-#include <sys/poll.h>
 #include <stdio.h>
 #include <fcntl.h>
 #include <errno.h>