<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="Street"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="country-region"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="PostalCode"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="State"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="address"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:Arial;
        color:navy;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hi Moises,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></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:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></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<o:p></o:p></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<o:p></o:p></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<o:p></o:p></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<o:p></o:p></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<o:p></o:p></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)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>
}<o:p></o:p></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->sockfd, codes.ECHOCANCEL, &len)) {<o:p></o:p></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, "Echo cancel not available for %d:%d\n",
ftdmchan->span_id, ftdmchan->chan_id);<o:p></o:p></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 >= 0) {<o:p></o:p></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 > 0) {<o:p></o:p></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;<o:p></o:p></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, "Enabling echo training %d:%d\n", ftdmchan->span_id,
ftdmchan->chan_id);<o:p></o:p></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->sockfd, codes.ECHOTRAIN, &len)) {<o:p></o:p></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, "Echo training not available for %d:%d\n",
ftdmchan->span_id, ftdmchan->chan_id);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> }<o:p></o:p></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]#<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></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. "Slim" van Gelderen<br>
Olympic Sports Data Services<br>
Email: jeroeng@thegreek.com<br>
Phone: +1 876 953 6182 x128</span></font><o:p></o:p></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 tabindex=-1>
</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'>
freeswitch-users-bounces@lists.freeswitch.org
[mailto:freeswitch-users-bounces@lists.freeswitch.org] <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<br>
<b><span style='font-weight:bold'>To:</span></b>
freeswitch-users@lists.freeswitch.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [Freeswitch-users]
FreeTDM and DAHDI+OSLEC/MG2 anyone?</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></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,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></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..<o:p></o:p></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. "Slim" van Gelderen<br>
Olympic Sports Data Services<br>
Email: jeroeng@thegreek.com<br>
Phone: +1 876 953 6182 x128</span></font><o:p></o:p></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 tabindex=-1>
</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'>
freeswitch-users-bounces@lists.freeswitch.org
[mailto:freeswitch-users-bounces@lists.freeswitch.org] <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>
freeswitch-users@lists.freeswitch.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [Freeswitch-users]
FreeTDM and DAHDI+OSLEC/MG2 anyone?</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></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->sockfd, codes.ECHOTRAIN, &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. | <st1:address w:st="on"><st1:Street w:st="on">50
McIntosh Drive, Suite 120</st1:Street>, <st1:City w:st="on">Markham</st1:City>
<st1:State w:st="on">ON</st1:State> <st1:PostalCode w:st="on">L3R 9T3</st1:PostalCode>
<st1:country-region w:st="on">Canada</st1:country-region></st1:address><br>
t.. 1 905 474 1990 x 128 | e. <a href="mailto:moy@sangoma.com">moy@sangoma.com</a><o:p></o:p></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 <<a
href="mailto:jeroeng@thegreek.com">jeroeng@thegreek.com</a>> wrote:<o:p></o:p></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>
"Maybe there are some new ioctls or something<br>
they added for interop with OSLEC that we don't<br>
know about."<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>
"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's sending data up to the app."<br>
<br>
I'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>
"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)"<br>
<br>
In FreeTDM/OpenZap/FreeSwitch there doesn't seem to be an "echo
training"<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><o:p></o:p></span></font></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
--<br>
Jeroen C. "Slim" van Gelderen<br>
Olympic Sports Data Services<br>
Email: <a href="mailto:jeroeng@thegreek.com">jeroeng@thegreek.com</a><br>
Phone: +1 876 953 6182 x128<o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>________________________________________<o:p></o:p></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">freeswitch-users-bounces@lists.freeswitch.org</a><o:p></o:p></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">freeswitch-users-bounces@lists.freeswitch.org</a>]
On Behalf Of Moises<br>
Silva<br>
Sent: Monday, June 28, 2010 10:04<o:p></o:p></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">freeswitch-users@lists.freeswitch.org</a><br>
Subject: Re: [Freeswitch-users] FreeTDM and DAHDI+OSLEC/MG2 anyone?<o:p></o:p></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. | <st1:address w:st="on"><st1:Street w:st="on">50 McIntosh
Drive, Suite 120</st1:Street>, <st1:City w:st="on">Markham</st1:City> <st1:State
w:st="on">ON</st1:State> <st1:PostalCode w:st="on">L3R 9T3</st1:PostalCode></st1:address><br>
<st1:place w:st="on"><st1:country-region w:st="on">Canada</st1:country-region></st1:place><br>
t. 1 905 474 1990 x 128 | e. <a href="mailto:moy@sangoma.com">moy@sangoma..com</a><o:p></o:p></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>
<<a href="mailto:jeroeng@thegreek.com">jeroeng@thegreek.com</a>> wrote:<br>
Hi everybody,<br>
<br>
I have a feeling I must be missing the obvious...<br>
<br>
I'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's
"known<br>
working" 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'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. "Slim" van Gelderen<br>
<br>
<br>
<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>
<br>
<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><o:p></o:p></span></font></p>
</div>
</div>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>