Email call recordings?

I need to record on demand using *1. When the call ends, I need it to email that recording to the email address on that extension. How is this done?

I know you can have all recorded calls emailed to a single email address (or group email address) but I’m uncertain how you could make it more specific to only go to the person who recorded the call.

You need a 'postrecording script ’ , defined in advanced settings, that passes ${EXTEN} as one of it’s parameters you can grep the email for ${EXTEN } out of /etc/asteriskvoicemail.conf

Other examples of postrecording scripts are here and on google.

I don’t even see this option. Are you saying this will work then? It worked on their 10 year old phone system

You probably need to enable hidden and read-only in advanced.

Okay. I am in the conf file. I guess I’m not sure what needs changed or added? I don’t see ${EXTEN} in that conf file

When your call to that script is called you can use any current channel variable , call dumpchan() to see

Comedian mail will write to the mailbox all the files with relevant extensions of the


line in /etc/asterisk/voicemail.conf, the first “extension” is what is what is normally played , and would be the files overridden by any attachfmt= in a particular extension,

I have never seen a “bin” file created but you could force wav49 (for the .WAV file) if it exists and you replaced your $6 (the “file”) with ${6%.*}.WAV

And the body of the email is anything between the quotes of:-

echo -e "You have a new call recording to listen to \n\n
The call date and time was $dt \n\n
The call was from $5 \n\n
The call was to $7 \n\n

Please see the attached file \n\n"

I am not sure what is wrong with my script. I don’t get anything in the body at all though. The attachments I get are a bin file and a txt file. I add this line to the post recording script line in advanced settings

bash /var/lib/asterisk/bin/ ^{YEAR} ^{MONTH} ^{DAY} ^{TIMESTR} ^{FROMEXTEN} ^{recording}.^{wav} ^{ARG3}

You perhaps look at the government over help for that in advanced, you don’t need bash at the beginning and your variables are overcomplicated

okay so that is probably the issue then. I just used what someone else did on another post. What should those settings be then?

If you read the hover over help,

An optional script to be run after the call is hangup. You can include channel and MixMon variables like ${CALLFILENAME}, ${MIXMON_FORMAT} and ${MIXMON_DIR}. To ensure that you variables are properly escaped, use the following notation: ^{MY_VAR}

No Default Provided, field can be left blank
Internal Name: MIXMON_POST

you could send the file to the script as


that fully qulified filename has all the info you need for the body of the email embedded. to get the email address of the owner of an extension

egrep “^{recipientsext}” /etc/asterisk/voicemail.conf |cut -d , -f 3

All code in the forums must be licensed.


Thanks for clarifying. Please, how can I make it such that the local extension (in-call or receiving) gets the notification with the mp3 audio file and not the default email e.g. [email protected]? Do I need to have a file with the lists of extensions and emails or I must input emails alongside extensions on the FreePBX?



There is a file already providing such correlatoon, as I said

egrep “^{recipientsext}” /etc/asterisk/voicemail.conf |cut -d , -f 3

Thank you.