From 313eef1e54b0858ab50a81e7929761744a262c0c Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Fri, 7 Jun 2013 10:17:41 +0200 Subject: pager config generator added --- misc/freeswitch/scripts/configuration.lua | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'misc/freeswitch') diff --git a/misc/freeswitch/scripts/configuration.lua b/misc/freeswitch/scripts/configuration.lua index 16dbed7..2486565 100644 --- a/misc/freeswitch/scripts/configuration.lua +++ b/misc/freeswitch/scripts/configuration.lua @@ -194,8 +194,8 @@ function conf_conference(database) local conf_name = params:getHeader('conf_name'); local profile_name = params:getHeader('profile_name'); - if conf_name then - require 'common.conference' + if conf_name:find('^conference%d+') then + require 'common.conference'; conference = common.conference.Conference:new{log=log, database=database}:find_by_id(common.str.to_i(conf_name)); if conference then log:debug('CONFIG_CONFERENCE ', conf_name, ' name: ', conference.record.name, ', profile: ', profile_name); @@ -211,6 +211,27 @@ function conf_conference(database) else log:error('CONFIG_CONFERENCE ', conf_name, ' - conference not found'); end + elseif conf_name:find('^pager%d+') then + local parameters = { + ['moh-sound'] = '', + ['caller-controls'] = "speaker", + ['moderator-controls'] = "moderator", + ['comfort-noise'] = false, + } + + require 'common.pager'; + pager = common.pager.Pager:new{log=log, database=database}:find_by_id(common.str.to_i(conf_name)); + if pager then + log:debug('CONFIG_PAGER ', conf_name, ', profile: ', profile_name); + profiles = xml:element{ + 'profiles', + xml:element{ + 'profile', + name = profile_name, + xml:from_hash('param', parameters, 'name', 'value'), + }, + }; + end else log:notice('CONFIG_CONFERENCE - no conference name'); end -- cgit v1.2.3