Would like to verify if a Channel is already recording and if yes not start a new record.
I am getting trouble with calls attended in a queue and then its transfered to a different endpoint and in the transfer is starting a new mixmonitor recording, it is causing duplicated files and sometimes overwritten by me application that treat it after the recorded audios.
Mixmonitor set some channels variables like MIXMONITOR_FILENAME and many others, you can evaluate them before start a new recording, also remember MixMonitor follow the Chanel who started the recording
Looking at the dox and a brief peek at the source, it looks like ‘MIXMONITOR_FILENAME’ and the option ‘i(variable-name)’ are the only variables set. Are there others?
Transfers don’t get recorded unless you start mixmonitor at the TRANSFER_CONTEXT level. and the TRANSFER_CONTEXT if not defined properly will be different depending on who transfers and how he transfers (blind, attended, called party, calling party, inbound, outbound, ) , for you to develop an application that tracks transfers in Asterisk will take you time to cover all the cases, so maybe a duplicate record here and there might not be as bad as it looks.
Define TRANSFER_CONTEXT var when the call comes in, then you can catch the transferred call inside this context and check vars, maybe start mixmonitor with a different file name (to avoid overwriting)
In my case transfer uses the same context of internal calls, with that will start a new MixMonitor. This is the issue.
If Asterisk doesn’t have an internal variable to control that, I will create it in my dialplan and control that. It’s not the best solution but should work.