mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-03 22:26:51 +00:00
FS-8404: if media engine will default to PCMU/PCMA if you don't specify any codecs
This commit is contained in:
parent
38ff603766
commit
7d57063a14
@ -1750,6 +1750,7 @@ SWITCH_DECLARE(void) switch_core_media_prepare_codecs(switch_core_session_t *ses
|
|||||||
const char *abs, *codec_string = NULL;
|
const char *abs, *codec_string = NULL;
|
||||||
const char *ocodec = NULL, *val;
|
const char *ocodec = NULL, *val;
|
||||||
switch_media_handle_t *smh;
|
switch_media_handle_t *smh;
|
||||||
|
char *tmp_codec_string;
|
||||||
|
|
||||||
switch_assert(session);
|
switch_assert(session);
|
||||||
|
|
||||||
@ -1806,16 +1807,16 @@ SWITCH_DECLARE(void) switch_core_media_prepare_codecs(switch_core_session_t *ses
|
|||||||
}
|
}
|
||||||
|
|
||||||
ready:
|
ready:
|
||||||
if (codec_string) {
|
|
||||||
char *tmp_codec_string = switch_core_session_strdup(smh->session, codec_string);
|
|
||||||
|
|
||||||
|
if (!codec_string) {
|
||||||
|
codec_string = "PCMU@20i,PCMA@20i,speex@20i";
|
||||||
|
}
|
||||||
|
|
||||||
|
tmp_codec_string = switch_core_session_strdup(smh->session, codec_string);
|
||||||
switch_channel_set_variable(session->channel, "rtp_use_codec_string", 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->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);
|
smh->mparams->num_codecs = switch_loadable_module_get_codecs_sorted(smh->codecs, SWITCH_MAX_CODECS, smh->codec_order, smh->codec_order_last);
|
||||||
} else {
|
|
||||||
smh->mparams->num_codecs = switch_loadable_module_get_codecs(smh->codecs, sizeof(smh->codecs) / sizeof(smh->codecs[0]));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user