summaryrefslogtreecommitdiff
path: root/app/controllers/call_routes_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/call_routes_controller.rb')
-rw-r--r--app/controllers/call_routes_controller.rb11
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