SMS Server Tools 3
Home
Future plans (some of them)
- Automatic outgoing binary and unicode message splitting to multipart.
- Built-in Wap Push message support.
- System check procedure to the startup.
- Error handler and reporting feature which can send message(s) to "administrative emergency" number.
- Configuration changes via administrative SMS.
- SMSC Large Account support. (Not coming very soon).
If you have any comments, ideas, needs or other things, please write them
to support website.
Version history
18.07.2007 3.0.10
Configuration file (smsd.conf):
- New global setting: os_cygwin = yes/no.
Default value is no.
Defines if the smsd is running on Cygwin environment.
This information is needed when some process creates outgoing files with incorrect permissions for smsd.
If smsd has no write access to the file, it tries to get it using chmod 766.
Bug fixes:
- Command line argument -t had no effect.
This terminal mode is useful when running smsd under Cygwin as a Windows service as it prevents one error message.
- In QNX, the OS libraries include already an unlock() function, causing a name conflict.
The unlock() function of smsd is therefore renamed.
Download
06.07.2007 3.0.9
General:
- Minor changes to the PDU checking.
- An incorrect sender number produces only a warning.
- It now shows error position in the message file.
- All possible data is checked (unused too) to detect invalid characters and a broken and/or incompatible PDU.
- Replace: usage is ignored while sending multipart message.
- Character set conversion now converts incoming "currency symbol" (0x24 GSM) to € character (0xA4 ISO).
This can easily be changed in top of charset.c if necessary (should not be any reason).
The smsd does not send 0x24 while messages are written using ISO/UTF-8 character set.
- Documentation is updated. Sample configuration files are not,
see the How to configure for details of new features.
NOTE for users running smsd with very heavy load:
Current version of smsd moves files between spooler directories using the original file name.
If outgoing files are created using a fixed filename (which is not recommended) and lot of
files using the same name are created within a short period, it's possible that previous file
and it's .LOCK file are still existing in the spooler directory. In this case a new file cannot
be moved to the spool. Previously the smsd stopped with a fatal error in this case. Now an
alarmhandler is called and after it has returned a file moving is retried. If a file still
cannot be moved, the smsd will stop with a fatal error.
The alarmhandler can be used to help with a file moving conflict. The script can wait until
a spooler can be used, or it can wait some fixed time like 5 seconds. It can also produce some
notices to the administration, if necessary.
In some cases this kind of conflict is a result of a previously happened error in the system
which creates outgoing files to send. In this case it's better to let smsd stop, instead of
sending couple of thousand messages to somewhere...
In the conflict case the alarmhandler will get following arguments (as an example):
- $1=ALARM
- $2=2007-07-06
- $3=12:00:00
- $4=2
- $5=smsd
- $6=Conflict with .LOCK file in the spooler: /var/spool/sms/outgoing/test_file /var/spool/sms/checked
Thank's for all users who have provided feedback, idea's, code and fixes.
Download
28.06.2007... 3.0.9beta2
General:
- All incoming PDU's are checked comprehensively.
If there is some illegal values in the content or illegal characters in the string or some characters are missing,
a problem is reported and handling of a broken PDU is aborted.
However, all possible junk cannot be detected because the PDU does not have any checksums.
- In case of errors a new header Error: explanation is printed to the message file.
With existense of this header it's easy to detect that there is no usual message content in the file.
Text part will tell more details of errors found.
- In the successfully processed message file there can be one or more Warning: explanation headers
telling that some minor issues has detected, but the message is still processed.
- If an incoming PDU does not match to the mode setting defined in the smsd.conf file,
alternative mode is tried before error is reported and handling is aborted.
This means that the mode setting is now automatic for PDU's of incoming messages.
Note that the outgoing side works like before and you have to use correct mode -setting in the configuration file.
- Number of devices is increased to 64.
- While reading a PDU from file, a first line starting with PDU: and space is taken if any exists.
- There is a simple script smstest.php included in the scripts directory.
This script can be used to create sms files using a web browser.
The script demonstrates a character set conversion made with PHP and can be used for testing purposes.
- Installation / uninstallation: path of executables can now be defined in the Makefile.
- Startup check: permission check for executable scripts is changed.
Previously this check required mode 750 for scripts.
Now owner and group settings are examined and permission is checked like a shell does.
- International Mobile Subscriber Identity (IMSI) is asked once from the modem when it's first time initialized.
If a device supports this query, information is printed to each incoming message file as a new header:
IMSI: 123456789.
This header is also inserted to sent and failed files.
- Running as an unpriviledged user: if user is set but group is unset, that user's normal groups (e.g. from
/etc/groups) are used.
This means you can allow other users on the system access to write messages to the outgoing spool without giving them
direct access to the serial port.
- When finding files from the spooler directories, the oldest file is selected.
- If a file in the spool directory cannot be handled because of file mode or ownership,
error message is printed to the log and alarm handler is called.
As soon as the problem is fixed, a file is processed normally.
If a file is deleted (outside of smsd), the smsd forgets past problems with it and in the future a file
with the same name is processed as usual.
Outgoing message file:
- New header: Replace: code. Code can be a number from 1 to 7.
If a receiving device and SIM supports "Replace Short Message Type n" -feature, a previously
received message with the same code is replaced with a new message. Only the messages sent from
the same originating address can be replaced. If there is nothing to replace, a message is stored
in the normal way.
Note that the smsd does not use this value while sending concatenated (multipart) message.
This is because some phones do not understand concatenated message as a single message and
therefore a previously received part might become overwritten if a replace code is used.
- SMSC setting is allowed only if there is a smsc set in the config file.
Incoming message file:
- New header: From_TOA: string.
Includes a Type Of Address definition with short explanation,
like: "From_TOA: 91 international, ISDN/telephone".
- New header: Report: yes/no.
Tells if a status report is going to be returned to the SME.
- New header: Replace: number.
This header is included if a message has a Replace Short Message Type 1..7 (number) defined.
Configuration file (smsd.conf):
- Setting: pdu_from_file = filename / dirname/ is slightly enhanced.
The original setting style will work when it points to the file which is read and then deleted.
If this setting ends with a slash and a directory with that name exists,
file(s) are read from this directory (and deleted after processing).
All files found from the given directory are processed one by one, expect hidden files (name begins with a dot).
When this setting points to the directory, no dot's are allowed in any position of a path.
Be very careful with this setting while it will delete the content of a whole directory.
- New setting: log_charconv = yes/no.
Default is no.
With this setting a details of character set conversions (outgoing UTF-8 to ISO conversion and incoming GSM/ISO to
UTF-8 conversion) is printed to the log.
If smsd is compiled using DEBUGMSG definition, details are also printed to the console.
Logging feature can be useful if you have some troubles with characters and like to know what exactly happens inside the smsd.
- New setting for a modem: modem_disabled = yes/no.
Default is no.
This is for testing purposes. Whole messaging system including eventhandlers etc. can be tested without any working
modem existing. Sending of messages is simulated in the similar way than with sending_disabled setting.
Incoming messages are taken only from the file, if pdu_from_file is defined.
No any communication is made between smsd and modem, but a device setting should still exist because smsd wants to
open and close a device.
If in you testing environment you do not have a priviledges to the usual modem device,
like /dev/ttyS0, you can use a definition like device = /tmp/modemfile.
If this file exists and is writable for the process owner, it's enough for smsd.
- Startup check will now report if there is a queue defined but no provider numbers for it.
- New global setting: store_sent_pdu = value.
Default is 1.
Possible values are: 0 = no PDU's are stored, 1 = failed (to send) PDU's are stored,
2 = failed PDU's and PDU's of binary/Unicode messages are stored, 3 = all PDU's are stored.
- Validity period setting now accepts keywords typed mixed/upcase.
Keyword can now be given without any numbers, like month means the same than 1 month.
This same applies to the outgoing message files.
When the smsd is started, a validity period setting is reported to the log if the setting used is less than maximum.
- Each provider can now have up to 64 numbers defined.
- Queue, provider and device/queues settings are checked.
If there is too much definitions, an error message is displayed and the daemon does not start.
- stats_interval defaults to 3600 (1 hour).
- New setting: blockafter = number. Defines number of errors which will cause modem to be blocked. Default value is 3.
- New setting for a modem: outgoing = yes/no.
Default is yes.
If set to no, a modem does not handle any outgoing message(s).
Bug fixes:
- The smsd accepted definition of providers only if it was written as [provider] in the configuration file.
Now singular/plural does not matter anymore, you can use [provider] or [providers].
This same applies to the queues: both definitions [queue] and [queues] are accepted.
- When alphanumeric senders had length more than 9 characters, garbage was appended to the sender's name.
- Setting of validity period did not accept clean numeric value, like 204 (for 12 weeks).
An error message was produced and a default value (maximum possible time) was used.
Validity setting also calculated some values incorrectly, like "3 months" produced a maximum time (63 weeks).
- SMSC setting in the message file did not work. However, usually this setting should not be used.
20.06.2007 3.0.9beta
Outgoing message file:
- When sending ISO coded message, all characters which cannot be transferred using the GSM character set
are replaced with their alternatives. For example Ê becomes E, õ becomes o and so on.
In the previous versions of smsd there was a replacement made only for few characters.
Configuration file (smsd.conf):
- New setting: outgoing_utf8 = yes/no.
Default is yes.
With this setting automatic UTF-8 to ISO conversion of outgoing files can be switched off, if necessary.
Bug fixes:
- Internal decoding of Unicode message was not done if a message contained only single part
and no user data header including concatenation information. (Some devices include contatenation
header even if there is only one part).
03.06.2007 3.0.8
General:
- Some modem(s), probably because of the firmware bug, gives an "OK" answer while trying to read
a message from the empty memory space. This causes an additional five seconds delay to the process,
because an "ERROR" answer is expected. New version of smsd accepts both messages without any
additional delay.
- While a PIN code status is asked from the modem, some modems do not include "OK" result code in the response.
This has caused an additional delay with those modems. Handling of response is changed to avoid delays.
Also some informative message logging is added to the modem initialization.
- If a modem does not accept the PIN code, the modem process will terminate immediately.
Previously it tried to use the same incorrect PIN again and again,
and this caused SIM card to be locked and the PUK code was then required.
- When a message is sent successfully, possible previous errors with a modem are forgotten.
- Logging of character set conversation problems is changed from LOG_INFO to LOG_NOTICE.
Log lines have now name of a modem.
Configuration file (smsd.conf):
- New setting: incoming_utf8 = yes/no.
Incoming message files with ISO or GSM alphabet can be saved using UTF-8 character set.
Default is no.
- If a modem needs some idle time after a PIN is entered, new setting pinsleeptime can be used to produce that.
This value is seconds.
- New setting for a modem: pre_init = yes/no.
This settting defaults to "yes" and causes "echo off" and "CMEE=1" commands to be sent to the modem
before anything else is done.
Outgoing message file:
- When an alphabet is ISO or GSM, smsd can also read files stored using the UTF-8 character set.
- Autosplit works now with Unicode messages.
If a message text is longer than 70 Unicode (16-bit) characters, multiple messages are created.
Autosplit value 2 (text numbers) is not in use, with this setting a message is splitted as with setting 3,
to multiple part with an UDH numbering.
Please note that while creating a text part for message file, a coding UCS-2BE should be used (not UCS-2).
Bug fixes:
- Storage for startup error strings was not initialized properly.
- If a message file in the spooler is readable, but some program is still keeping it open to write,
smsd tried to spool the file and failed because the file cannot be deleted. As a fix, the smsd first checks if the
message file is writable.
Download
18.05.2007 3.0.7
General:
- If smsd is compiled without a support for status monitor, command line option -s is not useable.
Bug fixes:
- Incorrectly written message file without an empty line between the header part and text part caused
modem process to scratch if there was previously sent a message with less header lines or message
text containing an empty line.
14.03.2007 3.0.6
General:
- New header Modem: devicename is automatically inserted to the SENT/FAILED message files.
- Message_id: n and Sent: timestamp headers are inserted to the message file before eventhandler is executed.
20.02.2007 3.0.5
General:
- Termination handling is changed. Previously the main process sent SIGTERM to the whole process group.
With sh shell it was possible that incorrect processes were killed because they were running in the same process group.
Also processes started from the eventhandler received SIGTERM and eventhandler was terminated before the job was completelly done.
New version of smsd sends SIGTERM to the modem processes only. This allows smooth shutdown to the eventhandlers.
If there is some eventhandlers running while the smsd gets a termination signal, an information is written to the logfile
and main process will wait until all modem processes are terminated.
- If smsd is running on terminal (foreground), smsd shuts down when a terminal window is closed.
- Internal combine can now handle 16-bit message reference numbers too.
- Log line titles are now completely process based.
For example the "SMS received" message tells now which one process (=modem) received that SMS.
22.01.2007 3.0.4
Bug fixes:
- Incoming PDU was not handled correctly when there was no SMSC information in the PDU string.
Also note that in this case there will not be From_SMSC: field in the message file,
which should be notified by the event handler.
11.01.2007 3.0.3
The major change is done to daemonizing:
When smsd is started to background (which is default), it forks itself before running processes are created.
This solves some issues when the smsd is started from the sh shell.
It is no more necessary to use the & sign at the end of a starting command line.
There is a command line switch -t available to force smsd to run in terminal (foreground).
If logging or debugging messages are printed to the terminal, smsd runs in foreground by default.
There is also TERMINAL keyword available in the Makefile to force smsd to run in foreground.
The start-stop script sms3 is updated.
The smsd now removes possible infofile and *.LOCK files at startup,
it is no more necessary to take care of them in the script.
New script can be used with most operating systems.
See more details on How to run/use.
General:
- The smstools uses ISO character set in message files.
If a locale is set to UTF-8, smsd does not handle outgoing message files correctly.
There is sample scripts checkhandler-utf-8 and eventhandler-utf-8 in the scripts directory
to demonstrate how character set conversation can be made using checkhandler and eventhandler.
- While smsd reads the configuration, all string length's are checked to prevent possible buffer overflows.
- More checks are done at startup. Fatal errors while reading the config are written to the log and
starting the daemon is prevented. Executable permissions of eventhandler(s) are checked.
- Lockfile is detected by finding ".LOCK" from the end of filename instead of the whole string.
- A logfile setting can be made using the command line argument -l (ell).
This overrides the config file setting.
- If received SMS is status report, log line starts with "SMS received (Report)".
- It's no more necessary to define user=root to get smsd running as a root.
NOTE for Windows users: If you are running smsd as a Windows service, you need to update settings of cygrunsrv.
The smsd should be run in terminal mode and --neverexits option should not be used anymore.
See more details on instructions for Windows.
30.11.2006 3.0.2
General:
- The smsd can be defined to run without root priviledges.
- System check is performed at startup to avoid some potential problems with permissions of directory structure
and some other settings.
- If a config file cannot be read, the smsd does not stay running.
- Only the process id of a main process is written to the pid file.
- Some code cleaning is done to avoid compiler warnings on Solaris 10 (6/06 x86) with gcc.
- mypath setting is not used anymore.
Configuration file (smsd.conf):
- user = username and group = groupname settings to change priviledges for the smsd.
- infofile = filename and pidfile = filename settings to change file locations,
needed when the smsd is not running as a root.
These settings can be overridden by the command line arguments.
See the How to configure for details and
How to run/use for more details.
Bug fixes:
- Sample script mysmsd did not read status report correctly while storing it to the MySQL database.
14.11.2006 3.0.1
General:
- When syslog is used to logging, a modem name is presented in the log line.
- Outgoing PDU: Data Coding Scheme uses message class bits only when message is sent as an alert (flash).
- Some code has 'cleaned' to avoid compiler warning messages.
Bug fixes:
- Syslog call is now made using a format string.
- There was two compiler warnings (with gcc >= 4) because blacklist.c and whitelist.c missed prototypes of exit() function.
- Buffer used to store received PDU's was not initialized correctly.
This caused a runtime error while concatenating multipart messages on latest Ubuntu releases.
02.11.2006 3.0
Bug fixes:
- Blacklist and Whitelist handling: fixed incorrect log message when the file was not readable.
Also fixed the program termination in those cases.
- If write_to_modem failed, for example because the modem was not clear to send, put_command did not free
the memory used by regexp.
- While reading a configuration file there was stack misuse which caused device_list become empty while running on ubuntu 6.10.
25.09.2006 3.0beta
This version is based to the SMS Server Tools version 2.2.8.
Some of new features were previously published as an enhancements to the 2.x version.
Now these features are officially maintained in this new 3.x version of smstools.
New features:
Configuration file (smsd.conf):
- Received PDU's can be stored to the incoming message file. It's possible to select which kind of PDU's will be stored.
- Message validity time can be selected for default.
- Incoming Unicode message can be decoded internally.
- Incoming multipart message can be combined internally.
- Dual memory handler: it's possible to read messages from both memories (SIM and Mobile Equipment).
- Incoming PDU string can be read from the file. This is for testing purposes.
- Sending can be disabled. This is for testing purposes.
See the How to configure for more details.
Outgoing message file:
- Priority can be set to high. This also works while the Provider Queue is used.
- Message validity time can be selected for the message.
- It's possible to make a voice call with DTMF tones.
- Binary messages can be presented as a Hex in the message file. There is a Wap Push demo using this feature.
- After a message is sent, Message_id is stored to the file if a status report was requested.
See the SMS file format for more details.
General:
- A new sms3 script is available (in the scripts directory) as an alternative for the original sms script.
This new script handles some special issues, including a smoother shutdown, multiple instance prevention and force-stop ability.
- If a modem reading reaches timeout, it will be reported to the log file.
- If for some reason the file moving fails, destination lock is removed.
- While creating a log file, file access permissions are limited to 640 (-rw-r-----).
- Provider definition can now have 's' for short numbers. For example: "FINLAND = 358, s".
If this is not defined to any provider, outgoing message file must have a provider queue setting while sending to short number.
Bug fixes:
- In the outgoing message file the "UDH: yes/no" setting did not work correctly.
However using this setting is not necessary because this value defaults to true when it's needed.
- Short number preceeding with 's' caused number become empty and sending failed.
End Of History