Autres langues

Langue: en

Version: 384656 (fedora - 01/12/10)

Section: 5 (Format de fichier)


gammu-smsdrc - gammu-smsd(1) configuration file




gammu-smsd(1) reads configuration from a config file. It's location can be specified on command line, otherwise default path /etc/gammu-smsdrc is used.

This file use ini file syntax, with comment parts being marked with both ; and #. Sections of config file are identified in square brackets line [this]. All key values are case insensitive.

Configuration file of gammu-smsd consists of at least two sections - [gammu] and [smsd].

The [gammu] section is configuration of a phone connection and is same as described in gammurc(5) with the only exception that logfile is ignored and common logging for gammu library and SMS daemon is used. However the logformat directive still configures how much messages gammu emits.

The [smsd] section configures SMS daemon itself, which are described in following subsections. First general parameters of SMS daemon are listed and then specific parameters for storage backends.

Then there are optional sections [include_numbers] and [exclude_numbers], which control message filtering (see bellow).

General parameters of SMS daemon


SMSD service to use, one of FILES, MYSQL, PGSQL, DBI (depends on compiled in support for backends).

FILES - stores messages in files, see gammu-smsd-files(7) for details
MYSQL - stores messages in MySQL database, see gammu-smsd-mysql(7) for details
PGSQL - stores messages in PostgreSQL database, see gammu-smsd-pgsql(7) for details
DBI - stores messages in any database supported by libdbi, this includes MSSQL, MySQL, PostgreSQL or SQLite databases, see gammu-smsd-dbi(7) for details


PIN for SIM card. This is optional, but you should set it if your phone after power on requires PIN.


Network personalisation password. This is optional, but some phones require it after power on.


Phone lock password. This is optional, but some phones require it after power on.


File where SMSD actions are being logged. You can also use special value "syslog" which will send all messages to syslog daemon. On Windows another special value "eventlog" exists, which will send logs to Windows Event Log.

Default is to provide no logging.


Debug level for SMSD. The integer value should be sum of all flags you want to enable.

1 - enables basic debugging information
2 - enables logging of SQL queries of service backends
4 - enables logging of gammu debug information

Generally to get as much debug information as possible, use 255.

Default is 0, what should mean no extra information.


How many seconds should SMSD wait after each read/write loop.

Default is 30.


Shows how many seconds SMSD should wait for network answer during sending sms. If nothing happen during this time, sms will be resent.

Default is 30.


How many times will SMSD try to resend message if sending fails.

Default is 1.


The number of seconds between testing for received SMSes, when the phone is busy sending SMSes. Normally a test for received SMSes is done every CommTimeout seconds and after each sent SMS.

Default is 0 (not used).


Whether to check if phone wants to enter PIN.

Default is 1 (enabled).


Whether to check phone battery state periodically.

Default is 1 (enabled).


Whether to check signal level periodically.

Default is 1 (enabled).


The number of seconds between performing a preventive soft reset in order to minimize the cases of hanging phones e.g. Nokia 5110 will sometimes freeze to a state when only after unmounting the battery the phone will be functional again.

Default is 0 (not used).


Whether delivery reports should be used, one of 'no', 'log', 'sms'.

log - one line log entry,
sms - store in inbox as a received SMS
no - no delivery reports

Default is 'no'.


Delay in seconds how long is still delivery report considered valid. This depends on brokeness of your network (delivery report should have same timestamp as sent message). Increase this if delivery reports are not paired with sent messages.

Default is 600 (10 minutes).


String with info about phone used for sending/receiving. This can be useful if you want to run several SMS daemons.

When you set PhoneID, all messages (including injected ones) will be marked by this string and it allow more SMS daemons to share single database. This option has actually no effect of FILES backend service.


Executes a program after receiving message. This parameter is executed through shell, so you might need to escape some special characters and you can include any number of parameters. Additionally parameters with identifiers of received messages are appended to the command line. The identifiers depend on used service backend, typically it is ID of inserted row for database backends or file name for file based backends.

Database backends options

All DBI, MYSQL and PGSQL backends (see gammu-smsd-mysql(7), gammu-smsd-pgsql(7), gammu-smsd-dbi(7)) for their documentation) supports same options for configuring connection to a database:


User name used for connection to a database.


Password used for connection to a database.


Database server address. It can also contain port or socket path after semicolon, for example localhost:/path/to/socket.


Name of database to use. Please note that you should create tables in this database before using gammu-smsd. SQL files for creating needed tables are included in documentation.


When you send sms from some SMS centere you can have delivery reports from other SMSC number. You can set here number of this SMSC used by you and Gammu will not check it's number during assigning reports to sent SMS.


DBI driver to use. Depends on what DBI drivers you have installed, DBI supports: mysql, freetds (provides access to MS SQL Server and Sybase), pgsql, sqlite, sqlite3, firebird and ingres, msql and oracle drivers are under development.


Path, where DBI drivers are stored, this usually does not have to be set if you have properly installed drivers.


Database directory for some (currently only sqlite) DBI drivers. Set here path where sqlite database files are stored.

Files backend options

The FILES backend accepts following configuration options. See gammu-smsd-files(7) for more detailed service backend description. Please note that all path should contain trailing path separator (/ on Unix systems):


Where the received SMSes are stored.

Default is current directory.


Where SMSes to be sent should be placed.

Default is current directory.


Where the transmitted SMSes are placed, if same as OutBoxPath transmitted messages are deleted.

Default is to delete transmitted messages.


Where SMSes with error in transmission is placed.

Default is same as SentSMSPath.


The format in which the SMS will be stored: 'detail', 'unicode', 'standard'.

detail - format used for message backup by gammu(1)
unicode - message text stored in unicode (UTF-16)
standard - message text stored in system charset

The 'standard' and 'unicode' settings do not apply for 8-bit messages, which are always written raw as they are received with extension .bin.

Default is 'unicode'.


The format for transmitting the SMS: 'auto', 'unicode', '7bit'.

Default is 'auto'.

Message filtering

SMSD allows to process only limited subset of incoming messages. You can define filters in [include_numbers] and [exclude_numbers] sections. If [include_numbers] section exists, all values (keys are ignored) from it are used as allowed phone numbers and no other message is processed. On the other side, in [exclude_numbers] you can specify numbers which you want to skip.


There is more complete example available in Gammu documentation. Please note that for simplicity following examples do not include [gammu] section, you can look into gammurc(5) for some examples how it can look like.

SMSD configuration file for FILES backend could look like:

 Service = files
 PIN = 1234
 LogFile = syslog
 InboxPath = /var/spool/sms/inbox/
 OutboPpath = /var/spool/sms/outbox/
 SentSMSPath = /var/spool/sms/sent/
 ErrorSMSPath = /var/spool/sms/error/

If you want to use MYSQL backend, you will need something like this:

 Service = mysql
 PIN = 1234
 LogFile = syslog
 User = smsd
 Password = smsd
 PC = localhost
 Database = smsd

Process only messages from 123456 number:

 number1 = 123456

Do not process messages from evil number 666:

 number1 = 666


gammu-smsd(1), gammu(1), gammurc(5)

gammu-smsd-files(7), gammu-smsd-mysql(7), gammu-smsd-pgsql(7), gammu-smsd-dbi(7), gammu-smsd-tables(7)


gammu-smsd and this manual page were written by Michal Cihar <>. Copyright © 2009 Michal Cihar and other authors. License GPLv2: GNU GPL version 2 <>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.


Please report bugs to <>.

Before reporting a bug, please enable verbose logging in SMSD configuration:

    debuglevel = 255
    logfile = smsd.log

and include this verbose log within bug report.