1GAMMU-SMSDRC(5) Gammu GAMMU-SMSDRC(5)
2
3
4
6 gammu-smsdrc - gammu-smsd(1) configuration file
7
9 gammu-smsd reads configuration from a config file. It's location can be
10 specified on command line, otherwise default path /etc/gammu-smsdrc is
11 used.
12
13 This file use ini file syntax, see ini.
14
15 Configuration file of gammu-smsd consists of at least two sections -
16 [gammu] and [smsd]. For gammu-smsd-sql you can also use [sql] and
17 [tables].
18
19 The [gammu] section is configuration of a phone connection and is same
20 as described in gammurc with the only exception that LogFile is ignored
21 and common logging for gammu library and SMS daemon is used. However
22 the LogFormat directive still configures how much messages gammu emits.
23
24 [smsd] The [smsd] section configures SMS daemon itself, which are
25 described in following subsections. First general parameters of
26 SMS daemon are listed and then specific parameters for storage
27 backends.
28
29 [include_numbers]
30 List of numbers from which accept messages, see Message filter‐
31 ing.
32
33 [exclude_numbers]
34 List of numbers from which reject messages, see Message filter‐
35 ing.
36
37 [include_smsc]
38 List of SMSC numbers from which accept messages, see Message
39 filtering.
40
41 [exclude_smsc]
42 List of SMSC numbers from which reject messages, see Message
43 filtering.
44
45 [sql] Configure SQL queries used by gammu-smsd-sql, you usually don't
46 have to modify them.
47
48 SEE ALSO:
49 Configurable queries
50
51 [tables]
52 Configure SQL table names used by gammu-smsd-sql, you usually
53 don't have to modify them.
54
55 SEE ALSO:
56 Configurable tables
57
59 Service
60 SMSD service to use, one of following choices:
61
62 FILES Stores messages in files, see gammu-smsd-files for
63 details.
64
65 NULL Does not store messages at all, see gammu-smsd-null for
66 details.
67
68 SQL Stores messages in SQL database, see gammu-smsd-sql for
69 details, choose database type to use by Driver.
70
71 New in version 1.28.93.
72
73
74 MYSQL Deprecated since version 1.28.93: Use Service = SQL and
75 Driver = native_mysql instead.
76
77
78 Compatibility option for older configuration files,
79 stores messages in MySQL database, see gammu-smsd-mysql
80 for details.
81
82 PGSQL Deprecated since version 1.28.93: Use Service = SQL and
83 Driver = native_pgsql instead.
84
85
86 Compatibility option for older configuration files,
87 stores messages in PostgreSQL database, see
88 gammu-smsd-pgsql for details.
89
90 DBI Deprecated since version 1.28.93: Use Service = SQL and
91 Driver = DBI driver instead.
92
93
94 Compatibility option for older configuration files,
95 stores messages in any database supported by libdbi, see
96 gammu-smsd-dbi for details.
97
98 NOTE:
99 Availability of backends depends on platform and compile time
100 configuration.
101
102 PIN PIN for SIM card. This is optional, but you should set it if
103 your phone after power on requires PIN.
104
105 NetworkCode
106 Network personalisation password. This is optional, but some
107 phones require it after power on.
108
109 PhoneCode
110 Phone lock password. This is optional, but some phones require
111 it after power on.
112
113 LogFile
114 File where SMSD actions are being logged. You can also use spe‐
115 cial value syslog which will send all messages to syslog daemon.
116 On Windows another special value eventlog exists, which will
117 send logs to Windows Event Log.
118
119 If you run SMSD as a system daemon (or service), it is recom‐
120 mended to use absolute path to log file as startup directory
121 might be different than you expect.
122
123 Default is to provide no logging.
124
125 NOTE:
126 For logging to Windows Event Log, it is recommended to
127 install Event Log source by invoking gammu-smsd -e (this is
128 automatically done during installation of Gammu).
129
130 LogFacility
131 Facility to use on logging backends which support it (currently
132 only syslog). One of following chouces:
133
134 · DAEMON (default)
135
136 · USER
137
138 · LOCAL0
139
140 · LOCAL1
141
142 · LOCAL2
143
144 · LOCAL3
145
146 · LOCAL4
147
148 · LOCAL5
149
150 · LOCAL6
151
152 · LOCAL7
153
154 New in version 1.30.91.
155
156
157 DebugLevel
158 Debug level for SMSD. The integer value should be sum of all
159 flags you want to enable.
160
161 1 enables basic debugging information
162
163 2 enables logging of SQL queries of service backends
164
165 4 enables logging of gammu debug information
166
167 Generally to get as much debug information as possible, use 255.
168
169 Default is 0, what should mean no extra information.
170
171 CommTimeout
172 How many seconds should SMSD wait after there is no message in
173 outbox before scanning it again.
174
175 Default is 30.
176
177 SendTimeout
178 Shows how many seconds SMSD should wait for network answer dur‐
179 ing sending sms. If nothing happen during this time, sms will be
180 resent.
181
182 Default is 30.
183
184 MaxRetries
185 How many times will SMSD try to resend message if sending fails.
186 This is tracked per message and currently supported only with
187 SQL backends.
188
189 Default is 1.
190
191 RetryTimeout
192 How long to wait before resending failed message (needs to be
193 enabled by MaxRetries).
194
195 Is used in update_retries.
196
197 Default is 600.
198
199 ReceiveFrequency
200 The number of seconds between testing for received SMSes, when
201 the phone is busy sending SMSes. Normally a test for received
202 SMSes is done every CommTimeout seconds and after each sent SMS.
203
204 Default is 15.
205
206 StatusFrequency
207 The number of seconds between refreshing phone status (battery,
208 signal) stored in shared memory and possibly in service back‐
209 ends. Use 0 to disable.
210
211 You might want to increase this for higher throughput.
212
213 Default is 60.
214
215 LoopSleep
216 The number of seconds how long will SMSD sleep before checking
217 for some activity. Please note that setting this to higher value
218 than 1 will have effects to other time based configurations,
219 because they will be effectively rounded to multiply of this
220 value.
221
222 Setting this to 0 disables sleeping. Please note this might
223 cause Gammu to consume quite a lot of CPU power as it will
224 effectively do busy loop.
225
226 This sleep is utilized only if the main loop (sending and
227 receiving messages) takes less than defined time. For example if
228 you set LoopSleep to 5 seconds and sending messages take 10 sec‐
229 onds, no sleep will be done in the iteration which is sending
230 messages. Also the sleep time is lowered by the already pro‐
231 cessed time.
232
233 Default is 1.
234
235 MultipartTimeout
236 The number of seconds how long will SMSD wait for all parts of
237 multipart message. If all parts won't arrive in time, parts will
238 be processed as separate messages.
239
240 Default is 600 (10 minutes).
241
242 CheckSecurity
243 Whether to check if phone wants to enter PIN.
244
245 Default is 1 (enabled).
246
247 HangupCalls
248 New in version 1.34.0.
249
250
251 Whether to automatically hangup any incoming calls.
252
253 Default is 0 (disabled).
254
255 CheckBattery
256 Whether to check phone battery state periodically.
257
258 Default is 1 (enabled).
259
260 CheckSignal
261 Whether to check signal level periodically.
262
263 Default is 1 (enabled).
264
265 CheckNetwork
266 New in version 1.37.90.
267
268
269 Whether to check network status periodically.
270
271 If phone is reported to be not on the network, SMSD tries to
272 power it on.
273
274 Default is 1 (enabled).
275
276 ResetFrequency
277 The number of seconds between performing a preventive soft reset
278 in order to minimize the cases of hanging phones e.g. Nokia 5110
279 will sometimes freeze to a state when only after unmounting the
280 battery the phone will be functional again.
281
282 Default is 0 (not used).
283
284 HardResetFrequency
285 New in version 1.28.92.
286
287
288 WARNING:
289 For some phones hard reset means deleting all data in it. Use
290 ResetFrequency instead, unless you know what you are doing.
291
292 The number of seconds between performing a preventive hard reset
293 in order to minimize the cases of hanging phones.
294
295 Default is 0 (not used).
296
297 DeliveryReport
298 Whether delivery reports should be used, one of no, log, sms.
299
300 log one line log entry,
301
302 sms store in inbox as a received SMS
303
304 no no delivery reports
305
306 Default is no.
307
308 DeliveryReportDelay
309 Delay in seconds how long is still delivery report considered
310 valid. This depends on brokenness of your network (delivery
311 report should have same timestamp as sent message). Increase
312 this if delivery reports are not paired with sent messages.
313
314 Default is 600 (10 minutes).
315
316 PhoneID
317 String with info about phone used for sending/receiving. This
318 can be useful if you want to run several SMS daemons (see
319 Multiple modems).
320
321 When you set PhoneID, all messages (including injected ones)
322 will be marked by this string (stored as SenderID in the data‐
323 base) and it allows more SMS daemons to share a single database.
324
325 SMSD daemon will in such case send outbox messages only with
326 matching or empty SenderID.
327
328 This option has actually no effect with gammu-smsd-files.
329
330 SMSC New in version 1.36.2.
331
332
333 SMSC number to use for sending messages if not specified in the
334 message (see options of gammu-smsd-inject).
335
336 In most cases you don't need this settings as Gammu tries to
337 read correct SMSC from phone, but sometimes this fails (try
338 gammu getsmsc).
339
340 RunOnReceive
341 Executes a program after receiving message.
342
343 This parameter is executed through shell, so you might need to
344 escape some special characters and you can include any number of
345 parameters. Additionally parameters with identifiers of received
346 messages are appended to the command line. The identifiers
347 depend on used service backend, typically it is ID of inserted
348 row for database backends or file name for file based backends.
349
350 Gammu SMSD waits for the script to terminate. If you make some
351 time consuming there, it will make SMSD not receive new mes‐
352 sages. However to limit breakage from this situation, the wait‐
353 ing time is limited to two minutes. After this time SMSD will
354 continue in normal operation and might execute your script
355 again.
356
357 The process has available lot of information about received mes‐
358 sage in environment, check gammu-smsd-run for more details.
359
360 RunOnFailure
361 New in version 1.28.93.
362
363
364 Executes a program on failure.
365
366 This can be used to proactively react on some failures or to
367 interactively detect failure of sending message.
368
369 The program will receive optional parameter, which can currently
370 be either INIT (meaning failure during phone initialization) or
371 message ID, which would indicate error while sending the mes‐
372 sage.
373
374 NOTE:
375 The environment with message (as is in RunOnReceive) is not
376 passed to the command.
377
378 RunOnSent
379 New in version 1.36.4.
380
381
382 Executes a program after sending message.
383
384 The program will receive optional parameter a message ID and
385 environment with message details as described in gammu-smsd-run.
386
387 RunOnIncomingCall
388 New in version 1.38.5.
389
390
391 Executes a program after cancelling incoming call.
392
393 The program will receive a parameter with a phone number of the
394 call. This requires HangupCalls to be enabled.
395
396 IncludeNumbersFile
397 File with list of numbers which are accepted by SMSD. The file
398 contains one number per line, blank lines are ignored. The file
399 is read at startup and is reread only when configuration is
400 being reread. See Message filtering for details.
401
402 ExcludeNumbersFile
403 File with list of numbers which are not accepted by SMSD. The
404 file contains one number per line, blank lines are ignored. The
405 file is read at startup and is reread only when configuration is
406 being reread. See Message filtering for details.
407
408 IncludeSMSCFile
409 File with list of SMSC numbers which are accepted by SMSD. The
410 file contains one number per line, blank lines are ignored. The
411 file is read at startup and is reread only when configuration is
412 being reread. See Message filtering for details.
413
414 ExcludeSMSCFile
415 File with list of SMSC numbers which are not accepted by SMSD.
416 The file contains one number per line, blank lines are ignored.
417 The file is read at startup and is reread only when configura‐
418 tion is being reread. See Message filtering for details.
419
420 BackendRetries
421 How many times will SMSD backend retry operation.
422
423 The implementation on different backends is different, for data‐
424 base backends it generally means how many times it will try to
425 reconnect to the server.
426
427 Default is 10.
428
429 Send New in version 1.28.91.
430
431
432 Whether to enable sending of messages.
433
434 Default is True.
435
436 Receive
437 New in version 1.28.91.
438
439
440 Whether to enable receiving of messages.
441
442 Default is True.
443
445 All DBI, ODBC, MYSQL and PGSQL backends (see gammu-smsd-mysql,
446 gammu-smsd-odbc, gammu-smsd-pgsql, gammu-smsd-dbi for their documenta‐
447 tion) supports same options for configuring connection to a database:
448
449 User User name used for connection to a database.
450
451 Password
452 Password used for connection to a database.
453
454 Host Database server address. It can also contain port or socket path
455 after semicolon, for example localhost:/path/to/socket or
456 192.168.1.1:8000.
457
458 For ODBC this is used as Data source name.
459
460 NOTE:
461 Some database servers differentiate usage of localhost (to
462 use local socket) and 127.0.0.1 (to use locat TCP/IP connec‐
463 tion). Please make sure your SMSD settings match the data‐
464 base server ones.
465
466 New in version 1.28.92.
467
468
469 PC Deprecated since version 1.28.92: Please use Host instead.
470
471
472 Synonym for Host, kept for backwards compatibility.
473
474 Database
475 Name of database (or schema) to use and where SMSD can find it's
476 tables.
477
478 Please note that you should create tables in this database
479 before using gammu-smsd. SQL files for creating needed tables
480 are included in documentation for individual database backends:
481 gammu-smsd-mysql, gammu-smsd-odbc, gammu-smsd-pgsql,
482 gammu-smsd-dbi
483
484 SkipSMSCNumber
485 When you send sms from some SMS centers you can have delivery
486 reports from other SMSC number. You can set here number of this
487 SMSC used by you and Gammu will not check it's number during
488 assigning reports to sent SMS.
489
490 Driver SQL driver to use, Gammu supports several native drivers and
491 generic interface using ODBC and DBI. Availability of the back‐
492 ends depends on compile time options.
493
494 Available drivers:
495
496 odbc
497 Connects to the database using ODBC, see gammu-smsd-odbc.
498
499 native_mysql
500 Stores messages in MySQL database, see gammu-smsd-mysql for
501 details.
502
503 native_pgsql
504 Stores messages in PostgreSQL database, see gammu-smsd-pgsql
505 for details.
506
507 db2, firebird, freetds, ingres, msql, mysql, oracle, pgsql,
508 sqlite, sqlite3
509 Stores messages using DBI library in given backend. You need
510 to have installed appropriate DBI driver to make it work. See
511 gammu-smsd-dbi for details.
512
513 SQL SQL dialect to use. This is specially useful with
514 gammu-smsd-odbc where SMSD does not know which server it is
515 actually talking to.
516
517 Possible values:
518
519 · mysql - MySQL
520
521 · pgsql - PostgreSQL
522
523 · sqlite - SQLite
524
525 · mssql - Microsoft SQL Server
526
527 · sybase - Sybase
528
529 · access - Microsoft Access
530
531 · oracle - Oracle
532
533 · odbc - Generic ODBC
534
535 New in version 1.28.93.
536
537
538 SEE ALSO:
539 You can also completely customize SQL queries used as
540 described in SQL Queries.
541
542 DriversPath
543 Path, where DBI drivers are stored, this usually does not have
544 to be set if you have properly installed drivers.
545
546 DBDir Database directory for some (currently only sqlite) DBI drivers.
547 Set here path where sqlite database files are stored.
548
549 Files backend options
550 The FILES backend accepts following configuration options. See
551 gammu-smsd-files for more detailed service backend description. Please
552 note that all path should contain trailing path separator (/ on Unix
553 systems):
554
555 InboxPath
556 Where the received SMSes are stored.
557
558 Default is current directory.
559
560 OutboxPath
561 Where SMSes to be sent should be placed.
562
563 Default is current directory.
564
565 SentSMSPath
566 Where the transmitted SMSes are placed, if same as OutboxPath
567 transmitted messages are deleted.
568
569 Default is to delete transmitted messages.
570
571 ErrorSMSPath
572 Where SMSes with error in transmission is placed.
573
574 Default is same as SentSMSPath.
575
576 InboxFormat
577 The format in which the SMS will be stored: detail, unicode,
578 standard.
579
580 detail format used for message backup by gammu, see gammu-sms‐
581 backup.
582
583 unicode
584 message text stored in unicode (UTF-16)
585
586 standard
587 message text stored in system charset
588
589 The standard and unicode settings do not apply for 8-bit mes‐
590 sages, which are always written raw as they are received with
591 extension .bin.
592
593 Default is unicode.
594
595 NOTE:
596 In detail format, all message parts are stored into signle
597 file, for all others each message part is saved separately.
598
599 OutboxFormat
600 The format in which messages created by gammu-smsd-inject will
601 be stored, it accepts same values as InboxFormat.
602
603 Default is detail if Gammu is compiled in with backup functions,
604 unicode otherwise.
605
606 TransmitFormat
607 The format for transmitting the SMS: auto, unicode, 7bit.
608
609 This option is used only if OutboxFormat is not set to detail.
610 In such case encoding specified in the message is used (you can
611 specify it to gammu-smsd-inject).
612
613 Default is auto.
614
616 SMSD allows one to process only limited subset of incoming messages.
617 You can define filters for sender number in [include_numbers] and
618 [exclude_numbers] sections or using IncludeNumbersFile and
619 ExcludeNumbersFile directives.
620
621 If [include_numbers] section exists, all values (keys are ignored) from
622 it are used as allowed phone numbers and no other message is processed.
623 On the other side, in [exclude_numbers] you can specify numbers which
624 you want to skip.
625
626 Lists from both sources are merged together. If there is any number in
627 include list, only include list is used and only messages in this list
628 are being accepted. If include list is empty, exclude list can be used
629 to ignore messages from some numbers. If both lists are empty, all mes‐
630 sages are accepted.
631
632 Similar filtering rules can be used for SMSC number filtering, they
633 just use different set of configuration options - [include_smsc] and
634 [exclude_smsc] sections or IncludeSMSCFile and ExcludeSMSCFile direc‐
635 tives.
636
638 There is more complete example available in Gammu documentation. Please
639 note that for simplicity following examples do not include [gammu] sec‐
640 tion, you can look into gammurc for some examples how it can look like.
641
642 Files service
643 SMSD configuration file for FILES backend could look like:
644
645 [smsd]
646 Service = files
647 PIN = 1234
648 LogFile = syslog
649 InboxPath = /var/spool/sms/inbox/
650 OutboxPath = /var/spool/sms/outbox/
651 SentSMSPath = /var/spool/sms/sent/
652 ErrorSMSPath = /var/spool/sms/error/
653
654 MySQL service
655 If you want to use MYSQL backend, you will need something like this:
656
657 [smsd]
658 Service = sql
659 Driver = native_mysql
660 PIN = 1234
661 LogFile = syslog
662 User = smsd
663 Password = smsd
664 PC = localhost
665 Database = smsd
666
667 DBI service using SQLite
668 For gammu-smsd-dbi backend, in this particular case SQLite:
669
670 [smsd]
671 Service = sql
672 Driver = sqlite3
673 DBDir = /var/lib/sqlite3
674 Database = smsd.db
675
676 ODBC service using MySQL
677 For gammu-smsd-odbc backend, in this particular case using DSN smsd
678 server:
679
680 [smsd]
681 Service = sql
682 Driver = odbc
683 Host = smsd
684
685 The DSN definition (in ~/.odbc.ini on UNIX) for using MySQL server
686 would look like:
687
688 [smsd]
689 Description = MySQL
690 Driver = MySQL
691 Server = 127.0.0.1
692 Database = smsd
693 Port =
694 Socket =
695 Option =
696 Stmt =
697
698 [smsdsuse]
699 Driver = MySQL ODBC 3.51.27r695 Driver
700 DATABASE = smsd
701 SERVER = 127.0.0.1
702
703 Numbers filtering
704 Process only messages from 123456 number:
705
706 [include_numbers]
707 number1 = 123456
708
709 Do not process messages from evil number 666:
710
711 [exclude_numbers]
712 number1 = 666
713
714 Debugging
715 Enabling debugging:
716
717 [smsd]
718 debuglevel = 255
719 logfile = smsd.log
720
721 Multiple modems
722 You can run any number of SMSD instances and they can even share same
723 backend database. For routing the messages, you need to set different
724 PhoneID for each instance and set SenderID column in outbox table.
725
726 Following example shows configuration for two modems, but you can have
727 any number of SMSD instances. The only limitation is performance of
728 your hardware, especially if all modems are connected using USB.
729
730 Configuration for first SMSD:
731
732 [gammu]
733 device = /dev/ttyACM0
734 connection = at
735
736 [smsd]
737 Service = sql
738 Driver = native_mysql
739 PIN = 1234
740 LogFile = syslog
741 User = smsd
742 Password = smsd
743 PC = localhost
744 Database = smsd
745 PhoneID = first
746
747 Configuration for second SMSD:
748
749 [gammu]
750 device = /dev/ttyACM1
751 connection = at
752
753 [smsd]
754 Service = sql
755 Driver = native_mysql
756 PIN = 1234
757 LogFile = syslog
758 User = smsd
759 Password = smsd
760 PC = localhost
761 Database = smsd
762 PhoneID = second
763
764 You can then start two separate instances of SMSD:
765
766 gammu-smsd -c /path/to/first-smsdrc
767 gammu-smsd -c /path/to/second-smsdrc
768
770 Michal Čihař <michal@cihar.com>
771
773 2009-2015, Michal Čihař <michal@cihar.com>
774
775
776
777
7781.41.0 Sep 27, 2019 GAMMU-SMSDRC(5)