mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-01 17:53:49 +00:00
With enterprise call each outbound channel has its own call_uuid. But we have to use `intercept` for call_uuid of inbound channel.
21 lines
528 B
Lua
21 lines
528 B
Lua
|
|
local api = api or freeswitch.API()
|
|
|
|
function channel_variable(uuid, name)
|
|
local result = api:executeString("uuid_getvar " .. uuid .. " " .. name)
|
|
|
|
if result:sub(1, 4) == '-ERR' then return nil, result end
|
|
if result == '_undef_' then return false end
|
|
|
|
return result
|
|
end
|
|
|
|
function channel_evalute(uuid, cmd)
|
|
local result = api:executeString("eval uuid:" .. uuid .. " " .. cmd)
|
|
|
|
if result:sub(1, 4) == '-ERR' then return nil, result end
|
|
if result == '_undef_' then return false end
|
|
|
|
return result
|
|
end
|