mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
add SWITCH_MESSAGE_HEARTBEAT_EVENT indication to execute on a session when session heartbeat fires
This commit is contained in:
@@ -226,8 +226,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
|
||||
if (session->read_codec && !session->track_id && session->track_duration) {
|
||||
if (session->read_frame_count == 0) {
|
||||
switch_event_t *event;
|
||||
switch_core_session_message_t msg = { 0 };
|
||||
|
||||
session->read_frame_count = (session->read_impl.actual_samples_per_second / session->read_impl.samples_per_packet) * session->track_duration;
|
||||
|
||||
msg.message_id = SWITCH_MESSAGE_HEARTBEAT_EVENT;
|
||||
switch_core_session_receive_message(session, &msg);
|
||||
|
||||
switch_event_create(&event, SWITCH_EVENT_SESSION_HEARTBEAT);
|
||||
switch_channel_event_set_data(session->channel, event);
|
||||
switch_event_fire(&event);
|
||||
|
Reference in New Issue
Block a user