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/pager.lua11
1 files changed, 8 insertions, 3 deletions
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