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