Asterisk - Missed call alert by email
- Create a Misc Destination in FreePBX.
- Add a new dial plan for missed call alert in /etc/asterisk/extensions_custom.conf under [from-internal-custom] context
exten => _*2255,1,Set(VMEMAIL=${SHELL(awk -F',' '$1 ~ /${CONNECTEDLINE(num)} / { print $3 }' /etc/asterisk/voicemail.conf | tr -d '\n')}) exten => _*2255,,n,TrySystem(echo "Call from ${CALLERID(name)} at ${CALLERID(number)} received ${STRFTIME(${EPOCH},%l:%M:%S %p %Z on %A %B %e)}" | mail -s " You missed a call from ${CALLERID(name)}: ${CALLERID(number)}" ${VMEMAIL}) exten => _*2255,n,Hangup()
- Edit extension and add your voicemail email.
- Change “-Optional Destinations” to the new misc. destination and submit.
- Dial the extension and wait till it forward the call to misc. destination.
-
This post is licensed under CC BY 4.0 by the author.




