summaryrefslogtreecommitdiff
path: root/misc/freeswitch/scripts/common
diff options
context:
space:
mode:
Diffstat (limited to 'misc/freeswitch/scripts/common')
-rw-r--r--misc/freeswitch/scripts/common/call_forwarding.lua2
-rw-r--r--misc/freeswitch/scripts/common/call_history.lua2
-rw-r--r--misc/freeswitch/scripts/common/conference.lua2
-rw-r--r--misc/freeswitch/scripts/common/configuration_file.lua2
-rw-r--r--misc/freeswitch/scripts/common/fapi.lua2
-rw-r--r--misc/freeswitch/scripts/common/gateway.lua21
-rw-r--r--misc/freeswitch/scripts/common/ipcalc.lua2
-rw-r--r--misc/freeswitch/scripts/common/log.lua2
-rw-r--r--misc/freeswitch/scripts/common/phone_number.lua2
-rw-r--r--misc/freeswitch/scripts/common/routing_tables.lua2
-rw-r--r--misc/freeswitch/scripts/common/sip_account.lua2
-rw-r--r--misc/freeswitch/scripts/common/str.lua2
-rw-r--r--misc/freeswitch/scripts/common/sync_log.lua2
13 files changed, 33 insertions, 12 deletions
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/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` \
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)