GNOKII-SMSD(8)

πŸ“¦ version 0.6.31, in epel 9, fedora 43, fedora 44

πŸ’– gnokii-smsd πŸ’–

so bestie, this is gnokii-smsd from the Gnokii family, and it lives in section 8 of the manual (that's the sysadmin section, iykyk πŸ‘‘). it's a daemon, it deals with SMSes, and honestly? it's a whole vibe. let's get into it πŸ¦‹


✨ NAME ✨

gnokii-smsd β€” daemon for handling incoming and outgoing SMSes using libgnokii πŸ’…


✨ SYNOPSIS ✨

gnokii-smsd [OPTIONS]

✨ DESCRIPTION ✨

okay so the SMSD (that's SMS daemon, keep up 🌈) is literally made for receiving and sending SMSes. that's the whole job. that's the assignment and it ate.

the way this works is: the program uses modules (aka plugins, same thing bestie) so it can talk to different backends. right now the supported ones are PostgreSQL, MySQL, and a special file module that's designed to run with no SQL database at all (there's a whole special section about it below, don't worry 🫢). so when SMSD uses an SQL server as its SMS repository, you must create a database (the default name is sms) with tables defined in the sms.tables.{module}.sql files.

the table inbox is where received SMSes go. SMSD periodically checks a given phone memory to move messages over into this table. and listen β€” only received SMSes and status reports are deleted from the phone. other kinds of messages do not get removed. periodt.

the inbox table has these fields:

  • number β€” phone number from which the sms was received
  • date β€” date set by SMS center
  • insertdate β€” date the SMS was inserted into the table
  • text β€” the SMS text
  • phone β€” number of phone to use. if you use gnokii-smsd without the -t option you can ignore this column. see the -t option below.
  • processed β€” gnokii-smsd sets this always to FALSE. you can use it for another program that'll parse the SMSes πŸ‘€

the table outbox is for outgoing SMSes. SMSD periodically looks into this table and searches for lines with the attribute processed set to FALSE. if it finds such an SMS, it will send the SMS to number.

the outbox table has these fields:

  • number β€” recipient's phone number
  • processed_date β€” date of processing the SMS
  • insertdate β€” date of inserting the SMS into the table
  • text β€” the SMS text
  • phone β€” number of phone to use. if you use gnokii-smsd without the -t option you must not fill this column. see the -t option below.
  • processed β€” a new SMS must have this attribute set to FALSE. SMSD will send this SMS and will update processed to TRUE.
  • error β€” this attribute contains the return value of the gn_sms_send() function. for explanation of the numeric values, see <gnokii/error.h> in the gnokii source.
  • dreport β€” request for delivery report per message. possible values are 0 for no delivery report, 1 for delivery report.
  • not_before β€” the sms will not be sent before this time (default 00:00:00).
  • not_after β€” the sms will not be sent after this time (default 23:59:59).

SMSD is a multi threaded program. so if you list your processes you're gonna see more than one instance of gnokii-smsd. it's not a glitch bestie, it's just like that 😌


🌸 THE FILE MODULE 🌸

this module doesn't need an SQL server to work, iconic honestly. for incoming messages it works by calling a program, giving it the phone number and date as parameters, and passing the message text on stdin. in the gnokii-smsd directory there's an example file action β€” it just shows the sms data to stdout. if you want something actually useful you gotta write your own action, sorry babe πŸŽ€

for outgoing messages you can set a spool directory where gnokii-smsd looks regularly.

incoming sms are passed in this format:

action number date < sms

outgoing sms must be in this format:

number
text

the name of the file is unimportant, but gnokii-smsd ignores all files with the prefix "ERR.". if gnokii-smsd successfully sends the sms, it removes the file from the spool directory. if gnokii-smsd cannot send the sms, it prepends the file with the "ERR." prefix and ignores it. πŸ’€

if you use -m file, then -u (--user) and -c (--host) mean something totally different:

  • -u is for the action (and the action must be executable)
  • -c is for the spool directory where gnokii-smsd looks for smses.

Smsd must have read and write permissions to this directory. no cap.

heads up bestie: the -p and -d parameters have no meaning when -m file is used. like, none. they're just sitting there.

if you don't specify -u, the default action is to print sms to stdout. if you don't specify -c, sms sending will be disabled. simple as that ✨


✨ OPTIONS ✨

available options, let's gooo:

  • -u, --user db_username β€” specify user name.
  • -p, --password db_password β€” specify user password.
  • -d, --db db_name β€” specify database name for the pq and mysql modules, or the full path to the database file for the sqlite module (defaults to sms).
  • -c, --host db_hostname β€” specify database server host name.
  • -s, --schema db_hostname β€” specify the database schema used by the PostgreSQL module (defaults to public).
  • -e, --encoding client_encoding β€” specify client encoding for the database connection.
  • -m, --module db_module β€” specify which module to use for connecting to the DB server. currently supported values are pq for PostgreSQL, mysql for MySQL, sqlite for SQLite3 and file. psst β€” the File module is not supported in Windows.
  • -l, --libdir path_to_db_module β€” specify the path to the DB modules. if you specify the pq module, gnokii-smsd searches in libdir for the file libsmsd_pq.so (for mysql it's libsmsd_mysql.so). and do not interchange these plugins with the default SQL libraries from your database distribution! i'm so serious.
  • -f, --logfile file β€” if used, gnokii-smsd will monitor sms traffic to the file file. the file is reopened and closed for every message, so you can simply rename or delete it if you want to rotate logs πŸŒ€. if you use - as the filename, smsd will use standard output.
  • -t, --phone phone_number β€” you can run more instances of gnokii-smsd, one instance per phone. in this setup you must configure the phone section in the config file. for example:
[global]
port = /dev/ttyS0
model = 6110
initlength = default
connection = serial
bindir = /usr/local/sbin/
use_locking = no
serial_baudrate = 38400
smsc_timeout = 10
[phone_1]
port = /dev/ttyS0
model = 6110
initlength = default
connection = serial
bindir = /usr/local/sbin/
use_locking = no
serial_baudrate = 38400
[phone_2]
port = /dev/ttyS1
model = AT
initlength = default
connection = serial
bindir = /usr/local/sbin/
use_locking = no
serial_baudrate = 38400
smsc_timeout = 10

in this setup, if you run gnokii-smsd without the -t option it'll use the config from the global section. if you run gnokii-smsd with -t 1 it'll use the config from phone_1, and likewise with -t 2 it uses phone_2. and in case you use the -t option, gnokii-smsd fills the phone number for incoming sms's, and in the outbox it looks only for sms's with the specified phone number in the phone column. this behaviour gives you the possibility to run one instance of gnokii-smsd for every phone you have, all at the same time. main character multitasking energy πŸ‘‘

  • -i, --interval interval β€” polling interval for incoming sms's, in seconds. default is 1 second.
  • -S, --maxsms number β€” when the phone driver doesn't support sms status, it's possible to specify the number of sms's supported by the phone. default is 10. if the driver does support sms status, this option is ignored.
  • -b, --inbox memory_type β€” where to look for new messages (defaults to IN for most Nokia phones and to SM for all other phones). for debugging or for unusual setups you can use another memory type supported by your phone (eg. IN for the Inbox, OU for the Outbox, AR for the Archive, TE for the Templates and F1,...,F20 for your own folders). use gnokii --showsmsfolderstatus for a list of such memory types. πŸ’–
  • -0, --firstpos0 β€” SMSD starts reading messages from position 1. if your phone stores sms's from position 0, use this option.
  • -v, --version β€” shows gnokii-smsd version.
  • -h, --help β€” shows short help.

✨ DIAGNOSTICS ✨

various error messages are printed to STDERR. 😭

debug output can be enabled by setting xdebug=on (for messages specific to SMSD) and debug=on (for messages specific to libgnokii) in the configuration file.


✨ BUGS ✨

None reported. 😌✨ (yeah, really. nothing. we love that for us.)


✨ AUTHOR ✨

SMSD was written by Jan Derfinak and contributed by other people. see also Docs/CREDITS from the Gnokii sources. 🫢


✨ COPYING ✨

this program is distributed under the GNU Public License.


✨ SEE ALSO ✨


and that's the whole page bestie πŸ’… the gnokii crew signed this one off on September 27, 2010, and it came to you straight from the Gnokii sources. go send some SMSes, you've got this πŸŒˆπŸ’–πŸŽ€

πŸ“¦ where this page comes from