diff --git a/src/include/switch_rtp.h b/src/include/switch_rtp.h index 9ead7de83a..288c15f8e6 100644 --- a/src/include/switch_rtp.h +++ b/src/include/switch_rtp.h @@ -168,7 +168,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_set_remote_address(switch_rtp_t *rtp_ SWITCH_DECLARE(char *) switch_rtp_get_remote_host(switch_rtp_t *rtp_session); SWITCH_DECLARE(switch_port_t) switch_rtp_get_remote_port(switch_rtp_t *rtp_session); - +SWITCH_DECLARE(void) switch_rtp_reset_media_timer(switch_rtp_t *rtp_session); SWITCH_DECLARE(void) switch_rtp_set_max_missed_packets(switch_rtp_t *rtp_session, uint32_t max); /*! diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 6175589957..7921da5819 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -1817,6 +1817,10 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f switch_assert(tech_pvt != NULL); switch_mutex_lock(tech_pvt->sofia_mutex); + if (switch_rtp_ready(tech_pvt->rtp_session)) { + switch_rtp_reset_media_timer(tech_pvt->rtp_session); + } + if ((var = switch_channel_get_variable(tech_pvt->channel, SOFIA_SECURE_MEDIA_VARIABLE)) && switch_true(var)) { switch_set_flag_locked(tech_pvt, TFLAG_SECURE); } diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 18603a9870..80910865fd 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -608,6 +608,11 @@ SWITCH_DECLARE(void) switch_rtp_set_max_missed_packets(switch_rtp_t *rtp_session rtp_session->max_missed_packets = max; } +SWITCH_DECLARE(void) switch_rtp_reset_media_timer(switch_rtp_t *rtp_session) +{ + rtp_session->missed_count = 0; +} + SWITCH_DECLARE(char *) switch_rtp_get_remote_host(switch_rtp_t *rtp_session) { return switch_strlen_zero(rtp_session->remote_host_str) ? "0.0.0.0" : rtp_session->remote_host_str;