Switch to audio mode when enabling echo cancellation
authorMark Spencer <markster@digium.com>
Wed, 23 Apr 2003 23:00:29 +0000 (23:00 +0000)
committerMark Spencer <markster@digium.com>
Wed, 23 Apr 2003 23:00:29 +0000 (23:00 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@899 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index 0c1cbaf..8932f0a 100755 (executable)
@@ -907,6 +907,12 @@ static void zt_enable_ec(struct zt_pvt *p)
                return;
        }
        if (p && p->echocancel) {
+               if (p->sig == SIG_PRI) {
+                       x = 1;
+                       res = ioctl(p->subs[SUB_REAL].zfd, ZT_AUDIOMODE, &x);
+                       if (res)
+                               ast_log(LOG_WARNING, "Unable to enable echo cancellation on channel %d\n", p->channel);
+               }
                x = p->echocancel;
                res = ioctl(p->subs[SUB_REAL].zfd, ZT_ECHOCANCEL, &x);
                if (res)