📄 smsd.8
字号:
.TH "smsd" "8" "October 5, 2003" "" "Gnokii".SH "NAME"smsd \- daemon for handling incoming and outgoing SMSes using libgnokii.SH "SYNOPSIS".B smsd \fI[OPTIONS]\fR.SH "DESCRIPTION".PP The.B SMSD(SMS daemon) program is intended for receiving and sending SMSes..PPThe program is designed to use modules (plugins) to work with an SQL server.Currently are supported PostgreSQL, MySQL and a special module 'file' which isdesigned to work without an SQL database (see below for special instructionsfor the file module). See option \fI--module\fR. \fBSMSD\fR uses an SQL server as arepository for SMSes. You must create a database (default name is 'sms') withtables defined in sms.tables.{module}.sql files. Table 'inbox' is forreceived SMSes:.RS.TP.B numberphone number from which is sms received.TP.B smsdatedate set by SMS center.TP.B insertdatedate SMS was inserted into table.TP.B textSMS text.TP.B phonenumber of phone to use. If you use smsd without -t option you can ignorethis column. See -t option below..TP.B processedsmsd sets this always to FALSE. You can use it for another program which will parse SMSes..RE.PPWhen the phone receives an SMS, \fBSMSD\fR moves it into 'inbox' table andremoves the SMS from the phone..PPTable 'outbox' is for outgoing SMSes. \fBSMSD\fR periodicaly looks into this tableand searches for lines with attribute 'processed' set to FALSE. If it findsuch SMS, it will send SMS to 'number':.RS.TP.B numberrecipient's phone number.TP.B processed_datedate of processing SMS..TP.B insertdatedate of inserting SMS in table.TP.B textSMS text.TP.B phonenumber of phone to use. If you use smsd without -t option youmust not fill this column. See -t option below..TP.B processednew SMS must have this attribut set to FALSE. \fBSMSD\fR will send this SMS and will update 'processed' to TRUE..TP.B errorThis attribute contains return value of gn_sms_send() function. For explanation of numeric values see <gnokii/error.h> in gnokii source..TP.B dreportrequest for delivery report per message. Possible values are 0 for no delivery report, 1 for delivery report..RE.PP\fBSMSD\fR is multi threaded program. If you list processes you will see more thenone instance of smsd..SSTHE FILE MODULE.PPThis module doesn't need an SQL server to work. For incoming messages itwork in a way that it calls a program giving phone number, date as parameterand the message text on stdin. In the smsd directory there is as example fileaction. It shows sms data to stdout. If you want something usefull you mustwrite your own action..BRFor outgoing messages you can set spool directory where smsd looksregularly..PPIncoming sms are passed in format.RS.PD 0.TP.BR action\ number\ date\ <\ sms.PD.RE.PPOutgoing sms must be in format:.RS.PD 0.TP.B number.TP.B text.PD.RE.PPThe name of file is unimportant but smsd ignores all files with prefix"ERR.". If smsd succesfuly sends sms, it removes file from spool directory.If smsd cannot sends sms prepend file with "ERR." prefix and ignores it.If you use \fI-m file\fR, \fI-u\fR (\fI--user\fR) and \fI-c\fR (\fI--host\fR) will have other meaning.\fI-u\fR is for action (action must be executable)\fI-c\fR is for spool directory where smsd looks for smses. Smsd must have readand write permissions to this directory..PP\fI-p\fR, \fI-d\fR parameters have no meaning when \fI-m file\fR is used..PPIf you don't specify \fI-u\fR, default action is to print sms to stdin.If you don't specify \fI-c\fR, sms sending will be disabled..SS OPTIONS.PPAvailable options:.TP.BR -u,\ --user\ db_usernameSpecify user name..TP.BR -p,\ --password\ db_passwordSpecify user password..TP.BR -d,\ --db\ db_nameSpecify database name..TP.BR -c,\ --host\ db_hostnameSpecify database server host name..TP.BR -m,\ --module\ db_moduleSpecify which module to use for connection to DB server. Currently supported are pq for PostgreSQL and mysql for MySQL..TP.BR -l,\ --libdir\ path_to_db_moduleSpecify path to DB modules. If you specify pq module, smsd searches in libdir for file libpq.so (for mysql - libmysql.so).Do not interchange this plugins with default SQL libraries from database distribution!.TP.BR -f,\ --logfile\ fileIf used, smsd will monitor sms traffic to file "file". File isreopened and closed for every message so you can simply rename ordelete it if you want rotate logs. If you use '-' as filename smsdwill use standard output..TP.BR -t,\ --phone\ phone_numberYou can run more instances of smsd. One instance per phone. In thissetup you must configure phone section in gnokiirc. For example:.PD 0.RS[global].Pport = /dev/ttyS0.Pmodel = 6110.Pinitlength = default.Pconnection = serial.Pbindir = /usr/local/sbin/.Puse_locking = no.Pserial_baudrate = 38400.Psmsc_timeout = 10.P[phone_1].Pport = /dev/ttyS0.Pmodel = 6110.Pinitlength = default.Pconnection = serial.Pbindir = /usr/local/sbin/.Puse_locking = no.Pserial_baudrate = 38400.P[phone_2].Pport = /dev/ttyS1.Pmodel = AT.Pinitlength = default.Pconnection = serial.Pbindir = /usr/local/sbin/.Puse_locking = no.Pserial_baudrate = 38400.Psmsc_timeout = 10.PDIn this setup if you run smsd without -t option it will use configfrom global section. If you run smsd with -t 1 it will use configfrom phone_1 and likewise with -t 2 uses phone_2. In case of use -toption smsd fill phone number for incoming sms's and in outbox itlooks only for sms's with the specified phone number in column'phone'. This behaviour give you possibility to run one instanceof smsd for every phone you have at the same time..RE.TP.BR -v,\ --versionShows smsd version..TP.BR -h,\ --helpShows short help..SH "DIAGNOSTICS"Various error messages are printed to STDERR..SH "BUGS".PP None reported..SH "AUTHOR"\fBSMSD\fR was written by Jan Derfinak and contributed by other people.See also Docs/CREDITS from the Gnokii sources..SH "COPYING"This program is distributed under the GNU Public License..SH "SEE ALSO"gnokii
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -