diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 4653f87d3f..ab64703c37 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -908,9 +908,14 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f } } - + switch_clear_flag_locked(tech_pvt, TFLAG_READING); + if (tech_pvt->read_frame.datalen == 0) { + *frame = NULL; + return SWITCH_STATUS_GENERR; + } + *frame = &tech_pvt->read_frame; return SWITCH_STATUS_SUCCESS;