summaryrefslogtreecommitdiff
path: root/misc/freeswitch
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-06-04 11:31:01 +0200
committerPeter Kozak <spag@golwen.net>2013-06-04 11:31:01 +0200
commiteda886ce7ca310beb844d3e56fd1cc7179ae9d9a (patch)
tree418dc3967b80ff63fe89a19f3ef6a0d53de7bd65 /misc/freeswitch
parentf89becb96fdfe7a247f04b6f472496972ba5827e (diff)
set moderator flag
Diffstat (limited to 'misc/freeswitch')
-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