home *** CD-ROM | disk | FTP | other *** search
- GSM pager gateway code
- ----------------------
-
- This code is copyright Nicko van Someren 1995. You may use it and freely
- distribute it for non-profit purposes but it may not be used as the basis
- of a commercial service without the prior writen consent of the author.
- An exception to this is the 'chat' program and the parts of the 'sendpage'
- program based on the chat program which which are writen by Karl Fox
- of MorningStar and are in the public domain.
-
-
- This code provides a set of tools for queuing short text messages and sending
- then to a Short Messaging Service on a GSM telephone. There is also code
- to allow email to be redirected to the messaging service and a cgi-bin
- program to send messages from a World Wide Web server. The code is made up
- of a number of C programs, Shell scripts and Python programs. If you do
- not have the Python language then you should and you can get a copy from
- ftp://ftp.cwi.nl/python/src/python1.2.tar.gz
-
- The distribution consists of the following code:
-
- callpager A shell script to be run by cron to send the messages.
- chat.c A C program that talks to you modem.
- pagemail.py A python script to send an email message to a pager.
- pager.py A python script to run on a WWW server.
- pagerq.c A trivial program to count the message queue.
- phonebook A template phone book for the python scripts
- qpage.c A C program to put a messgae into the queue
- sendpage.c A C prpgram to send queued messages to the GSM network.
-
- The callpager script will most likely need modifying for talking to your
- modem. The script needs to be run by root on most systems in order to
- open the serial port corectly. The script does nothing if there are
- no messages on the pager queue.
-
- The chat program is useful for reseting your modem after messages have
- been sent if you use the modem for incoming calls as well as outgoing
- ones.
-
- The pagemail program takes a mail message on the stdin, pulls off the
- headers and make a pager message out of the From: header, the Subject:
- header and the body of the message. It should be called from your mail
- aliases file with the address book user name as a parameter, e.g.:
-
- nicko-pager: "|/usr/local/etc/GSM/pagemail.py nicko"
-
- The pager.py program should be placed in the cgi-bin directory on a WWW
- server. It will display a form to fill in for sending a message,
- do some checks on the message and send the message to the queue. A menu
- listing the users in the phonebook file gives the user a quick way
- to send messages to known users.
-
- The pagerq program just opens the directory used for the message queue
- and counts the messages.
-
- The Phonebook file consists of lines of two whitespace separated fields,
- a user name (matched case insensitive) and a telephone number.
-
- The qpage program places a pager message in the queue. Files in the queue
- directory begining with a '.' and not considered to be queue so the file
- move opereation is used as an atomic way to put a file into the queue.
-
- The sendpage program is used to chat to the modem to connect to
- the SMS gateway and then send the messages down the line. It is derived
- from the chat program and doubtless has many bugs it if because of me.
- It is not very good at dealing with error back from the SMS gateway.
-
- If you have any fixes or comments then email me:
-
- Nicko@ant.co.uk
-
-
-