summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-06-20 11:24:29 +0200
committerPeter Kozak <spag@golwen.net>2013-06-20 11:24:29 +0200
commitb3a96040433edc2ee2a1d85cf989b6d6adb60ee2 (patch)
tree20d2fa97e14adcbd8bdc8957b8622be82a2da3ec /misc
parent4f5c5e93fe01dec4eea933ab7cb805d95b0bd647 (diff)
previous behavior of set action restored
Diffstat (limited to 'misc')
-rw-r--r--misc/freeswitch/scripts/dialplan/router.lua20
1 files changed, 6 insertions, 14 deletions
diff --git a/misc/freeswitch/scripts/dialplan/router.lua b/misc/freeswitch/scripts/dialplan/router.lua
index 4e6398e..24d2462 100644
--- a/misc/freeswitch/scripts/dialplan/router.lua
+++ b/misc/freeswitch/scripts/dialplan/router.lua
@@ -22,6 +22,7 @@ function Router.new(self, arg)
self.variables = arg.variables or {};
self.log_details = arg.log_details;
self.routing_tables = {};
+
return object;
end
@@ -75,8 +76,9 @@ function Router.element_match(self, pattern, search_string, replacement, route_v
local replace_by = common.array.expand_variables(replacement, route_variables, self.variables)
result = search_string:gsub(pattern, replace_by);
if self.log_details then
- self.log:debug('ELEMENT_MATCH - ', search_string, ' ~= ', pattern, ' => ', replacement, ' => ', replace_by);
+ self.log:debug('ELEMENT_MATCH - ', search_string, ' ~= ', pattern, ' => ', replacement, ' => ', result);
end
+
return true, result;
end
@@ -163,19 +165,9 @@ function Router.route_match(self, route)
end
if element.action ~= 'none' then
- if element.action == 'set' then
- if common.str.blank(element.var_in) then
- result = true;
- replacement = common.array.expand_variables(element.replacement, destination, self.variables);
- else
- local command, variable_name = common.str.partition(element.var_in, ':');
- if command == 'fun' then
- result, replacement = self:element_run_function(variable_name, element, destination);
- else
- result = true;
- replacement = common.array.expand_variables(element.replacement, destination, self.variables);
- end
- end
+ if common.str.blank(element.var_in) and common.str.blank(element.pattern) and element.action == 'set' then
+ result = true;
+ replacement = common.array.expand_variables(element.replacement, destination, self.variables);
else
local command, variable_name = common.str.partition(element.var_in, ':');