From: Anthony Minessale Date: Thu, 17 Apr 2014 19:06:24 +0000 (+0500) Subject: don't send heartbeat until the first timeout has elapsed rather than instantly X-Git-Tag: v1.5.12~174 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18df083c699d9f1aa193b0f3df72044f2813aab2;p=thirdparty%2Ffreeswitch.git don't send heartbeat until the first timeout has elapsed rather than instantly --- 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)