Fix. problem when same session can release task multiple times.

It can be when originate has group dial-string. So it call `api_hangup_hook`
for each channel.
Now we release task in `retry.lua` only if originate success and this is same channel
which execute `exec.lua`.
If originate fail we release task `next.lua`
This commit is contained in:
Alexey Melnichuk
2015-11-26 17:23:33 +03:00
parent 35752445c3
commit ac44787e36
5 changed files with 47 additions and 15 deletions

View File

@@ -103,6 +103,14 @@ local remove_finished_tasks_sql = [[
delete from v_fax_tasks where task_status > 3
]]
local function serialize(task, header)
local str = header or ''
for k, v in pairs(task) do
str = str .. ('\n %q = %q'):format(tostring(k), tostring(v))
end
return str
end
local function get_db()
if not db then
db = assert(Database.new('system'))