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