const char *global_cf = "voicemail_ivr.conf";
void populate_profile_menu_event(vmivr_profile_t *profile, vmivr_menu_profile_t *menu) {
- switch_xml_t cfg, xml, x_profiles, x_profile, x_keys, x_phrases, x_menus, x_menu;
+ switch_xml_t cfg, xml, x_profiles, x_profile, x_keys, x_phrases, x_menus, x_menu, x_settings;
free_profile_menu_event(menu);
goto end;
}
+ if (profile->event_settings) {
+ switch_event_create(&menu->event_settings, SWITCH_EVENT_REQUEST_PARAMS);
+ switch_event_merge(menu->event_settings, profile->event_settings);
+ }
+
+
if ((x_profile = switch_xml_find_child(x_profiles, "profile", "name", profile->name))) {
if ((x_menus = switch_xml_child(x_profile, "menus"))) {
if ((x_menu = switch_xml_find_child(x_menus, "menu", "name", menu->name))) {
if ((x_phrases = switch_xml_child(x_menu, "phrases"))) {
switch_event_import_xml(switch_xml_child(x_phrases, "phrase"), "name", "value", &menu->event_phrases);
}
+ if ((x_settings = switch_xml_child(x_profile, "settings"))) {
+ switch_event_import_xml(switch_xml_child(x_settings, "param"), "name", "value", &menu->event_settings);
+ }
+
}
}
}
if (menu->event_phrases) {
switch_event_destroy(&menu->event_phrases);
}
+ if (menu->event_settings) {
+ switch_event_destroy(&menu->event_settings);
+ }
+
}
vmivr_profile_t *get_profile(switch_core_session_t *session, const char *profile_name)
{
vmivr_profile_t *profile = NULL;
- switch_xml_t cfg, xml, x_profiles, x_profile, x_apis, param;
+ switch_xml_t cfg, xml, x_profiles, x_profile, x_apis, x_settings, param;
if (!(xml = switch_xml_open_cfg(global_cf, &cfg, NULL))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", global_cf);
profile->menu_check_main = "std_main_menu";
profile->menu_check_terminate = "std_purge";
+ if ((x_settings = switch_xml_child(x_profile, "settings"))) {
+ switch_event_import_xml(switch_xml_child(x_settings, "param"), "name", "value", &profile->event_settings);
+ }
+
if ((x_apis = switch_xml_child(x_profile, "apis"))) {
int total_options = 0;
int total_invalid_options = 0;