From 78cfbba5f201d2468c628abdfd457b1f14495541 Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 18 Jan 2013 11:18:30 +0100 Subject: set variables --- misc/freeswitch/scripts/dialplan/dialplan.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/misc/freeswitch/scripts/dialplan/dialplan.lua b/misc/freeswitch/scripts/dialplan/dialplan.lua index e90354c..0407485 100644 --- a/misc/freeswitch/scripts/dialplan/dialplan.lua +++ b/misc/freeswitch/scripts/dialplan/dialplan.lua @@ -624,7 +624,7 @@ function Dialplan.callthrough(self, destination) end require 'dialplan.router' - local route = dialplan.router.Router:new{ log = self.log, database = self.database, caller = self.caller }:route_run('prerouting', destination_number, true); + local route = dialplan.router.Router:new{ log = self.log, database = self.database, caller = self.caller, variables = self.caller }:route_run('prerouting', destination_number, true); if route and route.destination_number then destination_number = route.destination_number; @@ -773,7 +773,7 @@ function Dialplan.switch(self, destination) destination.callee_id_name = nil; require 'dialplan.router' - local routes = dialplan.router.Router:new{ log = self.log, database = self.database, caller = self.caller }:route_run('outbound', destination.number); + local routes = dialplan.router.Router:new{ log = self.log, database = self.database, caller = self.caller, variables = self.caller }:route_run('outbound', destination.number); if not routes or #routes == 0 then self.log:notice('SWITCH - no route - number: ', destination.number); @@ -878,7 +878,7 @@ function Dialplan.run(self, destination) self.caller.destination_number = self.caller:to_s(self.caller.gateway.settings.number_source); end - route = dialplan.router.Router:new{ log = self.log, database = self.database, caller = self.caller }:route_run('inbound', self.caller.destination_number, true); + route = dialplan.router.Router:new{ log = self.log, database = self.database, caller = self.caller, variables = self.caller }:route_run('inbound', self.caller.destination_number, true); if route then local ignore_keys = { id = true, @@ -898,7 +898,7 @@ function Dialplan.run(self, destination) self.log:notice('INBOUND - no route'); end else - route = dialplan.router.Router:new{ log = self.log, database = self.database, caller = self.caller }:route_run('prerouting', self.caller.destination_number, true); + route = dialplan.router.Router:new{ log = self.log, database = self.database, caller = self.caller, variables = self.caller }:route_run('prerouting', self.caller.destination_number, true); if route then local ignore_keys = { id = true, -- cgit v1.2.3 From 1e465e49670f6c0fccc1cd920992a14942d3cfba Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 18 Jan 2013 11:19:09 +0100 Subject: expand variables --- misc/freeswitch/scripts/dialplan/router.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/misc/freeswitch/scripts/dialplan/router.lua b/misc/freeswitch/scripts/dialplan/router.lua index 6c5b9f1..5f427ac 100644 --- a/misc/freeswitch/scripts/dialplan/router.lua +++ b/misc/freeswitch/scripts/dialplan/router.lua @@ -52,21 +52,20 @@ function Router.read_table(self, table_name) end -function Router.expand_variables(self, line) - return (line:gsub('{([%a%d_]+)}', function(captured) - return variables[captured] or ''; +function Router.expand_variables(self, line, variables) + return (line:gsub('{([%a%d%._]+)}', function(captured) + return common.str.try(variables, captured) or ''; end)) end function Router.element_match(self, pattern, search_string, replacement) - local variables_list = {}; local success, result = pcall(string.find, search_string, pattern); if not success then self.log:error('ELEMENT_MATCH - table error - pattern: ', pattern, ', search_string: ', search_string); elseif result then - return true, search_string:gsub(pattern, self:expand_variables(replacement, variables_list)); + return true, search_string:gsub(pattern, self:expand_variables(replacement, self.variables)); end return false; @@ -109,7 +108,7 @@ function Router.route_match(self, route) if element.action ~= 'none' then if common.str.blank(element.var_in) or common.str.blank(element.pattern) and element.action == 'set' then result = true; - replacement = element.replacement; + replacement = self:expand_variables(element.replacement, self.variables); else local command, variable_name = common.str.partition(element.var_in, ':'); -- cgit v1.2.3 From a76f384bef7deed913af1e2ee54eb1c295b62edd Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 18 Jan 2013 11:55:18 +0100 Subject: gateways ini rexample removed --- misc/freeswitch/scripts/ini/gateways.ini.example | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 misc/freeswitch/scripts/ini/gateways.ini.example diff --git a/misc/freeswitch/scripts/ini/gateways.ini.example b/misc/freeswitch/scripts/ini/gateways.ini.example deleted file mode 100644 index b6ae018..0000000 --- a/misc/freeswitch/scripts/ini/gateways.ini.example +++ /dev/null @@ -1,23 +0,0 @@ -; Gemeinschaft 5 gateways configuration file -; (c) AMOOMA GmbH 2012 -; - -[gateway1] -profile = gemeinschaft -name = gateway1 -username = gateway1 -realm = gemeinschaft -password = freeswitch -extension = default -proxy = 192.168.0.1 -expire-seconds = 600 -register = true - -[gateway2] -profile = gemeinschaft -name = sipgate -username = 1234567e0 -password = ABCdeF -proxy = sipgate.com -register = true -extension = {sip_to_user} -- cgit v1.2.3 From 045a4cfb6374cde4c664e91a9f8d1fede844b610 Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 18 Jan 2013 11:57:19 +0100 Subject: unused constant removed --- misc/freeswitch/scripts/dialplan/dialplan.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/misc/freeswitch/scripts/dialplan/dialplan.lua b/misc/freeswitch/scripts/dialplan/dialplan.lua index 0407485..87652d5 100644 --- a/misc/freeswitch/scripts/dialplan/dialplan.lua +++ b/misc/freeswitch/scripts/dialplan/dialplan.lua @@ -7,7 +7,6 @@ module(...,package.seeall) Dialplan = {} -- local constants -local CONFIG_FILE_NAME = '/opt/freeswitch/scripts/ini/dialplan.ini'; local DIAL_TIMEOUT = 120; local MAX_LOOPS = 20; local DIALPLAN_FUNCTION_PATTERN = '^f[_%-].*'; -- cgit v1.2.3 From 3a91509c6c668cc634d667a2e1c7144873a39861 Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 18 Jan 2013 12:10:48 +0100 Subject: gateway find_by_name method added --- misc/freeswitch/scripts/common/gateway.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/misc/freeswitch/scripts/common/gateway.lua b/misc/freeswitch/scripts/common/gateway.lua index 5c76aba..e50c763 100644 --- a/misc/freeswitch/scripts/common/gateway.lua +++ b/misc/freeswitch/scripts/common/gateway.lua @@ -52,6 +52,27 @@ function Gateway.find_by_id(self, id) end +function Gateway.find_by_name(self, name) + local gateway_name = name:gsub('([^%a%d%._%+])', ''); + + local sql_query = 'SELECT * FROM `gateways` WHERE `name`= "' .. gateway_name .. '" LIMIT 1'; + + local gateway = nil; + self.database:query(sql_query, function(entry) + gateway = Gateway:new(self); + gateway.record = entry; + gateway.id = tonumber(entry.id); + gateway.name = entry.name; + end) + + if gateway then + gateway.settings = self:config_table_get('gateway_settings', gateway.id); + end + + return gateway; +end + + function Gateway.authenticate(self, technology, caller) local sql_query = 'SELECT `c`.`name`, `c`.`id`, `a`.`value` `auth_source`, `b`.`value` `auth_pattern` \ FROM `gateway_settings` `a` \ -- cgit v1.2.3 From c7d5128985e4f4480068f467ad8efafdc7f7b7ed Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 18 Jan 2013 12:13:11 +0100 Subject: configuration.sip removed --- misc/freeswitch/scripts/configuration.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/misc/freeswitch/scripts/configuration.lua b/misc/freeswitch/scripts/configuration.lua index 1162e97..92ae7d8 100644 --- a/misc/freeswitch/scripts/configuration.lua +++ b/misc/freeswitch/scripts/configuration.lua @@ -312,10 +312,9 @@ function directory_sip_account(database) if string.len(auth_name) > 3 and auth_name:sub(1, 3) == 'gw+' then local gateway_name = auth_name:sub(4); domain = domain or freeswitch.API():execute('global_getvar', 'domain'); - require 'configuration.sip' - log:notice('DATABASE: ', database); - local sip_gateway = configuration.sip.Sip:new{ log = log, database = database}:find_gateway_by_name(gateway_name); - if sip_gateway ~= nil and next(sip_gateway) ~= nil then + require 'common.gateway' + local sip_gateway = common.gateway.Gateway:new{ log = self.log, database = self.database }:find_by_name(gateway_name); + if sip_gateway then log:debug('DIRECTORY_GATEWAY - name: ', gateway_name, ', auth_name: ', auth_name); local user_variables = { @@ -332,7 +331,7 @@ function directory_sip_account(database) 'params', xml:element{ 'param', - password = sip_gateway.password, + password = sip_gateway.record.password, } }, xml:element{ -- cgit v1.2.3 From 5e46709cadac227cbe5a2459a48d284ad657db36 Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 18 Jan 2013 12:17:03 +0100 Subject: find_gateway_by_name method removed --- misc/freeswitch/scripts/configuration/sip.lua | 6 ------ 1 file changed, 6 deletions(-) diff --git a/misc/freeswitch/scripts/configuration/sip.lua b/misc/freeswitch/scripts/configuration/sip.lua index 78143bc..4679aae 100644 --- a/misc/freeswitch/scripts/configuration/sip.lua +++ b/misc/freeswitch/scripts/configuration/sip.lua @@ -18,12 +18,6 @@ function Sip.new(self, arg) return object; end --- find gateway by name -function Sip.find_gateway_by_name(self, name) - require 'common.configuration_file' - return common.configuration_file.get('/opt/freeswitch/scripts/ini/gateways.ini', name); -end - -- list sip domains function Sip.domains(self) local sql_query = 'SELECT * FROM `sip_domains`'; -- cgit v1.2.3 From b5b1a19dd00eb8455ea21072bdd8249c82172619 Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 18 Jan 2013 12:18:39 +0100 Subject: save code lines --- misc/freeswitch/scripts/event_manager.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/misc/freeswitch/scripts/event_manager.lua b/misc/freeswitch/scripts/event_manager.lua index 0e3c0e0..707b8a2 100644 --- a/misc/freeswitch/scripts/event_manager.lua +++ b/misc/freeswitch/scripts/event_manager.lua @@ -17,10 +17,9 @@ if not database:connected() then end require "configuration.sip" -local sip = configuration.sip.Sip:new{ log = log, database = database } +local domains = configuration.sip.Sip:new{ log = log, database = database }:domains(); local domain = '127.0.0.1'; -local domains = sip:domains(); if domains[1] then domain = domains[1]['host']; else -- cgit v1.2.3 From 8744de13516c3fc2fbf2843e85aff08707f50de1 Mon Sep 17 00:00:00 2001 From: Julian Pawlowski Date: Fri, 18 Jan 2013 12:54:45 +0100 Subject: adjust copyright date for 2013 --- misc/freeswitch/scripts/acd_wait.lua | 2 +- misc/freeswitch/scripts/common/call_forwarding.lua | 2 +- misc/freeswitch/scripts/common/call_history.lua | 2 +- misc/freeswitch/scripts/common/conference.lua | 2 +- misc/freeswitch/scripts/common/configuration_file.lua | 2 +- misc/freeswitch/scripts/common/fapi.lua | 2 +- misc/freeswitch/scripts/common/ipcalc.lua | 2 +- misc/freeswitch/scripts/common/log.lua | 2 +- misc/freeswitch/scripts/common/phone_number.lua | 2 +- misc/freeswitch/scripts/common/routing_tables.lua | 2 +- misc/freeswitch/scripts/common/sip_account.lua | 2 +- misc/freeswitch/scripts/common/str.lua | 2 +- misc/freeswitch/scripts/common/sync_log.lua | 2 +- misc/freeswitch/scripts/configuration.lua | 2 +- misc/freeswitch/scripts/configuration/sip.lua | 2 +- misc/freeswitch/scripts/dialplan/acd.lua | 2 +- misc/freeswitch/scripts/dialplan/cdr.lua | 2 +- misc/freeswitch/scripts/dialplan/dialplan.lua | 2 +- misc/freeswitch/scripts/dialplan/fax.lua | 2 +- misc/freeswitch/scripts/dialplan/geo_number.lua | 2 +- misc/freeswitch/scripts/dialplan/hunt_group.lua | 2 +- misc/freeswitch/scripts/dialplan/phone_book.lua | 2 +- misc/freeswitch/scripts/dialplan/presence.lua | 2 +- misc/freeswitch/scripts/dialplan/route.lua | 2 +- misc/freeswitch/scripts/dialplan/session.lua | 2 +- misc/freeswitch/scripts/dialplan/sip_call.lua | 2 +- misc/freeswitch/scripts/dialplan/tenant.lua | 2 +- misc/freeswitch/scripts/dialplan/user.lua | 2 +- misc/freeswitch/scripts/dialplan/voicemail.lua | 2 +- misc/freeswitch/scripts/dialplan_default.lua | 2 +- misc/freeswitch/scripts/event/call_history_save.lua | 2 +- misc/freeswitch/scripts/event/cdr_save.lua | 2 +- misc/freeswitch/scripts/event/event.lua | 2 +- misc/freeswitch/scripts/event/perimeter.lua | 2 +- misc/freeswitch/scripts/event_manager.lua | 2 +- misc/freeswitch/scripts/fax_daemon.lua | 2 +- misc/freeswitch/scripts/ini/routes.ini | 2 +- misc/freeswitch/scripts/phones/phone.lua | 2 +- misc/freeswitch/scripts/phones/siemens.lua | 2 +- misc/freeswitch/scripts/phones/snom.lua | 2 +- misc/freeswitch/scripts/send_fax.lua | 2 +- misc/mon_ami/asterisk.py | 2 +- misc/mon_ami/freeswitch.py | 2 +- misc/mon_ami/helper.py | 2 +- misc/mon_ami/log.py | 2 +- misc/mon_ami/mon_ami | 2 +- misc/mon_ami/mon_ami_handler.py | 2 +- misc/mon_ami/mon_ami_main.py | 2 +- misc/mon_ami/mon_ami_server.py | 2 +- misc/mon_ami/tcp_server.py | 2 +- 50 files changed, 50 insertions(+), 50 deletions(-) diff --git a/misc/freeswitch/scripts/acd_wait.lua b/misc/freeswitch/scripts/acd_wait.lua index fd16bea..c05cc24 100644 --- a/misc/freeswitch/scripts/acd_wait.lua +++ b/misc/freeswitch/scripts/acd_wait.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5: acd call handler --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- local caller_uuid = argv[1]; diff --git a/misc/freeswitch/scripts/common/call_forwarding.lua b/misc/freeswitch/scripts/common/call_forwarding.lua index 3942d05..400fcde 100644 --- a/misc/freeswitch/scripts/common/call_forwarding.lua +++ b/misc/freeswitch/scripts/common/call_forwarding.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: call forwarding class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/common/call_history.lua b/misc/freeswitch/scripts/common/call_history.lua index 7a9ac07..7e1e22b 100644 --- a/misc/freeswitch/scripts/common/call_history.lua +++ b/misc/freeswitch/scripts/common/call_history.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: call_history class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/common/conference.lua b/misc/freeswitch/scripts/common/conference.lua index a7b21c3..ca5fa62 100644 --- a/misc/freeswitch/scripts/common/conference.lua +++ b/misc/freeswitch/scripts/common/conference.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: conference class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/common/configuration_file.lua b/misc/freeswitch/scripts/common/configuration_file.lua index 67e1f3b..3b3efbc 100644 --- a/misc/freeswitch/scripts/common/configuration_file.lua +++ b/misc/freeswitch/scripts/common/configuration_file.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: configuration file --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/common/fapi.lua b/misc/freeswitch/scripts/common/fapi.lua index 0a05155..5b96633 100644 --- a/misc/freeswitch/scripts/common/fapi.lua +++ b/misc/freeswitch/scripts/common/fapi.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: FS api class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/common/ipcalc.lua b/misc/freeswitch/scripts/common/ipcalc.lua index 5c19d20..49cb56c 100644 --- a/misc/freeswitch/scripts/common/ipcalc.lua +++ b/misc/freeswitch/scripts/common/ipcalc.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: ip calculation functions --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/common/log.lua b/misc/freeswitch/scripts/common/log.lua index d0d13dc..5aff2b8 100644 --- a/misc/freeswitch/scripts/common/log.lua +++ b/misc/freeswitch/scripts/common/log.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: log --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/common/phone_number.lua b/misc/freeswitch/scripts/common/phone_number.lua index 4df0d57..6635296 100644 --- a/misc/freeswitch/scripts/common/phone_number.lua +++ b/misc/freeswitch/scripts/common/phone_number.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: phone number class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/common/routing_tables.lua b/misc/freeswitch/scripts/common/routing_tables.lua index 34d0143..f28b5c5 100644 --- a/misc/freeswitch/scripts/common/routing_tables.lua +++ b/misc/freeswitch/scripts/common/routing_tables.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: routing table functions --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/common/sip_account.lua b/misc/freeswitch/scripts/common/sip_account.lua index 28a00df..8dd432b 100644 --- a/misc/freeswitch/scripts/common/sip_account.lua +++ b/misc/freeswitch/scripts/common/sip_account.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: sip account class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/common/str.lua b/misc/freeswitch/scripts/common/str.lua index c366fda..32f054e 100644 --- a/misc/freeswitch/scripts/common/str.lua +++ b/misc/freeswitch/scripts/common/str.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: string functions --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/common/sync_log.lua b/misc/freeswitch/scripts/common/sync_log.lua index 05b0dcf..3fdb646 100644 --- a/misc/freeswitch/scripts/common/sync_log.lua +++ b/misc/freeswitch/scripts/common/sync_log.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: sync log class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/configuration.lua b/misc/freeswitch/scripts/configuration.lua index 92ae7d8..9e62bb6 100644 --- a/misc/freeswitch/scripts/configuration.lua +++ b/misc/freeswitch/scripts/configuration.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 dynamic freeswitch configuration --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- function nodes(database, local_node_id) diff --git a/misc/freeswitch/scripts/configuration/sip.lua b/misc/freeswitch/scripts/configuration/sip.lua index 4679aae..6f5b204 100644 --- a/misc/freeswitch/scripts/configuration/sip.lua +++ b/misc/freeswitch/scripts/configuration/sip.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: sip configuration class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/dialplan/acd.lua b/misc/freeswitch/scripts/dialplan/acd.lua index 563d836..f4b298e 100644 --- a/misc/freeswitch/scripts/dialplan/acd.lua +++ b/misc/freeswitch/scripts/dialplan/acd.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: acd class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/dialplan/cdr.lua b/misc/freeswitch/scripts/dialplan/cdr.lua index 55a7889..d0fdede 100644 --- a/misc/freeswitch/scripts/dialplan/cdr.lua +++ b/misc/freeswitch/scripts/dialplan/cdr.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: cdr class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/dialplan/dialplan.lua b/misc/freeswitch/scripts/dialplan/dialplan.lua index 87652d5..405a664 100644 --- a/misc/freeswitch/scripts/dialplan/dialplan.lua +++ b/misc/freeswitch/scripts/dialplan/dialplan.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: dialplan class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/dialplan/fax.lua b/misc/freeswitch/scripts/dialplan/fax.lua index 2a40620..aa29ff6 100644 --- a/misc/freeswitch/scripts/dialplan/fax.lua +++ b/misc/freeswitch/scripts/dialplan/fax.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: fax class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/dialplan/geo_number.lua b/misc/freeswitch/scripts/dialplan/geo_number.lua index 06bfd62..76cc01b 100644 --- a/misc/freeswitch/scripts/dialplan/geo_number.lua +++ b/misc/freeswitch/scripts/dialplan/geo_number.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: geonumber class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/dialplan/hunt_group.lua b/misc/freeswitch/scripts/dialplan/hunt_group.lua index 87f86f1..44c2bb8 100644 --- a/misc/freeswitch/scripts/dialplan/hunt_group.lua +++ b/misc/freeswitch/scripts/dialplan/hunt_group.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: hunt group class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/dialplan/phone_book.lua b/misc/freeswitch/scripts/dialplan/phone_book.lua index 089f115..6653789 100644 --- a/misc/freeswitch/scripts/dialplan/phone_book.lua +++ b/misc/freeswitch/scripts/dialplan/phone_book.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: phone book class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/dialplan/presence.lua b/misc/freeswitch/scripts/dialplan/presence.lua index 234b908..0f63ce9 100644 --- a/misc/freeswitch/scripts/dialplan/presence.lua +++ b/misc/freeswitch/scripts/dialplan/presence.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: presence class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/dialplan/route.lua b/misc/freeswitch/scripts/dialplan/route.lua index 2243cbe..a12b5f9 100644 --- a/misc/freeswitch/scripts/dialplan/route.lua +++ b/misc/freeswitch/scripts/dialplan/route.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: routing class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/dialplan/session.lua b/misc/freeswitch/scripts/dialplan/session.lua index 20fef88..4029f9e 100644 --- a/misc/freeswitch/scripts/dialplan/session.lua +++ b/misc/freeswitch/scripts/dialplan/session.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: caller session class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/dialplan/sip_call.lua b/misc/freeswitch/scripts/dialplan/sip_call.lua index 0b799e5..3f56753 100644 --- a/misc/freeswitch/scripts/dialplan/sip_call.lua +++ b/misc/freeswitch/scripts/dialplan/sip_call.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: sip call class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall); diff --git a/misc/freeswitch/scripts/dialplan/tenant.lua b/misc/freeswitch/scripts/dialplan/tenant.lua index 8d6436c..904609e 100644 --- a/misc/freeswitch/scripts/dialplan/tenant.lua +++ b/misc/freeswitch/scripts/dialplan/tenant.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: user class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/dialplan/user.lua b/misc/freeswitch/scripts/dialplan/user.lua index 0a2e0dd..b536600 100644 --- a/misc/freeswitch/scripts/dialplan/user.lua +++ b/misc/freeswitch/scripts/dialplan/user.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: user class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/dialplan/voicemail.lua b/misc/freeswitch/scripts/dialplan/voicemail.lua index fe20128..5d79ba3 100644 --- a/misc/freeswitch/scripts/dialplan/voicemail.lua +++ b/misc/freeswitch/scripts/dialplan/voicemail.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: voicemail class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/dialplan_default.lua b/misc/freeswitch/scripts/dialplan_default.lua index eb80ae4..7caff57 100644 --- a/misc/freeswitch/scripts/dialplan_default.lua +++ b/misc/freeswitch/scripts/dialplan_default.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 default dialplan --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- diff --git a/misc/freeswitch/scripts/event/call_history_save.lua b/misc/freeswitch/scripts/event/call_history_save.lua index 057ca16..ba7a8f6 100644 --- a/misc/freeswitch/scripts/event/call_history_save.lua +++ b/misc/freeswitch/scripts/event/call_history_save.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: call_history event handler class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/event/cdr_save.lua b/misc/freeswitch/scripts/event/cdr_save.lua index ed53aa3..e7ac64a 100644 --- a/misc/freeswitch/scripts/event/cdr_save.lua +++ b/misc/freeswitch/scripts/event/cdr_save.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: cdr event handler class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/event/event.lua b/misc/freeswitch/scripts/event/event.lua index c57b32a..08d8bfe 100644 --- a/misc/freeswitch/scripts/event/event.lua +++ b/misc/freeswitch/scripts/event/event.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: event manager class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/event/perimeter.lua b/misc/freeswitch/scripts/event/perimeter.lua index 86c50d4..5bbb032 100644 --- a/misc/freeswitch/scripts/event/perimeter.lua +++ b/misc/freeswitch/scripts/event/perimeter.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: cdr event handler class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/event_manager.lua b/misc/freeswitch/scripts/event_manager.lua index 707b8a2..4e78ccf 100644 --- a/misc/freeswitch/scripts/event_manager.lua +++ b/misc/freeswitch/scripts/event_manager.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5.0 event handler --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- -- Set logger diff --git a/misc/freeswitch/scripts/fax_daemon.lua b/misc/freeswitch/scripts/fax_daemon.lua index cfe7c4e..6609fe6 100644 --- a/misc/freeswitch/scripts/fax_daemon.lua +++ b/misc/freeswitch/scripts/fax_daemon.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5.0 fax daemon --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- local MAIN_LOOP_SLEEP_TIME = 30; diff --git a/misc/freeswitch/scripts/ini/routes.ini b/misc/freeswitch/scripts/ini/routes.ini index 33d2f38..535ba63 100644 --- a/misc/freeswitch/scripts/ini/routes.ini +++ b/misc/freeswitch/scripts/ini/routes.ini @@ -1,5 +1,5 @@ ; Gemeinschaft 5 routing configuration file -; (c) AMOOMA GmbH 2012 +; (c) AMOOMA GmbH 2012-2013 ; [general] diff --git a/misc/freeswitch/scripts/phones/phone.lua b/misc/freeswitch/scripts/phones/phone.lua index bc2aa3d..856398b 100644 --- a/misc/freeswitch/scripts/phones/phone.lua +++ b/misc/freeswitch/scripts/phones/phone.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: phone class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/phones/siemens.lua b/misc/freeswitch/scripts/phones/siemens.lua index 71bb40a..ad2447a 100644 --- a/misc/freeswitch/scripts/phones/siemens.lua +++ b/misc/freeswitch/scripts/phones/siemens.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: general siemens model class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/phones/snom.lua b/misc/freeswitch/scripts/phones/snom.lua index 80d1fce..096ccb7 100644 --- a/misc/freeswitch/scripts/phones/snom.lua +++ b/misc/freeswitch/scripts/phones/snom.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5 module: general snom model class --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- module(...,package.seeall) diff --git a/misc/freeswitch/scripts/send_fax.lua b/misc/freeswitch/scripts/send_fax.lua index 321a5b1..a3de5f6 100644 --- a/misc/freeswitch/scripts/send_fax.lua +++ b/misc/freeswitch/scripts/send_fax.lua @@ -1,5 +1,5 @@ -- Gemeinschaft 5.0 --- (c) AMOOMA GmbH 2012 +-- (c) AMOOMA GmbH 2012-2013 -- local FAX_FILE_PATH = "/opt/GS5/public/uploads/fax_document/tiff/"; diff --git a/misc/mon_ami/asterisk.py b/misc/mon_ami/asterisk.py index ffcff06..3406c5b 100644 --- a/misc/mon_ami/asterisk.py +++ b/misc/mon_ami/asterisk.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # MonAMI Asterisk Manger Interface Server # Asterisk AMI client connector -# (c) AMOOMA GmbH 2012 +# (c) AMOOMA GmbH 2012-2013 from threading import Thread, Lock from log import ldebug, linfo, lwarn, lerror, lcritic diff --git a/misc/mon_ami/freeswitch.py b/misc/mon_ami/freeswitch.py index eab9bb6..218b7db 100644 --- a/misc/mon_ami/freeswitch.py +++ b/misc/mon_ami/freeswitch.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # MonAMI Asterisk Manger Interface server # FreeSWITCH event socket interface -# (c) AMOOMA GmbH 2012 +# (c) AMOOMA GmbH 2012-2013 from threading import Thread, Lock from log import ldebug, linfo, lwarn, lerror, lcritic diff --git a/misc/mon_ami/helper.py b/misc/mon_ami/helper.py index bf286de..8e665a4 100644 --- a/misc/mon_ami/helper.py +++ b/misc/mon_ami/helper.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # MonAMI Asterisk Manger Interface server # helper functions -# (c) AMOOMA GmbH 2012 +# (c) AMOOMA GmbH 2012-2013 def to_hash(message): diff --git a/misc/mon_ami/log.py b/misc/mon_ami/log.py index 92709ad..e89a53f 100644 --- a/misc/mon_ami/log.py +++ b/misc/mon_ami/log.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Log library -# (c) AMOOMA GmbH 2012 +# (c) AMOOMA GmbH 2012-2013 import logging diff --git a/misc/mon_ami/mon_ami b/misc/mon_ami/mon_ami index a212cfe..0e8ce50 100755 --- a/misc/mon_ami/mon_ami +++ b/misc/mon_ami/mon_ami @@ -1,7 +1,7 @@ #! /usr/bin/env python # -*- coding: utf-8 -*- # MonAMI Asterisk Manger Interface Server -# (c) AMOOMA GmbH 2012 +# (c) AMOOMA GmbH 2012-2013 from mon_ami_main import main from sys import exit diff --git a/misc/mon_ami/mon_ami_handler.py b/misc/mon_ami/mon_ami_handler.py index 59e9225..015f547 100644 --- a/misc/mon_ami/mon_ami_handler.py +++ b/misc/mon_ami/mon_ami_handler.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # MonAMI Asterisk Manger Interface Server # Asterisk AMI Emulator Handler Process -# (c) AMOOMA GmbH 2012 +# (c) AMOOMA GmbH 2012-2013 from threading import Thread from log import ldebug, linfo, lwarn, lerror, lcritic diff --git a/misc/mon_ami/mon_ami_main.py b/misc/mon_ami/mon_ami_main.py index 13dd4bb..72220e5 100644 --- a/misc/mon_ami/mon_ami_main.py +++ b/misc/mon_ami/mon_ami_main.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # MonAMI Asterisk Manger Interface Server # Main Programm -# (c) AMOOMA GmbH 2012 +# (c) AMOOMA GmbH 2012-2013 from log import ldebug, linfo, lwarn, lerror, lcritic, setup_log from time import sleep diff --git a/misc/mon_ami/mon_ami_server.py b/misc/mon_ami/mon_ami_server.py index 68e72c8..d3d7c0f 100644 --- a/misc/mon_ami/mon_ami_server.py +++ b/misc/mon_ami/mon_ami_server.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # MonAMI Asterisk Manger Interface Server # Asterisk AMI Emulator server thread -# (c) AMOOMA GmbH 2012 +# (c) AMOOMA GmbH 2012-2013 from threading import Thread from log import ldebug, linfo, lwarn, lerror, lcritic diff --git a/misc/mon_ami/tcp_server.py b/misc/mon_ami/tcp_server.py index 5536282..5faa9ea 100644 --- a/misc/mon_ami/tcp_server.py +++ b/misc/mon_ami/tcp_server.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # MonAMI Asterisk Manger Interface Server # TCP Server -# (c) AMOOMA GmbH 2012 +# (c) AMOOMA GmbH 2012-2013 import socket from traceback import format_exc -- cgit v1.2.3 From 8b37b125399ba4019091b83efe889dc8af89185f Mon Sep 17 00:00:00 2001 From: Julian Pawlowski Date: Fri, 18 Jan 2013 13:41:02 +0100 Subject: set log_level to warn for production environment (takeover from GBE) --- config/environments/production.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index f715d91..344f8f8 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -30,8 +30,8 @@ Gemeinschaft42c::Application.configure do # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true - # See everything in the log (default is :info) - # config.log_level = :debug + # Show only warnings in log files + config.log_level = :warn # Use a different logger for distributed setups # config.logger = SyslogLogger.new -- cgit v1.2.3 From baafa28ebe7046a987083f853cfe5a1a55b7adb3 Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 18 Jan 2013 14:19:01 +0100 Subject: dialed_sip_user and dialed_domain added --- misc/freeswitch/scripts/dialplan/session.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc/freeswitch/scripts/dialplan/session.lua b/misc/freeswitch/scripts/dialplan/session.lua index 20fef88..dc53f7a 100644 --- a/misc/freeswitch/scripts/dialplan/session.lua +++ b/misc/freeswitch/scripts/dialplan/session.lua @@ -43,6 +43,9 @@ function Session.init_channel_variables(self) self.from_gateway = true; end + self.dialed_sip_user = self.caller:to_s('dialed_user'); + self.dialed_domain = self.caller:to_s('dialed_domain'); + self.account_uuid = self:to_s('gs_account_uuid'); self.account_type = self:to_s('gs_account_type'); self.sip_contact_host = self:to_s('sip_contact_host'); -- cgit v1.2.3 From 8e58b80f2da3eb341e1be2ad5847606030910963 Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 18 Jan 2013 14:20:32 +0100 Subject: retrieve_caller_data method not dependent on session --- misc/freeswitch/scripts/dialplan/dialplan.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/misc/freeswitch/scripts/dialplan/dialplan.lua b/misc/freeswitch/scripts/dialplan/dialplan.lua index 87652d5..1c31968 100644 --- a/misc/freeswitch/scripts/dialplan/dialplan.lua +++ b/misc/freeswitch/scripts/dialplan/dialplan.lua @@ -234,19 +234,21 @@ end function Dialplan.retrieve_caller_data(self) - self.caller.caller_phone_numbers_hash = {} - require 'common.str' - local dialed_sip_user = self.caller:to_s('dialed_user'); + self.caller.caller_phone_numbers_hash = {} -- TODO: Set auth_account on transfer initiated by calling party - if not common.str.blank(dialed_sip_user) then - self.caller.auth_account = self:object_find('sipaccount', self.caller:to_s('dialed_domain'), dialed_sip_user); - self.caller:set_auth_account(self.caller.auth_account); + if not common.str.blank(self.caller.dialed_sip_user) then + self.caller.auth_account = self:object_find('sipaccount', self.caller.dialed_domain, dialed_sip_user); + if self.caller.set_auth_account then + self.caller:set_auth_account(self.caller.auth_account); + end elseif not common.str.blank(self.caller.auth_account_type) and not common.str.blank(self.caller.auth_account_uuid) then self.caller.auth_account = self:object_find(self.caller.auth_account_type, self.caller.auth_account_uuid); - self.caller:set_auth_account(self.caller.auth_account); + if self.caller.set_auth_account then + self.caller:set_auth_account(self.caller.auth_account); + end end if self.caller.auth_account then @@ -275,7 +277,7 @@ function Dialplan.retrieve_caller_data(self) self.log:error('CALLER_DATA - caller owner not found'); end - if not self.caller.clir then + if not self.caller.clir and self.caller.set_caller_id then self.caller:set_caller_id(self.caller.caller_phone_numbers[1], self.caller.account.record.caller_name or self.caller.account.record.name); end else -- cgit v1.2.3 From 1de349a41e84981171a197546e01eab2f1d2c09e Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 18 Jan 2013 14:21:03 +0100 Subject: ini dependance removed --- misc/freeswitch/scripts/send_fax.lua | 52 +++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/misc/freeswitch/scripts/send_fax.lua b/misc/freeswitch/scripts/send_fax.lua index 321a5b1..7099223 100644 --- a/misc/freeswitch/scripts/send_fax.lua +++ b/misc/freeswitch/scripts/send_fax.lua @@ -80,36 +80,38 @@ local session = nil if phone_number then session = freeswitch.Session("[" .. table.concat(origination_variables, ",") .. "]loopback/" .. destination_number .. "/default"); else - local owner_class = common.str.downcase(fax_account.record.fax_accountable_type); - - local caller = {} - caller.caller_phone_numbers = phone_number_class:list_by_owner(fax_account.record.id, 'FaxAccount'); - caller.account = fax_account; - caller.auth_account = fax_account; - caller.caller_id_name = fax_account.record.station_id; - - if owner_class == 'user' then - require 'dialplan.user' - caller.auth_account.owner = dialplan.user.User:new{ log = log, database = database }:find_by_id(fax_account.record.fax_accountable_id); - if caller.auth_account.owner then - caller.auth_account.owner.groups = caller.auth_account.owner:list_groups(); - end - elseif owner_class == 'tenant' then - require 'dialplan.tenant' - caller.auth_account.owner = dialplan.tenant.Tenant:new{ log = log, database = database }:find_by_id(fax_account.record.fax_accountable_id); + -- local owner_class = common.str.downcase(fax_account.record.fax_accountable_type); + + local caller = { + destination_number = destination_number, + caller_id_name = fax_account.record.station_id, + account_type = 'faxaccount', + account_uuid = fax_account.uuid, + auth_account_type = 'faxaccount', + auth_account_uuid = fax_account.uuid, + } + + -- caller.caller_phone_numbers = phone_number_class:list_by_owner(fax_account.record.id, 'FaxAccount'); + + require 'dialplan.dialplan' + local dialplan = dialplan.dialplan.Dialplan:new{ log = log, caller = caller, database = database }; + local result = dialplan:retrieve_caller_data(); + + local dialplan_router = require('dialplan.router'); + local routes = dialplan_router.Router:new{ log = log, database = database, caller = caller, variables = caller }:route_run('outbound', destination_number); + + if not routes or #routes == 0 then + log:notice('SWITCH - no route - number: ', destination_number); + return { continue = false, code = 404, phrase = 'No route' } end - require 'common.configuration_file' - local routing_table = common.configuration_file.get('/opt/freeswitch/scripts/ini/routes.ini'); - require 'dialplan.route' - local routes = dialplan.route.Route:new{ log = log, database = database, routing_table = routing_table }:outbound(caller, destination_number); - for index, route in ipairs(routes) do - log:info('FAX_SEND - ', route.class, '=', route.endpoint, ', number: ', route.value); - if route.class == 'gateway' then + log:info('FAX_SEND - ', route.type, '=', route.id, '/', route.gateway,', number: ', route.destination_number); + if route.type == 'gateway' then table.insert(origination_variables, "origination_caller_id_number='" .. (route.caller_id_number or caller.caller_phone_numbers[1]) .. "'"); table.insert(origination_variables, "origination_caller_id_name='" .. (route.caller_id_name or fax_account.record.station_id) .. "'"); - session = freeswitch.Session('[' .. table.concat(origination_variables, ',') .. ']sofia/gateway/' .. route.endpoint .. '/' .. route.value); + session = freeswitch.Session('[' .. table.concat(origination_variables, ',') .. ']sofia/gateway/' .. route.gateway .. '/' .. route.destination_number); + log:notice('SESSION: ', session); break; end end -- cgit v1.2.3 From 13f3c5274a025c6cc02200ea56488770d4a23984 Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 18 Jan 2013 14:21:41 +0100 Subject: comments removed --- misc/freeswitch/scripts/send_fax.lua | 4 ---- 1 file changed, 4 deletions(-) diff --git a/misc/freeswitch/scripts/send_fax.lua b/misc/freeswitch/scripts/send_fax.lua index 7099223..ffb81e2 100644 --- a/misc/freeswitch/scripts/send_fax.lua +++ b/misc/freeswitch/scripts/send_fax.lua @@ -80,8 +80,6 @@ local session = nil if phone_number then session = freeswitch.Session("[" .. table.concat(origination_variables, ",") .. "]loopback/" .. destination_number .. "/default"); else - -- local owner_class = common.str.downcase(fax_account.record.fax_accountable_type); - local caller = { destination_number = destination_number, caller_id_name = fax_account.record.station_id, @@ -90,8 +88,6 @@ else auth_account_type = 'faxaccount', auth_account_uuid = fax_account.uuid, } - - -- caller.caller_phone_numbers = phone_number_class:list_by_owner(fax_account.record.id, 'FaxAccount'); require 'dialplan.dialplan' local dialplan = dialplan.dialplan.Dialplan:new{ log = log, caller = caller, database = database }; -- cgit v1.2.3 From 6994ba4b5fecc2d532770f922d76227a175e3d71 Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 18 Jan 2013 14:22:24 +0100 Subject: ini removed --- misc/freeswitch/scripts/ini/routes.ini | 80 ---------------------------------- 1 file changed, 80 deletions(-) delete mode 100644 misc/freeswitch/scripts/ini/routes.ini diff --git a/misc/freeswitch/scripts/ini/routes.ini b/misc/freeswitch/scripts/ini/routes.ini deleted file mode 100644 index 33d2f38..0000000 --- a/misc/freeswitch/scripts/ini/routes.ini +++ /dev/null @@ -1,80 +0,0 @@ -; Gemeinschaft 5 routing configuration file -; (c) AMOOMA GmbH 2012 -; - -[general] - - -[prerouting] -^%*0%*$ , f-li -^%*0%*(%d+)#*$ , f-li-%1 -^%*0%*(%d+)%*(%d+)#*$ , f-li-%1-%2 -^#0#$ , f-lo -^%*5%*(%d+)#$ , f-acdmtg-0-%1 -^%*30#$ , f-clipon -^#30#$ , f-clipoff -^%*31#$ , f-cliroff -^#31#$ , f-cliron -^%*31#(%d+)$ , f-dcliroff-%1 -^#31#(%d+)$ , f-dcliron-%1 -^%*43#$ , f-cwaon -^#43#$ , f-cwaoff -^#002#$ , f-cfoff -^##002#$ , f-cfdel -^%*21#$ , f-cfu -^%*21%*(%d+)#$ , f-cfu-%1 -^%*%*21%*(%d+)#$ , f-cfu-%1 -^#21#$ , f-cfuoff -^##21#$ , f-cfudel -^%*61#$ , f-cfn -^%*61%*(%d+)#$ , f-cfn-%1 -^%*%*61%*(%d+)#$ , f-cfn-%1 -^%*61%*(%d+)%*(%d+)#$ , f-cfn-%1-%2 -^%*%*61%*(%d+)%*(%d+)#$ , f-cfn-%1-%2 -^#61#$ , f-cfnoff -^##61#$ , f-cfndel -^%*62#$ , f-cfo -^%*62%*(%d+)#$ , f-cfo-%1 -^%*%*62%*(%d+)#$ , f-cfo-%1 -^#62#$ , f-cfooff -^##62#$ , f-cfodel -^%*67#$ , f-cfb -^%*67%*(%d+)#$ , f-cfb-%1 -^%*%*67%*(%d+)#$ , f-cfb-%1 -^#67#$ , f-cfboff -^##67#$ , f-cfbdel -^%*66#$ , f-redial -^%*98$ , f-vmcheck -^%*98#$ , f-vmcheck -^%*98%*(%d+)#$ , f-vmcheck-%1 -^%*1337%*1%*1#$ , f-loaon -^%*1337%*1%*0#$ , f-loaoff - -^00(%d+)$ , +%1 -^0(%d+)$ , +49%1 - - -[outbound] -^%+(%d+)$ , class=gateway, endpoint=gateway1, group=users, %1 - - -[failover] -UNALLOCATED_NUMBER = true -NORMAL_TEMPORARY_FAILURE = true - - -[outbound_cid_number] - - -[outbound_cid_name] - - -[inbound] -^00(%d+)$ , +%1 -^0(%d+)$ , +49%1 - -[inbound_cid_number] -^00(%d+)$ , +%1 -^0(%d+)$ , +49%1 - -[inbound_cid_name] -- cgit v1.2.3 From c4c3ce49a9f1a229df30c88f0f8a24f06acc4d0f Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 18 Jan 2013 14:27:43 +0100 Subject: dialed_sip_user and dialed_domain fixed --- misc/freeswitch/scripts/dialplan/session.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/freeswitch/scripts/dialplan/session.lua b/misc/freeswitch/scripts/dialplan/session.lua index 6cb670c..7de85ca 100644 --- a/misc/freeswitch/scripts/dialplan/session.lua +++ b/misc/freeswitch/scripts/dialplan/session.lua @@ -43,8 +43,8 @@ function Session.init_channel_variables(self) self.from_gateway = true; end - self.dialed_sip_user = self.caller:to_s('dialed_user'); - self.dialed_domain = self.caller:to_s('dialed_domain'); + self.dialed_sip_user = self:to_s('dialed_user'); + self.dialed_domain = self:to_s('dialed_domain'); self.account_uuid = self:to_s('gs_account_uuid'); self.account_type = self:to_s('gs_account_type'); -- cgit v1.2.3