FS-11421: [core,mod_sofia] Fix rtp_pass_codecs_on_stream_change to process all sdp settings in the re-invite -- add new filter_codecs app and fix some races and negotiation bugs #resolve

This commit is contained in:
Piotr Gregor
2018-09-27 16:29:26 +00:00
committed by Mike Jerris
parent c47752c940
commit 118dd796f3
5 changed files with 70 additions and 8 deletions

View File

@@ -587,6 +587,23 @@ SWITCH_STANDARD_APP(sched_heartbeat_function)
}
#define FILTER_CODECS_SYNTAX "<codec string>"
SWITCH_STANDARD_APP(filter_codecs_function)
{
const char *r_sdp;
switch_channel_t *channel = switch_core_session_get_channel(session);
r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
if (data && r_sdp) {
switch_core_media_merge_sdp_codec_string(session, r_sdp, SDP_TYPE_REQUEST, data);
switch_channel_set_variable(channel, "filter_codec_string", data);
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Incomplete data\n");
}
}
#define HEARTBEAT_SYNTAX "[0|<seconds>]"
SWITCH_STANDARD_APP(heartbeat_function)
@@ -6507,6 +6524,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
SWITCH_ADD_APP(app_interface, "enable_heartbeat", "Enable Media Heartbeat", "Enable Media Heartbeat",
heartbeat_function, HEARTBEAT_SYNTAX, SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "filter_codecs", "Filter Codecs", "Filter Codecs", filter_codecs_function, FILTER_CODECS_SYNTAX, SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "enable_keepalive", "Enable Keepalive", "Enable Keepalive",
keepalive_function, KEEPALIVE_SYNTAX, SAF_SUPPORT_NOMEDIA);