mdsms(1)
NAME
mdsms - Mobile Device SMS tool
SYNOPSIS
mdsms --send[-mobildock] options... [-f] <dest. phone> <msg text> mdsms --receive options... <command name> mdsms --logo-send options... <dest. phone> <logo filename> [<GSMnet id>] mdsms --ring-send options... <dest. phone> <ring filename> options: [-c <cfgfile>] [-d <device>] [-L <file>] [-b <rate>] [-l <lockfile>] [-s <smsc #>] [-m <#>] [-r <sec>] [-t <msec>] [-T <msec>] [-w <sec>] [-vhV]
DESCRIPTION
- Program sends one SmartMessaging SMS through one of the
- supported mobile device connected through the serial port. Cur
- rently supported:
Nokia Communicator 9000/9000iAll modes except --logo-send/--ring-sendsupported.- Nokia Communicator 9110
All modes supported. This is the only devicewith --logo-send/--ring-send capability for now.
- Siemens A1
Firmware revision 2.0 required. All modesexcept --logo-send/--ring-send supported. These modes could besupported for this device but unfortunately mdsms currently doesnot support it.
- Siemens M20, M1
All modes except --logo-send/--ring-sendsupported. These modes could be supported for this device butunfortunately mdsms currently does not support it.
OPTIONS
- -c|--config <cfgfile>
- Process recursively this file and read all options
- from it. See the section CONFIGURATION for more information.
- -d|--device <device>
- Specify serial device to communicate with your mo
- bile. If only bare name is specified, "/dev/" is prepended auto
- matically. This device name is used consequently with
- -l|--lockfile option, see below.
- -L|--log <file>
- Log all important messages to this file preceded by
- timestamp, machine hostname etc., similar to output of
- syslogd(8). If set to empty string (which is default - " "" "),
- nothing is logged anywhere.
- -l|--lockfile <lockfile>
- Prior to accessing serial device specified above
- the lockfile should be acquired for correct concurrent processes
- behaviour. Although this name can be given as direct filename
- more common method is to use pattern with embedded "%s" where
- this mark is replaced by actual basename (last component of path
- name with all preceding directory names stripped) of serial de
- vice used. Default name for lockfile is " "/var/lock/LCK..%s" ".
- -b|--baud <rate>
- Sets custom baudrate for accessing Nokia modem.
- Supported speeds are currently: 2400, 4800, 9600, 19200, 38400,
- 57600. Default is 19200 .
- -x|--xonxoff
- Turns handshaking mode to XON/XOFF (also called
- software handshaking). Use this mode if you are using only
- 3-wire serial cable. Device should be configured in "AT+IFC=1,1"
- mode, if AT+IFC command supported. When possible, you should
- rather use RTS/CTS handshaking described in the following para
- graph. This mode is the default one.
- -C|--rtscts
- Turns handshaking mode to RTS/CTS (also called
- hardware handshaking). Use this mode if you are using full
- 7-wire (approx.) serial cable. Device should be configured in
- "AT+IFC=2,2" mode, if AT+IFC command supported. Try to use this
- mode whenever possible (instead of the default XON/XOFF mode de
- scribed in the previous paragraph). This mode may not be avail
- able in your UNIX flavour.
- -M|--smsmode
- Forces the SMS mode to use - either pdu or text
- mode. By default mdsms tries to detect mode to use automatically,
PDU
- and you need for some reasone text mode, you may use --smsmode
text argument to force it. PDU mode is recommended for unattended
operation, on the other side text mode should be more compatible
when you have compatibility problems with unsupported GSM modem.
It is recommended to force the exact mode you will be using in
unattanded operaton. By such way you will prevent failures caused
by the other mode after possible random communication glitches
(and therefore automatic mdsms switchover).
-P|--pdusmscmode - Forces SMS center prepending mode for PDU mode op
- eration. By default mdsms tries sequentially all the described
- modes, you should lock it for unattanded operation to prevent
- vain switchovers from random communication glitches (also you
- will notice faster response for "count-out" or "none" modes):
- count-in
The default mode, SMS center is prepended tothe PDU and SMS center's length is taken into account duringlength calculation for "AT+CMGS=#".
- count-out
SMS center is prepended to the PDU but SMScenter's length is omitted during length calculation for"AT+CMGS=#".
- none SMS center is NOT prepended to the PDU, SMS
- center to use by GSM modem is taken from the one set by
AT+CSCA="
- -s|--smsc <smsc #>
- Specify custom SMS center number. If not specified
- (or overriden as empty string by -s "") mdsms asks by "AT+CSCA?"
- for the current default SMS center. Situation with undeterminable
- SMS center is unrecoverable and causes immediate fail. Please
- contact your GSM operator customer service if you are in trouble.
- It is a common practice to use plus sign ("+") to indicate inter
- national number type. Known SMS centers as of April 2001:
- CZ Paegas (230 01): +420603052000
- CZ EuroTel (230 02): +420602909909
- CZ Oskar (230 03): +420608005681
- -m|--maxretry <#>
- Maximum retries of any AT-style command during the
- session. All the retries are summed during one run of mdsms and
- no more retries of the command are permitted. After exceeding
- this value the program is terminated. Exception is --receive
- which is never quit after the initial initialisation has been
- successfuly negotiated.
- -r|--readtime <sec>
- Maximum response read timeout before command retry.
- mdsms sends the requested AT-style command to the device and ex
- pects response. After exceeding this time interval, mdsms reis
- sues the last command until the maximum retry count (maxretry) is
- exhausted. Standard value is 5 seconds and should be enough for
- standard mobiles responses. This is the only point where
- --send-mobildock differs the behaviour from regular --send op
- tion. Unfortunately when MobilDock has a voice call in progress,
- it will block any serial device communication with Siemens A1 and
- it is impossible to differentiate between call-in-progress
MobilDock
- has very large value, see further. After exceeding this time interval, mdsms is terminated immediately, maxretry parameter
notwithstanding. Standard value of this parameter is 3600 seconds
and should be enough for any voice call.
-t|--chartime <msec> - (This paragraph doesn't apply to Nokia 9110 or
- similiar smart devices but the functionality has been retained
- just to be on the safe side.) Although the fixed used baudrate
- of 19200 is pretty low, MobilDock/Siemens A1 couple aren't able
- to accept steady stream of data at this speed. Even the used
- XON/XOFF handshaking is just not enough. The only possible
- workaround is to slowdown the communication by waiting a bit af
- ter character sent to give relax time to these devices. When
- full rate communication was used, occasional longer SMS data cor
- ruption was observed. Argument is given in milliseconds and its
- default value is 10ms.
- -T|--cmdtime <msec>
- (This paragraph doesn't apply to Nokia 9110 or
- similiar smart devices but the functionality has been retained
- just to be on the safe side.) This delay is given before sending
- any AT-style command to the device. Its primary purpose is to
- let any previous entered commands to finish and to clear any in
- put before actually sending our own command. Also all Siemens de
- vices are known that they strongly dislike fast edge-to-edge com
- munication and to satisfy these requirements this delay was con
- sidered as the best approach. The default value is 500ms.
- -w|--waittime <sec>
- This delay is maximum time allowed silently waiting
- for incoming data. After approx 30 minutes of waiting for Nokia
- 9110 data it will turn off its FaxModem feature disabling any
- further reading of messages. After such idle time mdsms will al
- so reinitialize the modem to handle the case where the modem was
- silently powercycled in the meanwhile loosing its initial set
- tings done by mdsms during its startup. The default value is
- 500s.
- -f|--file
- When parameter <msg text> has been specified, by
- using this option mdsms will read the file with the <msg text>
- filename instead and send its contents as the SMS message. This
- parameter is applicable only together with --send or
- --send-mobildock mode.
- -v|--verbose
- Increase verbosity level by one. Currently the max
- imum defined level is 3, the default value is 0.
- -h|--help
- Give short parameters description to stderr (stan
- dard error output stream).
- -V|--version
- Print the version number and exit.
- <dest. phone>
- This mandatory parameter specifies the telephone
- number of the recipient of SmartMessaging message. International
- prefix character plus (+) is supported the national mode without
- plus (+) prefix is supported and the meaning is specific to the
- GSM operator currently being roamed in (NOT the native 'home' op
- erator of the SIM card!). This number can be made default in
- system configuration files, see below for section CONFIGURATION.
- <msg text>
- Here you write the exact body of the message. This
- parameter should be specified only as one component, although if
- more found they are concatenated with separating space (" "). But
- this practice is discouraged as your shell will probably remove
- any multiple spaces found and also other metacharacters may be
- incorrectly interpreted. To prevent any escaping mess, you may
- prefer to omit this parameter and the the message text is then
- read from stdin (standard input stream). This parameter is ap
- plicable only together with --send or --send-mobildock mode.
- <logo filename>
- Here you specifify the filename of the logo file to
- be uploaded. Currently recognized file formats are NOL (Nokia lo
- go?) and NGG (Nokia Group Graphics). These formats are propri
- etary by KESSLER Wireless Design and mdsms currently "can't" edit
- them. This parameter is applicable only together with --logo
- send mode. More info can be found on:
http:/ - /www.kessler-design.com/wireless/operatorlogo.php3
- <GSMnet id>
- Specify GSM network code to be set on the logo be
- ing uploaded. Upon upload to Nokia phone each operator logo has a
- GSM network code binded with it. When you are registered (even
- roamed) into such network the logo is displayed on the phone.
- Current Nokia mobile phones can handle only one logo loaded si
- multaneously, it will be rewritten by any other upload. You can
- also specify string " "group" " to send the logo as group graph
- ics (even from NOL format) or string " "net" " to force detection
- of network code from NOL. The default if this parameter is not
- specified is " "net" " for NOL files and " "group" " for NGG
- files. This parameter is applicable only together with --logo
- send mode.
CONFIGURATION
- mdsms reads " "/etc/" "mdsms" "rc" " followed by "$HOME
- "/." "mdsms" "rc" " configuration files. The content of these
- files (and also any file read by -c|--config option) has the usu
- al getopt(3) syntax with dashes. Newlines are taken as whites
- pace, both double (""") and single ("'") quoting is supported.
- Embedded quote characters can be escaped by backslash ("
OPERATION
- Upon startup mdsms locks the port (see option
- -l|--lockfile for details) and opens the serial device with spec
- ified baudrate (default
- 19200 baud), software handshaking (XON/XOFF style), 8
- bits, no parity. Then issues the following commands:
- AT<ESCAPE><CTRL-Z>
- AT is used to fool MobilDock (if present, otherwise
- it is harmlesss anyway) and pass the following <ESCAPE><CTRL-Z>
- (ascii decimal code 27 followed by 26) characters to the device
- and break it from eventual AT+CMGS mode in which it may error
- neously remain from previous sessions.
- AT Test the responsiveness of the device.
- AT+CSCA="smsc # from user"
- This command is omitted if smsc # is not specified
- by user (or specified/overriden as empty string ""
- AT+CSCA?
- Query the currently set SMS center number to in
- clude it later to the header of SMS PDU format where it is re
- quired. If AT+CSCA="..." was issued before, this number should
- match it but no sanity checks are currently do so. Also it is
- used to detect possibly unset SMS center.
- Mode-dependent.
- Here are executed the commands listed for each of
- the specified operation mode separately.
- AT Check that the mobile survived our torture.
- The following operations are dependant on the operation:
- --send/--send-mobildock:
AT+CMGF=0, if fails AT+CMGF=1Set the default SMS message format to PDUtype (preferred) or text mode (if PDU not available). Next +CMGScommand is dependant on the mode selected by this one.- AT+CMGS=# chars if +CMGF=0
This command physically sends the messageand the resulting "+CMGS:" output is catched and returned as MR(message reference) number to the user. # chars corresonds tototal data bytes sent to the phone (so the half of thehex-string, SMSC is included). SMSC number is preceding the restof PDU to be conformant with GSM Phase 2 specification. Siemens
M1 or Siemens M20 rev. 1.x are known that
- number, I have to get in touch with such device to be able to autodetect it properly (mail me if you want to be helpful).
AT+CMGS="phone # from user" if +CMGF=1 - The same as the previous command except that
- the message is text as pure text terminated with <CTRL-Z> charac
- ter. SMSC number is not present anywhere in this mode.
- --logo-send/--ring-send:
AT+CSMP=81,,0,245Sets PDU type to 81 (SMS-SUBMIT + integertype for validity + UDHI - user data header indicator), PID (protocol identifier) to 0 (standard non-converted SMS) and DCS (datacoding scheme) to 0xF5 (data coding/message class, 8-bit data +mobile-equipment specific).- AT+CMGS="phone # from user"
This command physically sends the messageand the resulting "+CMGS:" output is catched and returned as MR(message reference) number to the user.
- AT+CSMP=17,,0,0
Resets back PDU type to 17 (SMS-SUBMIT + integer-type for validity), PID (protocol identifier) to 0 (standard non-converted SMS) and DCS (data coding scheme) to 0(alphabet indication, default 7-bit alphabet).
- --receive:
- Receiving of messages is performed using direct
- routing of incoming data to TE (Terminal Equipment). No SMSes
- are stored to SIM card/device memory and then read back as one
- may expect. There are slight advantages of better response times
- (SIM card access is very slow) and saving EEPROM writes to SIM
- card. Unfortunately there is one big advantage that when mdsms
- suddenly stops/crashes without switching the device back to SIM
- store mode, messages being consequently received are lost on the
- dead end of serial port. mdsms tries very hard to restore the
- device state before its termination but sometimes it just isn't
- possible. Due to this fact never kill mdsms with SIGKILL (-9)
- signal, use standard SIGTERM instead, please. Also one fact re
- sulting of this behaviour is that messages with Class-2 (SIM
- store) specific routing are really stored to SIM card and as such
- are not processed in any way by mdsms. Safer SIM store/retrieve
- mechanism may be implemented in future versions. Command sequence
- used in --receive mode follows:
- AT+CMGF=0, if fails AT+CMGF=1
Set the default SMS message format to PDUtype (preferred) or text mode (if PDU mode not available).
- AT+CNMI=,2
Set the message routing to go directly to TE(Terminal Equipment), see the discussion in paragraph above formore. Also right before starting attempt to send this command,
AT+CNMI=,0
- the original device behaviour.
AT+CSDH=0 - We aren't really much interested in addi
- tional non-standard values of PID (Protocol IDentifier), DCS (Da
- ta Coding Scheme) etc.
- data wait
- In this point the device lock file is re
- moved, retry count is set to infinite value (see discussion in
- --maxretry parameter) and mdsms starts to passively listen for
- any incoming data. Possible dial-out mode is being detected af
- terwards, otherwise message receive sequence follows as described
- below.
- +CMT: read
- Any waiting +CMT incoming message indica
- tions are read and processed. Format being processed (text/PDU)
- depends on the actual value of AT+CMGF set before. Any possible
- +CMTI: input is discarded as we are not interested in SIM-store
- directed messages.
- receive restart
- After processing all the messages, the whole
- initialization sequence is restarted as the device configuration
- may have changed or lost during the data wait phase.
SEE ALSO
- GSM 03.40
- ETSI documentation for SMS messages in GSM networks
- GNokii, tools and drivers for Nokia mobile phones
- Nokia logo data format was read from its sources:
- http:/ www.gnokii.org/
- Developers' Guide: SMS with the A1
- Tech note on PDU SMS format etc: http:/
- /www.siemens.se/telefoner/ovrigtgsm/fragorsvar/a1_sms.pdf
- Technical Description of the Siemens A1
- Siemens A1 command description http:/
- /www.siemens.se/telefoner/ovrigtgsm/fragorsvar/a1_manual.pdf
FILES
- "/etc/" "mdsms" "rc"
- Main configuration file
- $HOME "/." "mdsms" "rc"
- User personalized local configuration file
AUTHOR
- mdsms was written by Jan Kratochvil who should be respon
- sible for all the bugs included. Please see the file "AUTHORS"
- shipped with the original distribution archive for more details.
30 Oct 1999