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

Freeswitch SVN anthm at freeswitch.org
Fri Dec 1 16:24:55 EST 2006


Author: anthm
Date: Fri Dec  1 16:24:54 2006
New Revision: 3511

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

Log:
codec_string channel_var sets per-call codecs on outbound calls

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 Dec  1 16:24:54 2006
@@ -762,6 +762,8 @@
 
 static void tech_set_codecs(private_object_t *tech_pvt)
 {
+    switch_channel_t *channel;
+    char *codec_string = NULL;
 
 	if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
 		return;
@@ -771,7 +773,16 @@
 		return;
 	}
 
-	if (tech_pvt->profile->codec_string) {
+    assert(tech_pvt->session != NULL);
+
+    channel = switch_core_session_get_channel(tech_pvt->session);
+    assert (channel != NULL);
+
+    if (!(codec_string = switch_channel_get_variable(channel, "codec_string"))) {
+        codec_string = tech_pvt->profile->codec_string;
+    }
+
+	if (codec_string) {
 		tech_pvt->num_codecs = switch_loadable_module_get_codecs_sorted(tech_pvt->codecs,
 																		SWITCH_MAX_CODECS,
 																		tech_pvt->profile->codec_order,



More information about the Freeswitch-svn mailing list