Looking for information about current recording state of an extension and some AMI/AGI commands

Hello FreePBX community,

first of all… i’m pretty new to the asterisk/freepbx world, so apologizes, if my questions might be stupid or easily answers could be found elsewhere (ofc i tried before asking).

What i have so far is a running server, multiple extensions working, ring groups working, call recording working (all calls for some extension,some other on demand).

Currently im working on a web app, which should simply show the current call state (busy/not busy) of all extensions, which already works. Additionally it should show the current recording state of any line and it should be possible to start/stop recording there too. Communication with PHP via AMI works fine, i just need to know what commands to send, to 1.) get the current recording state for an extension, 2.) start a recording on demand for an extension and 3.) stop the recording on demand for an extension.

Any help in this would really be appreciated!

I think start/stop is doable probably with the monitor command. I think “recording state” is not currently possible without some voodoo. There is no facility within Asterisk or the manager to do this. Some folks wanted to trip BLF during record and it wasn’t doable. You may be able to watch /var/spool/asterisk/tmp and parse files in there but that may not be reliable.

The channel variable “REC_STATUS” will indicate whether the channel is being recorded, at least on version 2.11, don’t know about previous versions. From the CLI, get a list of active channels with “core show channels” then from that list “core show channel [name]” to get the channel variable list. With effort you can match the data from each of the channels back to trunks and extensions. I would be interested in seeing your finished result, post a link if possible.