From f17eece9e3643f3648019dd747a529f4428629e1 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Sat, 27 Jan 2007 04:45:54 +0000 Subject: [PATCH] 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 --- src/mod/endpoints/mod_sofia/mod_sofia.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index f5ec300242..94c530ad9e 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -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,