From a5e0ddf8a162d2e9890369f76f1a16ed6f648c25 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 12 Jan 2008 03:40:25 +0000 Subject: [PATCH] update fix to FSCORE-85 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7183 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- conf/autoload_configs/ivr.conf.xml | 2 +- src/switch_ivr_menu.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/conf/autoload_configs/ivr.conf.xml b/conf/autoload_configs/ivr.conf.xml index 4639cbb2d0..dc7424d280 100644 --- a/conf/autoload_configs/ivr.conf.xml +++ b/conf/autoload_configs/ivr.conf.xml @@ -9,7 +9,7 @@ - + diff --git a/src/switch_ivr_menu.c b/src/switch_ivr_menu.c index 51d2ec94e9..060971cd94 100644 --- a/src/switch_ivr_menu.c +++ b/src/switch_ivr_menu.c @@ -489,8 +489,6 @@ static switch_status_t switch_ivr_menu_stack_xml_add(switch_ivr_menu_xml_ctx_t * if (xml_ctx != NULL && name != NULL && xml_ctx->pool != NULL && switch_ivr_menu_stack_xml_find(xml_ctx, name) == NULL) { switch_ivr_menu_xml_map_t *map = switch_core_alloc(xml_ctx->pool, sizeof(switch_ivr_menu_xml_map_t)); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "switch_ivr_menu_stack_xml_add binding '%s'\n", name); - // and we have memory if (map != NULL) { map->name = switch_core_strdup(xml_ctx->pool, name); map->action = action; @@ -507,6 +505,10 @@ static switch_status_t switch_ivr_menu_stack_xml_add(switch_ivr_menu_xml_ctx_t * } else { status = SWITCH_STATUS_MEMERR; } + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "switch_ivr_menu_stack_xml_add binding '%s'\n", name); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to add binding %s\n", name); } return status; @@ -533,7 +535,7 @@ static struct iam_s { static switch_bool_t is_valid_action(const char *action) { int i; - + if (!switch_strlen_zero(action)) { for(i = 0;;i++) { if (!iam[i].name) { @@ -575,10 +577,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_init(switch_ivr_menu_x } // build the standard/default xml menu handler mappings if (status == SWITCH_STATUS_SUCCESS && xml_menu_ctx != NULL && *xml_menu_ctx != NULL) { - int iam_qty = (sizeof(iam) / sizeof(iam[0])); int i; - for (i = 0; i < iam_qty && status == SWITCH_STATUS_SUCCESS; i++) { + for (i = 0; iam[i].name && status == SWITCH_STATUS_SUCCESS; i++) { status = switch_ivr_menu_stack_xml_add(*xml_menu_ctx, iam[i].name, iam[i].action, NULL); } }