|
@@ -1,4 +1,4 @@
|
|
--- intercom.lua
|
|
|
|
|
|
+-- ring_groups.lua
|
|
-- Part of FusionPBX
|
|
-- Part of FusionPBX
|
|
-- Copyright (C) 2010 Mark J Crane <[email protected]>
|
|
-- Copyright (C) 2010 Mark J Crane <[email protected]>
|
|
-- All rights reserved.
|
|
-- All rights reserved.
|
|
@@ -40,10 +40,14 @@
|
|
end
|
|
end
|
|
|
|
|
|
--get the variables
|
|
--get the variables
|
|
- domain_name = session:getVariable("domain_name");
|
|
|
|
- ring_group_uuid = session:getVariable("ring_group_uuid");
|
|
|
|
- caller_id_name = session:getVariable("caller_id_name");
|
|
|
|
- caller_id_number = session:getVariable("caller_id_number");
|
|
|
|
|
|
+ if (session:ready()) then
|
|
|
|
+ domain_name = session:getVariable("domain_name");
|
|
|
|
+ ring_group_uuid = session:getVariable("ring_group_uuid");
|
|
|
|
+ caller_id_name = session:getVariable("caller_id_name");
|
|
|
|
+ caller_id_number = session:getVariable("caller_id_number");
|
|
|
|
+ recordings_dir = session:getVariable("recordings_dir");
|
|
|
|
+ uuid = session:getVariable("uuid");
|
|
|
|
+ end
|
|
|
|
|
|
--get the extension list
|
|
--get the extension list
|
|
sql =
|
|
sql =
|
|
@@ -108,6 +112,10 @@
|
|
if (session:ready()) then
|
|
if (session:ready()) then
|
|
session:execute("set", "hangup_after_bridge=true");
|
|
session:execute("set", "hangup_after_bridge=true");
|
|
session:execute("set", "continue_on_fail=true");
|
|
session:execute("set", "continue_on_fail=true");
|
|
|
|
+ session:execute("bind_meta_app", "1 ab s execute_extension::dx XML features");
|
|
|
|
+ session:execute("bind_meta_app", "2 ab s record_session::"..recordings_dir.."}/archive/"..os.date("%Y").."/"..os.date("%m").."/"..os.date("%d").."}/"..uuid..".wav");
|
|
|
|
+ session:execute("bind_meta_app", "3 ab s execute_extension::cf XML features");
|
|
|
|
+ session:execute("bind_meta_app", "4 ab s execute_extension::att_xfer XML features");
|
|
session:execute("bridge", app_data);
|
|
session:execute("bridge", app_data);
|
|
if (session:getVariable("last_bridge_hangup_cause") == "NORMAL_CLEARING") then
|
|
if (session:getVariable("last_bridge_hangup_cause") == "NORMAL_CLEARING") then
|
|
--ring group was answered
|
|
--ring group was answered
|