Email notification of incoming/missed call

If I was doing this, I would create a new context in /etc/asterisk/extensions_custom.conf with content similar to:

[send-email]
exten => s,1,NoOp(Entering user defined context  [send-email] in extensions_custom.conf)
exten => s,n,System(echo 'Call from ${CALLERID(name)} at  ${CALLERID(number)}' | mail -s 'SUBJECT' '[email protected]')
exten => s,n,hangup()

Then in FreePBX create an extension of type, other (custom) device, give it a name and number. In the dial field use:

local/s@send-email

Now you have a local dummy extension that will execute custom code whenever it is dialed. You can include it in ring groups, or queues, etc. It will never answer the call, but whenever it rings it will execute the custom code. You have the basis for adding your own code for whatever you can dream up once you learn a bit of Asterisk.

edit - fixed system line quote

3 Likes