Page 1 of 1

Send an email from the dialplan

PostPosted: 16/12/2014, 13:27
by matteo.erba
The WMS system automatically manages the e-mails alert for missed calls, to a single user or a call group. But if you need to receive an alert for any calls even if there is an answer from a user you can add three "system" command to the dialplan choosing the "Custom Application"
Code: Select allSystem(echo "Email body - ${STRFTIME(${EPOCH},,%d-%m-%Y %H:%M:%S)}" > /tmp/mail_${UNIQUEID})
System(mutt -F /etc/companies.d/0/Muttrc -s "Call from ${CALLERID(num)} - ${CALLERID(name)}" support@wildix.com < /tmp/mail_${UNIQUEID})
System(rm /tmp/mail_${UNIQUEID})

custom application.png
custom application.png (40.26 KiB) Viewed 36728 times


Some useful variables you can insert in the Subject and Body:
    Datetime: ${STRFTIME(${EPOCH},,%d-%m-%Y %H:%M:%S)}
    Caller ID Number: ${CALLERID(num)}
    Caller ID Name: ${CALLERID(name)}
    Called Number: ${EXTEN}
Please add a comment below with the description of the service where you used this application.

Thank you

Re: Send an email from the dialplan

PostPosted: 18/12/2014, 22:17
by nicola.bollini@telpro.it
Thank you Matteo I used this custom app when I forward all calls to mobile number, if the call drop the mobile user can't recall because see the Office number. Whit the email can see the number and recall.

Re: Send an email from the dialplan

PostPosted: 29/05/2015, 18:25
by angelo@intelcosrl.it
Nice work Matteo !

Whit this script, It's possible send email when a user make a outgoing call?

:mrgreen:

Re: Send an email from the dialplan

PostPosted: 01/06/2015, 10:13
by matteo.erba
Sure!!
Add it before the 'Dial the trunk' or the Huntgroup.

Tip: With some more scripting you can also read the CDR and send the email only after a monthly limit

Re: Send an email from the dialplan

PostPosted: 26/07/2016, 12:52
by a.chessa@guttadauro.it
Matteo, there's a way to use the mail address field as a variable taken from the user database of the PBX?
To explain better, would be very usefull we can use the extension number instead of the email in the "custom application".

Re: Send an email from the dialplan

PostPosted: 30/01/2017, 13:18
by salsi.m@caberinformatica.com
Thanks Matteo,
I configured these rules to notify by email all incoming calls to a particular number.