Call Recording duration during the call

Hello!

I’m trying to get call recording in real time. Is that possible ?

I tried to subscribe to AMI events so I can catch StartMixMonitor / StopMixMonitor, do some calculation and always have recorded duration, but the problem is: when bridged option is enabled for MixMonitor - there is no any event that recording was stopped, so it requires more complicated logic and complexity in implementing and using solution. Also it’s not reliable way in my opinion.

Currently I resolved that by checking recording duration directly in call recording file (wav), it has few problems:

  • measurement is not accurate, due to buffering recording
  • it requires access to the file

Do you have in mind more elegant solution ? I start to think to write custom application for asterisk to retrieve call recording duration in dialplan.

Maybe such functionality is planned in future releases ?
I use: 13.6.0 version.

Thank you in advance

In order to have an accurate value of recording file duration you need to access to the file, If the file is converted to mp3 you can fire the duration and any other details using the tool MP3Info, to a remote server using a post back request

I need to access call duration during the same call, so it’s not converted to mp3 yet and still in ongoing process.
This is required for be able to set bookmarks in call recording during the call.

BTW: What do you mean by post back request ?

Your use case is not supported.

In fact, during a call, anything more complex than a raw file is not complete until the recording is finished; only the media is written, but none of the meta data (the file size should be related, but will lag because of block buffering in user space).

Why is current time - answer time not an adequate equivalent?

THank you @david551 for your answer!

(the file size should be related, but will lag because of block buffering in user space).

Yes, that’s exactly what did I described originally in a topic. That time is not accurate due to buffering.

Why is current time - answer time not an adequate equivalent?

as I use modificator “b” it doesn’t record call untill call is bridged (connected to someone) More over, call recording may be stopped due to security reason and resume later. So it’s quite complicate to map all possible actions which may affect call recording.