-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathreceiver.rb
More file actions
28 lines (25 loc) · 844 Bytes
/
Copy pathreceiver.rb
File metadata and controls
28 lines (25 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# -*- encoding : utf-8 -*-
# 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)
class Smpp::Receiver < Smpp::Base
# Send BindReceiverResponse PDU.
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
end