summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/migrate/20130212071000_default_profile_to_template.rb13
-rw-r--r--misc/freeswitch/scripts/configuration.lua7
2 files changed, 19 insertions, 1 deletions
diff --git a/db/migrate/20130212071000_default_profile_to_template.rb b/db/migrate/20130212071000_default_profile_to_template.rb
new file mode 100644
index 0000000..d3fd89c
--- /dev/null
+++ b/db/migrate/20130212071000_default_profile_to_template.rb
@@ -0,0 +1,13 @@
+class DefaultProfileToTemplate < ActiveRecord::Migration
+ def up
+ GsParameter.where(:entity => 'sofia', :section => 'profile:gemeinschaft').each do |profile|
+ profile.update_attributes(:section => 'profile')
+ end
+ end
+
+ def down
+ GsParameter.where(:entity => 'sofia', :section => 'profile').each do |profile|
+ profile.update_attributes(:section => 'profile:gemeinschaft')
+ end
+ end
+end
diff --git a/misc/freeswitch/scripts/configuration.lua b/misc/freeswitch/scripts/configuration.lua
index 18f4ef2..9847cc9 100644
--- a/misc/freeswitch/scripts/configuration.lua
+++ b/misc/freeswitch/scripts/configuration.lua
@@ -63,7 +63,12 @@ function profile(database, sofia_ini, profile_name, index, domains, node_id)
require 'configuration.simple_xml'
local xml = configuration.simple_xml.SimpleXml:new();
- local parameters = sofia_ini['profile:' .. profile_name];
+ local profile_template = sofia_ini['profile'] or {};
+ local parameters = sofia_ini['profile:' .. profile_name] or {};
+
+ for key, value in pairs(profile_template) do
+ parameters[key] = parameters[key] or value;
+ end
if not parameters then
log:error('SOFIA_PROFILE ', index,' - name: ', profile_name, ' - no parameters');