1gnokii-smsd. (8") Gnokii gnokii-smsd. (8")
2
3
4
6 gnokii-gnokii-smsd.- daemon for handling incoming and outgoing SMSes
7 using libgnokii
8
10 gnokii-gnokii-smsd.[OPTIONS]
11
12
14 The SMSD (SMS daemon) program is intended for receiving and sending
15 SMSes.
16
17
18 The program is designed to use modules (plugins) to work with different
19 backends. Currently are supported PostgreSQL, MySQL and a special mod‐
20 ule 'file' which is designed to work without an SQL database (see below
21 for special instructions in the file module section). When SMSD uses an
22 SQL server as a repository for SMSes you must create a database
23 (default name is 'sms') with tables defined in sms.tables.{module}.sql
24 files.
25
26 Table 'inbox' is for received SMSes. SMSD periodically checks a given
27 phone memory to move messages to this table. Only received SMSes and
28 status reports are deleted from the phone, other kinds of messages are
29 not removed.
30
31
32 Table 'inbox' has the following fields:
33
34
35 number phone number from which is sms received
36
37 gnokii-smsd.te
38 date set by SMS center
39
40 insertdate
41 date SMS was inserted into table
42
43 text SMS text
44
45 phone number of phone to use. If you use gnokii-gnokii-
46 smsd.without -t option you can ignore this column. See -t
47 option below.
48
49 processed
50 gnokii-gnokii-smsd.sets this always to FALSE. You can use
51 it for another program which will parse SMSes.
52
53
54 Table 'outbox' is for outgoing SMSes. SMSD periodically looks into this
55 table and searches for lines with attribute 'processed' set to FALSE.
56 If it finds such SMS, it will send SMS to 'number'.
57
58
59 Table 'outbox' has the following fields:
60
61
62 number recipient's phone number
63
64
65 processed_date
66 date of processing SMS.
67
68
69 insertdate
70 date of inserting SMS in table
71
72
73 text SMS text
74
75
76 phone number of phone to use. If you use gnokii-gnokii-
77 smsd.without -t option you must not fill this column. See
78 -t option below.
79
80
81 processed
82 new SMS must have this attribute set to FALSE. SMSD will
83 send this SMS and will update 'processed' to TRUE.
84
85
86 error This attribute contains return value of gn_sms_send()
87 function. For explanation of numeric values see
88 <gnokii/error.h> in gnokii source.
89
90
91 dreport
92 request for delivery report per message. Possible values
93 are 0 for no delivery report, 1 for delivery report.
94
95
96 not_before
97 sms will not be sent before this time (default 00:00:00).
98
99
100 not_after
101 sms will not be sent after this time (default 23:59:59).
102
103 SMSD is multi threaded program. If you list processes you will see more
104 than one instance of gnokii-smsd.
105
106
107 THE FILE MODULE
108 This module doesn't need an SQL server to work. For incoming messages
109 it works in a way that it calls a program giving phone number, date as
110 parameter and the message text on stdin. In the gnokii-gnokii-
111 smsd.directory there is an example file action. It shows sms data to
112 stdout. If you want something useful you must write your own action.
113 For outgoing messages you can set spool directory where gnokii-gnokii-
114 smsd.looks regularly.
115
116
117 Incoming sms are passed in format
118 action number date < sms
119
120
121 Outgoing sms must be in format:
122 number
123 text
124
125
126 The name of file is unimportant but gnokii-gnokii-smsd.ignores all
127 files with prefix "ERR.". If gnokii-gnokii-smsd.succesfully sends sms,
128 it removes file from spool directory. If gnokii-gnokii-smsd.cannot
129 send sms prepends file with "ERR." prefix and ignores it. If you use
130 -m file, -u (--user) and -c (--host) will have other meaning. -u is
131 for action (action must be executable) -c is for spool directory where
132 gnokii-gnokii-smsd.looks for smses. Smsd must have read and write per‐
133 missions to this directory.
134
135
136 -p, -d parameters have no meaning when -m file is used.
137
138
139 If you don't specify -u, default action is to print sms to stdout. If
140 you don't specify -c, sms sending will be disabled.
141
142
143 OPTIONS
144 Available options:
145
146 -u, --user db_username
147 Specify user name.
148
149
150 -p, --password db_password
151 Specify user password.
152
153
154 -d, --db db_name
155 Specify database name for 'pq' and 'mysql' modules or full path
156 to database file for 'sqlite' module (defaults to 'sms').
157
158
159 -c, --host db_hostname
160 Specify database server host name.
161
162
163 -s, --schema db_hostname
164 Specify database schema used by the PostgreSQL module (defaults
165 to 'public').
166
167
168 -e, --encoding client_encoding
169 Specify client encoding for database connection.
170
171
172 -m, --module db_module
173 Specify which module to use for connection to DB server. Cur‐
174 rently supported values are 'pq' for PostgreSQL, 'mysql' for
175 MySQL, 'sqlite' for SQLite3 and 'file'. File module is not sup‐
176 ported in Windows.
177
178
179 -l, --libdir path_to_db_module
180 Specify path to DB modules. If you specify pq module, gnokii-
181 gnokii-smsd.searches in libdir for file libsmsd_pq.so (for mysql
182 - libsmsd_mysql.so). Do not interchange these plugins with
183 default SQL libraries from database distribution!
184
185
186 -f, --logfile file
187 If used, gnokii-gnokii-smsd.will monitor sms traffic to file
188 "file". File is reopened and closed for every message so you can
189 simply rename or delete it if you want to rotate logs. If you
190 use '-' as filename smsd will use standard output.
191
192
193 -t, --phone phone_number
194 You can run more instances of gnokii-smsd. One instance per
195 phone. In this setup you must configure phone section in the
196 config file. For example:
197
198 [global]
199 port = /dev/ttyS0
200 model = 6110
201 initlength = default
202 connection = serial
203 bindir = /usr/local/sbin/
204 use_locking = no
205 serial_baudrate = 38400
206 smsc_timeout = 10
207 [phone_1]
208 port = /dev/ttyS0
209 model = 6110
210 initlength = default
211 connection = serial
212 bindir = /usr/local/sbin/
213 use_locking = no
214 serial_baudrate = 38400
215 [phone_2]
216 port = /dev/ttyS1
217 model = AT
218 initlength = default
219 connection = serial
220 bindir = /usr/local/sbin/
221 use_locking = no
222 serial_baudrate = 38400
223 smsc_timeout = 10
224
225 In this setup if you run gnokii-gnokii-smsd.without -t option it
226 will use config from global section. If you run gnokii-gnokii-
227 smsd.with -t 1 it will use config from phone_1 and likewise with
228 -t 2 uses phone_2. In case of use -t option gnokii-gnokii-
229 smsd.fills phone number for incoming sms's and in outbox it
230 looks only for sms's with the specified phone number in column
231 'phone'. This behaviour gives you possibility to run one
232 instance of gnokii-gnokii-smsd.for every phone you have at the
233 same time.
234
235
236 -i, --interval interval
237 Polling interval for incoming sms's in seconds. Default is 1
238 second.
239
240
241 -S, --maxsms number
242 When phone driver doesn't support sms status it is possible to
243 specify number of sms's supported by phone. Default is 10. If
244 driver support sms status this option is ignored.
245
246
247 -b, --inbox memory_type
248 Where to look for new messages (defaults to IN for most Nokia
249 phones and to SM for all other phones). For debugging or for
250 unusual setups you can use another memory type supported by your
251 phone (eg. IN for the Inbox, OU for the Outbox, AR for the Ar‐
252 chive, TE for the Templates and F1,...,F20 for your own fold‐
253 ers). Use gnokii --showsmsfolderstatus for a list of such mem‐
254 ory types.
255
256
257 -0, --firstpos0
258 SMSD starts messages reading from position 1. If your phone
259 stores sms's from postion 0, use this option.
260
261
262 -v, --version
263 Shows gnokii-gnokii-smsd.version.
264
265
266 -h, --help
267 Shows short help.
268
269
271 Various error messages are printed to STDERR.
272
273 Debug output can be enabled setting xdebug=on (for messages specific to
274 SMSD) and debug=on (for messages specific to libgnokii) in the configu‐
275 ration file.
276
277
279 None reported.
280
281
283 SMSD was written by Jan Derfinak and contributed by other people. See
284 also Docs/CREDITS from the Gnokii sources.
285
286
288 This program is distributed under the GNU Public License.
289
290
292 gnokii(1)
293
294
295
296 September 27, 2010 gnokii-smsd. (8")