A
A
Andrey Aksenov2016-08-09 13:16:14
Asterisk
Andrey Aksenov, 2016-08-09 13:16:14

Sending missed call notification to mail in freepbx?

Notifications about a missed call are not sent to the mail, it is written in extensions_custom.conf

exten => s,n, System(echo "текст" | mail -s "тема" [email protected])

If you give a command via ssh, echo "текст" | mail -s "тема" [email protected]
then the letter arrives at the mail, tell me what could be the problem?
The solution was found, maybe someone will come in handy.
Created ivr:
Applications>Interactive Menu (IVR)
Added the entry "all managers are busy, we will call you back, hang up"
Then opened Applications>Extensions>"number">Change settings 'Go here'>Destination if no answer: Interactive menu ( IVR)> select the desired ivr.
Further in /etc/asterisk/extensions_override_freepbx.conf added
[ivr-5] ; 

exten => h,1,System(echo "Пропущеный вызов с номера ${CALLERID(num)} в ${STRFTIME(${EPOCH},,%H:%M)}" | sendmail -f [email protected] -t [email protected])
same  => n,Hangup()

ivr number can be seen in the CLI (asterisk -rvvvv )
During the call, there will be a line like:
-- Executing [[email protected]:1] System("SIP/AS5350-000041bc", "echo "Пропущеный вызов с номера 89991111111 в 16:45" | sendmail -f [email protected] -t [email protected]") in new stack

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
A
Andrey Aksyonov, 2016-08-11
@ndr_pro

Thanks for your help, I wrote it like this:

exten => 1314,1,GotoIf($["${QUEUESTATUS}"="CONTINUE"]?answered)
same => n,ExecIf($["${CDR(dstchannel)}"=""]?System(echo "Пропущеный вызов с номера ${CALLERID(num)} в ${STRFTIME(${EPOCH},,%H:%M)}" | sendmail -f [email protected] -t [email protected]))

and earned

L
Leks, 2016-08-09
@Leksnsk

Through ssh, you issue the command on your own behalf, and through System, most likely on behalf of the asterisk user (if one has been created). Perhaps the asterisk user does not have rights to the mail command.

A
archeops, 2016-08-11
@archeops

The mail command asks questions the first time it is run.
You need to
1) allow asterisk user /bin/bash instead of nologin in /etc/passwd
2) do su asterisk then mail, answer questions.
3) don't forget to do nologin back.
but in general it is necessary to transfer to systems only as /etc/asterisk/send_email "text" "[email protected]", and write a script that checks all possible gaps and sends a message.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question