summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-07-30 13:06:09 +0200
committerPeter Kozak <spag@golwen.net>2013-07-30 13:06:09 +0200
commit10d3037aa6e4dbdcd438b436b094bdb225f34de5 (patch)
tree5ac46c537094f579fbb6a6ef309c78c6a971af93
parent262257b5acb90b91a4325ae7d7603e4361955975 (diff)
find_by_uuid method added
-rw-r--r--misc/freeswitch/scripts/common/conference.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/misc/freeswitch/scripts/common/conference.lua b/misc/freeswitch/scripts/common/conference.lua
index 5694f62..423d564 100644
--- a/misc/freeswitch/scripts/common/conference.lua
+++ b/misc/freeswitch/scripts/common/conference.lua
@@ -52,8 +52,7 @@ function Conference.settings_get(self)
end
-function Conference.find_by_id(self, id)
- local sql_query = 'SELECT *, (NOW() >= `start` AND NOW() <= `end`) AS `open_now` FROM `conferences` WHERE `id`= ' .. tonumber(id) .. ' LIMIT 1';
+function Conference.find_sql(self, sql_query)
local conference = nil;
self.database:query(sql_query, function(conference_entry)
@@ -82,6 +81,16 @@ function Conference.find_by_id(self, id)
end
+function Conference.find_by_id(self, id)
+ return self:find_sql('SELECT *, (NOW() >= `start` AND NOW() <= `end`) AS `open_now` FROM `conferences` WHERE `id`= ' .. tonumber(id) .. ' LIMIT 1');
+end
+
+
+function Conference.find_by_uuid(self, uuid)
+ return self:find_sql('SELECT *, (NOW() >= `start` AND NOW() <= `end`) AS `open_now` FROM `conferences` WHERE `uuid`= ' .. self.database:escape(uuid, '"') .. ' LIMIT 1');
+end
+
+
function Conference.find_invitee_by_numbers(self, phone_numbers)
if not self.record then
return false;