Stop Recording call by Agent

Hello,

I have a purpose below:

When the agent in queue pick up the call, the caller says that he does not want that his call will be recorded, So the agent put the touch “#1” to stopping the recording.

In my dialplan i have:

[queue1] ;support
exten => _9XXXX,1,Answer()
same=>n,MixMonitor(queuetest1.wav,b)
same => n,Queue(support,t)
same=>n,StopMixMonitor()
same => n,Hangup()
In this way, the call is always recording when the bridge is created between caller and the agent.
So my question is:

How should I put into my dialplan and then when agent put “#1”, so it stops to recording the call, I mean the application StopMixMonitor will be called immediatly

Use AMI and a feature code https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+ManagerAction_StopMixMonitor

I’m not sure that you can have general feature codes in the Queue application, so you might need a fairly complex arrangement with non-optimised local channels.

From another question, it looks like Queue supports general features, but lacks the options to control their use, and only uses the channel variable.