<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:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="&#1;" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@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:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Texto de balão Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EstiloDeEmail17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#262626;}
span.TextodebaloChar
        {mso-style-name:"Texto de balão Char";
        mso-style-priority:99;
        mso-style-link:"Texto de balão";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>Hello Moy,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>We loop two ports, originate using call files. Call goes out in
port1 and comes in port 2. Port 2 answer the call and playback(tt-monkeys).
Port 1 echo() the call. After playback is finished, the dialplan priority after
playback do a Hangup().<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>We have two teams here testing it for production validation, and
we found the problem of this new bug. The bug It is not on your code!<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>In team #1 we had the occurrency of the “new bug” that locks the
ISDN channels, but not on team #2. So we did a deeper analisis.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>What was the diference about our two teams? The echo
cancelation!! That’s where the bug is!<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>Now I can easily reproduce it, and I can easily avoid it:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=PT-BR style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>Scenario:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>R2 loop + ISDN loop + echo cancelation type MG2 (echocancel=128)
-&gt; results in Lock channels after about 200 calls<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>R2 loop + ISDN loop + MG2 (echocancel = 256) -&gt; results in
Lock channels after about 150 calls<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>R2 loop + ISDN loop + MG2 (echocancel = 64) -&gt; No problems
after 40000 calls<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>R2 lopp + ISDN loop + MG2 (echocancel = 32) -&gt; No problems
after 40000 calls<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>Then I changed MG2 algorith to KB1 algorith.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>Same scenario, but no problems with echocancel (32, 64, 128 or
256) and we did a big validation test with KB1:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>R2 loop + ISDN + KB1 (echocancel = 256) -&gt; No problems after
131000 calls<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>Is very clear for me that there is a problem with MG2 algorithm,
that completely affects all the E1 channels. I will conduct some other tests
today only with the original asterisk code (without R2 patch), using ISDN on the
4 E1 and MG2. Maybe this is a hidden bug that was there for long time? <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>We tested this scenario with asterisk 1.4.22, 1.4.25, 1.4.26.2,
1.4.27.1 and with the current SVN branch 1.4. <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>I think this should affect asterisk 1.6 too. We have tests programmed
for 1.6 version for the next days.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>We tested using the latest zaptel and then repeated the tests
with the latest dahdi, and after that with that latest dahdi-trunk.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>All combinations were affect by the bug in the same way I
described above. <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>And all combinations run perfect when using KB1 or MG2 with
echocancel=64 or 32 <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>The tests were performed using an Intel Server with Q8200 quad
processor and repeated using an HP Proliant dual Xeon Server (two quad
processor), Centos 5.3 32bit, cpu processing was very low all the time about 2%
to 10%.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>Your code was validated with 131000 calls and I think everything
is fine with it now.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=PT-BR style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>--<o:p></o:p></span></p>

<p class=MsoNormal><span lang=PT-BR style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'>Rafael Prado<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'><a href="mailto:prado@practis.com.br"><span lang=PT-BR>prado@practis.com.br</span></a></span><span
lang=PT-BR style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'><o:p></o:p></span></p>

<p class=MsoNormal><span lang=PT-BR style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=PT-BR style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=PT-BR style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#262626'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span lang=PT-BR style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>De:</span></b><span lang=PT-BR style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> asterisk-r2-bounces@lists.digium.com
[mailto:asterisk-r2-bounces@lists.digium.com] <b>Em nome de </b>Moises Silva<br>
<b>Enviada em:</b> quarta-feira, 23 de dezembro de 2009 12:43<br>
<b>Para:</b> asterisk-r2@lists.digium.com<br>
<b>Assunto:</b> Re: [asterisk-r2] polling bug<o:p></o:p></span></p>

</div>

<p class=MsoNormal><span lang=PT-BR><o:p>&nbsp;</o:p></span></p>

<div>

<p class=MsoNormal>On Tue, Dec 22, 2009 at 10:17 PM, Rafael Prado Rocchi &lt;<a
href="mailto:prado@practis.com.br">prado@practis.com.br</a>&gt; wrote:<o:p></o:p></p>

</div>

<div>

<div>

<blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;
margin-left:4.8pt;margin-right:0cm'>

<div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='color:#262626'>Moy,</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='color:#262626'>I am doing a lot of testing on the polling bug. Your
latest revision (235811) fixed it apparently, but it introduced a new bug.</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='color:#262626'>&nbsp;</span><o:p></o:p></p>

</div>

</div>

</blockquote>

</div>

<div>

<div>

<p class=MsoNormal>Hello Rafael, thanks a lot for testing,
I&nbsp;committed&nbsp;but did not test myself yet :)<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>How easily can you reproduce the problem? you say
&quot;after a few R2 calls&quot;, can you try to put up a more detailed
description? You loop 2 ports and then what, originate calls using manager or
asterisk call files? once the call goes out in port 1 and comes in port 2, what
do you do? send to echo() application? for how long? who hangs up the call and
how?<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</div>

<p class=MsoNormal>-- <br>
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><o:p></o:p></p>

</div>

</div>

</body>

</html>