summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorJulian Pawlowski <julian.pawlowski@gmail.com>2013-01-08 19:07:34 +0100
committerJulian Pawlowski <julian.pawlowski@gmail.com>2013-01-08 19:07:34 +0100
commit8a5dd852e202ce2c190a1f2ad79a8a452f4fcf53 (patch)
treebbd124aef5a3b12daab6693aa2698db79082d84a /app/controllers
parentfaabc3e5db9310727e5d8cb9cd509adeb900d6c0 (diff)
parentb67c3f5ff6474ba117c75eb81c7d2d9371e8a103 (diff)
Merge branch 'develop' of https://github.com/amooma/GS5 into develop
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/phone_numbers_controller.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/controllers/phone_numbers_controller.rb b/app/controllers/phone_numbers_controller.rb
index 065934c..c562954 100644
--- a/app/controllers/phone_numbers_controller.rb
+++ b/app/controllers/phone_numbers_controller.rb
@@ -77,6 +77,23 @@ class PhoneNumbersController < ApplicationController
redirect_to :back
end
+ def call
+ sip_account = nil
+ current_user.sip_accounts.each do |user_sip_account|
+ if user_sip_account.registration
+ sip_account = user_sip_account
+ break
+ end
+ end
+
+ if can?(:call, @phone_number) && sip_account
+ if ! @phone_number.number.blank?
+ sip_account.call(@phone_number.number)
+ end
+ end
+ redirect_to(:back)
+ end
+
private
def set_and_authorize_parent
@parent = @phone_book_entry || @sip_account || @conference || @fax_account ||