Using Mobile Phone email addys for monitoring

Henning Brauer hb-nanog at bsws.de
Tue Sep 11 09:21:18 UTC 2007


* matthew zeier <mrz at velvet.org> [2007-09-06 23:39]:
> >It's more effective to spend the money on SMS messages. Mobile
> >providers are forced to use very aggressive anti spam measures, which
> >can add significant delays in message delivery.
> Recommendations on software and modems?

the UMTS PC-Cards you can get rather cheap these days show up as usb 
controllers with usb-cereal converters behind. add a little kermit 
magic and you're done (this is on OpenBSD).

unlock at boottime (replace 0000 with your PIN):

#!/usr/local/bin/kermit +
set line /dev/ttyU0
if failure exit 1
set carrier-watch off
set input echo on
lineout "AT+CPIN?"
input 10 "+CPIN: SIM PIN"
if failure exit 1
input 10 OK
if failure exit 1
lineout "AT+CPIN=0000"
input 20 OK
if failure exit 1
lineout "AT+CPIN?"
input 10 "+CPIN: SIM PIN2"
if failure exit 1
input 10 OK
if failure exit 1
exit 0

send an sms:
parameters: number "message"
(+49177... is the SMSC, replace by your provider's one)

#!/usr/local/bin/kermit +

set line /dev/ttyU0
if failure exit 1
set carrier-watch off
lineout ATZ
input 10 OK
if failure exit 1
lineout AT+CSCA="+491770610000"
input 10 OK
if failure exit 1
lineout AT+CMGF=1
input 10 OK
if failure exit 1
lineout AT+CMGS="\%1"
input 10 >
lineout \%2
output \26
input 100 ok
if failure exit 1
exit 0

of course I have some shell around it for failure handling (retries) etc

-- 
Henning Brauer, hb at bsws.de, henning at openbsd.org
BS Web Services, http://bsws.de
Full-Service ISP - Secure Hosting, Mail and DNS Services
Dedicated Servers, Rootservers, Application Hosting - Hamburg & Amsterdam



More information about the NANOG mailing list