Fixed my ChangeLog e-mail address.
[mdsms.git] / mdsms.1.in
1 .TH MDSMS 1 "17 May 1999" ~     VERSION ~ "SendSMS Manual"
2
3 .\~ $Id$
4
5 .SH NAME
6 mdsms \- send SMSes through MobilDock
7
8 .SH SYNOPSIS
9 .B mdsms
10 .RB [ "-c <cfgfile>" ]
11 .RB [ "-d <device>" ]
12 .RB [ "-L <file>" ]
13 .RB [ "-l <lockfile>" ]
14 .RB [ "-s <smsc #>" ]
15 .RB [ "-m <#>" ]
16 .RB [ "-r <sec>" ]
17 .RB [ "-t <msec>" ]
18 .RB [ "-T <msec>" ]
19 .RB [ "\-fvhV" ]
20 .RB [ "<dest. phone>" ]
21 .RB [ "<msg text>" ]
22
23 .SH DESCRIPTION
24 Program sends one SMS message through MobilDock device.
25
26 .SH OPTIONS
27 .TP
28 .BR -c | --config\  < cfgfile >
29 Process recursively this file and read all options from it. See the section
30 .B CONFIGURATION
31 for more information.
32 .TP
33 .BR -d | --device\  < device >
34 Specify serial device to communicate with MobilDock. If only bare name is
35 specified, "\fB/dev/\fP" is prepended automatically. This device name is used
36 subsequently with
37 .BR -l | --lockfile
38 option, see below.
39 .TP
40 .BR -L | --log\  < file >
41 Log all important messages to this file preceded by timestamp, machine hostname
42 etc., similar to output of
43 .BR syslogd (8).
44 If set to empty string (which is default - ~\fB DEF_LOGNAME     \fP~), nothing
45 is logged anywhere.
46 .TP
47 .BR -l | --lockfile\  < lockfile >
48 Prior to accessing serial device specified above the lockfile should be
49 acquired for correct concurrent processes behaviour. Although this name
50 can be given as direct filename more common method is to use pattern
51 with embedded "\fB%s\fP" where this mark is replaced by actual basename
52 (last component of pathname with all preceding directory names stripped)
53 of serial device used.
54 Default name for lockfile is ~\fB       DEF_LOCKFILE    \fP~.
55 .TP
56 .BR -s | --smsc\  < smsc\ # >
57 Specify custom SMS center number. If not specified (or overriden as empty
58 string by \fB-s ""\fP)
59 .B mdsms
60 asks by "\fBAT+CSCA?\fP"
61 Siemens A1 for its default SMS center. Situation with undeterminable SMS center
62 is unrecoverable and casues immediate fail. It is a common practice to use
63 plus sign ("\fB+\fP") to indicate international number type.
64 Known SMS centers as of May 1999:
65 .RS
66 .TP
67 .BR "CZ Paegas " ( "230 01" "): " +420603052000
68 .TP
69 .BR "CZ EuroTel " ( "230 02" "): " +420602909909
70 .RE
71 .TP
72 .BR -m | --maxretry\  < # >
73 Maximum retries of any \fBAT\fP-style command during the session. All the
74 retries are summed during one run of
75 .B mdsms
76 and no more retries of the command are permitted. After exceeding this
77 value the program is terminated.
78 .TP
79 .BR -r | --readtime\  < sec >
80 Maximum response read timeout before give up.
81 .B mdsms
82 sends the requested \fBAT\fP-style command to
83 .B MobilDock
84 and expects response. Unfortunately when the voice call is in progress,
85 .B MobilDock
86 will block any serial device communication and it is impossible to differentiate
87 between calling
88 .B MobilDock
89 and stucked/disconnected one. After exceeding this time interval,
90 .B mdsms
91 is terminated immediately,
92 .B maxretry
93 parameter notwithstanding. Standard value is
94 .BR DEF_READTIME
95 seconds and should be enough for any voice call.
96 .TP
97 .BR -t | --chartime\  < msec >
98 Although the fixed used baudrate of
99 .B 19200
100 is pretty low, MobilDock/Siemens A1 couple
101 .RB "aren't"
102 able to accept steady
103 stream of data at this speed. Even the used XON/XOFF handshaking is just not
104 enough. The only possible workaround is to slowdown the communication by
105 waiting a bit after character sent to give relax time to these devices.
106 When full rate communication was used, occasional longer SMS data corruption
107 was observed. Argument is given in milliseconds and its default value is
108 .BR DEF_CHARTIME ms.
109 .TP
110 .BR -T | --cmdtime\  < msec >
111 This delay is given before sending any
112 .B AT-style
113 command to MobilDock/Siemens A1.
114 Its primary purpose is to let any previous entered commands to finish and
115 to clear any input before actually sending our own command. Also all Siemens
116 devices are known that they strongly dislike fast edge-to-edge communication
117 and to satisfy these requirements this delay was considered as the best
118 approach. The default value is
119 .BR DEF_CMDTIME ms.
120 .TP
121 .BR -f | --file
122 When parameter <\fBmsg text\fP> has been specified, by using this option
123 \fBmdsms\fP will read the file with the <\fBmsg text\fP> filename instead
124 and send its \fBcontents\fP as the SMS message.
125 .TP
126 .BR -v | --verbose
127 Increase verbosity level by one. Currently the maximum defined level is
128 .BR 3 ,
129 the default value is
130 .BR 0 .
131 .TP
132 .BR -h | --help
133 Give short parameters description to
134 .I stderr
135 (standard error output stream).
136 .TP
137 .BR -V | --version
138 Print the version number and exit.
139 .TP
140 .RB < "dest. phone" >
141 This mandatory parameter specifies the telephone number of the recipient
142 of SMS message. International prefix character plus
143 .RB ( + )
144 is supported the national mode without plus
145 .RB ( + )
146 prefix is supported and the meaning is specific to the GSM operator currently
147 being roamed in (NOT the native
148 .RB "'home'"
149 operator of the SIM card!).
150 This number can be made default in system configuration files, see below
151 for section
152 .BR CONFIGURATION .
153 .TP
154 .RB < "msg text" >
155 Here you write the exact body of the message. This parameter should be
156 specified only as one component, although if more found they are concatenated
157 with separating space (" "). But this practice is discouraged as
158 your shell will probably remove any multiple spaces found and also other
159 metacharacters may be incorrectly interpreted. To prevent any escaping
160 mess, you may prefer to omit this parameter and the the message text is
161 then read from
162 .I stdin
163 (standard input stream).
164
165 .SH CONFIGURATION
166 .B mdsms
167 reads ~\fB      CONFIG_MAIN     \fP~ followed by ~\fB$HOME      CONFIG_HOME     \fP~
168 configuration files. The content of these files (and also any file read by
169 .BR -c | --config
170 option)
171 has the usual
172 .BR getopt (3)
173 syntax with dashes. Newlines are taken as whitespace, both double ("\fB~\fP")
174 and single ("\fB'\fP")
175 quoting is supported. Embedded quote characters can be escaped by backslash
176 ("\fB\\\fP").
177 Arguments are processes in order as specified in configuration files and
178 finally the command-line of the program itself, overriding any previous
179 values.  Although the order of
180 .BR -c | --config
181 options on one line is preserved the first file is read AFTER all of the
182 current options are processed. Recursive use of
183 .B -c
184 is permitted and the files are read in LIFO (Last-In First-Out, AKA stack)
185 order. You should use "\fB-v -v\fP"
186 to see details of option processing with more complex configuration setups.
187
188 .SH OPERATION
189 Upon startup
190 .B mdsms
191 locks the port (see option
192 .BR -l | --lockfile
193 for details) and opens the serial device with hardcoded parameters of
194 19200 baud, software handshaking (XON/XOFF style), 8 bits, no parity.
195 Then issues the following commands:
196 .TP
197 .BR AT <CTRL-Z>
198 .B AT
199 is used to fool MobilDock and pass the following
200 .B <CTRL-Z>
201 (ascii decimal code 26) character to Siemens A1 and break it from eventual
202 .B AT+CMGS
203 mode in which it may errorneously remain from previous sessions.
204 .TP
205 .B AT
206 Test the responsiveness of Siemens A1.
207 .TP
208 \fBAT+CSCA="\fPsmc # from user\fB"\fP
209 This command is omitted if
210 .B "smsc #"
211 is not specified by user (or specified/overriden as empty string \fB""\fP
212 .TP
213 \fBAT+CSCA?\fP
214 Query the currently set SMC center number to include it later to the
215 header of SMS PDU format where it is required. If \fBAT+CSCA="\fP...\fB"\fP
216 was issued before, this number should match it but no sanity checks are
217 currently do so.
218 .TP
219 \fBAT+CMGF=0\fP
220 Set the default SMS message format to PDU type. Currently Siemens A1
221 .RB "doesn't"
222 support any other SMS format anyway.
223 .TP
224 \fBAT+CMGS=\fP# chars
225 This command physically sends the message and the resulting "\fB+CMGS:\fP" output
226 is catched and returned as
227 .B MR
228 (message reference) number to the user.
229 .TP
230 \fBAT\fP
231 Check that Siemens A1 survived the sending of the message.
232
233 .SH SEE ALSO
234 .TP
235 .B GSM 03.40
236 ETSI documentation for SMS messages in GSM networks
237 .TP
238 .B "Developers'" Guide: SMS with the A1
239 Tech note on PDU SMS format etc:
240 .B http:/               /www.siemens.se/telefoner/ovrigtgsm/fragorsvar/a1_sms.pdf
241 .TP
242 .B Technical Description of the Siemens A1
243 Siemens A1 command description
244 .B http:/               /www.siemens.se/telefoner/ovrigtgsm/fragorsvar/a1_manual.pdf
245
246 .SH FILES
247 .TP
248 \fB     CONFIG_MAIN     \fP
249 Main configuration file
250 .TP
251 \fB$HOME        CONFIG_HOME     \fP
252 User personalized local configuration file
253
254 .SH AUTHOR
255 .B mdsms
256 was written by Jan Kratochvil who should be responsible for all the bugs
257 included. Please see the file "\fBAUTHORS\fP"
258 shipped with the original distribution archive for more details.