S
S
Satisfied IT2018-07-11 13:20:46
Asterisk
Satisfied IT, 2018-07-11 13:20:46

Why doesn't asterisk send dialog to mail?

We have Asterisk 13.7.0, the recording of conversations when calling to a certain direction is configured, it became necessary to send this record to the mail, added the following line to extensions.conf:

exten => _2xxxxxx,n,System(sendEmail -f [email protected] -t [email protected] -m test -a /home/records/${fname}.wav)
, thus it turned out such a miracle of thought:
exten => _2xxxxxx,1,Set(CALLERID(num)=***********)
exten => _2xxxxxx,2,Set(CALLERID(name)=***********)
exten => _2xxxxxx,3,Set(fname=${STRFTIME(${EPOCH},,%Y-%m-%d/out-%H-%M)}-${CALLERID(number)}-${EXTEN})
exten => _2xxxxxx.,4,MixMonitor(/home/records/${fname}.wav)
exten => _2xxxxxx,n,Dial(SIP/${EXTEN}@xxtel,90,tTW)
exten => _2xxxxxx,n,StopMixMonitor()
exten => _2xxxxxx,n,Hangup()
exten => _2xxxxxx,n,System(sendEmail -f [email protected] -t [email protected] -m test -a /home/records/${fname}.wav)

but in the end there are no letters, no errors, silence in the maillog. If I remove -m test from the line for sending a letter, then an error appears in the maillog of the system
postfix/sendmail[28582]: fatal: usage: sendmail [options]
, so this line succeeds. If in the console I execute
sendEmail -f [email protected] -t [email protected] -m test -a /home/records/test.wav
then the letter successfully leaves and the recipient receives everything, the rights to the sendEmail file are 0755. What else does he need from me? Where is the mistake?
At the same time, letters about missed calls (when the subscriber was busy) arrive successfully.
I also tried to write
exten => _2xxxxxx,n,System(/usr/local/bin/sendEmail -f [email protected] -t [email protected] -m test)
but... it didn't help, there are no letters.
sendEmail is taken from here , lies at /usr/local/bin/, everything is ok with the parameters, since it sends everything from the console with the same parameters

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2018-07-11
specialist @borisdenis

Try, for starters, to write the full path to the script in the command. It is possible that you have a file with the same name in the standard paths.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question