Add. attr_xfer analog based on conference. (#1629)

* Add. attr_xfer analog based on conference.

Control DTMF sequence
 `*0` transfer `self` to `enter number` state and `peer` leg to conference room
 `##` transfer `self` to `enter number` state and hangup `peer` leg
 `*#` transfer `self` to conference room and hangup `peer` leg

* Remove spaces.

* Add. Commented action to ring group.
This commit is contained in:
Alexey Melnichuk
2016-08-30 10:10:08 +03:00
committed by FusionPBX
parent 67a4124023
commit 66f26cf2e6
4 changed files with 95 additions and 1 deletions

View File

@@ -23,6 +23,20 @@ function channel_evalute(uuid, cmd)
return result
end
function channel_transfer(uuid, ext, typ, ctx)
local cmd = ("uuid_transfer %s %s %s %s"):format(uuid, ext, typ, ctx)
local result = trim(api:executeString(cmd))
if result:sub(1, 4) == '-ERR' then return nil, result end
if result == '_undef_' then return false end
return result
end
function channel_kill(uuid, cause)
cause = cause or 'CALL_REJECTED'
local res = trim(api:executeString("uuid_kill " .. uuid .. " " .. cause))
return res == '+OK'
end
function channel_display(uuid, text)
local cmd = ("uuid_display %s '%s'"):format(uuid, text)
local result = trim(api:executeString(cmd))