[Freeswitch-svn] [commit] r4703 - in freeswitch/trunk/src/mod: codecs/mod_g722 endpoints/mod_sofia

Freeswitch SVN anthm at freeswitch.org
Tue Mar 20 19:11:20 EDT 2007


Author: anthm
Date: Tue Mar 20 19:11:20 2007
New Revision: 4703

Modified:
   freeswitch/trunk/src/mod/codecs/mod_g722/mod_g722.c
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c

Log:
rfc3551 sucks

Modified: freeswitch/trunk/src/mod/codecs/mod_g722/mod_g722.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_g722/mod_g722.c	(original)
+++ freeswitch/trunk/src/mod/codecs/mod_g722/mod_g722.c	Tue Mar 20 19:11:20 2007
@@ -122,8 +122,8 @@
 
 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,

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	Tue Mar 20 19:11:20 2007
@@ -811,13 +811,20 @@
 		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);
 			}



More information about the Freeswitch-svn mailing list