]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix inherit_codec with video
authorMichael Jerris <mike@jerris.com>
Wed, 17 Mar 2010 16:50:59 +0000 (16:50 +0000)
committerMichael Jerris <mike@jerris.com>
Wed, 17 Mar 2010 16:50:59 +0000 (16:50 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@17031 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_originate.c

index 49600cbe29ec439dc9ec82a3221f671af00bd6aa..66d61bd4ab24c9baaa03f63f4ad6a5ff8f0fbd93 100644 (file)
@@ -674,11 +674,19 @@ static uint8_t check_channel_status(originate_global_t *oglobals, originate_stat
                const char *var = switch_channel_get_variable(caller_channel, "inherit_codec");
                if (switch_true(var)) {
                        switch_codec_implementation_t impl = { 0 };
+                       switch_codec_implementation_t video_impl = { 0 };
                        char tmp[128] = "";
 
 
                        if (switch_core_session_get_read_impl(originate_status[pindex].peer_session, &impl) == SWITCH_STATUS_SUCCESS) {
-                               switch_snprintf(tmp, sizeof(tmp), "%s@%uh@%ui", impl.iananame, impl.samples_per_second, impl.microseconds_per_packet / 1000);
+                               if (switch_core_session_get_video_read_impl(originate_status[pindex].peer_session, &impl) == SWITCH_STATUS_SUCCESS) {
+                                       switch_snprintf(tmp, sizeof(tmp), "%s@%uh@%ui,%s",
+                                                                       impl.iananame, impl.samples_per_second, impl.microseconds_per_packet / 1000,
+                                                                       video_impl.iananame);
+                               } else {
+                                       switch_snprintf(tmp, sizeof(tmp), "%s@%uh@%ui",
+                                                                       impl.iananame, impl.samples_per_second, impl.microseconds_per_packet / 1000);
+                               }
                                switch_channel_set_variable(caller_channel, "absolute_codec_string", tmp);
                                switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(caller_channel), SWITCH_LOG_DEBUG, "Setting codec string on %s to %s\n",
                                                                  switch_channel_get_name(caller_channel), tmp);