add heartbeat_use_scheduler variable to force the heartbeat to use the scheduler rather than the media stream and also make it auto-chage between modes when going in and out of the media path

This commit is contained in:
Anthony Minessale 2014-04-29 04:20:46 +05:00
parent cc928b2315
commit d0de8c0bc6
2 changed files with 12 additions and 0 deletions

View File

@ -7742,6 +7742,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se
}
goto end;
case SWITCH_MESSAGE_INDICATE_MEDIA:
{
if (session->track_duration) {
switch_core_session_enable_heartbeat(session, session->track_duration);
}
}
break;
case SWITCH_MESSAGE_INDICATE_NOMEDIA:
{
const char *uuid;
@ -7781,6 +7788,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se
switch_core_media_absorb_sdp(session);
}
if (session->track_duration) {
switch_core_session_enable_heartbeat(session, session->track_duration);
}
}
break;

View File

@ -1541,6 +1541,7 @@ SWITCH_DECLARE(void) switch_core_session_enable_heartbeat(switch_core_session_t
session->track_duration = seconds;
if (switch_channel_test_flag(session->channel, CF_PROXY_MODE) ||
switch_true(switch_channel_get_variable_dup(session->channel, "heartbeat_use_scheduler", SWITCH_FALSE, -1)) ||
switch_true(switch_channel_get_variable_dup(session->channel, "bypass_media", SWITCH_FALSE, -1)) ||
switch_true(switch_channel_get_variable_dup(session->channel, "bypass_media_after_bridge", SWITCH_FALSE, -1))) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s using scheduler due to bypass_media mode\n",