Call park bridging calls together

Status
Not open for further replies.

ug5

New Member
Nov 18, 2016
13
0
1
33
We have a customer who has a re-occurring issue where they will inadvertently bridge calls together with call park.

They have Cisco 504G phones with the last two lines buttons configured as park+*5901 and park+*5902

Some of their phone users don't look at the status of the blf light before parking the call, thus, if the park is in use and the blf is red, they will be bridging the call they were on with the previously parked call.

Oddly enough, when two calls are bridged together in a park the blf shows green again, which makes the issue even worse because users then think that the call park slot is free, and they park another call on top of the prior ones.

Because of this, I've watched them park 4 customers together. I'm sure that was an awkward conversation....

I can't figure out in the dialplan how to prevent this from happening. Basically, if the call park is in use, I want it to beep at the user or something. I want it to not accept another call if the park is already in use.

Has anybody else ever had this issue occur before?
 

mfelli

New Member
Dec 24, 2017
16
1
3
44
I have this same issue and was thinking of modifying the LUA script. Something like determining if the end user is on an active call and is pressing the park key with an active call itself, to just fail the transfer. How exactly I haven't had time to look into yet.
 

ug5

New Member
Nov 18, 2016
13
0
1
33
mmanning_ provided this solution on irc, instead of bridging the calls together it will just hang up on the caller if the parking slot is already in use.

create this lua script and name is something like: newpark.lua

Code:
-- valet park dialplan replacement
-- get the valet park lot passed as argv[1]
--create the api object
    api = freeswitch.API();
    park_lot = argv[1];
    
    hold_music    = session:getVariable("hold_music");

    if not park_lot or park_lot == "" then return end;
--get active lots for the domain
    domain_name = session:getVariable("domain_name");
    context     = session:getVariable("call_direction");
    
    --freeswitch.consoleLog("err",domain_name);
    --freeswitch.consoleLog("err",context);

    lot_in_use = string.find(api:executeString("valet_info park@" .. domain_name),park_lot) or false;
    
    referred_by_user=string.match(session:getVariable("sip_h_Referred-By") or "",'sip:(.*)@.*') or "";
    
    if not(referred_by_user=="") then
    -- if trying to park to the occupied lot return call back to the referrer
        if lot_in_use then
            session:execute("transfer", referred_by_user .." XML "..context);
            return;
        end
    else
    -- user just pressed an empty parking lot button... respond with 404
        if not lot_in_use then
            session:execute("respond", "404");
            return;
        end
    end
-- do the actual valet park stuff here
    session:setVariable("valet_hold_music",hold_music);

    if (session:getVariable("valet_parking_timeout") == nil) then
        -- Set to 5 minutes if not specified
        session:setVariable("valet_parking_timeout","300");
    end

    if (session:getVariable("valet_parking_orbit_exten") == nil) then
        -- Set to the referred users extension if not specified
        session:setVariable("valet_parking_orbit_exten",referred_by_user);
    end

    freeswitch.consoleLog("info", "park@"..domain_name.." "..park_lot);
    session:execute("valet_park", "park@"..domain_name.." "..park_lot);

Then copy the original valet_park dial plan, disable the original and replace with the text in the below image.

https://imgur.com/a/QYroz
 

Andrew Byrd

Member
Feb 16, 2018
309
10
18
54
Can you tell me the syntax you used to program the *5901 and *5902 on the spa 504?

I tried fnc=sd;ext=*5900@$PROXY to put it on park then I am not sure what to use to BLF the parked key?

Any help would be appreciated.
 

ug5

New Member
Nov 18, 2016
13
0
1
33
Can you tell me the syntax you used to program the *5901 and *5902 on the spa 504?

I tried fnc=sd;ext=*5900@$PROXY to put it on park then I am not sure what to use to BLF the parked key?

Any help would be appreciated.

Do you want to configure line keys as park buttons?

For this particular customer I do: fnc=blf+sd+cp;sub=park+*5901@customer.yolovoip.net;ext=park+*5901@customer.yolovoip.net;vid=1

This seems to work pretty well.
 

djzort

Member
Feb 28, 2018
76
5
8
41
Sydney, Australia
bytefoundry.com.au
I think that the problem may lie in park.db not being created successfully in /var/lib/freeswitch/db (i.e. database_dir) - this is owned by www-data:www-data which is what freeswitch is running as.

The code in my clean install of fusionpbx has sqlite uncommented, but subsequently has code that seems to create tables for mysql,pgsql and sqlite (all uncommented). it also seems to try to protect against the database not connecting - however in sqlite this may be useless.

park_monitor.lua only mentions sqlite
 

djzort

Member
Feb 28, 2018
76
5
8
41
Sydney, Australia
bytefoundry.com.au
manually creating the sqlite database, creating its tables and adjusting its permissions to match is neighbors - no data is entered in to it when there is a call parked.

something seems quite wrong - i dont know for certain if the default park.lua file is even being used
 
Status
Not open for further replies.