From 18df083c699d9f1aa193b0f3df72044f2813aab2 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 18 Apr 2014 00:06:24 +0500 Subject: [PATCH] don't send heartbeat until the first timeout has elapsed rather than instantly --- src/switch_core_session.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/switch_core_session.c b/src/switch_core_session.c index 228e765dad..b4703195ee 100644 --- a/src/switch_core_session.c +++ b/src/switch_core_session.c @@ -1538,6 +1538,8 @@ SWITCH_DECLARE(void) switch_core_session_enable_heartbeat(switch_core_session_t seconds = 60; } + + session->read_frame_count = (session->read_impl.actual_samples_per_second / session->read_impl.samples_per_packet) * seconds; session->track_duration = seconds; if (switch_channel_test_flag(session->channel, CF_PROXY_MODE)) { @@ -1552,8 +1554,6 @@ SWITCH_DECLARE(void) switch_core_session_enable_heartbeat(switch_core_session_t switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "%s setting session heartbeat to %u second(s).\n", switch_channel_get_name(session->channel), seconds); - session->read_frame_count = 0; - } SWITCH_DECLARE(void) switch_core_session_disable_heartbeat(switch_core_session_t *session)