]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8632 #resolve [Add origination_audio_mode originate variable]
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 9 Dec 2015 00:30:48 +0000 (18:30 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 9 Dec 2015 00:30:48 +0000 (18:30 -0600)
src/switch_core_media.c

index c7a7efacd474e6ed406389cf2e856c48faa328f0..2456925ce90c754f14bc25b0ae4a156f62dc0bb0 100644 (file)
@@ -7475,11 +7475,16 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
                        sr = "sendrecv";
                }
 
-               //if ((var_val = switch_channel_get_variable(session->channel, "media_audio_mode"))) {
-               //      sr = var_val;
-               //} else {
-               //      sr = "sendrecv";
-               //}
+               if ((var_val = switch_channel_get_variable(session->channel, "origination_audio_mode"))) {
+                       if (!strcasecmp(sr, "sendonly") || !strcasecmp(sr, "recvonly") || !strcasecmp(sr, "sendrecv")) {
+                               sr = var_val;
+                       }
+                       switch_channel_set_variable(session->channel, "origination_audio_mode", NULL);
+               }
+
+               if (zstr(sr)) {
+                       sr = "sendrecv";
+               }
        }
 
        if (!smh->owner_id) {