From 5099d3b8e3236844ef2502a6f7e40f0f98bb2730 Mon Sep 17 00:00:00 2001 From: Christopher Rienzo Date: Fri, 3 Jun 2011 20:41:09 +0000 Subject: [PATCH] fix mod_unimrcp reloadxml issue --- src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c index 53281bc389..c869d9e8da 100644 --- a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c +++ b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c @@ -3958,8 +3958,13 @@ static mrcp_client_t *mod_unimrcp_client_create(switch_memory_pool_t *mod_pool) client = NULL; goto done; } + if (zstr(param_value)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing SPEAK param value\n"); + client = NULL; + goto done; + } switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Loading SPEAK Param %s:%s\n", param_name, param_value); - switch_core_hash_insert(mod_profile->default_synth_params, param_name, param_value); + switch_core_hash_insert(mod_profile->default_synth_params, switch_core_strdup(pool, param_name), switch_core_strdup(pool, param_value)); } } @@ -3976,8 +3981,13 @@ static mrcp_client_t *mod_unimrcp_client_create(switch_memory_pool_t *mod_pool) client = NULL; goto done; } + if (zstr(param_value)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing RECOGNIZE param value\n"); + client = NULL; + goto done; + } switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Loading RECOGNIZE Param %s:%s\n", param_name, param_value); - switch_core_hash_insert(mod_profile->default_recog_params, param_name, param_value); + switch_core_hash_insert(mod_profile->default_recog_params, switch_core_strdup(pool, param_name), switch_core_strdup(pool, param_value)); } }