From 48d569baeda24663b3adcb6532c9678f5b6ddbcb Mon Sep 17 00:00:00 2001 From: spag Date: Thu, 17 Jan 2013 15:18:52 +0100 Subject: do not set variable when name blank --- misc/freeswitch/scripts/dialplan/router.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'misc/freeswitch/scripts') 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 -- cgit v1.2.3