summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/intruder.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/intruder.rb b/app/models/intruder.rb
index 9a1c39a..bdfa753 100644
--- a/app/models/intruder.rb
+++ b/app/models/intruder.rb
@@ -50,6 +50,17 @@ class Intruder < ActiveRecord::Base
}
end
+ def self.control(action, attributes={})
+ require 'freeswitch_event'
+ event = FreeswitchEvent.new('CUSTOM')
+ event.add_header('Event-Subclass', 'perimeter::control')
+ event.add_header('action', action)
+ attributes.each do |name, value|
+ event.add_header(name, value)
+ end
+ return event.fire()
+ end
+
private
def set_key_if_empty
if self.key.blank?