summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-01-25 10:50:39 +0100
committerspag <spag@golwen.net>2013-01-25 10:50:39 +0100
commit57e1f57912ed16873dd6a4f550d01cc050d573ce (patch)
treee24b58a35bf562e7eeee86dc659b1064cb52ee9e /app
parent654aeff46c957de4177435b8becd8c8637e4fe6a (diff)
check fallback sip account
Diffstat (limited to 'app')
-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 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 => "<!-- SipAccount not found -->",
+ :text => "<!-- SipAccount ID:#{params[:sip_account].to_i} not found -->",
)
end
end