Merge pull request #1229 from moteus/ivr_menu_exec_without_args
Fix. IVR menu option without arguments.
This commit is contained in:
commit
7bb1079dd6
|
|
@ -407,8 +407,12 @@
|
||||||
if (row.ivr_menu_option_action == "menu-exec-app") then
|
if (row.ivr_menu_option_action == "menu-exec-app") then
|
||||||
--get the action and data
|
--get the action and data
|
||||||
pos = string.find(row.ivr_menu_option_param, " ", 0, true);
|
pos = string.find(row.ivr_menu_option_param, " ", 0, true);
|
||||||
|
if pos then
|
||||||
action = string.sub(row.ivr_menu_option_param, 0, pos-1);
|
action = string.sub(row.ivr_menu_option_param, 0, pos-1);
|
||||||
data = string.sub(row.ivr_menu_option_param, pos+1);
|
data = string.sub(row.ivr_menu_option_param, pos+1);
|
||||||
|
else
|
||||||
|
action, data = row.ivr_menu_option_param, ""
|
||||||
|
end
|
||||||
|
|
||||||
--check if the option uses a regex
|
--check if the option uses a regex
|
||||||
regex = string.find(row.ivr_menu_option_digits, "(", 0, true);
|
regex = string.find(row.ivr_menu_option_digits, "(", 0, true);
|
||||||
|
|
@ -431,7 +435,11 @@
|
||||||
end
|
end
|
||||||
if (action == "lua") then
|
if (action == "lua") then
|
||||||
pos = string.find(data, " ", 0, true);
|
pos = string.find(data, " ", 0, true);
|
||||||
|
if pos then
|
||||||
script = string.sub(data, 0, pos-1);
|
script = string.sub(data, 0, pos-1);
|
||||||
|
else
|
||||||
|
script = data
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end --if regex match
|
end --if regex match
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue