GUI Wake-Up Call

Status
Not open for further replies.

MammerJammer

Member
Oct 23, 2018
60
5
8
48
Does anyone have the ability to use the API to create a GUI interface to set a wake-up call? I would love to see something that could perhaps mimic the operator panel to create the functionality.

As much as I dislike 3CX, two things that system does very elegantly is wake-up calls and PMS integration. I am open to ideas and I fully expect to compensate the individual for their effort. Is anyone able and interested?
 

MammerJammer

Member
Oct 23, 2018
60
5
8
48
Money.. money for sale. Please take my money. I want to get a 911 alert system in place like the one voiptools.com has for 3CX.

Please help me develop this. Please take my money. Thank you.
 

KonradSC

Active Member
Mar 10, 2017
166
99
28
Money.. money for sale. Please take my money. I want to get a 911 alert system in place like the one voiptools.com has for 3CX.

Please help me develop this. Please take my money. Thank you.

Here's a little lua script to send an email when an emergency call is made.

Instructions:
Simply add an action to your emergency outbound route. Make sure the order is a lower number than your bridge statement.

Tag: action
Type: lua
Data: app.lua emergency_notify [to_email_address] [from_email_address]

Put these files in your scripts directory. So the full path would look like this:
/usr/share/freeswitch/scripts/app/emergency_notify/index.lua

https://github.com/konradSC/Fusionpbx-Public/tree/master/Apps/emergency_notify
 

MammerJammer

Member
Oct 23, 2018
60
5
8
48
Does the Buffalo's gender make a difference? Hilarious. lol. Konrad, I really appreciate your feedback. I've seen other posts with this LUA email script process but this is a way better explanation of how to actually implement it. To get a screen-pop right on the Yealink T46 I think we have to use SMS however.

I've had very little response and I've thrown feelers in a lot of different directions. Either there aren't a lot of folks using FusionPBX in a hospitality or assisted living setting, or they want to keep their tweaks proprietary and top-secret.

What I would really like to do is sponsor a custom module that is tailored for the hospitality industry. There are 3 key modules that aren't under the hood with FusionPBX out of the box. I'd love to sponsor the development of those mods and contribute them back to the community. I've spoken with another member here that has interest and a lot of experience with modding FusionPBX.

Would you be interested in having that conversation privately?
 

puneet936

New Member
Jul 14, 2019
14
1
3
46
Does the Buffalo's gender make a difference? Hilarious. lol. Konrad, I really appreciate your feedback. I've seen other posts with this LUA email script process but this is a way better explanation of how to actually implement it. To get a screen-pop right on the Yealink T46 I think we have to use SMS however.

I've had very little response and I've thrown feelers in a lot of different directions. Either there aren't a lot of folks using FusionPBX in a hospitality or assisted living setting, or they want to keep their tweaks proprietary and top-secret.

What I would really like to do is sponsor a custom module that is tailored for the hospitality industry. There are 3 key modules that aren't under the hood with FusionPBX out of the box. I'd love to sponsor the development of those mods and contribute them back to the community. I've spoken with another member here that has interest and a lot of experience with modding FusionPBX.

Would you be interested in having that conversation privately?
Hi Mammer,
I have complete Hotel Module ready with us.. where following features we have..
1. Check in (Open Outgoing call, Set Guest Name as a caller ID)
2. Check out (Close Outgoing call, remove guest name from caller id, delete voice mail)
3. 911 Notification (if any extension dial 911 frontdesk ring group receive notification call room xxx has dialed emergency number)
4. Wakeup call (any extension can set wakeup call, if ext doest not pickup or cancel call after certain retry it will notify to frontdesk)

I have all above features available with UI and ready to implement.. you can send me PM.
 

MammerJammer

Member
Oct 23, 2018
60
5
8
48
Hi Mammer,
I have complete Hotel Module ready with us.. where following features we have..
1. Check in (Open Outgoing call, Set Guest Name as a caller ID)
2. Check out (Close Outgoing call, remove guest name from caller id, delete voice mail)
3. 911 Notification (if any extension dial 911 frontdesk ring group receive notification call room xxx has dialed emergency number)
4. Wakeup call (any extension can set wakeup call, if ext doest not pickup or cancel call after certain retry it will notify to frontdesk)

I have all above features available with UI and ready to implement.. you can send me PM.


PM Sent.
 

MammerJammer

Member
Oct 23, 2018
60
5
8
48
Puneet, I private messaged you about this module but did not receive a reply. Can you please share some contact info so we can discuss?
 

bcmike

Active Member
Jun 7, 2018
337
58
28
53
I am also interested in this. Please let me know if you get a response.
 

pbxshark

New Member
May 4, 2020
2
0
1
45
The files were just removed, 6 hours ago! I need this script. Any chance you could send me a zipped copy of it?
 

KonradSC

Active Member
Mar 10, 2017
166
99
28
Sorry, I pulled a bunch of stuff off my repo due to security concerns raised about some of the code.

Put the lua script in scripts/emergency_notify
Put the tpl files in scripts/emergency_notify/resources/templates/en/us

Here's the LUA: index.lua
Code:
--    Intructions:
--    Simply add an action to your emergency outbound route. Make sure
--    the order is higher than your bridge statement
--
--    Tag: action
--    Type: lua
--    Data: app.lua emergency_notify [to_email_address] [from_email_address]
--

--debug
    debug["info"] = false;
    debug["sql"] = false;

--include config.lua
    require "resources.functions.config";
    require "resources.functions.explode";
    require "resources.functions.trim";
    require "resources.functions.base64";

--get arguments
    to_email = argv[2];
    from_email = argv[3];
    
--check the missed calls
    function send_mail()

        --set the sounds path for the language, dialect and voice
            default_language = session:getVariable("default_language");
            default_dialect = session:getVariable("default_dialect");
            default_voice = session:getVariable("default_voice");
            if (not default_language) then default_language = 'en'; end
            if (not default_dialect) then default_dialect = 'us'; end
            if (not default_voice) then default_voice = 'callie'; end

        --prepare the files
            file_subject = scripts_dir.."/app/emergency_notify/resources/templates/"..default_language.."/"..default_dialect.."/email_subject.tpl";
            file_body = scripts_dir.."/app/emergency_notify/resources/templates/"..default_language.."/"..default_dialect.."/email_body.tpl";
            if (not file_exists(file_subject)) then
                file_subject = scripts_dir.."/app/emergency_notify/resources/templates/en/us/email_subject.tpl";
                file_body = scripts_dir.."/app/emergency_notify/resources/templates/en/us/email_body.tpl";
            end

        --prepare the headers
            headers = '{"X-FusionPBX-Domain-UUID":"'..domain_uuid..'",';
            headers = headers..'"X-FusionPBX-Domain-Name":"'..domain_name..'",';
            headers = headers..'"X-FusionPBX-Call-UUID":"'..uuid..'",';
            headers = headers..'"X-FusionPBX-Email-Type":"emergency_call"}';

        --prepare the subject
            local f = io.open(file_subject, "r");
            local subject = f:read("*all");
            f:close();
            subject = subject:gsub("${caller_id_name}", caller_id_name);
            subject = subject:gsub("${caller_id_number}", caller_id_number);
            subject = subject:gsub("${sip_to_user}", sip_to_user);
            subject = subject:gsub("${caller_destination}", caller_destination);
            subject = trim(subject);
            subject = '=?utf-8?B?'..base64.encode(subject)..'?=';

        --prepare the body
            local f = io.open(file_body, "r");
            local body = f:read("*all");
            f:close();
            body = body:gsub("${caller_id_name}", caller_id_name);
            body = body:gsub("${caller_id_number}", caller_id_number);
            body = body:gsub("${sip_to_user}", sip_to_user);
            body = body:gsub("${caller_destination}", caller_destination);
            body = body:gsub(" ", " ");
            body = body:gsub("%s+", "");
            body = body:gsub(" ", " ");
            body = body:gsub("\n", "");
            body = body:gsub("\n", "");
            body = body:gsub("'", "'");
            body = body:gsub([["]], """);
            body = trim(body);

        --send the email
            cmd = "luarun email.lua "..to_email.." "..from_email.." "..headers.." '"..subject.."' '"..body.."'";
            if (debug["info"]) then
                freeswitch.consoleLog("notice", "[emergency call] cmd: " .. cmd .. "\n");
            end
            api = freeswitch.API();
            result = api:executeString(cmd);
    end

--handle originate_disposition
    if (session ~= nil and session:ready()) then
        uuid = session:getVariable("uuid");
        domain_uuid = session:getVariable("domain_uuid");
        domain_name = session:getVariable("domain_name");
        context = session:getVariable("context");
        caller_id_name = session:getVariable("outbound_caller_id_name");
        caller_id_number = session:getVariable("caller_id_number");
        sip_to_user = session:getVariable("sip_to_user");
        caller_destination = session:getVariable("caller_destination");


        if (debug["info"] == true) then
            freeswitch.consoleLog("INFO", "[emergency_notify] caller_id_number: " .. tostring(caller_id_number) .. "\n");
            freeswitch.consoleLog("INFO", "[emergency_notify] caller_id_number: " .. tostring(caller_id_number) .. "\n");
            freeswitch.consoleLog("INFO", "[emergency_notify] caller_destination: " .. tostring(caller_destination) .. "\n");
            freeswitch.consoleLog("INFO", "[emergency_notify] to_email: " .. tostring(to_email) .. "\n");
            freeswitch.consoleLog("INFO", "[emergency_notify] from_email: " .. tostring(from_email) .. "\n");
        end


        send_mail();

    end

Here's the email body template: email_body.tpl
Code:
${caller_id_name} <${caller_id_number}> made an emergency call to ${sip_to_user}

Here's the email subject template: email_subject.tpl
Code:
${caller_id_name} <${caller_id_number}> Made An Emergency Call
 
  • Like
Reactions: pbxshark

riccardo.granchi

New Member
Feb 12, 2021
1
0
1
51
Hi Mammer,
I have complete Hotel Module ready with us.. where following features we have..
1. Check in (Open Outgoing call, Set Guest Name as a caller ID)
2. Check out (Close Outgoing call, remove guest name from caller id, delete voice mail)
3. 911 Notification (if any extension dial 911 frontdesk ring group receive notification call room xxx has dialed emergency number)
4. Wakeup call (any extension can set wakeup call, if ext doest not pickup or cancel call after certain retry it will notify to frontdesk)

I have all above features available with UI and ready to implement.. you can send me PM.

Hi puneet936,
I'm also interested in your hotel module (it is FreeSwitch / FusionPBX module, right?).
Can you send me information or links? Thanks, see you soon!
 
Status
Not open for further replies.