Send mail after recording the call

Hello everyone. What I want is to make a call to a certain extension and when the call ends the recording is automatically sent to an email. The part of the recording is done with the MixMonitor function, now my question is how can I send that recording to an email.
The command I am using is the following:

exten => 464,1, MixMonitor (/var/spool/asterisk/monitor/test1.wav, [m (464)])

But with this command it only sends the recording to the voice mailbox not to the email.

I also tried with other command:

exten => h,n,System(mail -s “Email” username@domain.com -A /var/spool/asterisk/monitor/test1.wav <<< “Body email”)

but it didn’t work either. For emails I am using exim4.

I am attentive to your comments. Greetings.

use the command - option Will be executed when the recording is over.
Any strings matching ^{X } will be unescaped to X .
All variables will be evaluated at the time MixMonitor is called. and varible ${MIXMONITOR_FILENAME}

The command I am using is the following:

exten => 464,1, MixMonitor (/var/spool/asterisk/monitor/test1.wav, [m (464)])

But with this command it only sends the recording to the voice mailbox not to the email.

I also tried with other command:

exten => h,n,System(mail -s “Email” username@domain.com -A /var/spool/asterisk/monitor/test1.wav <<< “Body email”)

but it didn’t work either. For emails I am using exim4.

I did it using mpack

exten=>h,1,System(/usr/bin/mpack -s "We got a new recording" /var/spool/asterisk/monitor/test1.wav black@gmail.com)

how about using Monitor + MONITOR_EXEC
(http://the-asterisk-book.com/1.6/applikationen-monitor.html)

at Linux shell script, you can do it

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