smsd(8) | Gnokii | smsd(8) |
smsd - daemon for handling incoming and outgoing SMSes using libgnokii
smsd [OPTIONS]
The SMSD (SMS daemon) program is intended for receiving and sending SMSes.
The program is designed to use modules (plugins) to work with different backends. Currently are supported PostgreSQL, MySQL and a special module 'file' which is designed to work without an SQL database (see below for special instructions in the file module section). When SMSD uses an SQL server as a repository for SMSes you must create a database (default name is 'sms') with tables defined in sms.tables.{module}.sql files.
Table 'inbox' is for received SMSes. SMSD periodically checks a given phone memory to move messages to this table. Only received SMSes and status reports are deleted from the phone, other kinds of messages are not removed.
Table 'inbox' has the following fields:
Table 'outbox' is for outgoing SMSes. SMSD periodically looks into this table and searches for lines with attribute 'processed' set to FALSE. If it finds such SMS, it will send SMS to 'number'.
Table 'outbox' has the following fields:
SMSD is multi threaded program. If you list processes you will see more than one instance of smsd.
This module doesn't need an SQL server to work. For incoming messages it works in a way that it calls a program giving phone number, date as parameter and the message text on stdin. In the smsd directory there is an example file action. It shows sms data to stdout. If you want something useful you must write your own action. For outgoing messages you can set spool directory where smsd looks regularly.
Incoming sms are passed in format
Outgoing sms must be in format:
The name of file is unimportant but smsd ignores all files with prefix "ERR.". If smsd succesfully sends sms, it removes file from spool directory. If smsd cannot send sms prepends file with "ERR." prefix and ignores it. If you use -m file, -u (--user) and -c (--host) will have other meaning. -u is for action (action must be executable) -c is for spool directory where smsd looks for smses. Smsd must have read and write permissions to this directory.
-p, -d parameters have no meaning when -m file is used.
If you don't specify -u, default action is to print sms to stdout. If you don't specify -c, sms sending will be disabled.
Available options:
port = /dev/ttyS0
model = 6110
initlength = default
connection = serial
bindir = /usr/local/sbin/
use_locking = no
serial_baudrate = 38400
smsc_timeout = 10
[phone_1]
port = /dev/ttyS0
model = 6110
initlength = default
connection = serial
bindir = /usr/local/sbin/
use_locking = no
serial_baudrate = 38400
[phone_2]
port = /dev/ttyS1
model = AT
initlength = default
connection = serial
bindir = /usr/local/sbin/
use_locking = no
serial_baudrate = 38400
smsc_timeout = 10
In this setup if you run smsd without -t option it will use config from global section. If you run smsd with -t 1 it will use config from phone_1 and likewise with -t 2 uses phone_2. In case of use -t option smsd fills phone number for incoming sms's and in outbox it looks only for sms's with the specified phone number in column 'phone'. This behaviour gives you possibility to run one instance of smsd for every phone you have at the same time.
Various error messages are printed to STDERR.
Debug output can be enabled setting xdebug=on (for messages specific to SMSD) and debug=on (for messages specific to libgnokii) in the configuration file.
None reported.
SMSD was written by Jan Derfinak and contributed by other people. See also Docs/CREDITS from the Gnokii sources.
This program is distributed under the GNU Public License.
September 27, 2010 |