]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
rfc3551 sucks
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 20 Mar 2007 23:11:20 +0000 (23:11 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 20 Mar 2007 23:11:20 +0000 (23:11 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4703 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/codecs/mod_g722/mod_g722.c
src/mod/endpoints/mod_sofia/mod_sofia.c

index a1bbe303cbaae9476239fea0a61103859a9b25df..3537e4fd8a6cea3034e25983a1808c0cd90e9766 100644 (file)
@@ -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,
index a13f1e5f1a32e0949519a44f871caf86369ca00f..4a9710e051e2f25d8bfdc5b5eb878564392a18ec 100644 (file)
@@ -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);
                        }