[Freeswitch-svn] [commit] r4298 - freeswitch/trunk/src/mod/endpoints/mod_sofia

Freeswitch SVN anthm at freeswitch.org
Fri Feb 16 14:43:01 EST 2007


Author: anthm
Date: Fri Feb 16 14:43:00 2007
New Revision: 4298

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

Log:
update

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	Fri Feb 16 14:43:00 2007
@@ -803,7 +803,7 @@
     } else {
         if (!(codec_string = switch_channel_get_variable(channel, "codec_string"))) {
 			if (tech_pvt->profile->codec_string) {
-				codec_string = switch_core_session_strdup(tech_pvt->session, tech_pvt->profile->codec_string);
+				codec_string = tech_pvt->profile->codec_string;
 			}
         }
         
@@ -821,12 +821,15 @@
     }
 
 	if (codec_string) {
-        tech_pvt->profile->codec_order_last = switch_separate_string(codec_string, ',', tech_pvt->profile->codec_order, SWITCH_MAX_CODECS);
-		tech_pvt->num_codecs = switch_loadable_module_get_codecs_sorted(tech_pvt->codecs,
-																		SWITCH_MAX_CODECS,
-																		tech_pvt->profile->codec_order,
-																		tech_pvt->profile->codec_order_last);
-		
+		char *tmp_codec_string;
+		if ((tmp_codec_string = strdup(codec_string))) {
+			tech_pvt->profile->codec_order_last = switch_separate_string(tmp_codec_string, ',', tech_pvt->profile->codec_order, SWITCH_MAX_CODECS);
+			tech_pvt->num_codecs = switch_loadable_module_get_codecs_sorted(tech_pvt->codecs,
+																			SWITCH_MAX_CODECS,
+																			tech_pvt->profile->codec_order,
+																			tech_pvt->profile->codec_order_last);
+			free(tmp_codec_string);
+		}
 	} else {
 		tech_pvt->num_codecs = switch_loadable_module_get_codecs(switch_core_session_get_pool(tech_pvt->session), tech_pvt->codecs,
 																 sizeof(tech_pvt->codecs) / sizeof(tech_pvt->codecs[0]));



More information about the Freeswitch-svn mailing list