Thanks for checking, I just committed the fix to freetdm.<div><br clear="all">Moises Silva<br>Senior Software Engineer<br>Sangoma Technologies Inc. | 50 McIntosh Drive, Suite 120, Markham ON L3R 9T3 Canada<br>t. 1 905 474 1990 x 128 | e. <a href="mailto:moy@sangoma.com">moy@sangoma.com</a><br>

<br><br><div class="gmail_quote">On Mon, Jun 28, 2010 at 8:51 PM, Jeroen C. van Gelderen <span dir="ltr">&lt;<a href="mailto:jeroeng@thegreek.com">jeroeng@thegreek.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

















<div lang="EN-US" link="blue" vlink="blue">

<div>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">Hi Moises,</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> </span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">I can confirm that the following patch
solves the problem:</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> </span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">[root@elastix freeswitch]# git diff</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">diff --git
a/libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.c b/libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.c</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">index a2eacac..b4a3acf 100644</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">---
a/libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.c</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">+++
b/libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.c</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">@@ -639,8 +639,9 @@ static
FIO_OPEN_FUNCTION(zt_open)</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">                       
}</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">                       
if (ioctl(ftdmchan-&gt;sockfd, codes.ECHOCANCEL, &amp;len)) {</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">                               
ftdm_log(FTDM_LOG_WARNING, &quot;Echo cancel not available for %d:%d\n&quot;,
ftdmchan-&gt;span_id, ftdmchan-&gt;chan_id);</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">-                      
} else if (zt_globals.etlevel &gt;= 0) {</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">+                      
} else if (zt_globals.etlevel &gt; 0) {</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">                               
len = zt_globals.etlevel;</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">+                              
ftdm_log(FTDM_LOG_INFO, &quot;Enabling echo training %d:%d\n&quot;, ftdmchan-&gt;span_id,
ftdmchan-&gt;chan_id);</span></font></p><div class="im">

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">                               
if (ioctl(ftdmchan-&gt;sockfd, codes.ECHOTRAIN, &amp;len)) {</span></font></p>

</div><p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">                                       
ftdm_log(FTDM_LOG_WARNING, &quot;Echo training not available for %d:%d\n&quot;,
ftdmchan-&gt;span_id, ftdmchan-&gt;chan_id);</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">                                }</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">[root@elastix freeswitch]#</span></font></p><div class="im">

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> </span></font></p>

<div>

<p><font size="2" color="navy" face="Times New Roman"><span style="font-size:10.0pt;color:navy">Cheers,<br>
-Slim<br>
--<br>
Jeroen C. &quot;Slim&quot; van Gelderen<br>
Olympic Sports Data Services<br>
Email: <a href="mailto:jeroeng@thegreek.com" target="_blank">jeroeng@thegreek.com</a><br>
Phone: +1 876 953 6182 x128</span></font></p>

</div>

</div><div>

<div class="MsoNormal" align="center" style="text-align:center"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">

<hr size="2" width="100%" align="center">

</span></font></div>

<p class="MsoNormal"><b><font size="2" face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma;font-weight:bold">From:</span></font></b><font size="2" face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma">
<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>
[mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>] <b><span style="font-weight:bold">On Behalf Of </span></b>Jeroen C. van Gelderen<br>

<b><span style="font-weight:bold">Sent:</span></b> Monday, June 28, 2010 19:20</span></font></p><font size="2" face="Tahoma"><div><div></div><div class="h5"><br>
<b><span style="font-weight:bold">To:</span></b>
<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br>
<b><span style="font-weight:bold">Subject:</span></b> Re: [Freeswitch-users]
FreeTDM and DAHDI+OSLEC/MG2 anyone?</div></div></font><p></p>

</div><div><div></div><div class="h5">

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"> </span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">Hi Moises,</span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> </span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">I basically arrived at the same conclusion
about echo training ioctl and I commented out the ECHOTRAIN ioctl in FreeTDM.
FreeSwitch does indeed pass audio if the ECHOTRAIN ioctl does NOT get called..</span></font></p>

<div>

<p><font size="2" color="navy" face="Times New Roman"><span style="font-size:10.0pt;color:navy">Cheers,<br>
-Slim<br>
--<br>
Jeroen C. &quot;Slim&quot; van Gelderen<br>
Olympic Sports Data Services<br>
Email: <a href="mailto:jeroeng@thegreek.com" target="_blank">jeroeng@thegreek.com</a><br>
Phone: +1 876 953 6182 x128</span></font></p>

</div>

<div>

<div class="MsoNormal" align="center" style="text-align:center"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">

<hr size="2" width="100%" align="center">

</span></font></div>

<p class="MsoNormal"><b><font size="2" face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma;font-weight:bold">From:</span></font></b><font size="2" face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma">
<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>
[mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>] <b><span style="font-weight:bold">On Behalf Of </span></b>Moises Silva<br>
<b><span style="font-weight:bold">Sent:</span></b> Monday, June 28, 2010 17:46<br>
<b><span style="font-weight:bold">To:</span></b>
<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br>
<b><span style="font-weight:bold">Subject:</span></b> Re: [Freeswitch-users]
FreeTDM and DAHDI+OSLEC/MG2 anyone?</span></font></p>

</div>

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"> </span></font></p>

<p class="MsoNormal" style="margin-bottom:12.0pt"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">That is what
echo_train_level in zt.conf is used for. I wonder if we should not be calling
the echo train ioctl when is 0, may be the sole fact of calling the echo train
ioctl is screwing things up.<br>
<br>
Try going to src/ftmod/ftmod_zt/ftmod_zt.c around line 642 and comment the<br>
<br>
if (ioctl(ftdmchan-&gt;sockfd, codes.ECHOTRAIN, &amp;len)) {<br>
}<br>
<br>
the whole if block should be commented, you can use #if 0 #endif, or regular C
comments.<br>
<br>
I took a look at the dahdi drivers and it seems even when this setting is 0,
then set the state to ECHO_MODE_PRETRAINING, and that can be what OSLEC does
not like at all.<br>
<br clear="all">
Moises Silva<br>
Senior Software Engineer<br>
Sangoma Technologies Inc. | 50
  McIntosh Drive, Suite 120, Markham
 ON L3R 9T3
 Canada<br>
t.. 1 905 474 1990 x 128 | e. <a href="mailto:moy@sangoma.com" target="_blank">moy@sangoma.com</a></span></font></p>

<div>

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">On Mon, Jun 28, 2010 at 4:01 PM, Jeroen C. van Gelderen &lt;<a href="mailto:jeroeng@thegreek.com" target="_blank">jeroeng@thegreek.com</a>&gt; wrote:</span></font></p>


<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">Hi Moises,<br>
<br>
Thank you. This is very helpful as it seems to detail the same problem. I<br>
tested with both OpenZap and FreeTDM yielding the same results.<br>
<br>
I think Anthony Minnessale is close when he writes:<br>
<br>
&quot;Maybe there are some new ioctls or something<br>
 they added for interop with OSLEC that we don&#39;t<br>
 know about.&quot;<br>
<br>
Except that whatever changed in (the) DAHDI (API) seems to have broken all<br>
echo canceling (MG2 and OSLEC) somewhere between DAHDI and FreeTDM/OpenZap.<br>
<br>
Anthony also suggests:<br>
<br>
&quot;If you still have the problem the next step<br>
 would be to add some debugging code to the<br>
 ozmod_zt read and write functions to see if<br>
 it&#39;s sending data up to the app.&quot;<br>
<br>
I&#39;m going to see if my C-fu is up to doing that. Anybody know where the<br>
debugging code should go for FreeTDM?<br>
<br>
Lastly, the only semi-relevant Google find I did was this [1]:<br>
<br>
&quot;Make sure echotraining is disabled when using<br>
 Oslec - this is not supported and if enabled<br>
 will cause the channel to be silent (i.e. no<br>
 audio will pass through)&quot;<br>
<br>
In FreeTDM/OpenZap/FreeSwitch there doesn&#39;t seem to be an &quot;echo
training&quot;<br>
knob to twiddle.<br>
<br>
Cheers,<br>
-Slim<br>
<br>
[1] <a href="http://www.rowetel.com/ucasterisk/oslec.html" target="_blank">http://www.rowetel.com/ucasterisk/oslec.html</a></span></font></p>

<div>

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"><br>
--<br>
Jeroen C. &quot;Slim&quot; van Gelderen<br>
Olympic Sports Data Services<br>
Email: <a href="mailto:jeroeng@thegreek.com" target="_blank">jeroeng@thegreek.com</a><br>
Phone: +1 876 953 6182 x128</span></font></p>

</div>

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">________________________________________</span></font></p>

<div>

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">From: <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a></span></font></p>


</div>

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">[mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>]
On Behalf Of Moises<br>
Silva<br>
Sent: Monday, June 28, 2010 10:04</span></font></p>

<div>

<p class="MsoNormal" style="margin-bottom:12.0pt"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">To: <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br>

Subject: Re: [Freeswitch-users] FreeTDM and DAHDI+OSLEC/MG2 anyone?</span></font></p>

</div>

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt">This may be of help:<br>
<br>
<a href="http://lists.freeswitch.org/pipermail/freeswitch-users/2010-March/055505.htm" target="_blank">http://lists.freeswitch.org/pipermail/freeswitch-users/2010-March/055505.htm</a><br>
l<br>
<br>
Moises Silva<br>
Senior Software Engineer<br>
Sangoma Technologies Inc. | 50 McIntosh
  Drive, Suite 120, Markham ON L3R 9T3<br>
Canada<br>
t. 1 905 474 1990 x 128 | e. <a href="mailto:moy@sangoma.com" target="_blank">moy@sangoma..com</a></span></font></p>

<div>

<div>

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"><br>
On Sat, Jun 26, 2010 at 8:57 PM, Jeroen C. van Gelderen<br>
&lt;<a href="mailto:jeroeng@thegreek.com" target="_blank">jeroeng@thegreek.com</a>&gt; wrote:<br>
Hi everybody,<br>
<br>
I have a feeling I must be missing the obvious...<br>
<br>
I&#39;ve been trying to get echo canceling to work with Freeswitch/FreeTDM/DAHDI<br>
but I have been failing miserably for days. When I enable echo cancellation<br>
(MG2 or OSLEC) on a DAHDI/FreeTDM channel (FXS or FXO) that channel goes<br>
silent.<br>
<br>
In absence of better suggestions I was hoping to replicate someone&#39;s
&quot;known<br>
working&quot; configuration. Is anyone successfully running the following<br>
combination:<br>
<br>
- any x86 hardware<br>
- any recent flavor Linux<br>
- any recent version of DAHDI using FXO ports<br>
- FreeSwitch/FreeTDM trunk from git<br>
- OSLEC echo canceller (or MG2)<br>
- (BONUS:) Xorcom Astribank with FXO/FXS ports.<br>
<br>
I addition to much Googling I&#39;ve tried most permutations of:<br>
- CentOS 5.4, 5.5, Ubuntu 10.04 LTS, Elastix<br>
- x86 and x64 single and multicore CPUs.<br>
- Non-PAE kernels for 32-bit installs.<br>
- DADHI from SVN (or -in case of Elastix- the built-in 2.2.0.2)<br>
- MG2 and OSLEC echo cancellers<br>
- Freeswitch from Git trunk<br>
<br>
In each case everything configures fine to the point that Asterisk 1.6 will<br>
function with echo cancellation enabled. So we know that DAHDI layer works.<br>
But Freeswitch channels go silent when echo cancellation is enabled.<br>
<br>
Puzzled,<br>
-Slim<br>
<br>
--<br>
Jeroen C. &quot;Slim&quot; van Gelderen<br>
<br>
<br>
<br>
_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br>
<br>
<br>
_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></span></font></p>

</div>

</div>

</div>

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12.0pt"> </span></font></p>

</div></div></div>

</div>


<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>