AMISMS is a simple command-line tool written in C, which connect to a local or remote Asterisk PBX via Asterisk Manager Interface and send SMS over a USB Huawei GSM/UMTS modem via chan_dongle channel driver.
AMISMS use the asynchronous event-driven libamievent library, which is present as submodule in this repository.
- gcc, make, binutils
- libev
For Debian users:
apt-get install build-essential libev-dev
For Gentoo users:
emerge -av libev
- and access to a working system with Asterisk + chan_dongle + Huawei/ZTE dongle + SIM card.
Clone the amisms repo with all submodules. Optionally run the
./update_git_submodules script
to sync submodules.
git clone --recursive git://github.com/andrewjsi/amisms
Compile the source, test and install:
make
make test
sudo make install
The AMISMS search the configuration file at /home/YOURUSER/.smsrc default. This is an ini-style config file, which contains the AMI server credentials and the name of the dongle device. Example config file is located in the doc directory. The simplest configuration looks like this:
[device0]
host = localhost ; hostname or IP address where Asterisk is running
port = 5038 ; port where AMI is listening, see asterisk/manager.conf
username = amiuser ; name of Asterisk Manager user which have flag 'call'
password = amipassword ; plaintext password for AMI user
dongle = dongle0 ; dongle name in asterisk/chan_dongle.conf
usage: sms <phone number> <message text>
or sms [OPTIONS] <phone number> [message text]
Options
-v, --verbose verbose output to stderr
-f, --flash flash SMS
-s, --stdin read message text from stdin
Send a simple message:
sms +36201234567 "Hello, this is AMISMS"
Send kernel version to mobile phone's display:
uname -a | sms --flash --stdin +36701234567
- the PDU routines not perfect, currently only 7bit GSM charset allowed
- AMISMS can send up to 160 characters long messages, multi-part SMS not yet allowed
- only tested on Linux, but we have use this software in production environment
- UTF-8 / multibyte message text, ISO, binary, alphabets in PDU
- multi-part SMS
- smooth exit codes
- pretty error and status messages to the user
- easy to parse error and status messages to the calling program
- chan_dongle query functions (dongle state, rssi, etc..)
- manage multiple dongles and AMI servers
- better console management, stdout, stderr, verbose and debug messages
- well-written documentation
- the ability to be integrated with other systems as easy as possible
The source code is well written as far as possible. We do not use tabs, instead of 4 spaces is indented. All identifiers, including variables, function names and macros written in English, but some comments and commits in Hungarian is, because we are speaking and thinking in Hungarian. Nevertheless, we try to write everything in English in the future.
It is an open source project, which is to be better and better. If you have any ideas or find an error, or get stuck, you can contact us, please file a bug report or send a pull-request!
(C) Copyright 2010-2014 Andras Jeszenszky, JSS & Hayer IT All Rights Reserved.