summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/config_snom_controller.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/config_snom_controller.rb b/app/controllers/config_snom_controller.rb
index 1cac4b2..5b31064 100644
--- a/app/controllers/config_snom_controller.rb
+++ b/app/controllers/config_snom_controller.rb
@@ -63,7 +63,10 @@ class ConfigSnomController < ApplicationController
if !params[:phone].blank?
@phone = Phone.where({ :id => params[:phone].to_i }).first
if !params[:sip_account].blank?
- @sip_account = @phone.sip_accounts.where({ :id => params[:sip_account].to_i }).first
+ @sip_account = @phone.sip_accounts.where({ :id => params[:sip_account].to_i }).first ||
+ if !@sip_account && @phone.fallback_sip_account && @phone.fallback_sip_account.id == params[:sip_account].to_i
+ @sip_account = @phone.fallback_sip_account
+ end
end
end