Giter Site home page Giter Site logo

amisms's Introduction

SMS Sender via Asterisk chan_dongle

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.

Requirements

  • 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.

Install

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

Configuration

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

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

Example

Send a simple message:

sms +36201234567 "Hello, this is AMISMS"

Send kernel version to mobile phone's display:

uname -a | sms --flash --stdin +36701234567

Known bugs

Caveats

  • 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

Todo, Future

  • 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

Source code

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.

Contribution

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!

License

GPL2

(C) Copyright 2010-2014 Andras Jeszenszky, JSS & Hayer IT All Rights Reserved.

amisms's People

Contributors

andrewjsi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.