Check add the option to record the user.

This commit is contained in:
Mark Crane
2014-04-04 07:08:00 +00:00
parent 671da94954
commit a7ab1c568c
4 changed files with 116 additions and 10 deletions
@@ -31,10 +31,12 @@
-- dir /usr/local/freeswitch/scripts -1
--set local variables
local context = session:getVariable("context");
local destination_number = session:getVariable("destination_number");
local call_direction = session:getVariable("call_direction");
local domain_name = session:getVariable("domain_name");
uuid = session:getVariable("uuid");
context = session:getVariable("context");
destination_number = session:getVariable("destination_number");
call_direction = session:getVariable("call_direction");
domain_name = session:getVariable("domain_name");
recordings_dir = session:getVariable("recordings_dir");
--determine the call direction
if (call_direction == nil) then
@@ -72,6 +74,17 @@
end
end
--include before
result = assert (io.popen ("dir " ..scripts_dir.."/app/dialplan/resources/before /b -1"));
for file in result:lines() do
if (string.sub(file, -4) == ".lua") then
if file_exists(scripts_dir.."/app/dialplan/resources/before/"..file) then
dofile(scripts_dir.."/app/dialplan/resources/before/"..file);
end
--freeswitch.consoleLog("notice", "[app:dialplan] lua: before/" .. file .. "\n");
end
end
--include the dialplans
result = assert (io.popen ("dir " ..scripts_dir.."/app/dialplan/resources/"..dialplan_dir.." /b -1"));
for file in result:lines() do
@@ -79,6 +92,17 @@
if file_exists(scripts_dir.."/app/dialplan/resources/"..dialplan_dir.."/"..file) then
dofile(scripts_dir.."/app/dialplan/resources/"..dialplan_dir.."/"..file);
end
freeswitch.consoleLog("notice", "[app:dialplan] lua: "..dialplan_dir.."/" .. file .. "\n");
--freeswitch.consoleLog("notice", "[app:dialplan] lua: "..dialplan_dir.."/" .. file .. "\n");
end
end
--include after
result = assert (io.popen ("dir " ..scripts_dir.."/app/dialplan/resources/after /b -1"));
for file in result:lines() do
if (string.sub(file, -4) == ".lua") then
if file_exists(scripts_dir.."/app/dialplan/resources/after/"..file) then
dofile(scripts_dir.."/app/dialplan/resources/after/"..file);
end
--freeswitch.consoleLog("notice", "[app:dialplan] lua: after/" .. file .. "\n");
end
end