diff options
author | Peter Kozak <spag@golwen.net> | 2013-06-04 13:09:25 +0200 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-06-04 13:09:25 +0200 |
commit | 67b1a49f66be8051e7a6b550d416553b1df472f4 (patch) | |
tree | cc3c9cddc507401e80f3a535136634ea869e7daf | |
parent | 63f253ee3786fdf2970a64b2bbfea5c2ee89b09f (diff) |
hangup_all method added
-rw-r--r-- | app/models/pager_group.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/models/pager_group.rb b/app/models/pager_group.rb index 21396ef..5c9c6ad 100644 --- a/app/models/pager_group.rb +++ b/app/models/pager_group.rb @@ -7,8 +7,21 @@ class PagerGroup < ActiveRecord::Base validates_presence_of :sip_account_id after_create :call + before_destroy :hangup_all + + def identifier + "pager#{self.id}" + end def call self.sip_account.call("f-pager-#{self.id}") end + + def hangup_all + require 'freeswitch_event' + return FreeswitchAPI.execute( + 'conference', "#{self.identifier} hup all", + true + ); + end end |