<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">This fix has been merged in to tree.<div><br><div><div>On Jun 28, 2013, at 6:33 AM, Giacomo Vacca <<a href="mailto:giacomo.vacca@gmail.com">giacomo.vacca@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div><div><div><div><div><div>Hi all,<br></div>I've seen a behaviour similar to <a href="http://jira.freeswitch.org/browse/FS-5398">http://jira.freeswitch.org/browse/FS-5398</a> and I have a proposed patch that fixes it.<br>
<br></div>Scenario:<br></div>- Caller offers, in order, AMR-WB, iLBC, SILK/12K, SILK/24K, SILK/8, speex/8<br></div>- FS has global_codec_prefs set to SILK@24000h@20i,SILK@16000h@20i,SILK@8000h@20i,speex@16000h@20i,speex@8000h@20i,PCMU,PC MA<br>
</div>- FS decides to accept with SILK/16K (not even offered): the caller BYEs immediately<br><br></div>FS logged:<br><br>7dc4b656-a7cf-46fe-93f0-b10b497a1f7d 2013-06-27 14:17:30.726808 [DEBUG] switch_core_media.c:2662 Audio Codec Compare [SILK:97:12000:20:0]/[SILK:120:24000:20:40000]<br>
7dc4b656-a7cf-46fe-93f0-b10b497a1f7d 2013-06-27 14:17:30.726808 [DEBUG] switch_core_media.c:2662 Audio Codec Compare [SILK:97:12000:20:0]/[SILK:119:16000:20:30000]<br>7dc4b656-a7cf-46fe-93f0-b10b497a1f7d 2013-06-27 14:17:30.726808 [DEBUG] switch_core_media.c:1772 Set Codec <a href="mailto:sofia/internal/4656729@truphone.comSILK">sofia/internal/4656729@truphone.comSILK</a>/16000 20 ms 320 samples 30000 bits<br clear="all">
<div><div><br></div><div>To fix this I've added the comparison of sample rates in switch_core_media.c, with this patch (applied on latest master):<br><br>diff --git a/src/switch_core_media.c b/src/switch_core_media.c<br>
index 9270b0b..4b926ed 100644<br>--- a/src/switch_core_media.c<br>+++ b/src/switch_core_media.c<br>@@ -2788,7 +2788,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s<br> if ((zstr(map->rm_encoding) || (smh->mparams->ndlb & SM_NDLB_ALLOW_BAD_IANANAME)) && map->rm_pt < 96) {<br>
match = (map->rm_pt == imp->ianacode) ? 1 : 0;<br> } else {<br>- match = strcasecmp(rm_encoding, imp->iananame) ? 0 : 1;<br>
+ match = (!strcasecmp(rm_encoding, imp->iananame) && (map->rm_rate == codec_rate)) ? 1 : 0<br> }<br><br></div></div></div></blockquote></div><br></div></body></html>