ruby-smpp 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
data/lib/smpp/pdu/base.rb CHANGED
@@ -67,6 +67,8 @@ module Smpp::Pdu
67
67
  OPTIONAL_RECEIPTED_MESSAGE_ID = 0x001E
68
68
  OPTIONAL_MESSAGE_STATE = 0x0427
69
69
 
70
+ SEQUENCE_MAX = 0x7FFFFFFF
71
+
70
72
  # PDU sequence number.
71
73
  @@seq = [Time.now.to_i]
72
74
 
@@ -130,7 +132,7 @@ module Smpp::Pdu
130
132
 
131
133
  def Base.next_sequence_number
132
134
  @@seq.synchronize do
133
- (@@seq[0] += 1) % 512
135
+ (@@seq[0] += 1) % SEQUENCE_MAX
134
136
  end
135
137
  end
136
138
 
data/lib/smpp/server.rb CHANGED
@@ -18,11 +18,6 @@ class Smpp::Server < Smpp::Base
18
18
  @received_messages = received_messages
19
19
  @sent_messages = sent_messages
20
20
 
21
- # Array of un-acked MT message IDs indexed by sequence number.
22
- # As soon as we receive SubmitSmResponse we will use this to find the
23
- # associated message ID, and then create a pending delivery report.
24
- @ack_ids = Array.new(512)
25
-
26
21
  ed = @config[:enquire_link_delay_secs] || 5
27
22
  comm_inactivity_timeout = [ed - 5, 3].max
28
23
  rescue Exception => ex
@@ -22,7 +22,7 @@ class Smpp::Transceiver < Smpp::Base
22
22
  # Array of un-acked MT message IDs indexed by sequence number.
23
23
  # As soon as we receive SubmitSmResponse we will use this to find the
24
24
  # associated message ID, and then create a pending delivery report.
25
- @ack_ids = Array.new(512)
25
+ @ack_ids = {}
26
26
 
27
27
  ed = @config[:enquire_link_delay_secs] || 5
28
28
  comm_inactivity_timeout = 2 * ed
@@ -136,7 +136,7 @@ class Smpp::Transceiver < Smpp::Base
136
136
  close_connection
137
137
  end
138
138
  when Pdu::SubmitSmResponse
139
- mt_message_id = @ack_ids[pdu.sequence_number]
139
+ mt_message_id = @ack_ids.delete(pdu.sequence_number)
140
140
  if !mt_message_id
141
141
  raise "Got SubmitSmResponse for unknown sequence_number: #{pdu.sequence_number}"
142
142
  end
data/ruby-smpp.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ruby-smpp}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ray Krueger", "August Z. Flatby"]
12
- s.date = %q{2010-02-11}
12
+ s.date = %q{2010-02-15}
13
13
  s.description = %q{Ruby implementation of the SMPP protocol, based on EventMachine. SMPP is a protocol that allows ordinary people outside the mobile network to exchange SMS messages directly with mobile operators.}
14
14
  s.email = %q{raykrueger@gmail.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-smpp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ray Krueger
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2010-02-11 00:00:00 -06:00
13
+ date: 2010-02-15 00:00:00 -06:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency