]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
codec_string channel_var sets per-call codecs on outbound calls
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 1 Dec 2006 21:24:54 +0000 (21:24 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 1 Dec 2006 21:24:54 +0000 (21:24 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3511 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c

index 349e1428951c0e2fd34735254d22222922578a6c..0b71e3241ea2814490e8c0d3620f1cd00d853267 100644 (file)
@@ -762,6 +762,8 @@ static void set_local_sdp(private_object_t *tech_pvt, char *ip, uint32_t port, c
 
 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 @@ static void tech_set_codecs(private_object_t *tech_pvt)
                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,