From baf86f285be7c02535c3bc1cd25bf8c69b3b2051 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Fri, 15 Mar 2013 06:02:44 -0400 Subject: Germans are serious about call progress tones --- app/controllers/gemeinschaft_setups_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/controllers') 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' -- cgit v1.2.3 From 5fdcf4e66f1b9d926ace0ab4a78db177b7487ad6 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Fri, 15 Mar 2013 08:43:29 -0400 Subject: test action --- app/controllers/call_routes_controller.rb | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/call_routes_controller.rb b/app/controllers/call_routes_controller.rb index 50e7849..819b593 100644 --- a/app/controllers/call_routes_controller.rb +++ b/app/controllers/call_routes_controller.rb @@ -88,10 +88,17 @@ 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)}) + end end private -- cgit v1.2.3 From 87655b8f02c5cdefc44abbacea8e60deefaf77c4 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Sun, 17 Mar 2013 02:08:18 -0400 Subject: set caller account --- app/controllers/call_routes_controller.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'app/controllers') diff --git a/app/controllers/call_routes_controller.rb b/app/controllers/call_routes_controller.rb index 819b593..e5cf56a 100644 --- a/app/controllers/call_routes_controller.rb +++ b/app/controllers/call_routes_controller.rb @@ -97,7 +97,15 @@ class CallRoutesController < ApplicationController 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)}) + @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 -- cgit v1.2.3