Verify if MixMonitor is already running

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.

Thanks

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?

Excluding the file name variable and the ID variable, the other variables related I have found are

  • ${TOUCH_MIXMONITOR } - The filename base to use with Touch MixMonitor (auto record)
  • ${TOUCH_MIXMONITOR_FORMAT } - The audio format to use with Touch MixMonitor (auto record)
  • ${TOUCH_MIXMONITOR_OUTPUT } - Recorded file from Touch MixMonitor (auto record)

I’ve never used features.conf/automon/automixmon. I assumed the OP was asking about the mixmonitor() application. Thanks.

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)

Exactly, my question is about MixMonitor application.

The truth is that I don’t know the FILENAME for the file created, then I can’t verify if it exists.

Basically my records are generated by MixMonitor application and MixMonitor used inside the Queue application.

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.

MIXMONITOR_FILENAME hold the file name, from there is where you evaluate it, assuming you want to use this variable

@ambiorixg12 I interpreted wrongly, I was thinking that FILENAME string in the variable name was dynamic.

I tested here, with that I can solve my issue.

Many thanks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.