Turn Off Active Call Recording

Status
Not open for further replies.

Matthew Main

Member
Jan 24, 2017
92
5
8
39
Hi Guys,

Need a little help, I need a feature code to turn off call recording during a call and also re-enable call recording during a call.

Can anyone help?

This is due to a client taking Credit Card numbers over the phone. We need to stop the recording during that time and then record once sensitive details have been taken

Kind Regards

Matt
 

Matthew Main

Member
Jan 24, 2017
92
5
8
39
been reading how to do this in freeswitch and wondering if all I need to do is add the action application into the inbound and outbound route.
the info is in a good freeswitch cookbook :)

can someone shed more light on this, please
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,044
565
113
I cannot remember exactly how to do this if I remember correctly FusionPBX uses the uuid_record function.

Within it there is an option to mask part of the recording, see: https://wiki.freeswitch.org/wiki/Mod_commands#uuid_record

I think you need to call mask then unmask, you would have to grab the uuid of the call.

uuid_record <uuid> mask /path/to/file/recording.wav

So you need to get UUID and recording path of the call.

If I remember correctly:

uuid_getvar 2f4444f0-b681-11e6-a048-cf63bb376a7e api_on_answer

will help with this, Where uuid of the call is yours obviously.

Hope it helps.
 
Last edited:

Matthew Main

Member
Jan 24, 2017
92
5
8
39
ok so it is call masking that i am after, is there a way to just create a short / feature code to handle this. I have googled and not found much, little stuck
i would have though with PCI / DSS compliance this would be a standard feature code in fusion / freeswitch
 

ThriveLife

New Member
Apr 19, 2017
12
0
1
42
I'd like to add my need for this exact requirement for PCI compliance. I've attempted to create a 'Payment' that our CS reps transfer to which doesn't have recordings enabled, but after a xfer from Support to Payments, the call continues to record. We need to record our call data, just not when we collect payment. Anybody else have any success here?
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,044
565
113
With regards to PCI compliance, I am surprised that they accept the operator activating the masking.
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,044
565
113
Did you guys get a solution to this? I have one which should be completed today. I need to do some further testing.
 

ThriveLife

New Member
Apr 19, 2017
12
0
1
42
I'm still tinkering around with it, my latest approach has been to turn off recording in the call center queue and use the dialplan to start and stop recording, but I've hit a block on hangup not stopping the recording. I'd love to see what you've discovered :)
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,044
565
113
Right, very tatty for now (I've dropped the bind digits into the variables part of the dialplan)

Code:
action bind_digit_action local,*789,exec:lua,toggle_recording_masking.lua,${bind_target}

Then in the following file:
/usr/share/freeswitch/scripts/toggle_recording_masking.lua

Code:
        require "resources.functions.config";
        require "resources.functions.settings";

--make sure the session is ready
        if ( session:ready() ) then

                --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

                --get the variables
                if (session:getVariable("masked") == null) then
                        masked = "false";
                else
                        masked = session:getVariable("masked");
                end
                uuid = session:getVariable("uuid");
                path = session:getVariable("api_on_answer");
                path = string.gsub(path, ".* start ", "")

                --mask or unmask the recording
                api = freeswitch.API();
                if (masked == "false") then
                        cmd = "uuid_record "..uuid.." mask "..path;
                        sound = "uuid_broadcast "..uuid.." "..sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/ivr/ivr-recording_paused.wav both";
                        api:executeString(sound);
                        api:executeString(cmd);
                        session:setVariable("masked", "true");
                else
                        cmd = "uuid_record "..uuid.." unmask "..path;
                        api:executeString(cmd);
                        sound = "uuid_broadcast "..uuid.." "..sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/ivr/ivr-recording_started.wav both";
                        api:executeString(sound);
                        session:setVariable("masked", "false");
                end
        end

Let us know how you get on :)
 
Last edited:

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,044
565
113
Hang fire with the above, there are multiple problems, but I think I'm just nailing them...
 

ThriveLife

New Member
Apr 19, 2017
12
0
1
42
Thanks Daz. I created a checkpoint on the VM so I'll play around with the above until you think you nail it down. Thanks!
 

Rick Hodger

New Member
Jul 21, 2017
3
1
3
I made some modifications to DigitalDaz's script and it works for me now.

Code:
        require "resources.functions.config";
        require "resources.functions.settings";

--make sure the session is ready
        if ( session:ready() ) then

                --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

                --get the variables
                if (session:getVariable("masked") == null) then
                        masked = "false";
                else
                        masked = session:getVariable("masked");
                end
                uuid = session:getVariable("bridge_uuid");
                path = session:getVariable("api_on_answer");
                path = string.gsub(path, ".* start ", "")

                --mask or unmask the recording
                api = freeswitch.API();
                if (masked == "false") then
                        freeswitch.consoleLog("notice", "[recording] Masking call "..uuid.."\n");
                        cmd = "uuid_record "..uuid.." mask "..path;
                        freeswitch.consoleLog("notice", cmd);
                        reply = api:executeString(cmd);
                        if (string.sub(reply, 0, 1) == "-") then
                            sound = "uuid_broadcast "..uuid.." "..sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/misc/error.wav both";
                        else
                            sound = "uuid_broadcast "..uuid.." "..sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/ivr/ivr-recording_paused.wav both";
                            session:setVariable("masked", "true");
                        end
                        api:executeString(sound);
                else
                       freeswitch.consoleLog("notice", "[recording] Unmasking call "..uuid.."\n");
                        cmd = "uuid_record "..uuid.." unmask "..path;
                        reply = api:executeString(cmd);
                        if (string.sub(reply, 0, 1) == "-") then
                            sound = "uuid_broadcast "..uuid.." "..sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/misc/error.wav both";
                        else
                            sound = "uuid_broadcast "..uuid.." "..sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/ivr/ivr-recording_started.wav both";
                            session:setVariable("masked", "false");
                        end
                        api:executeString(sound);
                     
                end
        end

To explain the changes I made:
  • The recording appears to be started under the bridge UUID, and not the leg UUID.
  • I added in checks for errors in case the recording fails to mask/unmask, and announce that it has failed to the call. In the original script it would fail silently and announce that recording was paused, when in actual fact it continued to record.
 
Last edited:
  • Like
Reactions: DigitalDaz

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,044
565
113
Nice, I had fixed this for the leg UUID but hadn't put in any checks so that's good to see, I'll dig around and see what else I have because the inbound causes a little grief too, I know in a couple of places, maybe ring groups, the bindings are hard coded so though your outbound may work, mileage will vary on the inbound depending on how they are routed in.
 

Rick Hodger

New Member
Jul 21, 2017
3
1
3
I hadn't actually tested transferring the call.

It does seem to work, with one small problem. If I answer a call, mask and unmask and then transfer - the new party can still mask and unmask the call, no issues with the recording. If I answer a call on extension 101, mask the call and transfer to extension 102, the recording remains masked. If ext 102 dials *9, the script attempts to mask the call again - the 'masked' variable does not appear to carry over after the transfer.

Edit: I'm guessing that the masked var is being stored in the leg of the call, rather than the bridge, and gets destroyed or left behind when the call is transferred. I can't see a way to store the variable in the bridge.
 
Last edited:
Status
Not open for further replies.