[Freeswitch-trunk] [commit] r12666 - freeswitch/trunk/src/mod/applications/mod_dptools
FreeSWITCH SVN
mrene at freeswitch.org
Wed Mar 18 21:11:52 PDT 2009
Author: mrene
Date: Wed Mar 18 23:11:51 2009
New Revision: 12666
Log:
Add Menu-Name param to ivr menu xml_locate function
Modified:
freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c Wed Mar 18 23:11:51 2009
@@ -1156,18 +1156,20 @@
{
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_event_t *params;
+ const char *name = (const char*)data;
if (channel) {
switch_xml_t cxml = NULL, cfg = NULL, xml_menus = NULL, xml_menu = NULL;
/* Open the config from the xml registry */
switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS);
+ switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "Menu-Name", name);
switch_assert(params);
switch_channel_event_set_data(channel, params);
if ((cxml = switch_xml_open_cfg(ivr_cf_name, &cfg, params)) != NULL) {
if ((xml_menus = switch_xml_child(cfg, "menus"))) {
- xml_menu = switch_xml_find_child(xml_menus, "menu", "name", (char *) data);
+ xml_menu = switch_xml_find_child(xml_menus, "menu", "name", name);
/* if the menu was found */
if (xml_menu != NULL) {
@@ -1182,7 +1184,7 @@
&& switch_ivr_menu_stack_xml_build(xml_ctx, &menu_stack, xml_menus, xml_menu) == SWITCH_STATUS_SUCCESS) {
switch_xml_free(cxml);
cxml = NULL;
- switch_ivr_menu_execute(session, menu_stack, (char *) data, NULL);
+ switch_ivr_menu_execute(session, menu_stack, (char*)name, NULL);
switch_ivr_menu_stack_free(menu_stack);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to create menu\n");
More information about the Freeswitch-trunk
mailing list