diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-03-17 12:45:23 +0100 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-03-17 12:45:23 +0100 |
commit | d007b83d1d6b51caea93b5f08f449db88a930a16 (patch) | |
tree | 53c3ff07977cd374182358acef4b821a17e345b6 /app/controllers | |
parent | 0ed2894ca7371199788c202b61f53a3f73c4b03b (diff) | |
parent | abc16da2c2afa636a928a031a540e677f4ac84f8 (diff) |
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/call_routes_controller.rb | 23 | ||||
-rw-r--r-- | app/controllers/gemeinschaft_setups_controller.rb | 5 |
2 files changed, 24 insertions, 4 deletions
diff --git a/app/controllers/call_routes_controller.rb b/app/controllers/call_routes_controller.rb index 50e7849..e5cf56a 100644 --- a/app/controllers/call_routes_controller.rb +++ b/app/controllers/call_routes_controller.rb @@ -88,10 +88,25 @@ class CallRoutesController < ApplicationController end def test - sip_account = SipAccount.where(:id => params[:sip_account_id]).first; - destination_number = params[:destination_number] - routing_table = params[:routing_table] - @route_test = CallRoute.test_route(routing_table, {'caller.destination_number' => destination_number, 'caller.auth_account_type' => 'SipAccount', 'caller.auth_account_uuid' => sip_account.uuid}) + if !params[:sip_account_id].blank? + account = SipAccount.where(:id => params[:sip_account_id]).first + elsif !params[:hunt_group_id].blank? + account = HuntGroup.where(:id => params[:hunt_group_id]).first + end + + if account + destination_number = params[:destination_number] + routing_table = params[:routing_table] + @route_test = CallRoute.test_route(routing_table, { + 'caller.destination_number' => destination_number, + 'caller.auth_account_type' => account.class.name, + 'caller.auth_account_id' => account.id, + 'caller.auth_account_uuid' => account.try(:uuid), + 'caller.account_type' => account.class.name, + 'caller.account_id' => account.id, + 'caller.account_uuid' => account.try(:uuid), + }) + end end private diff --git a/app/controllers/gemeinschaft_setups_controller.rb b/app/controllers/gemeinschaft_setups_controller.rb index a62df99..4949fa7 100644 --- a/app/controllers/gemeinschaft_setups_controller.rb +++ b/app/controllers/gemeinschaft_setups_controller.rb @@ -62,6 +62,11 @@ class GemeinschaftSetupsController < ApplicationController GsParameter.where(:name => 'ringtone_url').first.update_attributes(:value => "http://#{@gemeinschaft_setup.sip_domain.host}") GsParameter.where(:name => 'user_image_url').first.update_attributes(:value => "http://#{@gemeinschaft_setup.sip_domain.host}/uploads/user/image") + # Set ringback_tone + if @gemeinschaft_setup.country.country_code.to_s == '49' + GsParameter.where(:entity => 'dialplan', :section => 'variables', :name => 'ringback').first.update_attributes(:value => '%(1000,4000,425.0)') + end + # Restart FreeSWITCH if Rails.env.production? require 'freeswitch_event' |