Table of Contents

Name

sendsms - a command-line client for sms_serv(1)

Synopsis

sendsms [-grvhSPQ] -d dest [-s smsc] (-m message | -f msgfile) [-u user] [-p port] [-e priority] server

Description

sendsms is the Unix command-line client for the SMSLink project. It accepts command-line parameters that define the message to be sent, and transmits them to the SMS server process running on the designated server. sendsms was developped specifically for easy calling from shell scripts or similar situations.

This manual page will cover the functionalities and use of sendsms. For installation and configuration instructions, please refer to the INSTALL document, provided in the sources directory or on the web site.

Options

-g
Turns debugging on. Will output the entire dialog with the server on stderr (and more).
-r
Reporting. Additional info will be included in the message printed on stderr (namely, the device name used by the server to send the SMS out when applicable, and the message ID attributed to the outgoing SMS [attributed by the module's SIM card when sending, by the database engine or server when queueing]). If any of these items is missing or can't be parsed, a value of "??" will be returned.
-v
Displays version information and exits.
-h
Displays a short help message and exits.
-S
After providing the server with all the elements of the Short Message to be sent, issues the server-side send command (when neither -S nor -P nor -Q are provided, this will be the default action).
-P
After providing the server with all the elements of the Short Message to be sent, issues the server-side post command (this command will attempt an immediate send, and upon failure [due to the unavailability of any GSM device or to some other error] queue the request for later delivery [on the condition that queueing is supported by the server]).
-Q
After providing the server with all the elements of the Short Message to be sent, issues the server-side queue command. In case queueing is not enabled on the server, an error message is displayed, and the program returns the 105 exit code.
-d dest
The GSM network address (i.e. phone number) of the mobile phone the message is to be sent to. Supported format is:
[int. prefix - country code] area code - phone number

The international prefix can be either "+" or "00" (or any other value supported by the GSM network provider the server is subscribed to). Some separation characters can be used to beautify the number, but they are purely cosmetic and will be stripped by the server. Those characters are [./- ]. The pause character (',') is not supported. This parameter is required.

Regarding the international country code, don't forget that its necessity is to be considered respective to the SMS gateway location (the host this client program is connecting to), not the location where the client is run from. In case of doubt, please contact the SMS server administrator for your network.

Please always include the area code (even when sending to a destination in the same "area", i.e. on the same network). The number without the area code, though syntactically correct and accepted by the network, would never get delivered (at least, that's my experience with Proximus -- YMMV).

-s smsc
This optional parameter allows you to override the default Service Center stored in the GSM module SIM. This feature is probably usefull only for non-standard applications.
-m message
The text of the message to be sent. Unless made up of a single word, it will have to be quoted for obvious reasons. Maximum length is 160 characters. A longer message will be truncated (the user will be warned about it), but the message will still be sent.

At the present time, only 7bit ASCII is supported for the message text.

Use one and only one of -m or -f.

-f msgfile
The name of a text file where the message to send is to be read from. This file can contain multiple lines of text (they will be concatenated), but its total length can't exceed 160 characters. A longer text will be truncated (the user will be warned about it), but the message will still be sent.

The special file '-' means that input will be read from stdin.

At the present time, only 7bit ASCII is supported for the message text.

Use one and only one of -m or -f.

-u user
The server module requires the user to identify himself for logging purposes. No authentication is performed on this info though. If this parameter is ommited, sendsms will send the Unix username of the current user. This parameter allows you to override this default behaviour (might be usefull in the case of automated sending). The parameter is optional.
-p port
Communication port on the target server. If provided here, this value will be used to connect to the server. If omitted, the client will query the local system for the port number associated with the "well-known service" sms (as defined in /etc/services). If that doesn't return an answer, the compiled-in default value (6701) will be used.
-e priority
Sets the processing priority on the message. This priority is meaningful only when the message is going to be queued on the server, i.e. in either POST or QUEUE mode. It is ignored when set in SEND mode. Valid priorities range from 1 (= highest) to 5 (= lowest) -- at least those are the provided defaults.
server
The host name or IP address of the computer where the SMS gateway server process is running. By default, this server will be listening on TCP port 6701.

Return Value

Upon success (when the server module reports that the message was successfully sent), sendsms returns 0. When a problem occurs, a non-zero value is returned. Different return values indicate different problems. A return value of 1 indicates a general failure of the client program. A return value of 101 indicates that no response was received from the server and a value of 102 indicates that the server failed to send the message. A return value of 103 indicates failure to get initial server prompt, and a value of 104 indicates that the server failed to acknowledge one of the "set" commands (this might be the result of an invalid or incorrectly formatted value for that "set" parameter). A return value of 105 indicates that the queueing feature is disabled on the server (the client might request queueing either as a direct result of using the -Q option, or after the immediate send attempt failed when using the -P option).

Bugs

See the BUGS document in the sources directory or the relevant section on the web site.

See Also

sms_serv(1) , gsmdevices(5) , gsmaccess(5)

The INSTALL and README documents in the sources tree.

Copyright

SMSLink is (c) Les Ateliers du Heron, 1998-2006 by Philippe Andersson <philipa STRUDEL scarlet PUNKT be>. It has been originally written for Scitex Europe, S.A.

Part of the code is (c) Riccardo Facchetti.

The code also includes contributions from Philipp Klaus <pklaus@access.ch> and numerous others. All contributors are acknowledged in the CHANGELOG document, and in the comment headers of the source files they modified.

SMSLink has been released to the public under the GNU GPL.

Home page: <http://smslink.sourceforge.net/ >


Table of Contents