From 24f15aa9baecf0644241eb49a85223a16bc5dcf1 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 20 Mar 2007 23:11:20 +0000 Subject: [PATCH] rfc3551 sucks git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4703 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/codecs/mod_g722/mod_g722.c | 4 ++-- src/mod/endpoints/mod_sofia/mod_sofia.c | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/mod/codecs/mod_g722/mod_g722.c b/src/mod/codecs/mod_g722/mod_g722.c index a1bbe303cb..3537e4fd8a 100644 --- a/src/mod/codecs/mod_g722/mod_g722.c +++ b/src/mod/codecs/mod_g722/mod_g722.c @@ -122,8 +122,8 @@ static switch_status_t switch_g722_destroy(switch_codec_t *codec) static const switch_codec_implementation_t g722_8k_implementation = { /*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, - /*.ianacode */ 9, - /*.iananame */ "G722", + /*.ianacode */ 109, + /*.iananame */ "G722_8", /*.fmtp */ NULL, /*.samples_per_second */ 8000, /*.bits_per_second */ 64000, diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index a13f1e5f1a..4a9710e051 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -811,13 +811,20 @@ static void set_local_sdp(private_object_t *tech_pvt, char *ip, uint32_t port, c int i; for (i = 0; i < tech_pvt->num_codecs; i++) { const switch_codec_implementation_t *imp = tech_pvt->codecs[i]; + uint32_t rfc_3551_sucks = imp->samples_per_second; + if (!rate) { rate = imp->samples_per_second; } if (ptime && ptime != imp->microseconds_per_frame / 1000) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "ptime %u != advertised ptime %u\n", imp->microseconds_per_frame / 1000, ptime); } - snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d %s/%d\n", imp->ianacode, imp->iananame, imp->samples_per_second); + + if (rfc_3551_sucks && imp->ianacode == 9) { + rfc_3551_sucks = 8000; + } + + snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d %s/%d\n", imp->ianacode, imp->iananame, rfc_3551_sucks); if (imp->fmtp) { snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=fmtp:%d %s\n", imp->ianacode, imp->fmtp); }