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