Send an email when receiving calls on specific DID
[Magrathea-1]
exten => _441527908016,1,Noop( email-on-call execution )
exten => _441527908016,n,System(/tmp/initSend.sh ${CALLERID(num)})
exten => _441527908016,n,Agi(agi://127.0.0.1)
exten => _441527908016,n,Hangup();---
Bash scripts:
initSend.sh
#!/bin/bash /tmp/sendMail.sh $1 &
---
sendMail.sh
#!/bin/bash /usr/sbin/sendmail -fpbx@lansalot.co.uk -t <<EOF From: Lansalot PBX <pbx@lansalot.co.uk> To: William <william@mckinnonnelson.co.uk> Subject: Incoming Lettings Call Hi Just to let you know you received a call on your lettings number (02034324300) From $1 on: $(date -R). This email should be filed in the property folder for your future reference. Thanks . EOF