From eda886ce7ca310beb844d3e56fd1cc7179ae9d9a Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Tue, 4 Jun 2013 11:31:01 +0200 Subject: set moderator flag --- misc/freeswitch/scripts/common/pager.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'misc/freeswitch/scripts/common') diff --git a/misc/freeswitch/scripts/common/pager.lua b/misc/freeswitch/scripts/common/pager.lua index 2f60d14..bf19ba6 100644 --- a/misc/freeswitch/scripts/common/pager.lua +++ b/misc/freeswitch/scripts/common/pager.lua @@ -36,9 +36,14 @@ function Pager.find_by_id(self, id) end -function Pager.enter(self, originator) +function Pager.enter(self) local flags = 'mute'; - if originator then + + if not self.caller.account or self.caller.account.class ~= 'sipaccount' then + return false; + end + + if tonumber(self.record.sip_account_id) == tonumber(self.caller.account.id) then flags = 'moderator'; end @@ -56,7 +61,7 @@ function Pager.callback(self) state = 'terminated', } - if self.caller.account and self.caller.account.class:lower() == 'sipaccount' then + if self.caller.account and self.caller.account.class == 'sipaccount' then destination.sip_account_id = self.caller.account.id; end -- cgit v1.2.3