summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-03-13 15:41:42 -0400
committerPeter Kozak <spag@golwen.net>2013-03-13 15:41:42 -0400
commit25a4d0a3e1237f2ef4093149c2a0ca3c3c72378e (patch)
tree2e54670c03e85431cf14bc5dae75ca7db33554fd
parentdcdd37036f45d13b7402436ddb1af65c78052ca9 (diff)
run router
-rw-r--r--misc/freeswitch/scripts/test_route.lua8
1 files changed, 4 insertions, 4 deletions
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,