diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index c5e2dfaa21..390c8886a9 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -6134,7 +6134,6 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status extract_header_vars(profile, sip, session, nh); extract_vars(profile, sip, session); - switch_core_recovery_track(session); switch_channel_clear_flag(tech_pvt->channel, CF_RECOVERING); } diff --git a/src/switch_channel.c b/src/switch_channel.c index c27f1c5ff9..f6d3a96ddc 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -1990,6 +1990,10 @@ SWITCH_DECLARE(void) switch_channel_clear_flag(switch_channel_t *channel, switch switch_core_session_wake_video_thread(channel->session); } + if (flag == CF_RECOVERING && !channel->hangup_cause) { + switch_core_recovery_track(channel->session); + } + } diff --git a/src/switch_core_state_machine.c b/src/switch_core_state_machine.c index 91fe8f7a3d..eb54bc9ca1 100644 --- a/src/switch_core_state_machine.c +++ b/src/switch_core_state_machine.c @@ -48,6 +48,8 @@ static void switch_core_standard_on_init(switch_core_session_t *session) switch_channel_set_state(session->channel, CS_ROUTING); } } + + switch_channel_clear_flag(session->channel, CF_RECOVERING); } static void switch_core_standard_on_hangup(switch_core_session_t *session)