From 6cd5f4de00c5c7e201106f0cee01c0a39eeef1d7 Mon Sep 17 00:00:00 2001 From: Arsen Chaloyan Date: Mon, 24 Dec 2007 18:18:34 +0000 Subject: [PATCH] not to add mrcp profile to profile_hash, if it failed to run git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6970 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c b/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c index e7308b5ab3..d3f391a0b2 100644 --- a/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c +++ b/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c @@ -836,8 +836,13 @@ static switch_status_t do_config() /* add profile */ if (!switch_core_hash_find(openmrcp_module.profile_hash, mrcp_profile->name)) { - switch_core_hash_insert(openmrcp_module.profile_hash, mrcp_profile->name, mrcp_profile); - openmrcp_profile_run(mrcp_profile); + if(openmrcp_profile_run(mrcp_profile) == SWITCH_STATUS_SUCCESS) { + switch_core_hash_insert(openmrcp_module.profile_hash, mrcp_profile->name, mrcp_profile); + } + } + else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, + "profile with the name [%s] already exists\n", mrcp_profile->name); } } }