Class: Smpp::Receiver

Inherits:
Base
  • Object
show all
Defined in:
lib/smpp/receiver.rb

Overview

The SMPP Receiver maintains a unidirectional connection to an SMSC. Provide a config hash with connection options to get started. See the sample_gateway.rb for examples of config values. The receiver accepts a delegate object that may implement the following (all optional) methods:

mo_received(receiver, pdu)
delivery_report_received(receiver, pdu)
bound(receiver)
unbound(receiver)

Constant Summary

Constants included from Smpp

VERSION

Instance Attribute Summary

Attributes inherited from Base

#state

Instance Method Summary collapse

Methods inherited from Base

#bound?, #initialize, #logger, logger, logger=, #post_init, #process_pdu, #receive_data, #run_callback, #send_unbind, #start_enquire_link_timer, #unbind, #unbound?

Constructor Details

This class inherits a constructor from Smpp::Base

Instance Method Details

#send_bindObject

Send BindReceiverResponse PDU.

Raises:

  • (IOError)


15
16
17
18
19
20
21
22
23
24
25
# File 'lib/smpp/receiver.rb', line 15

def send_bind
  raise IOError, 'Receiver already bound.' unless unbound?
  pdu = Pdu::BindReceiver.new(
      @config[:system_id], 
      @config[:password],
      @config[:system_type], 
      @config[:source_ton], 
      @config[:source_npi], 
      @config[:source_address_range])
  write_pdu(pdu)
end