I want to send an email notification on missed calls.
Following is sending me an email on every call, how to do that only for missed calls?
[from-pstn-custom]
exten => _X.,1,NoOp(My Script Beginning)
same => n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?done)
same => n,System(echo "Missed Call From ${CALLERID(num)}" | mail -s "Missed Call From ${CALLERID(num)}" [email protected])
same => n(done),NoOp()
Your issue might be a problem with the order that the dialplan is being interpreted; can you confirm that this code happens after the call is answered and not before? Try including something like this in your code to determine the state that is generating the email…my guess is that the code works but the state is different from what you expect.
Does sombody now which extension to use to execute code after ringing and before hangup?
See problem above - I need to send an Email for missed calls, but do not know which hook to use.
Thx for you Reply - I need the other direction:
If a customer is calling from outside the PBX and hangs up before any extension is taking the call.
What ist the right hook for this?