Giter Club home page Giter Club logo

ruby-smpp's Introduction

Ruby-SMPP

<img src=“https://travis-ci.org/raykrueger/ruby-smpp.png” />

DESCRIPTION:

Ruby-SMPP is a Ruby implementation of the SMPP v3.4 protocol. It is suitable for writing gateway daemons that communicate with SMSCs for sending and receiving SMS messages.

The implementation is based on the Ruby/EventMachine library.

NOTE: Breaking change from 0.1.2 to 0.1.3. See below.

For help please use the Google group here: groups.google.com/group/ruby-smpp/topics

Glossary

  • SMSC: SMS Center. Mobile operators normally operate an SMSC in their network. The SMSC stores and forwards SMS messages.

  • MO: Mobile Originated SMS: originated in a mobile phone, ie. sent by an end user.

  • MT: Mobile Terminated SMS: terminated in a mobile phone, ie. received by an end user.

  • DR: Delivery Report, or delivery notification. When you send an MT message, you should receive a DR after a while.

  • PDU: Protcol Base Unit, the data units that SMPP is comprised of. This implementation does not implement all SMPP PDUs.

Protocol

The SMPP 3.4 protocol spec can be downloaded here: smsforum.net/SMPP_v3_4_Issue1_2.zip

Testing/Sample Code

Logica provides an SMPP simulator that you can download from opensmpp.logica.com. You can also sign up for a demo SMPP account at one of the many bulk-SMS providers out there.

For a quick test, download smscsim.jar and smpp.jar from the Logica site, and start the simulator by typing:

java -cp smscsim.jar:smpp.jar com.logica.smscsim.Simulator

Then type 1 (start simulation), and enter 6000 for port number. The simulator then starts a server socket on a background thread. In another terminal window, start the sample sms gateway from the ruby-smpp/examples directory by typing:

ruby sample_gateway.rb

You will be able to send MT messages from the sample gateway terminal window by typing the message body. In the simulator terminal window you should see SMPP PDUs being sent from the sample gateway.

You can also send MO messages from the simulator to the sample gateway by typing 7 (log to screen off) and then 4 (send message). MO messages received by the sample gateway will be logged to ./sms_gateway.log.

FEATURES/PROBLEMS:

  • Implements only typical client subset of SMPP 3.4 with single-connection Transceiver.

  • Contributors are encouraged to add missing PDUs.

BASIC USAGE:

Start the transceiver. Receive delegate callbacks whenever incoming messages or delivery reports arrive. Send messages with Transceiver#send_mt.

# connect to SMSC
tx = EventMachine::run do
  $tx = EventMachine::connect(
  host,
  port,
  Smpp::Transceiver,
  config,             # a property hash
  delegate            # delegate class that will receive callbacks on MOs and DRs and other events
end

# send a message
tx.send_mt(id, from, to, body)

As of 0.1.3 the delegate method signatures are as follows:

  • mo_received(transceiver, deliver_sm_pdu)

  • delivery_report_received(transceiver, deliver_sm_pdu)

  • message_accepted(transceiver, mt_message_id, submit_sm_response_pdu)

  • message_rejected(transceiver, mt_message_id, submit_sm_response_pdu)

  • bound(transceiver)

  • unbound(transceiver)

Where ‘pdu’ above is the actual actual instance of the Smpp:Pdu

class created.

For a more complete example, see examples/sample_gateway.rb

REQUIREMENTS:

  • Eventmachine >= 0.10.0

INSTALL:

sudo gem install ruby-smpp

LICENSE:

Copyright © 2008 Apparat AS Released under the MIT license.

ruby-smpp's People

Contributors

raykrueger avatar mido18 avatar crondaemon avatar levanarabuli avatar dwilkie avatar malmckay avatar floehopper avatar lazyatom avatar uncleandy avatar parolkar avatar benders avatar puzanov avatar cornet avatar presskey avatar floehopper-and-kalv avatar tomafro avatar yury avatar zioplox11 avatar

Watchers

James Cloos avatar  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.