Categories
Blog FreePBX Technical

Muting call recordings

Recently we had a request from a customer that was not the normal request to be able to start and stop a recording.

Recently we had a request from a customer that was not the normal request to be able to start and stop recordings. They wanted to just mute it but keep the recording intact duration wise, also the ability to just mute the caller was required.

Asterisk has a manager command ‘MixMonitorMute’ that does just this on all legs of a recording or just the caller / callee legs.

Action: MixMonitorMute
[ActionID:] <value>
Channel: <value>
[Direction:] <value>
[State:] <value>

[Synopsis]
Mute / unMute a Mixmonitor recording.

[Description]
This action may be used to mute a MixMonitor recording.

[Arguments]
ActionID
ActionID for this transaction. Will be returned.
Channel
Used to specify the channel to mute.
Direction
Which part of the recording to mute: read, write or both (from channel, to
channel or both channels).
State
Turn mute on or off : 1 to turn on, 0 to turn off.

So as the customer wanted the simplest interface possible we provided a simple login form which uses the freepbx user module users to log them in and pass their extension number over to the muteing form, with an icon showing the mute state as well as some text confirmation.

We split the code as this will mean in the future they can incorporate it into their CRM or dashboard with a simple post command if they so wanted.

How it works is by making a manager request to find variable RECORD_ID this is channel that what we need to pass in the AMI request to mute the recording and is best retrieved by running the ‘core show channel’ command and retrieving the variable from it, this is then passed in another AMI command to set the (un)mute.

Im sure there are other ways of achieving this and if you want the code to use or alter to your needs its available at https://github.com/cybercottage/muter.git