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