diff options
author | Peter Kozak <spag@golwen.net> | 2013-08-16 08:11:52 +0200 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-08-16 08:11:52 +0200 |
commit | 3893e50c2b27cf8b3958ed1b36697ab66a7f70b5 (patch) | |
tree | f7ba9cbb93b303c0015b942daa95476d1eabc7e7 | |
parent | 2277451c220ffb45aefae2a1bbd3a37821fa5dd8 (diff) |
set fallback_sip_account as a valid sip_account
-rw-r--r-- | app/controllers/config_snom_controller.rb | 5 |
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 |