1GAMMU-SMSDRC(5)                      Gammu                     GAMMU-SMSDRC(5)
2
3
4

NAME

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

DESCRIPTION

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

GENERAL PARAMETERS OF SMS DAEMON

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       ReceiveFrequency
192              The  number  of seconds between testing for received SMSes, when
193              the phone is busy sending SMSes. Normally a  test  for  received
194              SMSes is done every CommTimeout seconds and after each sent SMS.
195
196              Default is 15.
197
198       StatusFrequency
199              The  number of seconds between refreshing phone status (battery,
200              signal) stored in shared memory and possibly  in  service  back‐
201              ends. Use 0 to disable.
202
203              You might want to increase this for higher throughput.
204
205              Default is 60.
206
207       LoopSleep
208              The  number  of seconds how long will SMSD sleep before checking
209              for some activity. Please note that setting this to higher value
210              than  1  will  have  effects to other time based configurations,
211              because they will be effectively rounded  to  multiply  of  this
212              value.
213
214              Setting  this  to  0  disables  sleeping. Please note this might
215              cause Gammu to consume quite a lot  of  CPU  power  as  it  will
216              effectively do busy loop.
217
218              This  sleep  is  utilized  only  if  the  main loop (sending and
219              receiving messages) takes less than defined time. For example if
220              you set LoopSleep to 5 seconds and sending messages take 10 sec‐
221              onds, no sleep will be done in the iteration  which  is  sending
222              messages.  Also  the  sleep  time is lowered by the already pro‐
223              cessed time.
224
225              Default is 1.
226
227       MultipartTimeout
228              The number of seconds how long will SMSD wait for all  parts  of
229              multipart message. If all parts won’t arrive in time, parts will
230              be processed as separate messages.
231
232              Default is 600 (10 minutes).
233
234       CheckSecurity
235              Whether to check if phone wants to enter PIN.
236
237              Default is 1 (enabled).
238
239       HangupCalls
240              New in version 1.34.0.
241
242
243              Whether to automatically hangup any incoming calls.
244
245              Default is 0 (disabled).
246
247       CheckBattery
248              Whether to check phone battery state periodically.
249
250              Default is 1 (enabled).
251
252       CheckSignal
253              Whether to check signal level periodically.
254
255              Default is 1 (enabled).
256
257       CheckNetwork
258              New in version 1.37.90.
259
260
261              Whether to check network status periodically.
262
263              If phone is reported to be not on the  network,  SMSD  tries  to
264              power it on.
265
266              Default is 1 (enabled).
267
268       ResetFrequency
269              The number of seconds between performing a preventive soft reset
270              in order to minimize the cases of hanging phones e.g. Nokia 5110
271              will  sometimes freeze to a state when only after unmounting the
272              battery the phone will be functional again.
273
274              Default is 0 (not used).
275
276       HardResetFrequency
277              New in version 1.28.92.
278
279
280              WARNING:
281                 For some phones hard reset means deleting all data in it. Use
282                 ResetFrequency instead, unless you know what you are doing.
283
284              The number of seconds between performing a preventive hard reset
285              in order to minimize the cases of hanging phones.
286
287              Default is 0 (not used).
288
289       DeliveryReport
290              Whether delivery reports should be used, one of no, log, sms.
291
292              log    one line log entry,
293
294              sms    store in inbox as a received SMS
295
296              no     no delivery reports
297
298              Default is no.
299
300       DeliveryReportDelay
301              Delay in seconds how long is still  delivery  report  considered
302              valid.  This  depends  on  brokenness  of your network (delivery
303              report should have same timestamp  as  sent  message).  Increase
304              this if delivery reports are not paired with sent messages.
305
306              Default is 600 (10 minutes).
307
308       PhoneID
309              String  with  info  about phone used for sending/receiving. This
310              can be useful if you  want  to  run  several  SMS  daemons  (see
311              Multiple modems).
312
313              When  you  set  PhoneID,  all messages (including injected ones)
314              will be marked by this string (stored as SenderID in  the  data‐
315              base) and it allows more SMS daemons to share a single database.
316
317              SMSD  daemon  will  in  such case send outbox messages only with
318              matching or empty SenderID.
319
320              This option has actually no effect with gammu-smsd-files.
321
322       SMSC   New in version 1.36.2.
323
324
325              SMSC number to use for sending messages if not specified in  the
326              message (see options of gammu-smsd-inject).
327
328              In  most  cases  you  don’t need this settings as Gammu tries to
329              read correct SMSC from phone,  but  sometimes  this  fails  (try
330              gammu getsmsc).
331
332       RunOnReceive
333              Executes a program after receiving message.
334
335              This  parameter  is executed through shell, so you might need to
336              escape some special characters and you can include any number of
337              parameters. Additionally parameters with identifiers of received
338              messages are appended  to  the  command  line.  The  identifiers
339              depend  on  used service backend, typically it is ID of inserted
340              row for database backends or file name for file based backends.
341
342              Gammu SMSD waits for the script to terminate. If you  make  some
343              time  consuming  there,  it  will make SMSD not receive new mes‐
344              sages. However to limit breakage from this situation, the  wait‐
345              ing  time  is  limited to two minutes. After this time SMSD will
346              continue in normal  operation  and  might  execute  your  script
347              again.
348
349              The process has available lot of information about received mes‐
350              sage in environment, check gammu-smsd-run for more details.
351
352       RunOnFailure
353              New in version 1.28.93.
354
355
356              Executes a program on failure.
357
358              This can be used to proactively react on  some  failures  or  to
359              interactively detect failure of sending message.
360
361              The program will receive optional parameter, which can currently
362              be either INIT (meaning failure during phone initialization)  or
363              message  ID,  which  would indicate error while sending the mes‐
364              sage.
365
366              NOTE:
367                 The environment with message (as is in RunOnReceive)  is  not
368                 passed to the command.
369
370       RunOnSent
371              New in version 1.36.4.
372
373
374              Executes a program after sending message.
375
376              The  program  will  receive  optional parameter a message ID and
377              environment with message details as described in gammu-smsd-run.
378
379       RunOnIncomingCall
380              New in version 1.38.5.
381
382
383              Executes a program after cancelling incoming call.
384
385              The program will receive a parameter with a phone number of  the
386              call.  This requires HangupCalls to be enabled.
387
388       IncludeNumbersFile
389              File  with  list of numbers which are accepted by SMSD. The file
390              contains one number per line, blank lines are ignored. The  file
391              is  read  at  startup  and  is reread only when configuration is
392              being reread. See Message filtering for details.
393
394       ExcludeNumbersFile
395              File with list of numbers which are not accepted  by  SMSD.  The
396              file  contains one number per line, blank lines are ignored. The
397              file is read at startup and is reread only when configuration is
398              being reread. See Message filtering for details.
399
400       IncludeSMSCFile
401              File  with  list of SMSC numbers which are accepted by SMSD. The
402              file contains one number per line, blank lines are ignored.  The
403              file is read at startup and is reread only when configuration is
404              being reread. See Message filtering for details.
405
406       ExcludeSMSCFile
407              File with list of SMSC numbers which are not accepted  by  SMSD.
408              The  file contains one number per line, blank lines are ignored.
409              The file is read at startup and is reread only  when  configura‐
410              tion is being reread. See Message filtering for details.
411
412       BackendRetries
413              How many times will SMSD backend retry operation.
414
415              The implementation on different backends is different, for data‐
416              base backends it generally means how many times it will  try  to
417              reconnect to the server.
418
419              Default is 10.
420
421       Send   New in version 1.28.91.
422
423
424              Whether to enable sending of messages.
425
426              Default is True.
427
428       Receive
429              New in version 1.28.91.
430
431
432              Whether to enable receiving of messages.
433
434              Default is True.
435

DATABASE BACKENDS OPTIONS

437       All   DBI,  ODBC,  MYSQL  and  PGSQL  backends  (see  gammu-smsd-mysql,
438       gammu-smsd-odbc, gammu-smsd-pgsql, gammu-smsd-dbi for their  documenta‐
439       tion) supports same options for configuring connection to a database:
440
441       User   User name used for connection to a database.
442
443       Password
444              Password used for connection to a database.
445
446       Host   Database server address. It can also contain port or socket path
447              after  semicolon,  for  example   localhost:/path/to/socket   or
448              192.168.1.1:8000.
449
450              For ODBC this is used as Data source name.
451
452              NOTE:
453                 Some  database  servers  differentiate usage of localhost (to
454                 use local socket) and 127.0.0.1 (to use locat TCP/IP  connec‐
455                 tion).   Please  make sure your SMSD settings match the data‐
456                 base server ones.
457
458              New in version 1.28.92.
459
460
461       PC     Deprecated since version 1.28.92: Please use Host instead.
462
463
464              Synonym for Host, kept for backwards compatibility.
465
466       Database
467              Name of database (or schema) to use and where SMSD can find it’s
468              tables.
469
470              Please  note  that  you  should  create  tables in this database
471              before using gammu-smsd. SQL files for  creating  needed  tables
472              are  included in documentation for individual database backends:
473              gammu-smsd-mysql,       gammu-smsd-odbc,       gammu-smsd-pgsql,
474              gammu-smsd-dbi
475
476       SkipSMSCNumber
477              When  you  send  sms from some SMS centers you can have delivery
478              reports from other SMSC number. You can set here number of  this
479              SMSC  used  by  you  and Gammu will not check it’s number during
480              assigning reports to sent SMS.
481
482       Driver SQL driver to use, Gammu supports  several  native  drivers  and
483              generic  interface using ODBC and DBI. Availability of the back‐
484              ends depends on compile time options.
485
486              Available drivers:
487
488              odbc
489                 Connects to the database using ODBC, see gammu-smsd-odbc.
490
491              native_mysql
492                 Stores messages in MySQL database, see  gammu-smsd-mysql  for
493                 details.
494
495              native_pgsql
496                 Stores  messages in PostgreSQL database, see gammu-smsd-pgsql
497                 for details.
498
499              db2, firebird, freetds,  ingres,  msql,  mysql,  oracle,  pgsql,
500              sqlite, sqlite3
501                 Stores  messages using DBI library in given backend. You need
502                 to have installed appropriate DBI driver to make it work. See
503                 gammu-smsd-dbi for details.
504
505       SQL    SQL   dialect   to   use.   This   is   specially   useful  with
506              gammu-smsd-odbc where SMSD does not  know  which  server  it  is
507              actually talking to.
508
509              Possible values:
510
511              · mysql - MySQL
512
513              · pgsql - PostgreSQL
514
515              · sqlite - SQLite
516
517              · mssql - Microsoft SQL Server
518
519              · sybase - Sybase
520
521              · access - Microsoft Access
522
523              · oracle - Oracle
524
525              · odbc - Generic ODBC
526
527              New in version 1.28.93.
528
529
530              SEE ALSO:
531                 You  can  also  completely  customize  SQL  queries  used  as
532                 described in SQL Queries.
533
534       DriversPath
535              Path, where DBI drivers are stored, this usually does  not  have
536              to be set if you have properly installed drivers.
537
538       DBDir  Database directory for some (currently only sqlite) DBI drivers.
539              Set here path where sqlite database files are stored.
540
541   Files backend options
542       The  FILES  backend  accepts  following  configuration   options.   See
543       gammu-smsd-files  for more detailed service backend description. Please
544       note that all path should contain trailing path separator  (/  on  Unix
545       systems):
546
547       InboxPath
548              Where the received SMSes are stored.
549
550              Default is current directory.
551
552       OutboxPath
553              Where SMSes to be sent should be placed.
554
555              Default is current directory.
556
557       SentSMSPath
558              Where  the  transmitted  SMSes are placed, if same as OutboxPath
559              transmitted messages are deleted.
560
561              Default is to delete transmitted messages.
562
563       ErrorSMSPath
564              Where SMSes with error in transmission is placed.
565
566              Default is same as SentSMSPath.
567
568       InboxFormat
569              The format in which the SMS will  be  stored:  detail,  unicode,
570              standard.
571
572              detail format  used  for message backup by gammu, see gammu-sms‐
573                     backup.
574
575              unicode
576                     message text stored in unicode (UTF-16)
577
578              standard
579                     message text stored in system charset
580
581              The standard and unicode settings do not apply  for  8-bit  mes‐
582              sages,  which  are  always written raw as they are received with
583              extension .bin.
584
585              Default is unicode.
586
587              NOTE:
588                 In detail format, all message parts are  stored  into  signle
589                 file, for all others each message part is saved separately.
590
591       OutboxFormat
592              The  format  in which messages created by gammu-smsd-inject will
593              be stored, it accepts same values as InboxFormat.
594
595              Default is detail if Gammu is compiled in with backup functions,
596              unicode otherwise.
597
598       TransmitFormat
599              The format for transmitting the SMS: auto, unicode, 7bit.
600
601              This  option  is used only if OutboxFormat is not set to detail.
602              In such case encoding specified in the message is used (you  can
603              specify it to gammu-smsd-inject).
604
605              Default is auto.
606

MESSAGE FILTERING

608       SMSD  allows  one  to process only limited subset of incoming messages.
609       You can define filters  for  sender  number  in  [include_numbers]  and
610       [exclude_numbers]    sections    or    using   IncludeNumbersFile   and
611       ExcludeNumbersFile directives.
612
613       If [include_numbers] section exists, all values (keys are ignored) from
614       it are used as allowed phone numbers and no other message is processed.
615       On the other side, in [exclude_numbers] you can specify  numbers  which
616       you want to skip.
617
618       Lists  from both sources are merged together. If there is any number in
619       include list, only include list is used and only messages in this  list
620       are  being accepted. If include list is empty, exclude list can be used
621       to ignore messages from some numbers. If both lists are empty, all mes‐
622       sages are accepted.
623
624       Similar  filtering  rules  can  be used for SMSC number filtering, they
625       just use different set of configuration options  -  [include_smsc]  and
626       [exclude_smsc]  sections  or IncludeSMSCFile and ExcludeSMSCFile direc‐
627       tives.
628

EXAMPLES

630       There is more complete example available in Gammu documentation. Please
631       note that for simplicity following examples do not include [gammu] sec‐
632       tion, you can look into gammurc for some examples how it can look like.
633
634   Files service
635       SMSD configuration file for FILES backend could look like:
636
637          [smsd]
638          Service = files
639          PIN = 1234
640          LogFile = syslog
641          InboxPath = /var/spool/sms/inbox/
642          OutboxPath = /var/spool/sms/outbox/
643          SentSMSPath = /var/spool/sms/sent/
644          ErrorSMSPath = /var/spool/sms/error/
645
646   MySQL service
647       If you want to use MYSQL backend, you will need something like this:
648
649          [smsd]
650          Service = sql
651          Driver = native_mysql
652          PIN = 1234
653          LogFile = syslog
654          User = smsd
655          Password = smsd
656          PC = localhost
657          Database = smsd
658
659   DBI service using SQLite
660       For gammu-smsd-dbi backend, in this particular case SQLite:
661
662          [smsd]
663          Service = sql
664          Driver = sqlite3
665          DBDir = /var/lib/sqlite3
666          Database = smsd.db
667
668   ODBC service using MySQL
669       For gammu-smsd-odbc backend, in this particular  case  using  DSN  smsd
670       server:
671
672          [smsd]
673          Service = sql
674          Driver = odbc
675          Host = smsd
676
677       The  DSN  definition  (in  ~/.odbc.ini  on UNIX) for using MySQL server
678       would look like:
679
680          [smsd]
681          Description         = MySQL
682          Driver              = MySQL
683          Server              = 127.0.0.1
684          Database            = smsd
685          Port                =
686          Socket              =
687          Option              =
688          Stmt                =
689
690          [smsdsuse]
691          Driver              = MySQL ODBC 3.51.27r695 Driver
692          DATABASE            = smsd
693          SERVER              = 127.0.0.1
694
695   Numbers filtering
696       Process only messages from 123456 number:
697
698          [include_numbers]
699          number1 = 123456
700
701       Do not process messages from evil number 666:
702
703          [exclude_numbers]
704          number1 = 666
705
706   Debugging
707       Enabling debugging:
708
709          [smsd]
710          debuglevel = 255
711          logfile = smsd.log
712
713   Multiple modems
714       You can run any number of SMSD instances and they can even  share  same
715       backend  database.  For routing the messages, you need to set different
716       PhoneID for each instance and set SenderID column in outbox table.
717
718       Following example shows configuration for two modems, but you can  have
719       any  number  of  SMSD  instances. The only limitation is performance of
720       your hardware, especially if all modems are connected using USB.
721
722       Configuration for first SMSD:
723
724          [gammu]
725          device = /dev/ttyACM0
726          connection = at
727
728          [smsd]
729          Service = sql
730          Driver = native_mysql
731          PIN = 1234
732          LogFile = syslog
733          User = smsd
734          Password = smsd
735          PC = localhost
736          Database = smsd
737          PhoneID = first
738
739       Configuration for second SMSD:
740
741          [gammu]
742          device = /dev/ttyACM1
743          connection = at
744
745          [smsd]
746          Service = sql
747          Driver = native_mysql
748          PIN = 1234
749          LogFile = syslog
750          User = smsd
751          Password = smsd
752          PC = localhost
753          Database = smsd
754          PhoneID = second
755
756       You can then start two separate instances of SMSD:
757
758          gammu-smsd -c /path/to/first-smsdrc
759          gammu-smsd -c /path/to/second-smsdrc
760

AUTHOR

762       Michal Čihař <michal@cihar.com>
763
765       2009-2015, Michal Čihař <michal@cihar.com>
766
767
768
769
7701.39.0                           Jan 05, 2018                  GAMMU-SMSDRC(5)
Impressum