summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-06-04 11:10:35 +0200
committerPeter Kozak <spag@golwen.net>2013-06-04 11:10:35 +0200
commite4b3cf44d7f5a46cb051221b8b2c547a814943c9 (patch)
tree88f9852529eb09388f85e842c43763a68a961815 /app
parent21995072fb0e57c8209460936c0e5b322a1547c3 (diff)
call method added
Diffstat (limited to 'app')
-rw-r--r--app/models/pager_group_destination.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/pager_group_destination.rb b/app/models/pager_group_destination.rb
index 333d10f..98a1b32 100644
--- a/app/models/pager_group_destination.rb
+++ b/app/models/pager_group_destination.rb
@@ -2,7 +2,14 @@ class PagerGroupDestination < ActiveRecord::Base
attr_accessible :pager_group_id, :sip_account_id
belongs_to :pager_group
+ belongs_to :sip_account
validates_presence_of :pager_group_id
validates_presence_of :sip_account_id
+
+ after_create :call
+
+ def call
+ self.sip_account.call("f-pager-#{self.pager_group_id}", '', "Pager #{self.id}")
+ end
end