12th January 2010

ASPSMS

ASPSMS is a Switzerland-based SMS gateway featuring an XML interface, at rather low prices, and neither setup nor monthly fee. This perl script provides a convenient way to send SMS through the ASPSMS gateway, either manually from your shell, or from automated, scripted tasks such as cron jobs.

Disclaimer: I am in no way affiliated with ASPSMS / Vadian.net.

Usage

aspsms.pl [OPTIONS...] RCPTS...

Send SMS through the aspsms.com short message service gateway.

        -f FILE      Read message text from FILE instead of stdin.
        -s SENDER    Set sender/origin to SENDER (max 11 characters).
        -t           Truncate message to 160 characters (default: split)
        -v           Be verbose.

Recipient cellphone numbers RCPTS are in international format,
eg. +41XXXXXXXXX for Switzerland or +44XXXXXXXXX for the UK.

The script handles multiple recipients and knows about the multiple redundant gateway addresses at ASPSMS. Otherwise, its functionality is pretty basic. Fancy features of the XML interface — like blinking text — are not supported, nor are (non-)delivery notifications.

Configuration

The script reads the configuration file from ~/.aspsms or /etc/aspsms. Make sure to set sensible permissions (0600 is a good start).

# aspsms.pl configuration file
userkey [USERKEY]
password [PASSWORD]
sender [DEFAULT SENDER]

The option -s takes precedence over the configuration file. Userkey and password deliberately cannot be specified on the command line, as the parameters can be seen by all users on a shared system (eg. using ps auxw).

Proxy settings are read from the environment in the usual way ($http_proxy).

To Do

  • Support (non-)delivery notifications
  • Write manpage
  • Write FreeBSD port (maybe)
Ƿ