GAMMU-SMSDRC(5) | Gammu | GAMMU-SMSDRC(5) |
gammu-smsdrc - gammu-smsd(1) configuration file
gammu-smsd 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, see ini.
Configuration file of gammu-smsd consists of at least two sections - [gammu] and [smsd]. For gammu-smsd-sql you can also use [sql] and [tables].
The [gammu] section is configuration of a phone connection and is same as described in gammurc 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.
SEE ALSO:
SEE ALSO:
New in version 1.28.93.
Compatibility option for older configuration files, stores messages in MySQL database, see gammu-smsd-mysql for details.
Compatibility option for older configuration files, stores messages in PostgreSQL database, see gammu-smsd-pgsql for details.
Compatibility option for older configuration files, stores messages in any database supported by libdbi, see gammu-smsd-dbi for details.
NOTE:
If you run SMSD as a system daemon (or service), it is recommended to use absolute path to log file as startup directory might be different than you expect.
Default is to provide no logging.
NOTE:
New in version 1.30.91.
Generally to get as much debug information as possible, use 255.
Default is 0, what should mean no extra information.
Default is 30.
Default is 30.
Default is 1.
Is used in update_retries.
Default is 600.
Default is 15.
You might want to increase this for higher throughput.
Default is 60.
Setting this to 0 disables sleeping. Please note this might cause Gammu to consume quite a lot of CPU power as it will effectively do busy loop.
This sleep is utilized only if the main loop (sending and receiving messages) takes less than defined time. For example if you set LoopSleep to 5 seconds and sending messages take 10 seconds, no sleep will be done in the iteration which is sending messages. Also the sleep time is lowered by the already processed time.
Default is 1.
Default is 600 (10 minutes).
Default is 1 (enabled).
Whether to automatically hangup any incoming calls.
Default is 0 (disabled).
Default is 1 (enabled).
Default is 1 (enabled).
Whether to check network status periodically.
If phone is reported to be not on the network, SMSD tries to power it on.
Default is 1 (enabled).
Default is 0 (not used).
WARNING:
The number of seconds between performing a preventive hard reset in order to minimize the cases of hanging phones.
Default is 0 (not used).
Default is 600 (10 minutes).
When you set PhoneID, all messages (including injected ones) will be marked by this string (stored as SenderID in the database) and it allows more SMS daemons to share a single database.
SMSD daemon will in such case send outbox messages only with matching or empty SenderID.
This option has actually no effect with gammu-smsd-files.
SMSC number to use for sending messages if not specified in the message (see options of gammu-smsd-inject).
In most cases you don't need this settings as Gammu tries to read correct SMSC from phone, but sometimes this fails (try gammu getsmsc).
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.
Gammu SMSD waits for the script to terminate. If you make some time consuming there, it will make SMSD not receive new messages. However to limit breakage from this situation, the waiting time is limited to two minutes. After this time SMSD will continue in normal operation and might execute your script again.
The process has available lot of information about received message in environment, check gammu-smsd-run for more details.
Executes a program on failure.
This can be used to proactively react on some failures or to interactively detect failure of sending message.
The program will receive optional parameter, which can currently be either INIT (meaning failure during phone initialization) or message ID, which would indicate error while sending the message.
NOTE:
Executes a program after sending message.
The program will receive optional parameter a message ID and environment with message details as described in gammu-smsd-run.
Executes a program after cancelling incoming call.
The program will receive a parameter with a phone number of the call. This requires HangupCalls to be enabled.
The implementation on different backends is different, for database backends it generally means how many times it will try to reconnect to the server.
Default is 10.
Whether to enable sending of messages.
Default is True.
Whether to enable receiving of messages.
Default is True.
All DBI, ODBC, MYSQL and PGSQL backends (see gammu-smsd-mysql, gammu-smsd-odbc, gammu-smsd-pgsql, gammu-smsd-dbi for their documentation) supports same options for configuring connection to a database:
For ODBC this is used as Data source name.
NOTE:
New in version 1.28.92.
Synonym for Host, kept for backwards compatibility.
Please note that you should create tables in this database before using gammu-smsd. SQL files for creating needed tables are included in documentation for individual database backends: gammu-smsd-mysql, gammu-smsd-odbc, gammu-smsd-pgsql, gammu-smsd-dbi
Available drivers:
odbc
native_mysql
native_pgsql
db2, firebird, freetds, ingres, msql, mysql, oracle, pgsql, sqlite, sqlite3
Possible values:
New in version 1.28.93.
SEE ALSO:
The FILES backend accepts following configuration options. See gammu-smsd-files for more detailed service backend description. Please note that all path should contain trailing path separator (/ on Unix systems):
Default is current directory.
Default is current directory.
Default is to delete transmitted messages.
Default is same as SentSMSPath.
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.
NOTE:
Default is detail if Gammu is compiled in with backup functions, unicode otherwise.
This option is used only if OutboxFormat is not set to detail. In such case encoding specified in the message is used (you can specify it to gammu-smsd-inject).
Default is auto.
SMSD allows one to process only limited subset of incoming messages. You can define filters for sender number in [include_numbers] and [exclude_numbers] sections or using IncludeNumbersFile and ExcludeNumbersFile directives.
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.
Lists from both sources are merged together. If there is any number in include list, only include list is used and only messages in this list are being accepted. If include list is empty, exclude list can be used to ignore messages from some numbers. If both lists are empty, all messages are accepted.
Similar filtering rules can be used for SMSC number filtering, they just use different set of configuration options - [include_smsc] and [exclude_smsc] sections or IncludeSMSCFile and ExcludeSMSCFile directives.
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 for some examples how it can look like.
SMSD configuration file for FILES backend could look like:
[smsd] Service = files PIN = 1234 LogFile = syslog InboxPath = /var/spool/sms/inbox/ OutboxPath = /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:
[smsd] Service = sql Driver = native_mysql PIN = 1234 LogFile = syslog User = smsd Password = smsd PC = localhost Database = smsd
For gammu-smsd-dbi backend, in this particular case SQLite:
[smsd] Service = sql Driver = sqlite3 DBDir = /var/lib/sqlite3 Database = smsd.db
For gammu-smsd-odbc backend, in this particular case using DSN smsd server:
[smsd] Service = sql Driver = odbc Host = smsd
The DSN definition (in ~/.odbc.ini on UNIX) for using MySQL server would look like:
[smsd] Description = MySQL Driver = MySQL Server = 127.0.0.1 Database = smsd Port = Socket = Option = Stmt = [smsdsuse] Driver = MySQL ODBC 3.51.27r695 Driver DATABASE = smsd SERVER = 127.0.0.1
Process only messages from 123456 number:
[include_numbers] number1 = 123456
Do not process messages from evil number 666:
[exclude_numbers] number1 = 666
Enabling debugging:
[smsd] debuglevel = 255 logfile = smsd.log
You can run any number of SMSD instances and they can even share same backend database. For routing the messages, you need to set different PhoneID for each instance and set SenderID column in outbox table.
Following example shows configuration for two modems, but you can have any number of SMSD instances. The only limitation is performance of your hardware, especially if all modems are connected using USB.
Configuration for first SMSD:
[gammu] device = /dev/ttyACM0 connection = at [smsd] Service = sql Driver = native_mysql PIN = 1234 LogFile = syslog User = smsd Password = smsd PC = localhost Database = smsd PhoneID = first
Configuration for second SMSD:
[gammu] device = /dev/ttyACM1 connection = at [smsd] Service = sql Driver = native_mysql PIN = 1234 LogFile = syslog User = smsd Password = smsd PC = localhost Database = smsd PhoneID = second
You can then start two separate instances of SMSD:
gammu-smsd -c /path/to/first-smsdrc gammu-smsd -c /path/to/second-smsdrc
Michal Čihař <michal@cihar.com>
2009-2015, Michal Čihař <michal@cihar.com>
January 28, 2019 | 1.40.0 |