]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
don't send heartbeat until the first timeout has elapsed rather than instantly
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 17 Apr 2014 19:06:24 +0000 (00:06 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 17 Apr 2014 19:06:24 +0000 (00:06 +0500)
src/switch_core_session.c

index 228e765dadbb07ff5b5469f692053682d983e8f5..b4703195eea90eb9e321afb990a1406c72aeecd9 100644 (file)
@@ -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)