[Asterisk-Users] Monitor application and e-mailing attachment

Attilla De Groot mail at youmeandvoip.nl
Sun Jun 4 03:01:00 MST 2006


Hi all,


I'm trying to make a context that will monitor a call and when it's  
completed it would e-mail the wav to a specified mail adres.

So I made a standard context that records a call, like this:

exten => _*31*00[1-9].,1,Setvar(CALLFILENAME=CALL-${EXTEN:4}-$ 
{TIMESTAMP})
exten => _*31*00[1-9].,2,Monitor(wav,${CALLFILENAME},m})
exten => _*31*00[1-9].,3,Dial(SIP/0031${EXTEN:6}@easynet)

exten => h,1,System(/etc/asterisk/mail.sh ${CALLFILENAME})


Ok, this is my mail.sh:

/usr/bin/mime-construct --to mail at address.com --subject "Asterisk  
Recording" --attachment $1.wav --file /var/spool/asterisk/monitor/$1.wav


-- Executing System("SIP/attilla-8407", "/etc/asterisk/mail.sh  
CALL-008000200570-20060604-115659") in new stack


But this just doesn't work.

Asterisk says it's executing the script, but the mail doesn't get  
send. If I check my log-files I don't see that the mail gets send. I  
tried to run the script manually and that worked without problems. I  
checked if it was a file rights issue, but even when I run Asterisk  
as root, it doesn't work.

Then I just mad a little scipt that said "touch /etc/blaat" and if I  
executed that with the system command, it worked perfectly.

Can anyone give a hint about what I'm doing wrong ?



Regards,
Attilla



More information about the asterisk-users mailing list