<div dir="ltr">Dear James and all,<div><br></div><div>I managed to find out the cause of the issue. I simply forgot (mea culpa!) to add a couple of lines to the patch (which is why I couldn&#39;t replicate it in my setup, where the lines exist) which tells Asterisk which rate to use for the format. As you know, Opus always uses 48kHz, while the default in Asterisk is 8000: this caused wrong timestamp increase calculations on the non-Opus RTP leg, and hence the corrupt audio.</div>
<div><br></div><div>I updated the patch on the repository. If you don&#39;t want to apply the patch again, just add these lines in the ast_format_rate method of format.c:</div><div><br></div><div><div><span class="" style="white-space:pre">        </span>/* Opus */</div>
<div><span class="" style="white-space:pre">        </span>case AST_FORMAT_OPUS:</div><div><span class="" style="white-space:pre">                </span>return 48000;</div></div><div><br></div><div>and make/make install again. The easiest thing to do is put this as the last case before the default.</div>
<div><br></div><div>Let me know if this fixes the issue,</div><div>Lorenzo</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/30 James Mortensen <span dir="ltr">&lt;<a href="mailto:james.mortensen@voicecurve.com" target="_blank">james.mortensen@voicecurve.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><div><div class="h5"><div class="gmail_quote">On Thu, May 30, 2013 at 5:15 AM, Lorenzo Miniero <span dir="ltr">&lt;<a href="mailto:lminiero@gmail.com" target="_blank">lminiero@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><p>James,</p>
<p>I mostly tested it in conferencing scenarios, using ConfBridge to attach heterogeneous peers. In those scenarios, I used both Chrome and Firefox (using the DTLS-SRTP hacks I mentioned in the other thread), and PhonerLite as well. For other codecs I used a bunch of softphones, our Java applet (wideband speex) and calls from the PSTN using a VoIP gateway. This way it seems to work as expected.</p>




<p>At the beginning, through, I mostly used PhonerLite and Linphone calling each other through Asterisk to test the codec, and I can&#39;t recall issues like those you mentioned, but I didn&#39;t test this intensively. As I anticipated, I&#39;m currently traveling and won&#39;t be able to do any testing until Saturday: I&#39;ll keep you posted about this.</p>




<p>Lorenzo</p>
<div class="gmail_quote">Il giorno 30/mag/2013 00:43, &quot;James Mortensen&quot; &lt;<a href="mailto:james.mortensen@voicecurve.com" target="_blank">james.mortensen@voicecurve.com</a>&gt; ha scritto:<div><div>

<br type="attribution"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div><br></div><div class="gmail_extra"><div class="gmail_quote">On Wed, May 29, 2013 at 11:06 AM, Lorenzo Miniero <span dir="ltr">&lt;<a href="mailto:lminiero@gmail.com" target="_blank">lminiero@gmail.com</a>&gt;</span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">2013/5/29 James Mortensen <span dir="ltr">&lt;<a href="mailto:james.mortensen@voicecurve.com" target="_blank">james.mortensen@voicecurve.com</a>&gt;</span><br>





<div class="gmail_extra"><div class="gmail_quote"><div><div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><div><div class="gmail_quote">





On Wed, May 29, 2013 at 8:37 AM, James Mortensen <span dir="ltr">&lt;<a href="mailto:james.mortensen@voicecurve.com" target="_blank">james.mortensen@voicecurve.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div><div><br></div>





</div><div><br></div><div>There appears to be paths for both ulaw as well as g729.</div>


<div><br></div><div>I did try the patch on Asterisk 11.1.2, but shifted gears when I realized the crypto headers are buggy as per <a href="https://issues.asterisk.org/jira/browse/ASTERISK-20849" target="_blank">https://issues.asterisk.org/jira/browse/ASTERISK-20849</a>.  However, I&#39;ll apply the patch to fix that issue and then try a call on Asterisk 11.1.2.</div>









<div><br></div><div>I&#39;ll follow up with additional details when I know more.  Again, thank you for your time and your work on this. We&#39;re really stoked about getting opus working in Asterisk! :)</div><div>

<br clear="all">
<div><br></div>-- <br>James Mortensen<br>Project Manager, VoiceCurve, Inc.<br><a href="tel:866-707-4590" value="+18667074590" target="_blank">866-707-4590</a><br><a href="mailto:james.mortensen@voicecurve.com" target="_blank">james.mortensen@voicecurve.com</a><br>









</div></div></div>
</blockquote></div><br><br></div>Hi Lorenzo,</div><div class="gmail_extra"><br></div><div class="gmail_extra">The problem exists on Asterisk 11.1.2 as well.  It sounds like the two parties are talking underwater.  Please let me know if there&#39;s any other details that I can get you.</div>






<div>

<div class="gmail_extra"><br clear="all"></div></div></div></blockquote><div><br></div></div></div><div>Ok, thanks for the details and the clarification. Unfortunately I&#39;ll be out of office for the next two days so I won&#39;t be able to look into this right away, but I&#39;ll check what may be going wrong as soon as I get back to work.</div>






<div><br></div><div>Please keep me posted if you find any additional info that may be of use.</div><div><br></div><div>Cheers,</div><div>Lorenzo</div><div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">






<div dir="ltr"><div><div class="gmail_extra"><div><br></div>-- <br>James Mortensen<br>Project Manager, VoiceCurve, Inc.<br><a href="tel:866-707-4590" value="+18667074590" target="_blank">866-707-4590</a><br><a href="mailto:james.mortensen@voicecurve.com" target="_blank">james.mortensen@voicecurve.com</a><br>









</div></div></div>
</blockquote></div></div><br></div></div>
</blockquote></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div>Hi Lorenzo,</div><div class="gmail_extra"><br></div><div class="gmail_extra">I wanted to let you know that our trunk provider supports both ulaw and g729. We&#39;re using Chrome with JsSIP in the browser.</div>





<div class="gmail_extra"><br></div><div class="gmail_extra">We&#39;ve tried calls transcoding to/from ulaw to opus and g729 to opus, and we still hear the robotic audio in both scenarios, and this is on both Asterisk 11.1.2 and Asterisk 11.4.0.</div>





<div class="gmail_extra"><br></div><div class="gmail_extra">What is your setup like, as it sounds like you actually have this working?  What codecs are you transcoding to/from?  Are you making calls from the browser at all or are you only testing with that PhonerLite system?</div>





<div class="gmail_extra"><br></div><div class="gmail_extra">Also, our SIP clients are on Mac OS 10.8.  The Asterisk server is on Ubuntu 12.04.  I installed the opus libraries from this site:  <a href="http://www.opus-codec.org/downloads/" target="_blank">http://www.opus-codec.org/downloads/</a> using the latest version, 1.0.2</div>





<div class="gmail_extra"><br></div><div class="gmail_extra">Hope this helps!  Let us know if there&#39;s anything else we should try.<br><br clear="all"><div><br></div>-- <br>James Mortensen<br>Project Manager, VoiceCurve, Inc.<br>





<a href="tel:866-707-4590" value="+18667074590" target="_blank">866-707-4590</a><br><a href="mailto:james.mortensen@voicecurve.com" target="_blank">james.mortensen@voicecurve.com</a><br>
</div></div>
</blockquote></div></div></div>
</blockquote></div><br><br><br></div></div>Hi Lorenzo,<div><br></div><div>Thanks again for your help.  When you do get back around to this, can you specifically test the scenario where you&#39;re calling from Chrome to Asterisk to the PSTN?  Using the codecs opus to g729 and opus to ulaw?</div>


<div><br></div><div>We really appreciate the work you&#39;re doing on this!  Thank you again!</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>James</div></font></span><div class="im"><div><br></div>-- <br>
James Mortensen<br>Project Manager, VoiceCurve, Inc.<br><a href="tel:866-707-4590" value="+18667074590" target="_blank">866-707-4590</a><br>

<a href="mailto:james.mortensen@voicecurve.com" target="_blank">james.mortensen@voicecurve.com</a><br>
</div></div></div>
</blockquote></div><br></div>