Recording using features.conf then send recording via email

Hi all,

I have a callback system where when authorised users will call a DID, it will call them back and allow them to place calls.

I already have a *9 feature activated that hangs up the active call to allow the user to place another call without having Asterisk callback the user again.

I would like to have another feature that would record both sides of the call when pressed, rename the recording using a format like --.ext and then send the recording via email when the call is hung up either because the caller or callee hung up or because *9 was pressed.
I’m a bit confused at how to do this because it seems features.conf can only call a command or function. However, this is not enough to do all I would like.

Can anyone advise regarding what I am missing here? Thanks!