Email Notification On Missed Call

Home » Asterisk Users » Email Notification On Missed Call
Asterisk Users 4 Comments

Hello,

what is the best way to implement email notification on missed call ?

So far, I have been using a solution that I hacked together. I create a hangup-handler, inside which I check for “${DIALSTATUS}” and use System():

System(/bin/echo … | /usr/bin/mail ….)

I have pasted the block here, for better formating:

https://pastebin.com/Sf8raPD6

My question is:

Do I have to call external echo and pipe it to mail command?

Does asterisk not have some internal function to send email ?
It does so for voicemail.

Is there perhaps a better way to this than described above ?

thanks,

4 thoughts on - Email Notification On Missed Call

  • As far as I am aware, Asterisk has no built-in dialplan function to allow sending of email.

    The way that your currently programming this is the typical way that I
    would handle it.

    Doug

  • This is my way:

    exten => h,1,System(echo “Missed Call Open on Asterisk from
    ${CALLERID(num)}” | mail -s “Missed VIP Call on Asterisk from
    ${CALLERID(num)}” -a “From: Astersik PBX ” myemailaddr ess@example.com)

    exten => h,n,HangUp()

  • Doesn’t that send an email for every call once it ends, not just unanswered ones?

    That looks most strange to me – calling Hangup() in the hangup extension…


    The idea that Bill Gates appeared like a knight in shining armour to lead all customers out of a mire of technological chaos neatly ignores the fact that it was he who, by peddling second-rate technology, led them into it in the first place.

    – Douglas Adams in The Guardian, 25th August 1995

    Please reply to the list;
    please *don’t* CC me.

  • Whoops! You are right! 🙂

    exten => h,1,GotoIf($[“${DIALSTATUS}” = “ANSWER”]?done)
    exten => h,n,System(echo “Missed Call Open on Asterisk from
    ${CALLERID(num)}” | mail -s “Missed VIP Call on Asterisk from
    ${CALLERID(num)}” -a “From: Astersik PBX ” myemailaddr ess@example.com)
    exten => h,n(done),NoOp()
    exten => h,n,HangUp()

    😀

    Probably it is not necessary. But isn’t a good practice to end any extension with a “HangUp”?