summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-08-16 08:11:52 +0200
committerPeter Kozak <spag@golwen.net>2013-08-16 08:11:52 +0200
commit3893e50c2b27cf8b3958ed1b36697ab66a7f70b5 (patch)
treef7ba9cbb93b303c0015b942daa95476d1eabc7e7
parent2277451c220ffb45aefae2a1bbd3a37821fa5dd8 (diff)
set fallback_sip_account as a valid sip_account
-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