]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix codec issue on recover
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 16 Apr 2013 18:02:50 +0000 (13:02 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 16 Apr 2013 18:02:59 +0000 (13:02 -0500)
src/switch_core_media.c

index ffb542d88c10a12c6eaef9a6dbdb79573a8accdf..316fa7b6d1a48a9a54f0ef7d03346ba8abff0af0 100644 (file)
@@ -1078,9 +1078,9 @@ SWITCH_DECLARE(void) switch_core_media_prepare_codecs(switch_core_session_t *ses
        }
 
  ready:
-
        if (codec_string) {
                char *tmp_codec_string = switch_core_session_strdup(smh->session, codec_string);
+               switch_channel_set_variable(session->channel, "rtp_use_codec_string", codec_string);
                smh->codec_order_last = switch_separate_string(tmp_codec_string, ',', smh->codec_order, SWITCH_MAX_CODECS);
                smh->mparams->num_codecs = switch_loadable_module_get_codecs_sorted(smh->codecs, SWITCH_MAX_CODECS, smh->codec_order, smh->codec_order_last);
        } else {
@@ -7100,6 +7100,12 @@ SWITCH_DECLARE (void) switch_core_media_recover_session(switch_core_session_t *s
 
        a_engine->codec_params.iananame = a_engine->codec_params.rm_encoding = (char *) switch_channel_get_variable(session->channel, "rtp_use_codec_name");
        a_engine->codec_params.rm_fmtp = (char *) switch_channel_get_variable(session->channel, "rtp_use_codec_fmtp");
+       
+       if ((tmp = switch_channel_get_variable(session->channel, "rtp_use_codec_string"))) {
+               char *tmp_codec_string = switch_core_session_strdup(smh->session, tmp);
+               smh->codec_order_last = switch_separate_string(tmp_codec_string, ',', smh->codec_order, SWITCH_MAX_CODECS);
+               smh->mparams->num_codecs = switch_loadable_module_get_codecs_sorted(smh->codecs, SWITCH_MAX_CODECS, smh->codec_order, smh->codec_order_last);
+       }
 
        if ((tmp = switch_channel_get_variable(session->channel, "rtp_2833_send_payload"))) {
                smh->mparams->te = (switch_payload_t)atoi(tmp);