summaryrefslogtreecommitdiff
path: root/misc/freeswitch/scripts/configuration.lua
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-01-10 16:41:32 +0100
committerspag <spag@golwen.net>2013-01-10 16:41:32 +0100
commitbf0976bf84a8a25c69ce9a36b28e1f74ccc42030 (patch)
treeb4af0195212b0be065c760f5a50016bd395853fd /misc/freeswitch/scripts/configuration.lua
parente8f75901658a648f2cc4e95f49d76f89afceeb33 (diff)
voicemail configuration
Diffstat (limited to 'misc/freeswitch/scripts/configuration.lua')
-rw-r--r--misc/freeswitch/scripts/configuration.lua41
1 files changed, 39 insertions, 2 deletions
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