Caller ID email script

No replies
kevin9
Offline
Lincolnshire, United Kingdom
Joined: 24 May 2010

Based on bretts script "Sending EMAIL (adv)" I have created a script which emails me with phone number and caller id of any calls to my landline phone number.

I should explain that this monitoring of the phone line is not an HAH function but is carried out by the Switchboard(mi4) and xAPtel(UKUSA) on dedicated HA PC on my home network. I have been monitoring my phone line for many years and the system works well.

Briefly, when a phone call is received, xAPtel monitors a meteor caller ID device and sends a xAP message to switchboard, which looks up the number and carries out a number of actions including sending a xAP-OSD.display message like this

xap-header
{
v=12
hop=1
uid=FF111300
Class=xAP-OSD.display
Source=mi4.switchboard.BLACK1
}
Display.SLIMP3
{
Line1=Incoming  Call : Kevin  (Mobile)
Line2=Mobile Telephone, 07871 7946221
Duration=20
Brightness=Brightest
}

The plugboard script, htmlEmailPhoneApplet.lua, sees this xAP message and sends an SMTP email formatted using the message template,phone.tmpl,  to a mail server.

My main email source is gmail which does not accept smtp, so I send it to another email server and gmail collects it from there. As before lte.lua is also required in the plugboard folder

So now when I am away from home, I get an email on my phone telling me when someone has called and who they are.

 

And in case you are wondering, that phone number is not my real phone number, so dont go ringing it expecting to get me!

Configuration

In htmlEmailPhoneApplet.lua you will need to change

3 instances of user@somedomain.co.uk>
- to = "user <user@somedomain.co.uk>",
- from="<user@somedomain.co.uk>",
- rcpt="<user@somedomain.co.uk>",

and

user="user@domain.co.uk",
password="password",
server="smtp.domain.co.uk",
port=587

plus

f:add("xap-header","source","mi4.switchboard.BLACK1")

to the appropriate values for your setup

Thanks to brett for the original script

Note that lte.lua is unchanged from the original script, and it would be shared by other applets

kevint

AttachmentSize
phone.tmpl280 bytes
lte.lua1.57 KB
htmlEmailPhoneApplet.lua1.26 KB
Hardware Info