From 25a4d0a3e1237f2ef4093149c2a0ca3c3c72378e Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Wed, 13 Mar 2013 15:41:42 -0400 Subject: run router --- misc/freeswitch/scripts/test_route.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'misc') diff --git a/misc/freeswitch/scripts/test_route.lua b/misc/freeswitch/scripts/test_route.lua index 9ab00f7..e311690 100644 --- a/misc/freeswitch/scripts/test_route.lua +++ b/misc/freeswitch/scripts/test_route.lua @@ -46,7 +46,7 @@ dialplan_object:retrieve_caller_data(); local destination = arguments.destination or dialplan_object:destination_new{ number = caller.destination_number }; local routes = {}; -if destination.type == 'unknown' then +if destination and destination.type == 'unknown' then local clip_no_screening = common.array.try(caller, 'account.record.clip_no_screening'); caller.caller_id_numbers = {} if not common.str.blank(clip_no_screening) then @@ -63,11 +63,11 @@ if destination.type == 'unknown' then destination.callee_id_number = destination.number; destination.callee_id_name = nil; - - require 'dialplan.router'; - routes = dialplan.router.Router:new{ log = log, database = database, caller = caller, variables = caller, log_details = true }:route_run(arguments.table or 'outbound'); end +require 'dialplan.router'; +routes = dialplan.router.Router:new{ log = log, database = database, caller = caller, variables = caller, log_details = true }:route_run(arguments.table or 'outbound'); + local result = { routes = routes, destination = destination, -- cgit v1.2.3