ruby-smpp 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ = 0.3.0
2
+ * Added begin/rescue handling in receive_data to keep the connection alive. Delegates can implement data_error(Exception) and re-raise the error if they wish to break the connection.
3
+
1
4
  = 0.1.3
2
5
  * Transition maintenance from August to Ray Krueger
3
6
  * Changed the expected signature of transceiver delegates to use the full PDU instead of picking off attributes one by one
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.3.0
data/lib/smpp/base.rb CHANGED
@@ -88,14 +88,21 @@ module Smpp
88
88
  #not complete packet ... break
89
89
  break
90
90
  end
91
-
92
- pkt = @data.slice!(0,cmd_length)
93
91
 
94
- # parse incoming PDU
95
- pdu = read_pdu(pkt)
92
+ pkt = @data.slice!(0,cmd_length)
96
93
 
97
- # let subclass process it
98
- process_pdu(pdu) if pdu
94
+ begin
95
+ # parse incoming PDU
96
+ pdu = read_pdu(pkt)
97
+
98
+ # let subclass process it
99
+ process_pdu(pdu) if pdu
100
+ rescue Exception => e
101
+ logger.error "Error receiving data: #{e}\n#{e.backtrace.join("\n")}"
102
+ if @delegate.respond_to?(:data_error)
103
+ @delegate.data_error(e)
104
+ end
105
+ end
99
106
 
100
107
  end
101
108
  end
@@ -19,7 +19,7 @@ class Smpp::Pdu::DeliverSm < Smpp::Pdu::Base
19
19
  @destination_addr = destination_addr
20
20
  @esm_class = options[:esm_class]?options[:esm_class]:0 # default smsc mode
21
21
  @protocol_id = options[:protocol_id]?options[:protocol_id]:0
22
- @priority_flag = options[:priority_flag]?options[:priority_flag]:1
22
+ @priority_flag = options[:priority_flag]?options[:priority_flag]:0
23
23
  @schedule_delivery_time = options[:schedule_delivery_time]?options[:schedule_delivery_time]:''
24
24
  @validity_period = options[:validity_period]?options[:validity_period]:''
25
25
  @registered_delivery = options[:registered_delivery]?options[:registered_delivery]:1 # we want delivery notifications
@@ -24,7 +24,7 @@ class Smpp::Pdu::SubmitMulti < Smpp::Pdu::Base
24
24
  dest_addresses = build_destination_addresses(destination_addr_array,dest_addr_ton,dest_addr_npi,IS_SMEADDR)
25
25
  esm_class = options[:esm_class]
26
26
  protocol_id = 0
27
- priority_flag = 1
27
+ priority_flag = 0
28
28
  schedule_delivery_time = ''
29
29
  validity_period = ''
30
30
  registered_delivery = 1 # we want delivery notifications
@@ -22,7 +22,7 @@ class Smpp::Pdu::SubmitSm < Smpp::Pdu::Base
22
22
  @destination_addr = destination_addr
23
23
  @esm_class = options[:esm_class]?options[:esm_class]:0 # default smsc mode
24
24
  @protocol_id = options[:protocol_id]?options[:protocol_id]:0
25
- @priority_flag = options[:priority_flag]?options[:priority_flag]:1
25
+ @priority_flag = options[:priority_flag]?options[:priority_flag]:0
26
26
  @schedule_delivery_time = options[:schedule_delivery_time]?options[:schedule_delivery_time]:''
27
27
  @validity_period = options[:validity_period]?options[:validity_period]:''
28
28
  @registered_delivery = options[:registered_delivery]?options[:registered_delivery]:1 # we want delivery notifications
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.1"
8
+ s.version = "0.3.0"
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-15}
12
+ s.date = %q{2010-06-14}
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 = [
@@ -60,7 +60,7 @@ Gem::Specification.new do |s|
60
60
  s.rdoc_options = ["--charset=UTF-8"]
61
61
  s.require_paths = ["lib"]
62
62
  s.rubyforge_project = %q{ruby-smpp}
63
- s.rubygems_version = %q{1.3.5}
63
+ s.rubygems_version = %q{1.3.6}
64
64
  s.summary = %q{Ruby implementation of the SMPP protocol, based on EventMachine.}
65
65
  s.test_files = [
66
66
  "test/optional_parameter_test.rb",
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-smpp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 3
8
+ - 0
9
+ version: 0.3.0
5
10
  platform: ruby
6
11
  authors:
7
12
  - Ray Krueger
@@ -10,19 +15,23 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2010-02-15 00:00:00 -06:00
18
+ date: 2010-06-14 00:00:00 -05:00
14
19
  default_executable:
15
20
  dependencies:
16
21
  - !ruby/object:Gem::Dependency
17
22
  name: eventmachine
18
- type: :runtime
19
- version_requirement:
20
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
21
25
  requirements:
22
26
  - - ">="
23
27
  - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ - 10
31
+ - 0
24
32
  version: 0.10.0
25
- version:
33
+ type: :runtime
34
+ version_requirements: *id001
26
35
  description: 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.
27
36
  email: raykrueger@gmail.com
28
37
  executables: []
@@ -84,18 +93,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
84
93
  requirements:
85
94
  - - ">="
86
95
  - !ruby/object:Gem::Version
96
+ segments:
97
+ - 0
87
98
  version: "0"
88
- version:
89
99
  required_rubygems_version: !ruby/object:Gem::Requirement
90
100
  requirements:
91
101
  - - ">="
92
102
  - !ruby/object:Gem::Version
103
+ segments:
104
+ - 0
93
105
  version: "0"
94
- version:
95
106
  requirements: []
96
107
 
97
108
  rubyforge_project: ruby-smpp
98
- rubygems_version: 1.3.5
109
+ rubygems_version: 1.3.6
99
110
  signing_key:
100
111
  specification_version: 3
101
112
  summary: Ruby implementation of the SMPP protocol, based on EventMachine.