diff options
Diffstat (limited to 'misc')
-rw-r--r-- | misc/freeswitch/scripts/common/conference.lua | 13 |
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; |