[zaptel-commits] kpfleming: branch 1.4 r3604 - /branches/1.4/zaptel-base.c

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Thu Jan 3 16:10:41 CST 2008


Author: kpfleming
Date: Thu Jan  3 16:10:40 2008
New Revision: 3604

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3604
Log:
re-add proper support for boards with hardware echo cancellers

Modified:
    branches/1.4/zaptel-base.c

Modified: branches/1.4/zaptel-base.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/zaptel-base.c?view=diff&rev=3604&r1=3603&r2=3604
==============================================================================
--- branches/1.4/zaptel-base.c (original)
+++ branches/1.4/zaptel-base.c Thu Jan  3 16:10:40 2008
@@ -4316,8 +4316,8 @@
 		/* disable mode, don't need to inspect params */
 		spin_lock_irqsave(&chan->lock, flags);
 		tec = chan->ec;
+		chan->ec = NULL;
 		chan->echocancel = 0;
-		chan->ec = NULL;
 		chan->echostate = ECHO_STATE_IDLE;
 		chan->echolastupdate = 0;
 		chan->echotimer = 0;
@@ -4353,8 +4353,16 @@
 	
 	/* attempt to use the span's echo canceler; fall back to built-in
 	   if it fails (but not if an error occurs) */
-	if (chan->span && chan->span->echocan_with_params)
-		ret = chan->span->echocan_with_params(chan, ecp, params);
+	if (chan->span) {
+		if (ecp->param_count) {
+			if (chan->span->echocan_with_params)
+				ret = chan->span->echocan_with_params(chan, ecp, params);
+		} else if (chan->span->echocan) {
+			ret = chan->span->echocan(chan, ecp->tap_length);
+		} else if (chan->span->echocan_with_params) {
+			ret = chan->span->echocan_with_params(chan, ecp, NULL);
+		}
+	}
 	
 	if (ret == -ENOTTY) {
 		switch (ecp->tap_length) {




More information about the zaptel-commits mailing list