mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 09:03:49 +00:00
IVR Menu only allow direct dial calls to existing extensions.
This commit is contained in:
@@ -228,8 +228,17 @@
|
||||
if (string.len(digits) < 6) then
|
||||
--replace the $1 and the domain name
|
||||
digits = digits:gsub("*", "");
|
||||
--run the action
|
||||
session:execute("transfer", digits.." XML "..context);
|
||||
--check to see if the user extension exists
|
||||
cmd = "user_exists id ".. digits .." "..context;
|
||||
result = api:executeString(cmd);
|
||||
freeswitch.consoleLog("NOTICE", "[confirm] "..cmd.." --"..result.."--\n");
|
||||
if (result == "true") then
|
||||
--run the action
|
||||
session:execute("transfer", digits.." XML "..context);
|
||||
else
|
||||
--run the menu again
|
||||
menu();
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user