## SMS Server Tools 3

Home

### Future plans (some of them)

- Built-in Wap Push message support (already done but can be enhanced).

- 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).

- About support for incoming messages with Symbian S60 based smart phones like Nokia N95 etc.:
  There will be no support for those devices as they do not show incoming messages thru the AT command interface.
  See F.A.Q. for more details.

If you have any comments, ideas, needs or other SMS Server Tools 3 related things, please write them to SMSTools3 Community which is a support forum for this software.

### Coming to the version 3.2.x, not yet released

Estimated release time for following additions is fall 2009. was fall 2009, but the publishing is delayed.

1. Faster spooling algorithm. Required if system has lot of modems and very much messages to send. Current algorithm works well on systems with less than 10 - 15 modems and with about 500 -600 messages per hour per each modem.

2. SQL database based spooling and message handling. Can be used together with current filesystem based spooling, or instead of it. At least MySQL will be supported, probably SQLite too.

### Version history

21.09.2010 3.1.14

1. New setting for a modem: signal_quality_ber_ignore = yes/no.
   Default value: no.
   Some devices do not support Bit Error Rate when signal quality is asked, and this always provides "Bit Error Rate: not known or not detectable" to the log line and to the status file. With this setting ber can be ignored.

2. When logging "SMS sent...", and there has been retries, count of retries is shown in the log line:
   SMS sent, Message_id: 12, To: 358401234567, sending time 34 sec. Retries: 2

3. When logging "SMS received...", and message is a status report, explanation of status is included in the log line:
   SMS received (report, Message_id: 12, Status: 0,Ok,short message received by the SME), From: 358401234567

4. New setting for a modem: verify_pdu = yes/no.
   Default value: no.
   This setting is for testing purposes. When trying to send SMS and modem does not accept the PDU, there may be a communication problem which breaks the sent PDU. With this setting smsd changes "echo on", and verifies the string which is echoed back after the PDU was sent. In case of mismatch "Verify PDU: ERROR" is printed to the log and also both sent and received strings are logged. In case of success "Verify PDU: OK" is printed to the log. After the verification is done, "echo" is changed back to "off".

5. New setting for a modem: loglevel_lac_ci = number/word.
   Default value: LOG_INFO.
   Sets the verbosity of logging the Location area code and Cell ID and their changes. This requires that AT+CREG? returns location information. It is automatically enabled by pre_init using a command CREG=2. After the Location are code or Cell ID changes, quality of signal is also logged. This feature can be disabled with the setting which is more than current loglevel, for example 8.

6. New setting for a modem: log_not_registered_after = number.
   Default value: 0.
   If it's known that the modem gives "not registered" after a message is sent or received, with this setting number of log messages can be avoided.

7. When "MODEM IS NOT REGISTERED, WAITING..." is logged, also alarmhandler is called with a severity LOG_NOTICE.

8. The script email2sms can handle e-mail with multiple recipients.

9. New global settings:
   logtime_ms = yes/no
   Default value: no.
   logtime_us = yes/no
   Default value: no.
   With these settings the timestamp in the log file can have microseconds or milliseconds shown. These settings can be used when a default format for timestamp is in use. Value is shown after seconds and is delimited with a dot.

   If logtime_format is defined, these settings have no effect. Milliseconds or microseconds can be included in customized logtime_format using keywords timeus or timems.

10. When max_continuous_sending time is reached and smsd will do other tasks, number of messages sent in max_continuous_sending time and average time for one message is logged with loglevel LOG_NOTICE.

11. When the sending of SMS fails, trying time and number of retries are logged.

12. New global setting: shell_test = yes/no.
    Default value: yes.
    When executable_check is enabled, testing of the shell can be omitted with this setting.

Bug fixes:

13. When executable_check was enabled, smsd tested the shell using a /tmp directory for the script. This caused failure when /tmp was mounted noexec. Smsd now uses the incoming directory for the test.

14. Handling of headers failed when /tmp directory was on different mount than /var/spool/sms tree. This caused that message file was not moved to the sent or failed directory.

Download

02.09.2010 3.1.12

1. Handling of files in the spooler directory has changed. When large number of modems are serving the same queue, previously more than one modem tried to pick up the same file and in some cases this caused conflicts and performance loss. This new version will avoid conflicts by using the internal list of file candidates.

2. Global setting devices can be given in the shorten form: devices = <prefix>* <first_number> - <last_number>.
   For example: devices = GSM* 101-164 produces the same as devices = GSM101, GSM102, GSM103, etc. ...GSM164.

3. Modem settings device and logfile can have a special keyword modemname, which is replaced with a name of a modem.
   For example:

   devices = USB0, USB1, USB2
   [default]
   device = /dev/ttymodemname produces: device = /dev/ttyUSB0 and so on...
   logfile = /var/log/smstools/GSM-modemname.log produces: logfile = /var/log/smstools/GSM-USB0.log and so on...

4. It is no more mandatory that the modem section exists in the configuration file. If all settings, including device, are set in the default section, modem section can be left out.

5. Handling of timeout has changed. Previously smsd was expecting the whole answer from the modem in the given time, now timeout occurs if nothing is received in the given time.

6. Lock files contain now process ID, and name of a device. This is for monitoring purposes. With large number of lock files in the spooler it is easy to see what modems are sending messages currently.

7. Modem commands +CSQ and +CPIN now allow "echo on". However, in the normal operation "echo" should be set to off.

8. When a quality of signal is logged, it's level is explained: Marginal (-95dBm or lower) / Workable (-85dBm to -95dBm) / Good (-75dBm to -85dBm) / Excellent (above -75dBm).

9. When reading commands from regular_run_cmdfile, the expected answer can be defined in the begin of a line, between square brackets. See the How to configure for details.

10. When reading a file from the spooler and waiting if it is still growing, the time of waiting is reduced from one second to half seconds.

11. New setting for a modem: smsc_pdu = yes/no.
    Default value: no.
    If the number of SMSC is set in the configuration, or in the message file, the number is included in the PDU instead of changing SMSC with a command AT+CSCA. The number can be presented in international format, or in national format starting with 0.

12. New setting for a modem: voicecall_clcc = yes/no.
    Default value: no.
    Defines if AT+CLCC is used to detect when a call is answered. This is required if modem returns OK immediately after the call and voicecall_cpas cannot be used.

13. When check_memory_method is set to use any CMGL method, larger buffer is used for handling the data. In normal cases about 400 messages can be handled. With some problematic devices the status report may contain extra padding which is almost 300 characters. This causes that about 50 status reports can be handled simultaneously. If this limit is reached, use some other than CMGL method.

14. When a device is a socket (network modem) and is using Telnet protocol, smsd uses the Q Method implementation for option negotiation. Simply, every DO command is answered with WONT, and every WILL with DONT. This feature is very simple, and may not work with some devices or with some options. It is recommended to disable Telnet in the modem setup.

15. New setting for a modem: telnet_login = string.
    Default value: empty.
    If a network modem requires telnet login, it can be defined with this setting.

16. New setting for a modem: telnet_login_prompt = string.
    Default value: login:.
    If telnet_login is used, this setting can be used to change the login prompt.

17. New setting for a modem: telnet_login_prompt_ignore = string.
    Default value: Last login:.
    If telnet_login is used and after successful login motd contains a string which is the same as telnet_login_prompt, this setting can be used to define which kind of a string is ignored. For example, telnet_login_prompt can be login: and telnet_login_prompt_ignore could be Last login:.

18. New setting for a modem: telnet_password = string.
    Default value: empty.
    If telnet_login is used and device requires password, it can be defined with this setting.

19. New setting for a modem: telnet_password_prompt = string.
    Default value: Password:.
    If telnet_password is used, this setting can be defined to change the prompt for password.

Bug fixes:

20. A modem setting trust_spool did not work properly. When the spool directory was trusted, smsd did not check existence of lock files and this caused conflicts and slow performance when large number of modems were serving the same queue directory.

21. When headers of SMS file were handled, temporary files were created to the spooler directory. With large number of modems and slow system this caused unnecessary error messages to the log. Temporary files are now placed into the /tmp directory.

22. When a command was read from the regular_run_cmdfile, control characters were removed from the string. This caused that PDU termination (Ctrl-Z) could not be used.

23. Even when modem_disabled = yes was used, smsd tried to initialize modem if incoming = no was used. Also send_startstring and send_stopstring did not check if a modem is disabled.

21.06.2010 3.1.11

1. A modem setting ussd_convert = number can now have a new value: 4. With this value text part from the USSD answer is converted from hexadecimal dump to ASCII.

2. Some cleanup has been done to the code. The fix for "overlapped buffers" bug now uses it's own function containing a simple loop, instead of using memmove().

19.06.2010 3.1.10

Bug fixes:

1. Global settings international_prefixes, national_prefixes and global and modem setting priviledged_numbers did not always work because of an "overlapped buffers" bug. This failure happened on 32bit environments too.

17.06.2010 3.1.9

1. New setting for a modem: trust_spool = yes/no.
   Default value: yes.
   When a modem process is searching for a file from the spooler, it assumes that the file is complete when it exists and it's not locked. This will speed up sending, because one second delay is avoided. If some other process or checkhandler is creating files directly to the spooler, it may be necessary to set this to no.

2. When searching for a file to send, the lock file is created before the one second delay is spent.

3. New global setting: log_read_from_modem = yes/no.
   Default value: no.
   In some cases, when resolving troubles with a modem, it's useful to see exact data which is received from the modem. This setting is similar than log_unmodified, but displays the data as a hexadecimal dump.

4. Programs regular_run and regular_run_post_run now get the device name as a third argument.

5. The script sendsms has automatic detection of character set and creates Unicode messages if necessary.

6. New setting for a modem: send_handshake_select = yes/no.
   Default value: yes.
   Instead of checking the flag TIOCM_CTS, select() function is used when the serial transmitted is busy. If because of some reason the old style should be used, this setting allows it.

7. With a setting trim_text = yes, whitespaces are not removed if the message is going blank. This is because some people, really, need to send a message which contains only single space character.

Bug fixes:

8. When manipulating strings, the coding style assumed that strcpy() and some other functions start copying from the begin of a buffer. That's how those have worked for years, but it's against what the manual of those functions says about overlapped buffers. With 64bit Ubuntu 10.04 running on Intel processor this caused serious failures. The code is reviewed and fixed.

9. When a Sent header was printed to the incoming message file, wrong variable was used causing that only current date was printed.

10. The setting umask did not work properly and that caused the message files became world writable.

05.05.2010 3.1.8

1. Added "init info" for chkconfig to the init.d script sms3.

Bug fixes:

2. When a signal quality was asked from the modem, and it was explained to the log, incorrect severity was used. Changed severity from LOG_NOTICE to LOG_INFO.

02.05.2010 3.1.7

1. When a signal quality is asked from the modem, it's also explained to the log.

2. The sample script sendsms can now use keys for protecting the usage, for example when running with tcpserver over the internet.

3. The name of a global setting datetime is changed to datetime_format. The old name can still be used because of backward compatibility.

4. The init.d script sms3 now uses option -n for setting the process title: ARGS="-n MAINPROCESS -p$PIDFILE -i$INFOFILE". Smsd still works without that option, because of backward compatibility.

Bug fixes:

5. If a setting voicecall_hangup_ath was not defined in the configuration, default value was handled as yes, but it's defined as no.

6. A modem setting status_signal_quality was not parsed and was giving a startup error.

20.04.2010 3.1.7beta7

1. New global setting: suspend = filename.
   Default value: not in use.
   With this file, any modem process can be suspended. When a process is suspended, the modem port is closed and modem process does not do anything.

   The file is checked before smsd starts sending or receiving. If a name of the device is found from the file, suspend will start. The format of a line in file is: <devicename>: <reason>. Colon is needed, but the <reason> is optional. It is printed to the log. A special line ALL: <reason> can also be used, and this affects for all modem processes.

   When a process is suspended, the file is checked every ten seconds, or more frequently if the delaytime value is smaller.

   When a process is suspended, it listens a signal SIGUSR2. If this signal is received, modem process will send and receive messages once.

2. New setting for a modem: phonecalls_error_max = number.
   Default value: 3.
   Specifies the maximum number of errors before phonecalls are ignored.

Bug fixes:

3. Modem setting socket_connection_errorsleeptime (from 3.1.7beta4) did not work because it's name is longer than the code was able to handle.

18.04.2010 3.1.7beta6

1. A modem setting phonecalls = yes/no can now have a new value: clip, or 2. This value could be used with modems which do not support reading of phonebook, or phobebook cannot be used because entries cannot be deleted. Phocecall is detected using the +CLIP Calling line identification report from a modem.

   When phonecalls = clip is used, a setting hangup_incoming_call is automaticatty set to yes. This is because smsd must hangup a call before it's handled. Smsd also initializes a modem with +CLIP=1 automatically to enable this functionality.

2. File of a missed call has now more headers, like file of a received SMS has:

   - Subject: <modemname>
   - Modem: <modemname>
   - Number: <phone number> (if defined in the configuration)
   - IMSI: <string> (if available)

3. The setting date_filename now applies for files of missed calls too.

Bug fixes:

4. When filename_preview was used, creation of modified filename for message file of a missed call caused modem process to freeze.

5. When dialling of a voicecall ended with timeout, the result was taken from the answer of hangup and was "OK". Now it's "Timeout".

16.04.2010 3.1.7beta5

1. When running smsd as an unpriviledged user and group is defined, given group is added to the group access list which is initialized by reading the group database. In the previous versions of smsd the given group was used as only group.

2. New settings for a modem:

   start = modem command.
   Default value: not in use.
   startsleeptime = number.
   Default value: 3.
   stop = modem command.
   Default value: not in use.
   If defined, start command is sent to the modem when a modem process starts. After a command is sent, startsleeptime is spent. When a modem process is stopping, stop command is sent to the modem.

3. When using queues without provider sorting, it's no more necessary to define providers. The number list of each queue defaults to "catch-all", which is the same as "0,1,2,3,4,5,6,7,8,9,s". See the manual for more details and examples.

Bug fixes:

4. In the 3.1.7beta4, when eventhandler_ussd was used and the answer was read back from the file, extra linefeed was included in the answer string. This linefeed was printed to the log and statfile.

11.04.2010 3.1.7beta4

In addition to other changes, this version contains couple of changes which were provided as a patch by yjh, a member of SMSTools3 Community. This topic contains more details. These changes were originally going to the version 3.2, but because it's still delayed, I publish those changes now.

In 3.2, handling of character sets is based on iconv and the code is widely changed. Because the "iconv" patch in 3.1.7 is not very well tested, it's disabled by default. Edit the src/Makefile to enable the patch, if necessary. The patch requires that UTF-8 is used as a locale.

1. New global setting: logtime_format = format string.
   Default value: compatible with previous versions of smsd.
   With this setting a format of the timestamp in the logging can be set. The format string is strftime() compatible.

2. New global setting: use_linux_ps_trick = yes/no.
   Default value: no/yes
   This setting changes the way how smsd processes are shown in the process list. Instead of command line, processes can be shown like "smsd: MAINPROCESS", "smsd: GSM1" etc. In the Makefile there is a definition which sets the default value for this setting. This is a "Linux trick", it's not quaranteed that this can be used in all possible environments.

3. In the outgoing message file, the setting System_message can now have a value 2 or ToSIM for communicating with SIM applications. SMS is sent as SS (no show) and stored (sent) to SIM. Currently this only works with binary messages.

4. If USE_ICONV is defined in the src/Makefile, iconv is used for character set conversions. The current implementation works with Unicode and UTF-8 and could be used with cyrillic languages.

5. New global setting: date_filename_format = format string.
   Default value: compatible with previous versions of smsd.
   With this setting a format of the timestamp in filenames (date_filename >= 0) can be set. The format string is strftime() compatible.

6. New setting for a modem: device_open_retries = number.
   Default value: 1.
   Defines how many times smsd will retry when cannot open a device. When maximum number of retries is reached, modem process will call alarmhandler and stop. With value -1 smsd will retry forever.

7. New setting for a modem: device_open_alarm_after = number.
   Default value: 0.
   After defined number of retries, an alarmhandler is called. Smsd still continues trying, if device_open_retries value is bigger.

8. New setting for a modem: device_open_errorsleeptime = number.
   Default value: 30.
   Defines how many seconds the smsd will sleep after an error with device open.

9. New setting for a modem: socket_connection_errorsleeptime = number.
   Default value: 5.
   Defines how many seconds the smsd will sleep after an error with socket connection.

10. New command line options: -Ex and -Dx.

    - -Ex encodes a given string to the GSM 7bit packed format. The string can be written using ISO or UTF-8 alphabet.
    - -Dx decodes a given string from GSM 7bit packed format. The result uses ISO alphabet, or UTF-8 if incoming_utf8 = yes is defined in the configuration file.

    Both options can used as a helper for USSD message handlers. When these optios are used, smsd does not start as a daemon. Therefore options can be used even when smsd is running as a daemon.

11. New setting for a modem: ussd_convert = number.
    Default value: 0.
    Defines if a text part from incoming USSD message is decoded. Possible values are:

    1 | Unicode format is converted to UTF-8. This requires that USE_ICONV is defined.
    2 | GSM 7bit packed format is converted to ISO or UTF-8.

    Decoded text is appended to the original answer with two slashes and one space character.

12. New setting for a modem: eventhandler_ussd = filename.
    Default value: not in use.
    This setting defines an eventhandler to use with USSD messages. It is possible to use the same script or program which is used as eventhandler, but it's not a default because basically those scripts are not compatible without modifications.
    After an USSD message is received, and probably ussd_convert is done, eventhandler_ussd is called. Smsd checks what is the current character set of a modem and creates a temporary file which contains the USSD answer. Arguments for the eventhandler_ussd are:

    $1 | "USSD" keyword.
    $2 | Filename (which contains the answer).
    $3 | Devicename.
    $4 | Character set.
    $5 | Command what was used to get the USSD answer.

    Eventhandler_ussd can do whatever is needed with the USSD answer. It can also modify the answer, or delete the file. After eventhandler_ussd returns, smsd will check if the file still exists. If it exists, it's first line is taken as a new answer. Modified answer is then logged and probably printed to the regular_run_statfile.

Bug fixes:

13. Removed reasons for compiler warning messages when compiling with -W -Wall under x64.

14. In 3.1.7beta2 socket_connection_retries was counted incorrectly.

30.03.2010 3.1.7beta3

One important feature has been requested, but I forgot to include it in the previous version :(. So here it is:

1. New setting for a modem: regular_run_post_run = filename.
   Default value: not in use.
   This setting can define the second script or program which is executed regularly. The same script with regular_run can be used. The script gets an argument $1 which is PRE_RUN for regular_run and POST_RUN for regular_run_post_run. There is also the second argument $2, which includes a definition of regular_run_statfile.
   This is how the regular_run for a modem currently works:

   - If regular_run is defined, it's executed with arguments PRE_RUN and regular_run_statfile. A modem is closed while the script is running. regular_run_statfile is available from the previous run.
   - regular_run_statfile is deleted.
   - If regular_run_cmdfile is defined and the file exists, commands from this file are sent to the modem. If regular_run_logfile is defined, results are written to the file. If regular_run_statfile is defined, results are written to this file too. NOTE: regular_run_cmdfile is deleted after commands are handled. Use PRE_RUN phase or an external process to create this file.
   - If regular_run_cmd, one or more, is defined, commands are sent to the modem. Results are logged and written to the statfile, if defined.
   - If regular_run_post_run is defined, it's executed with arguments POST_RUN and regular_run_statfile.

29.03.2010 3.1.7beta2

1. Smsd can connect directly to the network modem. This enhancement is provided by Hubert Gilch, SEP Logistik AG.

   A device definition which starts with @ character is handled as a socket. Format for the internet host is: @<host_or_ip>:<port>. Host definition can be name or IP address.

2. New setting for a modem: socket_connection_retries = number.
   Default value: 11.
   Defines how many times smsd will retry when a socket connection fails. When maximum number of retries is reached, modem process will call alarmhandler and stop. With value -1 smsd will retry forever.

3. New setting for a modem: socket_connection_alarm_after = number.
   Default value: 0.
   After defined number of retries, an alarmhandler is called. Smsd still continues trying, if socket_connection_retries value is bigger.

4. New setting for a modem: report_device_details = yes/no.
   Default value: no/yes.
   Defines if a details from device are printed to the log when modem process is starting. With beta versions of smsd this setting defaults to yes, otherwise it defaults to no.

5. New setting for a modem: using_routed_status_report = yes/no.
   Default value: no.
   Smsd can detect routed status reports, but usually it's not recommended to use them. Modems should store status reports as an ordinary messages, which can be read when smsd will need them. However, some modem cannot store status reports, and therefore routing is the only way to get them. With this setting smsd will change some severity and text of a logging.

6. New setting for a modem: routed_status_report_cnma = yes/no.
   Default value: yes.
   Defines if +CNMA acknowledgement is needed to send after routed status report was received.

7. New setting for a modem: phonecalls_purge = yes/no/string.
   Default value: no.
   Usually missed calls are deleted from the device using AT+CPBW=index command. Some modems do not support this command, and have an alternative way to clear Missed Calls storage. With setting yes, this feature uses Siemens compatilbe way for purging: AT^SPBD="MC". Another command can be defined as a string.

8. New setting for a modem: voicecall_vts_quotation_marks = yes/no.
   Default value: no.
   Defines if quotation marks are used when sending VTS command to the modem. NOTE: previously quotation marks were used, now this setting default to no.

9. New setting for a modem: voicecall_cpas = yes/no.
   Default value: no.
   Defines if AT+CPAS is used to detect when a call is answered. This is required if modem returns OK immediately after the call.

10. New setting for a modem: needs_wakeup_at = yes/no.
    Default value: no.
    After being idle, some modems do not answer to the first AT command. For example with BenQ M32, there can be OK answer, but in many times there is not. To avoid error messages, smsd first send AT and read the answer if it's available.

11. New setting for a modem: keep_messages = yes/no.
    Default value: no.
    Defines if messages are not deleted from the device. Unlike a global setting keep_messages, smsd continues running.

12. New global setting: umask = value.
    Default value: empty.
    Effective umask for smsd can be set in the configuration file. Value can be hexadecimal, decimal or octal format.

13. New global setting: log_unmodified = yes/no.
    Default value: no.
    In some cases, when resolving troubles with a modem, it's useful to see what kind of line ends were received from the modem. With this setting spaces and line ends are not removed from the string which is logged. This setting overrides the setting log_single_lines.

14. New global setting: trim_text = yes/no.
    Default value: yes.
    With this setting trailing whitespaces are removed from the outgoing message. Does not effect with messages written using Unicode or GSM alphabet.

15. When a modem process is starting, it's checked if reading of messages is supported. This version will not do the check, if a device is not going to read incoming messages.

16. When checking the PIN, some modems include quotation marks in the answer. Some modems may leave a space away after +CPIN:. Those kind of answers are now handled.

17. When initializing a modem, and it does not respond, after 5 retries the port is closed and reopened.

18. When handling the smsc setting from configuration file, extra + sign is removed from it.

19. Message counter file (for example GSM1.counter) is always created, even when messages are not yet sent.

20. Startup check will check that any modem does not use duplicate device name.

21. Locked files in the spooler: as in the past, *.LOCK files are handled as locked files, and now LOCKED* files are handled as locked too.

22. When using a communication mode, it's no longer necessary that the name of a modem is in the devices list. It's enough that a section for the modem exists. Note, that still no more than one smsd can run at the same time.

23. When sending SMS and From field is not defined, content of a setting number is printed to the log: "Sending SMS from <number> to <destination>". If the setting number is not defined, log line is as before: "Sending SMS from to <destination>".

Bug fixes:

24. When a GMGL list was handled and sorted, older message was not read first. With this fix messages are sorted by the date and time when a message was sent.

25. When reading messages from the modem, some modems return only LF characters, even when both CR and LF should be returned. Some modems may give the answer with double line-ending. Both cases are now handled.

01.02.2010 3.1.7beta

This is not the major version change, it's publishing is still delayed. This version continues 3.1.x and contains some minor features which may be useful for some users.

1. New global setting: ignore_exec_output = yes/no.
   Default value: no.
   Usually eventhandlers should not output anything. If there is some output, it usually means that some error has occurred. These errors are often problematic, because that output cannot be seen and error is therefore not notified. Smsd will print any output from the evenhandlers to the log file. This output can also be used for debugging purposes, but usually debugging should be done by running eventhandler manually. With a setting ignore_exec_output = yes this feature can be disabled.

30.11.2009 3.1.6

This version was released because of a critical bug in the handling of a concatenation storage. Users of version 3.1.5 should upgrade to this version. As a workaround, disable purging of a concatenation storage with a global setting in the smsd.conf: ic_purge_hours = 0. If ic_purge_minutes was set, remove the setting or change it to 0.

1. Outgoing message files with the same timestamp are selected by name.

2. Carriage return characters are removed from the modem response when writing it to the log.

3. Trouble logging is slightly enhanced: if something was printed to the log and trouble is over, "Everything is ok now" is printed to the trouble log.

4. Regular_run_statfile is created using the same mask as the message files.

Bug fixes:

5. Purging of a concatenation storage freezed modem process in some environments. This was caused by too small buffer.

6. With incoming Unicode messages the Euro character was decoded incorrectly.

7. When checkhandler spooled a message and returned a value 2, trouble logging was started.

8. Destination number was accepted even if it contained 's' only.

9. Check_memory_method using CMGL did not accept zero as a message number.

01.06.2009 3.1.5

1. New global setting: smart_logging = yes/no.
   Default value: no.
   This feature is available when file based logging is used. If loglevel is less than 7 (for example "notice" is a good choise with smart_logging), trouble log (with loglevel 7) about whole communication is written to different file if there has been any errors.

   "Whole communication" means sending single SMS, receiving single SMS, and other things what smsd will do after idle time is spent. When communication starts, all possible log lines are collected to internal buffer and only loglevel lines are written to the logfile. If during communication there are any errors, all collected lines are printed to trouble log when communication reaches it's end.

   This feature was made because with loglevel 7 logfile grows very much and fast, and debug level is not usually needed when there was no any errors. In case of errors it's important to see whole communication, not just a single line which says that "something happened".

   File name is created with the rule: if lenght of logfile setting is more than 4 characters and setting ends with ".log", trouble log filename will end with "_trouble.log". If length is less than 4 or setting does not end with ".log", trouble log filename is logfile appended with ".trouble". In usual cases logfile is /var/log/smsd.log and trouble log filename will be /var/log/smsd_trouble.log, or in some (Debian, Ubuntu, ...) distributions: /var/log/smstools/smsd.log and /var/log/smstools/smsd_trouble.log.

2. New setting for a modem: unexpected_input_is_trouble = yes/no
   Default value: yes.
   With smart_logging, this setting defines if unexpected input activates trouble log.

3. New global and modem setting: hangup_incoming_call = yes/no
   Default value: no.
   If set to yes and detected unexpected input contains "RING", incoming call is ended. Use setting voicecall_hangup_ath to define if "ATH" is used to make hangup instead of "AT+CHUP".

4. New setting for a modem: communication_delay = number
   Default value: 0.
   Only some very problematic modems may need this setting. Defines minimum time in milliseconds between latest answer from modem and next command which will be sent to modem.

5. New global setting: status_interval = number.
   Default value: 1.
   If statistics function is enabled and stats directory is defined, smsd writes file named status into this directory. The file contains status of all modems in the first line using Status: header (this is similar than smsd -s outputs to console) and explained status in the next lines using modem's name as a header. Smsd writes status file every status_interval seconds if a status has changed. Value 0 disables this feature.

   For example, the output is like:

       Status:     09-05-27 20:46:17, irir------------
       SONERA:     09-05-27 20:46:09, Idle,      123, 0, 321, ssi: -63 dBm, ber: < 0.2 %
       ELISA:      09-05-27 20:46:12, Receiving, 234, 0, 432, ssi: -73 dBm, ber: < 0.2 %
       DNA:        09-05-27 20:46:06, Idle,      456, 0, 543, ssi: -77 dBm, ber: < 0.2 %
       SAUNALAHTI: 09-05-27 20:46:14, Receiving, 678, 0, 654, ssi: -69 dBm, ber: < 0.2 %

   Timestamp value tells when status is created or modem initialization was last started.

   Status can be: (s) Sending, (r) Receiving, (i) Idle, (b) Blocked, (t) Trouble, (-) Unknown. Trouble -status means that something abnormal has happened and if smart_logging is in use, trouble log will be written.

   Counters are: sent, failed, received. Sent counter is the value from stats/<modemname>.counter file. Smsd does not clear this value. Failed and received counters are from original statistics data and they are cleared each time when stats are stored (stats_interval), or smsd is restarted.

6. New global and modem settings:
   status_include_counters = yes/no
   Default value: yes.
   status_signal_quality = yes/no
   Default value: yes.
   Modem setting overrides global setting. These settings define if message counters and explained signal quality is included in the line of status file.

7. New global and modem setting:
   max_continuous_sending = number
   Default value: 300 (5 min).
   As usual, modem setting overrides global setting. This setting is in seconds and defines how long modem can send messages without doing anything else. After max_continuous_sending time is reached, received messages are checked and other tasks are run.

8. Number of modems can be defined in the src/Makefile. Default value is 64. If you are running SMSTools3 in an embedded device, you can use NUMBER_OF_MODEMS=1 to save memory. This setting also affects the number of provider queues. If you need more provider queues than you have modems, just increase the number of modems value.

9. Modem setting init2 can be used to monitor signal quality. When init2 contains AT+CSQ (uppercase), signal quality is explained in the log file using log level "notice".

10. If shared memory is not in use, global setting stats_no_zeroes defaults to yes.

11. Error message after PDU was sent is changed: Previously: "The modem said ERROR or did not answer.". Now: "The modem did not answer (expected OK)." or "The modem answer was not OK: <the answer what it was>" depending on the answer. This change is because in some cases it's important to see if there was any answer or not.

12. IMSI (International Mobile Subscriber Identity) is now logged with log level "notice". If AT+CIMI query was supported, Product Serial Number is also logged (CGSN).

13. Modem setting voicecall_hangup_ath is now global too.

14. Modem setting queues can be defined using special keyword modemname which is replaced with a name of modem.

15. New section in configuration file: [default]. This section can be used to define default settings for all modems. If setup has large count of similar modems, almost all settings can be defined once in [default] section and only device depended settings like device are required to define in the modem sections. In the future versions this will replace all modem settings which are now defined in the global part of configuration.

    As "default" is now reserved name, it cannot be used as a modem name.

Bug fixes:

16. Smsd did not compile on old GCC because two variables were defined elsewhere than begin of a block.

17. When logged to syslog, modem processes missed the correct program name. Now the program name is always smsd and in addition, MAINPROCESS: title is included in the lines which are from the main process.

18. During the startup check, smsd used file mode 0600 when checking directories. In Cygwin this was not enough when mode 0666 was inherited and directories were 0755. For testing smsd uses now the same mode which is later used to create message files.

11.05.2009 3.1.5beta9

1. Maximum number of provider queues is increased to 64 which is the same as maximum number of modems.

2. New setting for a modem: voicecall_ignore_modem_response = yes/no.
   Default value: no.
   When a voicecall is ringing, some devices give OK answer after couple of seconds even if a call is not yet answered. With this kind of device DTMF tones cannot be sent. If a ringing time is defined in the message file (using TIME: n), the waiting loop is breaked too soon. To avoid this, use voicecall_ignore_modem_response = yes in the modem settings. With this setting call rings n seconds (if not answered) and after this voicecall is over.

3. New setting for a modem: voicecall_hangup_ath = yes/no.
   Default value: no.
   Defines if ATH is used to hangup call instead of AT+CHUP.

Bug fixes:

4. When PDU had no sender address included, decoding failed with an error message "Invalid sender address length: 00".

05.04.2009 3.1.5beta8

1. New setting for a modem: detect_unexpected_input = yes/no
   Default value: yes.
   Before any command is sent to the modem, smsd checks if there is some unexpected input. For example some modem may send new message identification (CMTI) if settings are incorrect. Any unexpected input will be logged.

31.03.2009 3.1.5beta7

1. If signal quality is asked from a modem (when initializing it or when running a regular_run), the result is explained in the log file.
   For example:

       2009-03-17 12:40:05,5, GSM1: CMD: AT+CSQ: +CSQ: 20,0 OK
       2009-03-17 12:40:05,5, GSM1: Signal Strength Indicator: -73 dBm,
       Bit Error Rate: less than 0.2 %

2. New setting for a modem: detect_message_routing = yes/no
   Default value: yes.
   By default smsd tries to detect if a modem is in message routing mode. Before sending a command smsd listens if some data with routed message is available. Also, after a command is sent, smsd checks the answer. In both cases, if there is one or more routed message coming, a notification is written to the log and alarmhandler is called. Routed messages are saved and handled later when smsd can do it.

   NOTE: This checking is done to avoid errors and loss of messages. Routing mode SHOULD NOT BE USED in normal operation. With routing mode it is NOT quaranteed that all messages are delivered. Some devices are in routing mode by default and this feature helps to detect it. Use init = AT+CNMI=... with suitable values to disable routing mode. Values depend on modem, see the manual of a modem for details. All received messages must be stored to the message store which is usually "SM" (SIM card memory).

3. New global setting: shell = filename.
   Default value: /bin/sh.
   Defines which shell is used to run eventhandler and other external scripts.

   During the startup check it is now verified that the shell is accessible and it works. Runtime errors are now logged with details.

4. If running of eventhandler or regular_run fails, an administrative alert is sent (if admin_to is specified). Each process has it's own error status and while the error remains, no more messages are sent unless the problem is first solved.

5. New global setting: adminmessage_device = name.
   Default value: first available device.
   This settings defines which modem is used to send administrative messages when mainspooler detects some trouble.

6. New settings for a modem:
   adminmessage_limit = number
   Default value: 0.
   adminmessage_count_clear = number
   Default value: 0.
   With these settings sending of administrative messsages can be limited. adminmessage_limit, defines a maximum number of messages to be sent. adminmessage_count_clear defines a period to automatically clear the message counter. This value is number of minutes.

7. Timeout for message sending is increased. If your modem still gets timeout, use a modem setting read_timeout = 10 to increase value even more.

8. USSD messages using regular run for a modem feature: You can use a regular_run_cmd = AT+CUSD=1,"*100#",0; to get saldo details of a prepaid SIM. When a command starts with AT+CUSD and the length is more than 9 characters, smsd will wait response which starts with +CUSD: instead of OK string. For example in Finland the response in the log file will be like (here split into three lines):

       2009-03-30 11:56:00,5, GSM1: CMD: AT+CUSD=1,"*100#",0;:
       OK +CUSD: 2,"Liittymäsi saldo on 35.95 EUR ja
       voimassaoloaika päättyy 27.07.2009.",15

9. Sample script sendsms now checks if an user "smsd" is existing, and if it is, ownership of an outgoing file is given to the user "smsd". If you are using some else unpriviledged user to run smsd, change the script variable "smsd_user".

15.03.2009 3.1.5beta6

1. New global settings:
   ic_purge_hours = number
   Default value: 24.
   ic_purge_minutes = number
   Default value: 0.
   ic_purge_read = yes/no
   Default value: yes.
   ic_purge_interval = number
   Default value: 30.
   These settings defines how concatenation storage is purged when internal_combine is used and messages with missing parts are received. Storage is checked every ic_purge_interval minutes. If there are message parts older than defined with ic_purge_hours and/or ic_purge_minutes settings, message parts are deleted. If ic_purge_read is yes, message is stored to the incoming folder. In this case there will be only one part in the file and a header Incomplete: yes indicates that message is broken. Value 0 for both ic_purge_hours and ic_purge_minutes disables this feature.

2. New settings for a modem:
   ms_purge_hours = number
   Default value: 6.
   ms_purge_minutes = number
   Default value: 0.
   ms_purge_read = yes/no
   Default value: yes.
   These settings are used only with SIM600 (or compatible) modems (check_memory_method 5). If multipart message is received with one or more parts missing, incomplete message is removed from the message storage after time defined. Time is calculated from timestamp of first available part. Value 0 for both settings disables this feature. Setting ms_purge_read defines if parts are read before they are deleted. If internal_combine setting is used, parts are stored to the concatenation storage. If missing part(s) are later received, there will be similar timeout before parts are purged. After this the messsage is complete and is stored to the incoming folder.

3. New setting for a modem: read_timeout = number.
   Default value: 5.
   When smsd reads data from a modem, timeout will occur after read_timeout seconds if an acceptable answer is not received. Some very slow devices might need greater value than 5 seconds.

4. A modem setting check_network is enhanced. Possible values are:

   0 no | Network registration is not checked.
   1 yes | Network registration is always checked
   2 | Network registration is checked only when preparing to send messages.

   Default value is 1. If a modem does not support network checking, checking is automatically ignored.
   With value 2 incoming messages are processed faster.

11.03.2009 3.1.5beta5

1. New value for check_memory_method: 5 = CMGL list is used and messages are handled with SIMCOM SIM600 compatible way: Multipart message is handled after all of it's parts are available. After multipart message is handled, only the first part is deleted by the smsd. The modem will delete rest parts by itself.

2. New global and modem settings: priviledged_numbers = list of numbers
   Default values: not in use.
   These lists can be used with check_memory_method values 31, 41, and 5. If a modem setting is defined, it overrides global setting which is default for each modem. List can be comma delimited list of numbers or their parts starting from the left. Maximum 25 priviledged numbers can be defined. When messages are received, messages from priviledged numbers are handled first. First number in the list has highest priority.

09.03.2009 3.1.5beta4

1. New global settings: international_prefixes = value(s)
   and: national_prefixes = value(s).
   Default values: not in use.
   Can be used for automated Type Of Address selection.
   See SMS file (Using Type Of Address selection) for details.

2. New header: To_TOA: value. Can be used for Type Of Address setting. Possible values are unknown, international and national.
   See SMS file for details.

3. If character set conversion incoming_utf8 is used, a header Alphabet: UTF-8 is written to the incoming message file.

4. The script sendsms is enhanced: it now accepts multiple destination numbers. While used from the command line, last argument is taken as a text and all other arguments as numbers. In Debian based distribution scripts can be found from the /usr/share/doc/smstools/examples/scripts/ directory.

5. A function tempnam is not used anymore. It is removed because of a compiler warning which said that "using is dangerous". However, it was used safely but compiler did not know it :). Now there are no any warnings while compiling smstools3. NOTE that after this change there must be /tmp directory available in the system.

6. Baud rate 460800 is now supported. All other possible rates are supported too. Default baudrate is now 115200 which is good value for many old modems too.

7. The smsd main process checks periodically if it's own pid is still in the pidfile. If it's not, it means that another smsd was started and it's illegal to run more than one daemon at once. To avoid problems, all other than latest smsd will stop with logfile and alarmhandler notice. Usually this kind of usage happens in testing, in productive environments init.d/sms3 script should always be used to start and stop the smsd.

   Update: 3.1.5beta7: this checking is not done in Cygwin, when os_cygwin = yes is defined. This is beacause Windows locks serial ports and another modem process will not start.

8. New global setting: keep_messages = yes/no.
   Default value: no.
   This is for testing purposes. Smsd runs as usual but messages are not removeed from the modem. After all messages are read, smsd will stop. Use this with one modem only.

9. New value for check_memory_method: 4 = CMGL list is used and messages are deleted after all messages are read. There is also some more new values, see the How to configure for details.

10. Default cmgl_value is 4 which is good for most modems.

11. New global and modem setting: internal_combine_binary = no. In this version all multipart messages including binary messages are combined internally. Setting internal_combine now defaults to yes. When a binary message is combined, UDH is removed from the message body and it's shown as a header line.

Bug fixes:

12. While retrieving identification from device, if IMSI was not supported, CGSN was not tried because ERROR text was removed incorrectly.

13. Phonecall reading freezed process if there was incorrect syntax (broken answer) from a modem.

16.02.2009 3.1.5beta3

1. When a modem is first time initialized, support for reading of messages is checked. If it looks like reading is not supported, a notice is written to the log and alarmhandler is called. This is general issue with S60 based phones. See F.A.Q. for more details.

2. Log file size more than 2GB is now supported.

3. When sending or spooling is failed, "Failed: timestamp" header is printed to the message file.

Bug fixes:

4. When a CMGL method (available from 3.1.5beta) was used to check incoming messages, there was a delay when modem did not have any messages.

03.02.2009 3.1.5beta2

1. Modem setting send_delay = number has slightly enhanced:
   Value 0 now means that whole string is sent at once without any delays. This resolves slow communication with LAN based multiport servers, like Digi Portserver II. If, for some reason, "tcdrain" is still needed after sending, use value -1.

30.11.2008 3.1.5beta

1. New setting for a modem: number = string.
   Default value: empty.
   SIM card's telephone number. If not empty, it is stored to the message files using header "Number:".

2. New global setting: delaytime_mainprocess = number.
   Default value: not in use.
   If this value is not set, delaytime setting is used in the main process. With this setting outgoing messages can be checked more frequently than incoming messages.

3. HDR_Modem header is printed to incoming messages too. There is still HDR_Subject header presented for backward compatibility.

4. New command line argument: MAINPROCESS. Each modem process will change this with it's own name. With long modem names underscores like MAINPROCESS___ can be used.

5. Failure with network registration will stop the modem process only if SIM was never registered successfully.

6. Phonecalls are read even if incoming messages are not read.

7. Configuration file: Only whole line comments are now allowed. For example:
   # This comment line is valid.
   devices = GSM1 # This kind of comment is invalid.

8. Queue directory definitions are checked. If there is similar typed definition for more than one queue, it's reported and smsd does not start.

9. New setting for a modem: check_memory_method = number
   Default value: 1.
   Defines how incoming messages are checked:

   0 | CPMS is not supported. Default values are used for used_memory and max_memory.
   1 | CPMS is supported and must work. In case of failure incoming messages are not read.
   2 | CMGD is used to check messages. Some devices does not support this.
   3 | CMGL is used to check messages. Some devices are incompatible with this.

10. New setting for a modem: cmgl_value = string
    Default value: empty.
    If check_memory_method = 3 is used, correct value for AT+CMGL= command must be defined. This value depends on the modem.

Bug fixes:

11. Filename preview for sent and failed files was generated using GMS alphabet version of a message text. Because of this, skandinavian characters were not recognized and underscore was used. This is fixed.

12. When SMSC: was set in the message file, this caused an infinite loop.

11.08.2008 3.1.3

1. New setting for a modem: voicecall_vts_list = yes/no.
   Default value: no.
   Defines how VTS command is used to create DTMF tones: yes = AT+VTS=1,2,3,4,5 (list is used), no = each tone is created with single command like AT+VTS="1";+VTS="2" etc.

Security fix:

2. Tone definition string used to make a voicecall was not checked and it was possible to send user entered AT commands to the modem.

10.08.2008 3.1.2

Bug fixes:

1. Signal handlers are now silent. Previously informative messages were written to the log but at least in some environments this caused process to hang when logging function was called twice. This fix has no effect to the run script like /etc/init.d/sms3.

06.08.2008 3.1.1

1. New setting for a modem: messageids = number.
   Default value: 2.
   Defines how message id's are stored: 1 = first, 2 = last, 3 = all. When all id's are stored, numbers are delimited whith space and there is one space and dot in the end of string.

2. Destination number can have minus characters, like 358-40-111 2222.

3. If a modem is used for sending only, it is initialized when a device spooler is started.

4. Filename preview is applied for sent and failed files too.

5. While checking the network registration status, some modems include extra space character in the answer. All space characters are now removed before second field of answer is checked. The format like "+CREG: 000,001" (Motorola) is now accepted. All additional fields are remove before testing.

6. New global setting: executable_check = yes/no.
   Default value: yes.
   This setting defines if all executables are checked during the startup check. Usually eventhanler, alarmhandler etc. are shell scripts or some other single files which can be executed and therefore checked simply. If using a settings like eventhandler = /usr/local/bin/php -f /usr/local/bin/smsd_eventhandler.php, the check will fail and smsd will not start unless executable_check = no is defined.

7. If stats directory is defined, smsd will store and update message counter files in this directory.

8. If a file which is failed to send is empty, it's deleted even if there is failed folder defined.

9. While checking the network registration, result 3 (registration denied) will stop the modem process after two retries.

10. PIN handling is slightly improved. If a modem needs PIN, but there is no PIN defined in the configuration file, the process will stop.

11. Some modems do not include "OK" in the answer for CPMS query. In this case timeout time will be spent, but after this the answer is accepted if it includes at least 8 commas.

Bug fixes:

12. While reading PDU string from file and directory was defined for pdu_from_file setting, file handle for directory was not closed after finding the PDU file. After a while this caused modem process to stop with error message "Too many open files".

11.05.2008 3.1

General:

1. While running as an unpriviledged user, outgoing files which are not writable for smsd are re-created to fix the permissions.

2. In the log, a process id is now included in the "started" message.

3. Message sending time (how long it took) is logged. Some other changes and enhancements is also applied to the logging.

Outgoing message file:

4. Binary message can now have UDH-DATA defined.

5. New header: System_message: yes. With this setting message is sent as a system message. This kind of message has fixed values 0x40 for Protocol Identifier and 0xF4 for Digital Coding Scheme. A message cannot have User Data Header. Maximum length of a message is 140 bytes.

Incoming message file:

5. New header: Flash: yes. This header exists if a message was received as a flash (immediate display). Note that usually phone devices do not save flash messages, they can be saved manually if necessary.

Configuration file (smsd.conf):

6. New global setting: date_filename = number.
   Default value: 0.
   Defines if date is included to the filename of incoming message. With value 1 like 2007-09-02.GSM1.xxxxxx and with value 2 like GSM1.2007-09-02.xxxxxx.

7. Baudrate 4800 is now supported.

8. New global setting: log_single_lines = yes/no.
   Default value: yes.
   Linefeeds are removed from the modem response.

9. New setting for a modem: check_network = yes/no.
   Default value: yes.
   Network checking can be disabled if it's known that a device cannot support it.

10. New settings for a modem: logfile and loglevel.
    Default value: empty.
    Each modem can now have it's own logfile and loglevel setting. If logfile is not defined, global log is used.

15.08.2007 3.1beta7

After 3.1beta was released at march 2007, lot of changes are tested and implemented to the "stable" version of smsd. This new 3.1beta7 contains all changes and features included in the 3.0.10. Because the feature list of beta's was quite long, it's shortened and this new list contains only the changes and additions not included in the 3.0.10. Older beta versions are removed from the download area because there is no reason to use them.

Configuration file (smsd.conf):

1. New global setting: saved = directory.
   Default value: empty.
   If defined, smsd will store concatenation storage's to this directory (otherwise incoming directory is used). At startup check existing concatenation storages are moved from incoming directory to saved directory. Zero sized files are ignored. If both directories has a storage file with data, fatal error is produced and the smsd does not start.

2. New global setting: phonecalls = directory.
   Default value: empty.
   If defined and reporting of phonecalls is used, message files are store to this directory instead of incoming directory.

3. New setting for a modem: phonecalls = yes/no.
   Default value: no.
   Report phonecalls. Currently only missed calls are reported.
   When a phonecall entry is read from the phone, eventhandler is executed with argument $1 = CALL. This event can be used to make some actions after an unanswered phonecall is received.

4. New global setting: language_file = filename.
   Default value: empty.
   Message files can be written using localized headers. See the localizing for details.

5. New setting for a modem: keep_open = yes/no.
   Default value: yes
   If this is changed to no, a modem is closed while it's not used.

6. Regular_run for a modem: Like in the global part, it is possible to define an external script or program which is executed regularly within a given interval. A modem is available for script and command definitions as well as logging can be defined. See the How to configure for details.

7. New global setting: datetime = format string.
   Default value: compatible with previous versions of smsd.

8. Defining loglevels and alarmlevel, can use string value like LOG_NOTICE or "notice".

9. New command line argument -a (ask). In the configuration file there can be multiple choices for values and selections can be done while the smsd is starting.

10. Primary_memory and Secondary_memory settings can now have multiple parameters defined, like SM,SM,SM. Double-quotation marks are not necessary to use in the string.

11. All yes/no values are checked, also the "no" value should be typed correctly. Previously all incorrect values were interpreted as "no". This might have an effect if you have errors in the current setup. Possible errors are reported at startup and the smsd does not start spooling.

12. Device names are checked. Only alphanumeric characters, underline, minus-sign and dot are allowed.

13. All errors are reported, not just the first one found.

14. Numbers for the provider sorting can be given in the grouped format. (3.1beta4).

15. New global setting report = directory. This can be used to define where status report files are stored. By default they are stored to the Incoming Folder. (3.1beta3).

16. New global settings: keep_filename and store_original_filename to select file naming convention when files are moved between directories. (3.1beta).

17. New global settings: regular_run = filename and regular_run_interval = number. It is possible to define an external script or program which is executed regularly within a given interval. See an usage sample on How to run/use. (3.1beta).

18. Whitelist can specify a queue to be used with a list of numbers. See more details. (3.1beta).

19. New global setting: admin_to, destination number for administrative messages. Messages are sent without using the filesystem. (3.1beta).

20. New modem settings: message_limit, defines a maximum number of messages to be sent. message_count_clear defines a period to automatically clear the message counter. This value is number of minutes. (3.1beta).

21. New global setting: filename_preview = number. Defines how many characters of message text is concatenated to the name of messsage file. Currently works with incoming message files. (3.1beta).

Outgoing message file:

22. New header: Include: filename. Some parts of a message can be read from different file. If an included file contains only text part, it should begin with one empty line.

23. New header: Macro: definition. Works like macros usually do. See the SMS file format for details.

24. Binary message can be automatically splitted to the concatenated messages. With Autosplit value of 0 message is not sent if it does not fit in the single message. All other Autosplit values cause concatenated UDH part to be inserted to the message parts. If a message starts with UDH data (which is the default for binary messages), concatenation header is inserted to the existing user data header. If there is no UDH by the user, a new header is created.

25. Unicode messages can now have part numbering as text (Autosplit: 2).

26. Priority: HIGH accepted case insensitive, all which means "yes" is accepted too (including localized strings).

27. Voicecall can now have TIME: number defined, where number is number of seconds to keep modem calling. After a time has reached, hang up is done. If a call is answered before a time is reached, normal sound playing is done. NOTE that this time counting starts after a command is given to the modem and there will be some delay before receiving device starts ringing. You should test this with your own handset to find a reasonable time which works fine in the network you are using.

28. To: number is accepted in the grouped format, like 358 12 345 6789. The number can also contain * and # character(s). (3.1beta3).

29. While smsd reads the message, all string length's are checked to prevent possible buffer overflows. (3.1beta).

Incoming message file:

30. New header: Length: number. Length of text / data. With Unicode text number of Unicode characters. If non-Unicode text message is stored using UTF-8, number of bytes may differ.

General:

31. While retrieving identification from device, CGSN is tried if IMSI is not supported.

32. Dirty patch for Wavecom SR memory bug is included in the PDU handling. If PDU starts with "000000FF00", first 8 bytes are removed and zeros are catenated to the PDU until it's length is enough. Because of missing information, the Status Report cannot be really fixed. With this patch the SR still can be handled, but all result codes are assumed to be "ok, message delivered".

33. Incoming PDU checking: content of a broken PDU is shown as much as possible.

34. Very simple communication feature is included in this version. If you need to communicate with a device, but do not have any terminal program available, you can start the smsd with a communicate option -C devicename, for example smsd -C GSM1. This runs smsd in terminal mode which can be breaked with Ctrl-C. (3.1beta3).

35. Smsd processes are listening SIGCONT signal to break an idle loops. When the mainspooler has moved a file to the outgoing folder, SIGCONT is sent to all modem processes. This causes a new message to be immediately handled and sent. This is especially important when a delaytime is long (for a modem and directory polling). (3.1beta2).

36. Execution order of checkhandler has changed: When the mainspooler finds a message file, checkhandler is executed first before anything else is done. This allows checkhandler to make changes to the message file, for example queue selecting or "nickname to phonenumber" replacing. The smsd can also be notified with return code 2, if checkhandler has spooled a message by itself. (3.1beta).

37. Execution order of eventhandler has changed: eventhandler is executed after a file is moved to it's final location. File will then have it's final directory and name, and the smsd does not do any prosessing with a file after an eventhanler was called. (3.1beta).

38. When the modem is initialized and modem answers ERROR to some command, an errorsleeptime is spent and a command is tried once again. If a program is going to terminate while the modem is initialized, initializing is interrupted immediately. (3.1beta).

39. Concatenated id start's from the random value between 1 ... 255. (3.1beta).

40. Modem is blocked only if sending has failed because of a modem related reason. (3.1beta).

41. "SMS sent" log information includes a message id and part information (while sending multipart messsages). (3.1beta).

42. Status report log information includes a message id and status value. (3.1beta).

Bug fixes:

43. If both received and sent PDU's were stored to the messsage files, some sent PDU's were lost if a message was received while the smsd was sending a multipart message. This is because the same buffer was used to store PDU's and receiving side cleaned it. Receiving and sending side now uses their own buffer to store PDU's.

18.07.2007 3.0.10

Configuration file (smsd.conf):

1. 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:

2. 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.

3. In QNX, the OS libraries include already an unlock() function, causing a name conflict. The unlock() function of smsd is therefore renamed.

06.07.2007 3.0.9

General:

1. 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.

2. Replace: usage is ignored while sending multipart message.

3. 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.

4. 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.

28.06.2007... 3.0.9beta2

General:

1. 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.

2. 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.

3. Number of devices is increased to 64.

4. While reading a PDU from file, a first line starting with PDU: and space is taken if any exists.

5. 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.

6. Installation / uninstallation: path of executables can now be defined in the Makefile.

7. 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.

8. 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.

9. 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.

10. When finding files from the spooler directories, the oldest file is selected.

11. 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:

12. 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.

13. SMSC setting is allowed only if there is a smsc set in the config file.

Incoming message file:

14. New header: From_TOA: string. Includes a Type Of Address definition with short explanation, like: "From_TOA: 91 international, ISDN/telephone".

15. New header: Report: yes/no. Tells if a status report is going to be returned to the SME.

16. 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):

17. 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.

18. 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.

19. 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.

20. Startup check will now report if there is a queue defined but no provider numbers for it.

21. 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.

22. 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.

23. Each provider can now have up to 64 numbers defined.

24. 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.

25. stats_interval defaults to 3600 (1 hour).

26. New setting: blockafter = number. Defines number of errors which will cause modem to be blocked. Default value is 3.

27. 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:

28. 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.

29. When alphanumeric senders had length more than 9 characters, garbage was appended to the sender's name.

30. 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).

31. 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:

1. 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):

2. 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:

3. 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:

1. 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.

2. 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.

3. 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.

4. When a message is sent successfully, possible previous errors with a modem are forgotten.

5. 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):

6. 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.

7. 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.

8. 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:

9. When an alphabet is ISO or GSM, smsd can also read files stored using the UTF-8 character set.

10. 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:

11. Storage for startup error strings was not initialized properly.

12. 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.

18.05.2007 3.0.7

General:

1. If smsd is compiled without a support for status monitor, command line option -s is not useable.

Bug fixes:

2. 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:

1. New header Modem: devicename is automatically inserted to the SENT/FAILED message files.

2. Message_id: n and Sent: timestamp headers are inserted to the message file before eventhandler is executed.

20.02.2007 3.0.5

General:

1. 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.

2. If smsd is running on terminal (foreground), smsd shuts down when a terminal window is closed.

3. Internal combine can now handle 16-bit message reference numbers too.

4. 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:

1. 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:

1. 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.

2. While smsd reads the configuration, all string length's are checked to prevent possible buffer overflows.

3. 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.

4. Lockfile is detected by finding ".LOCK" from the end of filename instead of the whole string.

5. A logfile setting can be made using the command line argument -l (ell). This overrides the config file setting.

6. If received SMS is status report, log line starts with "SMS received (Report)".

7. 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:

1. The smsd can be defined to run without root priviledges.

2. System check is performed at startup to avoid some potential problems with permissions of directory structure and some other settings.

3. If a config file cannot be read, the smsd does not stay running.

4. Only the process id of a main process is written to the pid file.

5. Some code cleaning is done to avoid compiler warnings on Solaris 10 (6/06 x86) with gcc.

6. mypath setting is not used anymore.

Configuration file (smsd.conf):

7. user = username and group = groupname settings to change priviledges for the smsd.

8. 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:

9. Sample script mysmsd did not read status report correctly while storing it to the MySQL database.

14.11.2006 3.0.1

General:

1. When syslog is used to logging, a modem name is presented in the log line.

2. Outgoing PDU: Data Coding Scheme uses message class bits only when message is sent as an alert (flash).

3. Some code has 'cleaned' to avoid compiler warning messages.

Bug fixes:

4. Syslog call is now made using a format string.

5. There was two compiler warnings (with gcc >= 4) because blacklist.c and whitelist.c missed prototypes of exit() function.

6. 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:

1. Blacklist and Whitelist handling: fixed incorrect log message when the file was not readable. Also fixed the program termination in those cases.

2. 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.

3. 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):

1. Received PDU's can be stored to the incoming message file. It's possible to select which kind of PDU's will be stored.

2. Message validity time can be selected for default.

3. Incoming Unicode message can be decoded internally.

4. Incoming multipart message can be combined internally.

5. Dual memory handler: it's possible to read messages from both memories (SIM and Mobile Equipment).

6. Incoming PDU string can be read from the file. This is for testing purposes.

7. Sending can be disabled. This is for testing purposes.

See the How to configure for more details.

Outgoing message file:

8. Priority can be set to high. This also works while the Provider Queue is used.

9. Message validity time can be selected for the message.

10. It's possible to make a voice call with DTMF tones.

11. Binary messages can be presented as a Hex in the message file. There is a Wap Push demo using this feature.

12. 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:

13. 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.

14. If a modem reading reaches timeout, it will be reported to the log file.

15. If for some reason the file moving fails, destination lock is removed.

16. While creating a log file, file access permissions are limited to 640 (-rw-r-----).

17. 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:

18. 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.

19. Short number preceeding with 's' caused number become empty and sending failed.