To fix this I've added the comparison of sample rates in switch_core_media.c, with this patch (applied on latest master):
diff --git a/src/switch_core_media.c b/src/switch_core_media.c
index 9270b0b..4b926ed 100644
--- a/src/switch_core_media.c
+++ b/src/switch_core_media.c
@@ -2788,7 +2788,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
if ((zstr(map->rm_encoding) || (smh->mparams->ndlb & SM_NDLB_ALLOW_BAD_IANANAME)) && map->rm_pt < 96) {
match = (map->rm_pt == imp->ianacode) ? 1 : 0;
} else {
- match = strcasecmp(rm_encoding, imp->iananame) ? 0 : 1;
+ match = (!strcasecmp(rm_encoding, imp->iananame) && (map->rm_rate == codec_rate)) ? 1 : 0
}
Hope this helps, even if a better solution exists.
Regards,
Giacomo