From bf0976bf84a8a25c69ce9a36b28e1f74ccc42030 Mon Sep 17 00:00:00 2001 From: spag Date: Thu, 10 Jan 2013 16:41:32 +0100 Subject: voicemail configuration --- misc/freeswitch/scripts/configuration.lua | 41 +++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) (limited to 'misc/freeswitch/scripts/configuration.lua') diff --git a/misc/freeswitch/scripts/configuration.lua b/misc/freeswitch/scripts/configuration.lua index 0cd3752..ec5099e 100644 --- a/misc/freeswitch/scripts/configuration.lua +++ b/misc/freeswitch/scripts/configuration.lua @@ -98,9 +98,9 @@ end function conf_conference(database) require 'common.configuration_table' - XML_STRING = xml:document(xml:conference()); - + local config = common.configuration_table.get(database, 'conferences'); + XML_STRING = xml:document(xml:conference(nil, config.controls_speaker, config.controls_moderator)); local event_name = params:getHeader("Event-Name") if event_name == 'COMMAND' then @@ -125,6 +125,41 @@ function conf_conference(database) end end +function conf_voicemail(database) + require 'common.configuration_table'; + local parameters = common.configuration_table.get(database, 'voicemail', 'parameters'); + + if tostring(parameters['odbc-dsn']) == 'default' then + parameters['odbc-dsn'] = 'gemeinschaft:' .. tostring(database.user_name) .. ':' .. tostring(database.password); + end + + local params_xml = {}; + for name, value in pairs(parameters) do + params_xml[#params_xml+1] = xml:tag{ _name = 'param', name = name, value = value }; + end + + XML_STRING = xml:document( + xml:tag{ + _name = 'section', + name = 'configuration', + description = 'Gemeinschaft 5 FreeSWITCH configuration', + _data = xml:tag{ + _name = 'configuration', + name = 'voicemail.conf', + description = 'Voicemail configuration', + _data = xml:tag{ + _name = 'profiles', + _data = xml:tag{ + _name = 'profile', + name = 'default', + _data = table.concat(params_xml, '\n'), + }, + }, + }, + } + ); +end + function conf_post_switch(database) require 'common.configuration_table'; local parameters = common.configuration_table.get(database, 'post_load_switch', 'settings'); @@ -220,6 +255,8 @@ if XML_REQUEST.section == 'configuration' and XML_REQUEST.tag_name == 'configura conf_sofia(database); elseif XML_REQUEST.key_value == "conference.conf" then conf_conference(database); + elseif XML_REQUEST.key_value == "voicemail.conf" then + conf_voicemail(database); elseif XML_REQUEST.key_value == "post_load_switch.conf" then conf_post_switch(database); end -- cgit v1.2.3