fail the call when the best match is a codec with no name.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4065 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2007-01-27 04:45:54 +00:00
parent b6bcd30dff
commit f17eece9e3

View File

@ -1348,6 +1348,12 @@ static switch_status_t tech_set_codec(private_object_t *tech_pvt, int force)
channel = switch_core_session_get_channel(tech_pvt->session);
assert(channel != NULL);
if (!tech_pvt->rm_encoding) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec with no name?\n");
terminate_session(&tech_pvt->session, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER, __LINE__);
return SWITCH_STATUS_FALSE;
}
if (switch_core_codec_init(&tech_pvt->read_codec,
tech_pvt->rm_encoding,
tech_pvt->rm_fmtp,