From e1e45b9d4859099ef314dda9101d1d59d4a91917 Mon Sep 17 00:00:00 2001 From: spag Date: Tue, 29 Jan 2013 11:07:57 +0100 Subject: profiles order --- misc/freeswitch/scripts/configuration.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'misc/freeswitch/scripts/configuration.lua') diff --git a/misc/freeswitch/scripts/configuration.lua b/misc/freeswitch/scripts/configuration.lua index 062cf5d..18f4ef2 100644 --- a/misc/freeswitch/scripts/configuration.lua +++ b/misc/freeswitch/scripts/configuration.lua @@ -134,8 +134,15 @@ function conf_sofia(database) require 'configuration.sip' local domains = configuration.sip.Sip:new{ log = log, database = database}:domains(); - sofia_profiles_xml = ''; + local sofia_profiles = {}; for profile_name, index in pairs(sofia_ini.profiles) do + if tonumber(index) and tonumber(index) > 0 then + sofia_profiles[index] = profile_name; + end + end + + local sofia_profiles_xml = ''; + for index, profile_name in ipairs(sofia_profiles) do if tonumber(index) and tonumber(index) > 0 then sofia_profiles_xml = sofia_profiles_xml .. profile(database, sofia_ini, profile_name, tonumber(index), domains, local_node_id); end -- cgit v1.2.3 From d1145ad9d4f495d7416ed97e0dd3c17365990323 Mon Sep 17 00:00:00 2001 From: spag Date: Tue, 12 Feb 2013 08:19:00 +0100 Subject: create profile template --- misc/freeswitch/scripts/configuration.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'misc/freeswitch/scripts/configuration.lua') 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'); -- cgit v1.2.3 From 0ece4561627130eceb83deef4e5c2df00ec1664e Mon Sep 17 00:00:00 2001 From: spag Date: Tue, 12 Feb 2013 09:41:55 +0100 Subject: support for registrations to non default profiles --- misc/freeswitch/scripts/configuration.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'misc/freeswitch/scripts/configuration.lua') diff --git a/misc/freeswitch/scripts/configuration.lua b/misc/freeswitch/scripts/configuration.lua index 9847cc9..75d0df3 100644 --- a/misc/freeswitch/scripts/configuration.lua +++ b/misc/freeswitch/scripts/configuration.lua @@ -415,7 +415,7 @@ function directory_sip_account(database) end else require 'common.sip_account' - local sip_account = common.sip_account.SipAccount:new{ log = log, database = database}:find_by_auth_name(auth_name, domain); + local sip_account = common.sip_account.SipAccount:new{ log = log, database = database}:find_by_auth_name(auth_name); require 'common.configuration_table' local user_parameters = common.configuration_table.get(database, 'sip_accounts', 'parameters'); -- cgit v1.2.3