mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 03:33:49 +00:00
committed by
FusionPBX
parent
101cdf27be
commit
36e12ec0ae
32
resources/install/scripts/transfer2.lua
Normal file
32
resources/install/scripts/transfer2.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
local api = freeswitch.API()
|
||||
local uuid = assert(argv[1])
|
||||
local t1 = assert(argv[2])
|
||||
local t2 = assert(argv[3])
|
||||
|
||||
require "resources.functions.channel_utils"
|
||||
require "resources.functions.split"
|
||||
local log = require "resources.functions.log".transfer2
|
||||
|
||||
log.noticef("session %s\n", uuid);
|
||||
|
||||
local other_leg_uuid = channel_variable(uuid, "signal_bond")
|
||||
|
||||
log.noticef("other leg: %s\n", other_leg_uuid or '<NONE>')
|
||||
|
||||
if other_leg_uuid and #other_leg_uuid > 0 then
|
||||
if t2 ~= '::NONE::' then
|
||||
if t2 == '::KILL::' then
|
||||
channel_kill(other_leg_uuid)
|
||||
else
|
||||
channel_transfer(other_leg_uuid, usplit(t2, '::'))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if t1 ~= '::NONE::' then
|
||||
if t1 == '::KILL::' then
|
||||
channel_kill(uuid)
|
||||
else
|
||||
channel_transfer(uuid, usplit(t1, '::'))
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user