<div dir="ltr">Bug reports are filed at <a href="http://freeswitch.org/jira">http://freeswitch.org/jira</a></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 9, 2015 at 3:45 PM, Antonio Eugenio Burriel <span dir="ltr">&lt;<a href="mailto:aeburriel@gmail.com" target="_blank">aeburriel@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yesterday I posted the subject &quot;LIN16 at 16000h Freeswitch &lt;-&gt;<br>
Asterisk&quot; in the user mailing list, but after having taken a peek at<br>
the source, I thought it was better to share my analysis here:<br>
<br>
Problem: Freeswitch can&#39;t negotiate L16@16000h codec with some peers<br>
(like Aterisk) which assigns a dynamic PT (over 95) to L16.<br>
<br>
Internally Freeswitch assigns a PT of 70 to L16; in<br>
switch_core_media_negotiate_sdp() we have the following match check:<br>
match = (!strcasecmp(rm_encoding, imp-&gt;iananame) &amp;&amp;<br>
    ((map-&gt;rm_pt &lt; 96 &amp;&amp; imp-&gt;ianacode &lt; 96) || (map-&gt;rm_pt &gt; 95 &amp;&amp;<br>
imp-&gt;ianacode &gt; 95)) &amp;&amp;<br>
    (remote_codec_rate == codec_rate || fmtp_remote_codec_rate ==<br>
imp-&gt;actual_samples_per_second)) ? 1 : 0;<br>
Which means that when our peer&#39;s codec is dynamic, our match must be<br>
also dynamic and, if not, out match mustn&#39;t.<br>
<br>
Except for L16@44100h, which has a PT of 10, its PT should be dynamic<br>
(&gt;95) according to RFC3551. But Freeswitch is internally assigning 70,<br>
so it will never match.<br>
Incidentally, Asterisk erroneously assigns to L16@8000h a PT of 10,<br>
which passes the check.<br>
<br>
I&#39;m not quite sure which is the proper way to fix this.<br>
If we change PT from 70 to something over 95, we&#39;ll break<br>
interoperability with older Freeswitches and other peers, such<br>
LN16@800h with Asterisk.<br>
<br>
So maybe its cleaner to add a exception to the match check like:<br>
match = (!strcasecmp(rm_encoding, imp-&gt;iananame) &amp;&amp;<br>
    ((map-&gt;rm_pt &lt; 96 &amp;&amp; imp-&gt;ianacode &lt; 96) || (map-&gt;rm_pt &gt; 95 &amp;&amp;<br>
(imp-&gt;ianacode &gt; 95 || imp-&gt;ianacode == 70))) &amp;&amp;<br>
    (remote_codec_rate == codec_rate || fmtp_remote_codec_rate ==<br>
imp-&gt;actual_samples_per_second)) ? 1 : 0;<br>
<br>
Any thoughts?<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">







<p><font face="courier new, monospace"><b><i><font size="4">Brian West</font></i></b><br><span style="font-size:x-small"><a href="mailto:brian@freeswitch.org" target="_blank">brian@freeswitch.org</a></span></font></p>
<p><font size="1" face="courier new, monospace"><img src="http://billing.freeswitch.org/templates/default/img/whmcslogo.png"><br></font></p><p><font face="courier new, monospace"><b><i>Twitter: @FreeSWITCH , @briankwest</i></b><br><a href="http://www.freeswitchbook.com" target="_blank">http://www.freeswitchbook.com</a><br><a href="http://www.freeswitchcookbook.com" target="_blank">http://www.freeswitchcookbook.com</a></font></p>
<p><font face="courier new, monospace"><b>T:</b>+19184209001 | <b>F:</b>+19184209002 | <b>M:</b>+1918424WEST (9378)<br><b>iNUM:</b>+883 5100 1420 9001 | <b>ISN:</b>410*543 | <b>Skype:</b>briankwest</font></p></div></div>
</div>