From e34dcbc160300d8b6974303675c233fecc592fe9 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Fri, 12 Jul 2013 12:01:10 +0200 Subject: list tenant's voicemail accounts --- app/controllers/call_forwards_controller.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'app/controllers/call_forwards_controller.rb') diff --git a/app/controllers/call_forwards_controller.rb b/app/controllers/call_forwards_controller.rb index f9d2faa..0e1141f 100644 --- a/app/controllers/call_forwards_controller.rb +++ b/app/controllers/call_forwards_controller.rb @@ -187,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 -- cgit v1.2.3