From 166af5966564fc351cffc2f01d83739de38e9c81 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Wed, 31 Jul 2013 10:34:40 +0200 Subject: honor CLIR flag in call action --- app/controllers/call_histories_controller.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'app/controllers/call_histories_controller.rb') 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) -- cgit v1.2.3