diff options
author | spag <spag@golwen.net> | 2013-01-30 15:59:52 +0100 |
---|---|---|
committer | spag <spag@golwen.net> | 2013-01-30 15:59:52 +0100 |
commit | d4a664a0495bd183b16a239aeb4c342e1ca739fa (patch) | |
tree | a6ef715208cbfdcbe8567388d27311daac3fef58 /app/controllers | |
parent | 44337fb9a2bcbb8766e7c2b508cf2206afa09c05 (diff) |
select route endpoint
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/call_routes_controller.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/call_routes_controller.rb b/app/controllers/call_routes_controller.rb index 0259a10..653fd55 100644 --- a/app/controllers/call_routes_controller.rb +++ b/app/controllers/call_routes_controller.rb @@ -1,6 +1,12 @@ class CallRoutesController < ApplicationController authorize_resource :call_route + before_filter { |controller| + if !params[:call_route].blank? and !params[:call_route][:endpoint_str].blank? + params[:call_route][:endpoint_type], delimeter, params[:call_route][:endpoint_id] = params[:call_route][:endpoint_str].partition('=') + end + } + def index @call_routes = CallRoute.order([:routing_table, :position]) @routing_tables = @call_routes.pluck(:routing_table).uniq.sort @@ -29,6 +35,11 @@ class CallRoutesController < ApplicationController def edit @call_route = CallRoute.find(params[:id]) + @endpoints = Gateway.all.collect {|r| [ "gateway: #{r.to_s}", "gateway=#{r.id}" ] } + @endpoints << [ 'phonenumber', 'phonenumber' ] + @endpoints << [ 'dialplanfunction', 'dialplanfunction' ] + @endpoints << [ 'hangup', 'hangup' ] + @endpoints << [ 'unknown', 'unknown' ] spread_breadcrumbs end |