summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-01-25 11:57:45 +0100
committerspag <spag@golwen.net>2013-01-25 11:57:45 +0100
commit25c8fd5f00df857c24ce61b0290f67fb5006ffb2 (patch)
treee7127e207a6792f4280bd6c0edad6a9e08b548e4 /app
parent076e5b8cc14097efe96932e02fa7ccd7df538495 (diff)
use voicemail storage directory from parameters
Diffstat (limited to 'app')
-rw-r--r--app/controllers/voicemail_settings_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/voicemail_settings_controller.rb b/app/controllers/voicemail_settings_controller.rb
index d31de8f..5de0c35 100644
--- a/app/controllers/voicemail_settings_controller.rb
+++ b/app/controllers/voicemail_settings_controller.rb
@@ -71,7 +71,8 @@ class VoicemailSettingsController < ApplicationController
end
def voicemail_defaults
- path = "/opt/freeswitch/storage/voicemail/default/#{@sip_account.sip_domain.host}/#{@sip_account.auth_name}/"
+ storage_dir = GsParameter.where(:entity => 'voicemail', :section => 'parameters', :name => 'storage-dir').first.try(:value)
+ path = "#{storage_dir}/#{@sip_account.sip_domain.host}/#{@sip_account.auth_name}/"
@greeting_files = Dir.glob("#{path}*greeting*.wav").collect {|r| [ File.basename(r), File.expand_path(r) ] }
@name_files = Dir.glob("#{path}*name*.wav").collect {|r| [ File.basename(r), File.expand_path(r) ] }