summaryrefslogtreecommitdiff
path: root/app/models/switchboard.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/switchboard.rb')
-rw-r--r--app/models/switchboard.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/switchboard.rb b/app/models/switchboard.rb
index cf8c708..095f878 100644
--- a/app/models/switchboard.rb
+++ b/app/models/switchboard.rb
@@ -35,6 +35,10 @@ class Switchboard < ActiveRecord::Base
self.name.to_s
end
+ def active_calls
+ self.switchboard_entries.where(:switchable => true).map{|se| se.sip_account}.uniq.map{|sip_account| sip_account.calls}.flatten
+ end
+
private
def convert_0_to_nil
if self.reload_interval == 0