[Freeswitch-dev] Can't negotiate L16 at 16000h with Asterisk

Brian West brian at freeswitch.org
Tue Feb 10 01:11:45 MSK 2015


Bug reports are filed at http://freeswitch.org/jira

On Mon, Feb 9, 2015 at 3:45 PM, Antonio Eugenio Burriel <aeburriel at gmail.com
> wrote:

> Yesterday I posted the subject "LIN16 at 16000h Freeswitch <->
> Asterisk" in the user mailing list, but after having taken a peek at
> the source, I thought it was better to share my analysis here:
>
> Problem: Freeswitch can't negotiate L16 at 16000h codec with some peers
> (like Aterisk) which assigns a dynamic PT (over 95) to L16.
>
> Internally Freeswitch assigns a PT of 70 to L16; in
> switch_core_media_negotiate_sdp() we have the following match check:
> match = (!strcasecmp(rm_encoding, imp->iananame) &&
>     ((map->rm_pt < 96 && imp->ianacode < 96) || (map->rm_pt > 95 &&
> imp->ianacode > 95)) &&
>     (remote_codec_rate == codec_rate || fmtp_remote_codec_rate ==
> imp->actual_samples_per_second)) ? 1 : 0;
> Which means that when our peer's codec is dynamic, our match must be
> also dynamic and, if not, out match mustn't.
>
> Except for L16 at 44100h, which has a PT of 10, its PT should be dynamic
> (>95) according to RFC3551. But Freeswitch is internally assigning 70,
> so it will never match.
> Incidentally, Asterisk erroneously assigns to L16 at 8000h a PT of 10,
> which passes the check.
>
> I'm not quite sure which is the proper way to fix this.
> If we change PT from 70 to something over 95, we'll break
> interoperability with older Freeswitches and other peers, such
> LN16 at 800h with Asterisk.
>
> So maybe its cleaner to add a exception to the match check like:
> match = (!strcasecmp(rm_encoding, imp->iananame) &&
>     ((map->rm_pt < 96 && imp->ianacode < 96) || (map->rm_pt > 95 &&
> (imp->ianacode > 95 || imp->ianacode == 70))) &&
>     (remote_codec_rate == codec_rate || fmtp_remote_codec_rate ==
> imp->actual_samples_per_second)) ? 1 : 0;
>
> Any thoughts?
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-dev mailing list
> FreeSWITCH-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
>



-- 

*Brian West*
brian at freeswitch.org


*Twitter: @FreeSWITCH , @briankwest*
http://www.freeswitchbook.com
http://www.freeswitchcookbook.com

*T:*+19184209001 | *F:*+19184209002 | *M:*+1918424WEST (9378)
*iNUM:*+883 5100 1420 9001 | *ISN:*410*543 | *Skype:*briankwest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20150209/2ee29baf/attachment.html 


Join us at ClueCon 2014 Aug 4-7, 2014
More information about the FreeSWITCH-dev mailing list