Smshelper

THE lib for SMS-MT / HLR-Lookups.

One day i was asked to connect a crm to correspond in SMS with call center customers. Chose at random one of the operators, wrote a few lines of code and there it was - SMS inbound/outbound.

"Some of our messages aren't being delivered on time, some are being lost altogether, some arrive multiple times, some arrive after more then 24 hours from being sent"

--Your faithful customer

I kept adding operators and here are the results...

Currently supported:

  • Unicode: across all operators
    Operator#send_message#get_balance#get_status#get_callback_response#hlr_lookup
    AqlXXX
    BulksmsXXXX
    ClickatellXXX
    EsendexXXXX
    MediaburstXXX
    MycoolsmsXXXX
    NexmoXXX
    RoutomessagingXXXX**
    SmstradeXXX
    TextmagicXXX
    TraitelXX
    VianettXXXX
    WebtextXX_

** Does NOT provide handset network status, so you can't check if a subscriber is in reception zone with a switched-on handset.

Installation

gem install smshelper

Usage

require 'smshelper'
config = Smshelper::Config.new(
                               :webtext => {:uname => '', :passwd => ''},
                               :bulksms => {:uname => '', :passwd => ''},
                               :clickatell => {:api_key => '',:uname => '', :passwd => ''},
                               :textmagic => {:uname => '', :passwd => ''},
                               :smstrade => {:api_key => ''},
                               :esendex => {:uname => '', :passwd => '', :acc => ''},
                               :mediaburst => {:uname => '', :passwd => ''},
                               :nexmo => {:uname => '', :passwd => ''}
                               )

service0 = Smshelper::Api::Bulksms.new config
service1 = Smshelper::Api::Webtext.new config
service2 = Smshelper::Api::Clickatell.new config
service3 = Smshelper::Api::Textmagic.new config
service4 = Smshelper::Api::Smstrade.new config, :route => 'gold'
service5 = Smshelper::Api::Esendex.new config, 'com:validityperiod' => '1'
service6 = Smshelper::Api::MediaBurst.new config
service7 = Smshelper::Api::Nexmo.new config, :ttl => '60000'

message = Smshelper::Message.new(
                                 :recipient => '14128765432',
                                 :text => "The balance on
                                 #{serviceX.class.name} is
                                 #{serviceX.get_balance}",
                                 :sender => '33765432132')

serviceX.send_message message

Is It "Production Ready™"?

Most likely not, there are no tests yet and the API is going to change a bit until v1.0.0 release

TODO:

I welcome pull requests!