mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-03-09 01:58:44 +00:00
Fix small bags and clear code in call_flow.
Move code to turn on/off BLF to separate function. ```Lua presence_in.turn_lamp( toggle == "false", call_flow_feature_code.."@"..domain_name, call_flow_uuid ); ``` Close temp file in call_flow_monitor because on Windows it prevent to remove it. Connect/release to database inside call_flow_monitor loop. Check successful connection to database in call_flow_monitor loop so monitor did not crash if connection temporary lost.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
local function turn_lamp(on, user, uuid)
|
||||
local event = freeswitch.Event("PRESENCE_IN");
|
||||
event:addHeader("proto", "sip");
|
||||
event:addHeader("event_type", "presence");
|
||||
event:addHeader("alt_event_type", "dialog");
|
||||
event:addHeader("Presence-Call-Direction", "outbound");
|
||||
event:addHeader("from", user);
|
||||
event:addHeader("login", user);
|
||||
event:addHeader("unique-id", uuid);
|
||||
event:addHeader("status", "Active (1 waiting)");
|
||||
if on then
|
||||
event:addHeader("answer-state", "confirmed");
|
||||
event:addHeader("rpid", "unknown");
|
||||
event:addHeader("event_count", "1");
|
||||
else
|
||||
event:addHeader("answer-state", "terminated");
|
||||
end
|
||||
event:fire();
|
||||
end
|
||||
|
||||
return {
|
||||
turn_lamp = turn_lamp;
|
||||
}
|
||||
Reference in New Issue
Block a user