HELP ME!

Status
Not open for further replies.

yguomonstrodospabx

New Member
Feb 1, 2020
7
0
1
26
Hi everyone, I need to hangup a call and call to the same number again before some seconds, someone knows how do that ? I alreeady try to do this whith XML in inbound routes, but, when the call hangup the XML stop the execution. =/
 

yguomonstrodospabx

New Member
Feb 1, 2020
7
0
1
26
Tanks for the answer. I use this line in my inbound route to continue the execution: api_hangup_hook=luarun ligardevolta.lua...
 

yguomonstrodospabx

New Member
Feb 1, 2020
7
0
1
26
But now I have another problem, when I answer the call I receive a hangup before transfer to my callcenter.

Look the code

local clock = os.clock
function sleep(n) -- seconds
local t0 = clock()
while clock() - t0 <= n do end
end

telefone = argv[1]
gateway = argv[2]
contexto = argv[3]
fila = argv[4]

freeswitch.consoleLog("info","INICIANDO CALLBACK\n")
freeswitch.consoleLog("info","NUMERO ALVO DO CALLBACK: " ..telefone.. ".\n")
freeswitch.consoleLog("info","GATEWAY DE LIGAÇÃO: " ..gateway.. ".\n")
freeswitch.consoleLog("info","CONTEXTO: " ..contexto.. " FILA: " ..fila.. ".\n")
--Ligando para o numero respectivo

sleep(3)

freeswitch.consoleLog("info","TENTANDO CALLBACK\n")

session = freeswitch.Session(gateway..telefone)

if session:answered() then
session:transfer(fila, "XML", contexto)
else
freeswitch.consoleLog("info","TELEFONE INDISPONIVEL\n")
end
 
Status
Not open for further replies.