summaryrefslogtreecommitdiff
path: root/app/controllers/call_forwards_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/call_forwards_controller.rb')
-rw-r--r--app/controllers/call_forwards_controller.rb17
1 files changed, 14 insertions, 3 deletions
diff --git a/app/controllers/call_forwards_controller.rb b/app/controllers/call_forwards_controller.rb
index 1721aa3..0d0f946 100644
--- a/app/controllers/call_forwards_controller.rb
+++ b/app/controllers/call_forwards_controller.rb
@@ -29,8 +29,8 @@ class CallForwardsController < ApplicationController
@call_forward.depth = GsParameter.get('DEFAULT_CALL_FORWARD_DEPTH')
@call_forward.active = true
@call_forwarding_destinations = call_forwarding_destination_types()
+ @call_forward.destinationable_type = 'PhoneNumber'
@call_forward.destination = GsParameter.get('CALLFORWARD_DESTINATION_DEFAULT').to_s if defined?(GsParameter.get('CALLFORWARD_DESTINATION_DEFAULT'))
- @destination_phone_number = @call_forward.destination
@available_call_forward_cases = []
CallForwardCase.all.each do |available_call_forward_case|
@@ -66,7 +66,6 @@ class CallForwardsController < ApplicationController
@available_call_forward_cases = CallForwardCase.all
@call_forwarding_destinations = call_forwarding_destination_types()
@available_greetings = available_greetings()
- @destination_phone_number = @call_forward.destination if @call_forward.call_forwarding_destination == ':PhoneNumber'
end
def update
@@ -118,7 +117,7 @@ class CallForwardsController < ApplicationController
add_breadcrumb @parent, sip_account_phone_number_path(@sip_account, @parent)
elsif @parent.class == SipAccount
add_breadcrumb t("users.index.page_title"), tenant_users_path(@user.current_tenant)
- add_breadcrumb @user, tenant_users_path(@user.current_tenant, @user)
+ add_breadcrumb @user, tenant_user_path(@user.current_tenant, @user)
add_breadcrumb t("sip_accounts.index.page_title"), user_sip_accounts_path(@user)
end
end
@@ -188,6 +187,18 @@ class CallForwardsController < ApplicationController
end
end
+ if @parent.class == HuntGroup && @parent.tenant
+ @parent.tenant.voicemail_accounts.each do |voicemail_account|
+ call_forwards_destination = CallForwardingDestination.new()
+ call_forwards_destination.id = "#{voicemail_account.id}:VoicemailAccount"
+ call_forwards_destination.label = "VoicemailAccount: #{voicemail_account.to_s}"
+ if !destinations_hash[call_forwards_destination.id]
+ destinations_hash[call_forwards_destination.id] = true
+ call_forwarding_destinations << call_forwards_destination
+ end
+ end
+ end
+
if @parent.class == PhoneNumber
if @parent.phone_numberable.class == SipAccount
sip_account = @parent.phone_numberable