This is the original README. Please consider, this is a different project from
original smstools. You need to create a gnokii and smstools configuration file!



  	Juraj Bednar.



Quick start:

1) Extract the source package into an empty directory
2) Enter "make"
3) Enter "make install"
4) Edit /etc/smsd.conf
5) Create empty directories (queues) for every provider in /var/spool/sms 
   according to your smsd.conf.

To run smsd as a daemon enter "/sbin/init.d/sms start".

To run smsd as a console application enter "./smsd".

If you want to run smsd automatically using the runlevels you have to make the
links to /sbin/init.d/sms yourself.

-------------------------------------------------------------------------------

Update:

If you update from an older version to 1.0.5 you should know that there are  
new options in the file smsd.conf. Please compare your file to the new one in 
the examples directory. SMS version 1.0.5 and above do not write a log file.
They use syslog instead. There is no excelexport anymore but I plan to write
a new excelexport.

Pleas read the rest of this file because there may be some informations you
need to configure the new program for your hardware.

-------------------------------------------------------------------------------


About Hardware:

If you want to use this software you need a linux computer an at least one
GSM modem. I prefer devices from Falcom (A1 or newer) but Siemens modems
work too. All modems that support GSM 07.05 command set should work.

Some old modems are not full GSM 07.05 compatible - they use a simplified
encoding of the message. Use the option "-m old" or "mode=old" for these old
devices. Use "-m new" or "mode=new" for the new devices. 

Old devices are: Falcom A1 (and subversions), Siemens M1 (and subversions)
and Xircon CreditCard. All other are new devices. 

Most modems are "new" but the default value is "old" for compatibility to 
older versions of this software. 

If you do not want to use the pdu mode you can set mode=ascii. This helps
debugging but the sms are limited to 140 characters and some modems do not
support ascii mode.

Some old devices need 9600 bps most need 19200 bps.

If you want to use a mobile phone to send SMS you need a driver that
adds the GSM 07.05 AT command set to the phone or a cellular data card. 
Most phones do not have an AT command set without special drivers.
There is a linux project on http://www.gnokii.org wich may be useful for you.

I know only one mobile phone that works without a special driver: 
Siemens S25

-------------------------------------------------------------------------------


About the files:

Smsd uses two sub-programs called putsms and getsms wich you may call
manually in the console for debuggng purpose.

Smsd read its configuration from /etc/smsd.conf.

Smsd creates a log file in /var/log/smsd.log.

You may export the log-file to a table-calculator like Microsoft Excel
using the program bin/excelexport. It creates a text file wich you can
import into nearly all table-calculators.

You can find the following examples in the exmaple directory:

received.txt    Shows how a received SMS looks like.
send.txt        Shows how a SMS has to look like wich you can send by 
                copying it into the directory /var/spool/sms/outgoing.
sms             Scripts wich you may use to start smsd as a daemon.
                When you install smsd this script will be copied to
	        /sbin/init.d.
smsd.conf       Configuration file for germany. If you install
                smsd for the first time it will be copied to /etc. See below.
smsevent	Script wich you can use a an event handler to
                notify people about incoming and outgoing SMS.
email2sms	Script wich you can use with procmail to build an
		"email to sms" gateway.
.procmailrc	Use this with email2sms. 

If you want to send a SMS you have to put a file into /var/spool/outgoing.

If you want to read received SMS look into /var/spool/incoming.


------------------------------------------------------------------------------


How smsd works:

Smsd sorts alls SMS in /var/spool/outgoing depending on the phone numbers.
Each phone network provider has its own dial prefixes so smsd looks for 
them and sorts the SMS files into the corresponding spool directories. You 
have to create one spool directory for each provider.

Smsd creates one thread for each modem. The modem threads search for new
SMS in the spool directories and send them. You can define wich modem should
look into wich spool directories.

In germany we have three mayor phone network providers. Two of them are 
interesting for me: Mannesmann D2 and Telekom D1.

I prefer to use one modem for each phone network provider. So my modem with
the D2 card sends only SMS to other D2 phones and my modem with the D1 card
sends only SMS to other D1 phones. This is much cheaper than sending SMS to
D1 destinations using a D2 modem and vice versa.

Remember that you may use 'yaps' (that is shipped with suse linux) to send SMS
through your ISDN card. Today yaps seems to have problems with D2.

If you want to send a SMS you have to put a file into /var/spool/outgoing.
If you want to read received SMS look into /var/spool/incoming.

If a message is longer than one SMS it is splitted into many SMS. Alls these
parts are send through the same modem one after another. Files greater than 
2048 characters will be truncated.

If smsd has problems to send a SMS it puts the file into /var/spool/sms/failed
and tells you about the problem.

Smsd
 uses the default SMSC number that is stored in your modem if you do
not set it in the config file.


------------------------------------------------------------------------------


About the configuration file:

Edit /etc/smsd.conf and enter all your modems, your network providers and
the assignments between modems and network providers. Each provider is
represented by one queue. Each provider may have several dialprefixes. Each
modem may serve one or more queues. If you have only one modem you can send
alls SMS through this one but think about the costs.

The syntax for provider prefixes are shown in the example config file. For 
german D2 you have to write '49172, 49173, 49174'.

      If you want to use yaps you have to set up a device with these settings:

      device = yaps
      incoming = no
      queues = what you want

Set incoming=yes for every modem that should check their SIM cards for
incoming messages.

Set mode=new for new modems or mode=old for old modems. Old Modems are
Falcom A1, Siemens M1 and Xircom CreditCard. This option selects the
encoding method of the message (PDU string). If you set it wrong the
modem answers with ERROR to the command AT+CMGS.

Set smsc=xxyyyyzzzzzzz if you do not want to use the sms service center
stored in your modem. 

There is an option in the config file wich sets the speed of the queues. 
delaytime=10 means that smsd checks every 10 seconds if there were new files.

The option eventhandler=command runs the command if a SMS was sent, received or
if sending failed. Smsd gives the string SENT, RECEIVED or FAILED as the first
argument and the filename of the message as the second argument. 

-------------------------------------------------------------------------------


About number format:


All phone number are in the form xx yyyy zzzzzzz without Spaces, for 
example 491722056395. You have to use this international syntax.

Smsd removes + characters if you use it accidently in outgoing files.


-------------------------------------------------------------------------------


Information for special countries:

I heard that all mobile phone numbers in singapur begin with the same prefixes.
This means that smsd cannot decide wich provider corresponds to the phone
numbers. So you only have to set up one provider for all phone numbers in your
/etc/smsd.conf :

devices = GSM_Modem1, GSM_Modem2
...

[queues]
All = /var/spool/sms/all_sms

[provider]
All = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
# This means that Numbers beginning with any digit are assigned to this queue.

[GSM_Modem1]
queues = All
...

[GSM_Modem2]
queues = All
...
