From 57e1f57912ed16873dd6a4f550d01cc050d573ce Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 25 Jan 2013 10:50:39 +0100 Subject: check fallback sip account --- app/controllers/config_snom_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/controllers') diff --git a/app/controllers/config_snom_controller.rb b/app/controllers/config_snom_controller.rb index 149e601..b697488 100644 --- a/app/controllers/config_snom_controller.rb +++ b/app/controllers/config_snom_controller.rb @@ -158,12 +158,15 @@ class ConfigSnomController < ApplicationController if ! params[:sip_account].blank? @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.where({ :id => params[:sip_account].to_i }).first + end if ! @sip_account render( :status => 404, :layout => false, :content_type => 'text/plain', - :text => "", + :text => "", ) end end -- cgit v1.2.3