Hello Guys,
If you are guys looking for BLF settings for Agent status with FusionPBX then i have done something to do this, I hope this will help you .
In Ringotel you can configure BLF like below in features > Speed Dial Numbers & Features BLF Indicators.
agent+<Agent Name>
And do changes like below in agent_status/index.lua
-- Include files
--general functions
require "resources.functions.trim";
local presence_in = require "resources.functions.presence_in"
-------- START-----------
--set the presence to terminated - turn the lamp off:
if (action == "logout") then
freeswitch.consoleLog("info", "[EVENT] [LogOUT]");
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("state", "Active (1 waiting)");
event:addHeader("from", agent_name.."@"..domain_name);
event:addHeader("login", agent_name.."@"..domain_name);
event:addHeader("unique-id", user_uuid);
event:addHeader("answer-state", "terminated");
event:fire();
end
--set presence in - turn lamp on
if (action == "login") then
freeswitch.consoleLog("info", "[EVENT] [LOGIN]");
event = freeswitch.Event("PRESENCE_IN");
event:addHeader("proto", "sip");
event:addHeader("login", agent_name.."@"..domain_name);
event:addHeader("from", agent_name.."@"..domain_name);
event:addHeader("status", "Active (1 waiting)");
event:addHeader("rpid", "unknown");
event:addHeader("event_type", "presence");
event:addHeader("alt_event_type", "dialog");
event:addHeader("event_count", "1");
event:addHeader("unique-id", user_uuid);
event:addHeader("Presence-Call-Direction", "outbound");
event:addHeader("answer-state", "confirmed");
event:fire();
end
if (action == "login") then
blf_status="true"
if string.find(agent_name, 'agent+', nil, true) ~= 1 then
presence_in.turn_lamp( blf_status,
'agent+'..agent_name.."@"..domain_name,user_uuid
);
end
elseif (action == "logout") then
blf_status="false"
if string.find(agent_name, 'agent+', nil, true) ~= 1 then
presence_in.turn_lamp( blf_status,
'agent+'..agent_name.."@"..domain_name
);
end
end
----------END----------------
If you are guys looking for BLF settings for Agent status with FusionPBX then i have done something to do this, I hope this will help you .
In Ringotel you can configure BLF like below in features > Speed Dial Numbers & Features BLF Indicators.
agent+<Agent Name>
And do changes like below in agent_status/index.lua
-- Include files
--general functions
require "resources.functions.trim";
local presence_in = require "resources.functions.presence_in"
-------- START-----------
--set the presence to terminated - turn the lamp off:
if (action == "logout") then
freeswitch.consoleLog("info", "[EVENT] [LogOUT]");
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("state", "Active (1 waiting)");
event:addHeader("from", agent_name.."@"..domain_name);
event:addHeader("login", agent_name.."@"..domain_name);
event:addHeader("unique-id", user_uuid);
event:addHeader("answer-state", "terminated");
event:fire();
end
--set presence in - turn lamp on
if (action == "login") then
freeswitch.consoleLog("info", "[EVENT] [LOGIN]");
event = freeswitch.Event("PRESENCE_IN");
event:addHeader("proto", "sip");
event:addHeader("login", agent_name.."@"..domain_name);
event:addHeader("from", agent_name.."@"..domain_name);
event:addHeader("status", "Active (1 waiting)");
event:addHeader("rpid", "unknown");
event:addHeader("event_type", "presence");
event:addHeader("alt_event_type", "dialog");
event:addHeader("event_count", "1");
event:addHeader("unique-id", user_uuid);
event:addHeader("Presence-Call-Direction", "outbound");
event:addHeader("answer-state", "confirmed");
event:fire();
end
if (action == "login") then
blf_status="true"
if string.find(agent_name, 'agent+', nil, true) ~= 1 then
presence_in.turn_lamp( blf_status,
'agent+'..agent_name.."@"..domain_name,user_uuid
);
end
elseif (action == "logout") then
blf_status="false"
if string.find(agent_name, 'agent+', nil, true) ~= 1 then
presence_in.turn_lamp( blf_status,
'agent+'..agent_name.."@"..domain_name
);
end
end
----------END----------------