Attilla De Groot
2006-Jun-04 03:01 UTC
[Asterisk-Users] Monitor application and e-mailing attachment
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@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
Doug Lytle
2006-Jun-04 05:16 UTC
[Asterisk-Users] Monitor application and e-mailing attachment
Attilla De Groot wrote:> Hi all, > > exten => h,1,System(/etc/asterisk/mail.sh ${CALLFILENAME}) > > > But this just doesn't work.Check the execute permissions on the script. If that doesn't work, then echo the output of the script to a log and review the log to find the error. Doug -- Ben Franklin quote: "Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."
Gonzalo Servat
2006-Jun-04 09:37 UTC
[Asterisk-Users] Monitor application and e-mailing attachment
On 6/4/06, Attilla De Groot <mail@youmeandvoip.nl> wrote:> 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})[..snip..] Not sure if this is the problem or if you made a typo when sending the list email, but you seem to have put an extra } by accident: exten => _*31*00[1-9].,2,Monitor(wav,${CALLFILENAME},m}) .. should be: exten => _*31*00[1-9].,2,Monitor(wav,${CALLFILENAME},m) Regards, Gonzalo