summaryrefslogtreecommitdiff
path: root/misc/freeswitch/scripts
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-01-17 15:18:52 +0100
committerspag <spag@golwen.net>2013-01-17 15:18:52 +0100
commit48d569baeda24663b3adcb6532c9678f5b6ddbcb (patch)
tree579d749c5f7b8cbfd40c898a8550dfc98a833eb5 /misc/freeswitch/scripts
parentb086515a8a82f572e204bac9cb8c139ca8a0960d (diff)
do not set variable when name blank
Diffstat (limited to 'misc/freeswitch/scripts')
-rw-r--r--misc/freeswitch/scripts/dialplan/router.lua16
1 files changed, 9 insertions, 7 deletions
diff --git a/misc/freeswitch/scripts/dialplan/router.lua b/misc/freeswitch/scripts/dialplan/router.lua
index 4a756ea..f207276 100644
--- a/misc/freeswitch/scripts/dialplan/router.lua
+++ b/misc/freeswitch/scripts/dialplan/router.lua
@@ -151,13 +151,15 @@ function Router.route_match(self, route)
return false;
end
else
- local command, variable_name = common.str.partition(element.var_out, ':');
- if not command or not variable_name or command == 'var' then
- destination[element.var_out] = replacement;
- elseif command == 'chv' then
- table.insert(destination.channel_variables, { name = element.var_out, value = replacement });
- elseif command == 'hdr' then
- table.insert(destination.channel_variables, { name = 'sip_h_' .. tostring(element.var_out), value = replacement });
+ if not common.str.blank(element.var_out) then
+ local command, variable_name = common.str.partition(element.var_out, ':');
+ if not command or not variable_name or command == 'var' then
+ destination[element.var_out] = replacement;
+ elseif command == 'chv' then
+ table.insert(destination.channel_variables, { name = element.var_out, value = replacement });
+ elseif command == 'hdr' then
+ table.insert(destination.channel_variables, { name = 'sip_h_' .. tostring(element.var_out), value = replacement });
+ end
end
if element.action == 'match' or element.action == 'not_match' then