mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-07 04:03:49 +00:00
Validate the uuid used in intercept
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
require "resources.functions.explode";
|
||||
require "resources.functions.trim";
|
||||
require "resources.functions.channel_utils";
|
||||
require "resources.functions.is_uuid";
|
||||
|
||||
--prepare the api object
|
||||
api = freeswitch.API();
|
||||
@@ -361,23 +362,23 @@
|
||||
end
|
||||
|
||||
--get the call center channel variables and set in the intercepted call
|
||||
if (uuid ~= nil) then
|
||||
if (uuid ~= nil and is_uuid(uuid)) then
|
||||
call_center_queue_uuid = api:executeString("uuid_getvar ".. uuid .." call_center_queue_uuid");
|
||||
if (call_center_queue_uuid ~= nil) then
|
||||
if (call_center_queue_uuid ~= nil and is_uuid(call_center_queue_uuid)) then
|
||||
session:execute("set", "call_center_queue_uuid="..call_center_queue_uuid);
|
||||
session:execute("set", "cc_cause=answered");
|
||||
|
||||
cc_side = api:executeString("uuid_getvar ".. uuid .." cc_side");
|
||||
cc_side = api:executeString("uuid_getvar ".. uuid .." cc_side");
|
||||
if (cc_side ~= nil) then
|
||||
session:execute("set", "cc_side="..cc_side);
|
||||
end
|
||||
|
||||
cc_queue = api:executeString("uuid_getvar ".. uuid .." cc_queue");
|
||||
cc_queue = api:executeString("uuid_getvar ".. uuid .." cc_queue");
|
||||
if (cc_queue ~= nil) then
|
||||
session:execute("set", "cc_queue="..cc_queue);
|
||||
end
|
||||
|
||||
cc_queue_joined_epoch = api:executeString("uuid_getvar ".. uuid .." cc_queue_joined_epoch");
|
||||
cc_queue_joined_epoch = api:executeString("uuid_getvar ".. uuid .." cc_queue_joined_epoch");
|
||||
if (cc_queue_joined_epoch ~= nil) then
|
||||
session:execute("set", "cc_queue_joined_epoch="..cc_queue_joined_epoch);
|
||||
end
|
||||
@@ -389,3 +390,4 @@
|
||||
--cmd = "originate user/1007@voip.example.com &intercept("..uuid..")";
|
||||
--api = freeswitch.API();
|
||||
--result = api:executeString(cmd);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user