Author: anthm Date: Thu May 8 16:58:25 2008 New Revision: 8314 Modified: freeswitch/trunk/src/switch_core_io.c Log: extra protection against unruly practice Modified: freeswitch/trunk/src/switch_core_io.c ============================================================================== --- freeswitch/trunk/src/switch_core_io.c (original) +++ freeswitch/trunk/src/switch_core_io.c Thu May 8 16:58:25 2008 @@ -103,8 +103,14 @@ switch_status_t status; int need_codec, perfect, do_bugs = 0, do_resample = 0, is_cng = 0; unsigned int flag = 0; + top: + if (!(session->read_codec && session->read_codec->implementation)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s has no read codec.\n", switch_channel_get_name(session->channel)); + return SWITCH_STATUS_FALSE; + } + if (switch_channel_get_state(session->channel) >= CS_HANGUP) { *frame = NULL; return SWITCH_STATUS_FALSE; @@ -502,6 +508,7 @@ } if (!(session->write_codec && session->write_codec->implementation)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s has no write codec.\n", switch_channel_get_name(session->channel)); return SWITCH_STATUS_FALSE; }