diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index eced7cb00d..2287b191aa 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -1786,7 +1786,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi } set_local_sdp(tech_pvt, NULL, 0, NULL, 1); do_invite(session); - while (!switch_rtp_ready(tech_pvt->rtp_session)) { + while (!switch_rtp_ready(tech_pvt->rtp_session) && switch_channel_get_state(channel) < CS_HANGUP) { switch_yield(1000); } }