diff options
author | Peter Kozak <spag@golwen.net> | 2013-07-31 10:34:40 +0200 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-07-31 10:34:40 +0200 |
commit | 166af5966564fc351cffc2f01d83739de38e9c81 (patch) | |
tree | 0c45b971725066fa2463f699bf95823c5672a722 /app/controllers | |
parent | 1ba505931e6bd2ff6e102f1a3774b2f564a6099a (diff) |
honor CLIR flag in call action
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/call_histories_controller.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/app/controllers/call_histories_controller.rb b/app/controllers/call_histories_controller.rb index a4d0c21..edd19cb 100644 --- a/app/controllers/call_histories_controller.rb +++ b/app/controllers/call_histories_controller.rb @@ -71,8 +71,17 @@ class CallHistoriesController < ApplicationController @call_history = CallHistory.where(:id => params[:id]).first if can?(:call, @call_history) && @sip_account.registration phone_number = @call_history.display_number - if ! phone_number.blank? - @sip_account.call(phone_number) + caller_id_number = phone_number + if ! phone_number.blank? + if @sip_account.clir != @call_history.clir + if @call_history.clir == true + phone_number = 'f-dcliron-' + phone_number + elsif call.clir == false + phone_number = 'f-dcliroff-' + phone_number + end + end + + @sip_account.call(phone_number, caller_id_number, @call_history.display_name) end end redirect_to(:back) |