anthill_smpp_ruby 0.5.1
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/MIT-LICENSE +21 -0
- data/README +30 -0
- data/anthill_smpp_ruby.gemspec +18 -0
- data/changelog +43 -0
- data/data/dumps/random_command.dump +1 -0
- data/data/dumps/smpp_alert_notification.dump +1 -0
- data/data/dumps/smpp_bind_receiver.dump +1 -0
- data/data/dumps/smpp_bind_receiver_resp.dump +1 -0
- data/data/dumps/smpp_bind_transceiver.dump +1 -0
- data/data/dumps/smpp_bind_transceiver_1.dump +2 -0
- data/data/dumps/smpp_bind_transceiver_resp.dump +1 -0
- data/data/dumps/smpp_bind_transmitter.dump +1 -0
- data/data/dumps/smpp_bind_transmitter_resp.dump +1 -0
- data/data/dumps/smpp_broadcast_sm.dump +1 -0
- data/data/dumps/smpp_broadcast_sm_resp.dump +1 -0
- data/data/dumps/smpp_cancel_broadcast_sm.dump +1 -0
- data/data/dumps/smpp_cancel_broadcast_sm_resp.dump +1 -0
- data/data/dumps/smpp_cancel_sm.dump +1 -0
- data/data/dumps/smpp_cancel_sm_resp.dump +1 -0
- data/data/dumps/smpp_data_sm.dump +1 -0
- data/data/dumps/smpp_data_sm_resp.dump +1 -0
- data/data/dumps/smpp_deliver_sm.dump +1 -0
- data/data/dumps/smpp_deliver_sm_resp.dump +1 -0
- data/data/dumps/smpp_enquire_link.dump +1 -0
- data/data/dumps/smpp_enquire_link_resp.dump +1 -0
- data/data/dumps/smpp_generic_nack.dump +1 -0
- data/data/dumps/smpp_outbind.dump +1 -0
- data/data/dumps/smpp_query_broadcast_sm.dump +1 -0
- data/data/dumps/smpp_query_broadcast_sm_resp.dump +1 -0
- data/data/dumps/smpp_query_broadcast_sm_resp_1.dump +1 -0
- data/data/dumps/smpp_query_sm.dump +1 -0
- data/data/dumps/smpp_query_sm_resp.dump +1 -0
- data/data/dumps/smpp_replace_sm.dump +1 -0
- data/data/dumps/smpp_replace_sm_resp.dump +1 -0
- data/data/dumps/smpp_submit_multi.dump +1 -0
- data/data/dumps/smpp_submit_multi_resp.dump +1 -0
- data/data/dumps/smpp_submit_sm.dump +1 -0
- data/data/dumps/smpp_submit_sm_resp.dump +1 -0
- data/data/dumps/smpp_unbind.dump +1 -0
- data/data/dumps/smpp_unbind_resp.dump +1 -0
- data/data/pdus/random_command.xml +35 -0
- data/data/pdus/smpp_alert_notification.xml +14 -0
- data/data/pdus/smpp_alert_notification_no_optional.xml +13 -0
- data/data/pdus/smpp_bind_receiver.xml +17 -0
- data/data/pdus/smpp_bind_receiver_resp.xml +12 -0
- data/data/pdus/smpp_bind_receiver_resp_no_optional.xml +11 -0
- data/data/pdus/smpp_bind_transceiver.xml +17 -0
- data/data/pdus/smpp_bind_transceiver_resp.xml +12 -0
- data/data/pdus/smpp_bind_transceiver_resp_no_optional.xml +11 -0
- data/data/pdus/smpp_bind_transmitter.xml +17 -0
- data/data/pdus/smpp_bind_transmitter_resp.xml +12 -0
- data/data/pdus/smpp_bind_transmitter_resp_no_optional.xml +11 -0
- data/data/pdus/smpp_broadcast_sm.xml +47 -0
- data/data/pdus/smpp_broadcast_sm_no_optional.xml +26 -0
- data/data/pdus/smpp_broadcast_sm_resp.xml +14 -0
- data/data/pdus/smpp_broadcast_sm_resp_no_optional.xml +8 -0
- data/data/pdus/smpp_cancel_broadcast_sm.xml +17 -0
- data/data/pdus/smpp_cancel_broadcast_sm_no_optional.xml +15 -0
- data/data/pdus/smpp_cancel_broadcast_sm_resp.xml +7 -0
- data/data/pdus/smpp_cancel_sm.xml +18 -0
- data/data/pdus/smpp_cancel_sm_resp.xml +10 -0
- data/data/pdus/smpp_commands.xsd +914 -0
- data/data/pdus/smpp_data_sm.xml +58 -0
- data/data/pdus/smpp_data_sm_no_optional.xml +17 -0
- data/data/pdus/smpp_data_sm_resp.xml +15 -0
- data/data/pdus/smpp_data_sm_resp_no_optional.xml +8 -0
- data/data/pdus/smpp_deliver_sm.xml +46 -0
- data/data/pdus/smpp_deliver_sm_no_optional.xml +25 -0
- data/data/pdus/smpp_deliver_sm_resp.xml +14 -0
- data/data/pdus/smpp_deliver_sm_resp_no_optional.xml +8 -0
- data/data/pdus/smpp_enquire_link.xml +10 -0
- data/data/pdus/smpp_enquire_link_resp.xml +10 -0
- data/data/pdus/smpp_generic_nack.xml +10 -0
- data/data/pdus/smpp_outbind.xml +12 -0
- data/data/pdus/smpp_query_broadcast_sm.xml +12 -0
- data/data/pdus/smpp_query_broadcast_sm_no_optional.xml +11 -0
- data/data/pdus/smpp_query_broadcast_sm_resp.xml +17 -0
- data/data/pdus/smpp_query_broadcast_sm_resp_no_optional.xml +15 -0
- data/data/pdus/smpp_query_sm.xml +11 -0
- data/data/pdus/smpp_query_sm_resp.xml +11 -0
- data/data/pdus/smpp_replace_sm.xml +18 -0
- data/data/pdus/smpp_replace_sm_no_optional.xml +17 -0
- data/data/pdus/smpp_replace_sm_resp.xml +7 -0
- data/data/pdus/smpp_submit_multi.xml +73 -0
- data/data/pdus/smpp_submit_multi_no_optional.xml +51 -0
- data/data/pdus/smpp_submit_multi_resp.xml +35 -0
- data/data/pdus/smpp_submit_sm.xml +57 -0
- data/data/pdus/smpp_submit_sm_no_optional.xml +28 -0
- data/data/pdus/smpp_submit_sm_resp.xml +8 -0
- data/data/pdus/smpp_unbind.xml +10 -0
- data/data/pdus/smpp_unbind_resp.xml +10 -0
- data/examples/dump_viewer.rb +298 -0
- data/examples/pdu_composer.rb +1331 -0
- data/knownbugs +24 -0
- data/lib/anthill_smpp_ruby.rb +83 -0
- data/lib/i_smpp_outputter.rb +425 -0
- data/lib/pdu/smpp_alert_notification.rb +132 -0
- data/lib/pdu/smpp_bind.rb +102 -0
- data/lib/pdu/smpp_bind_receiver.rb +29 -0
- data/lib/pdu/smpp_bind_receiver_resp.rb +30 -0
- data/lib/pdu/smpp_bind_resp.rb +100 -0
- data/lib/pdu/smpp_bind_transceiver.rb +29 -0
- data/lib/pdu/smpp_bind_transceiver_resp.rb +31 -0
- data/lib/pdu/smpp_bind_transmitter.rb +29 -0
- data/lib/pdu/smpp_bind_transmitter_resp.rb +30 -0
- data/lib/pdu/smpp_broadcast_sm.rb +566 -0
- data/lib/pdu/smpp_broadcast_sm_resp.rb +130 -0
- data/lib/pdu/smpp_cancel_broadcast_sm.rb +143 -0
- data/lib/pdu/smpp_cancel_broadcast_sm_resp.rb +60 -0
- data/lib/pdu/smpp_cancel_sm.rb +110 -0
- data/lib/pdu/smpp_cancel_sm_resp.rb +60 -0
- data/lib/pdu/smpp_data_sm.rb +679 -0
- data/lib/pdu/smpp_data_sm_resp.rb +148 -0
- data/lib/pdu/smpp_deliver_sm.rb +458 -0
- data/lib/pdu/smpp_deliver_sm_resp.rb +137 -0
- data/lib/pdu/smpp_enquire_link.rb +59 -0
- data/lib/pdu/smpp_enquire_link_resp.rb +61 -0
- data/lib/pdu/smpp_generic_nack.rb +61 -0
- data/lib/pdu/smpp_outbind.rb +71 -0
- data/lib/pdu/smpp_pdu.rb +90 -0
- data/lib/pdu/smpp_query_broadcast_sm.rb +120 -0
- data/lib/pdu/smpp_query_broadcast_sm_resp.rb +192 -0
- data/lib/pdu/smpp_query_sm.rb +92 -0
- data/lib/pdu/smpp_query_sm_resp.rb +92 -0
- data/lib/pdu/smpp_replace_sm.rb +172 -0
- data/lib/pdu/smpp_replace_sm_resp.rb +61 -0
- data/lib/pdu/smpp_resp.rb +40 -0
- data/lib/pdu/smpp_submit_multi.rb +517 -0
- data/lib/pdu/smpp_submit_multi_resp.rb +90 -0
- data/lib/pdu/smpp_submit_sm.rb +591 -0
- data/lib/pdu/smpp_submit_sm_resp.rb +72 -0
- data/lib/pdu/smpp_unbind.rb +60 -0
- data/lib/pdu/smpp_unbind_resp.rb +61 -0
- data/lib/smpp_constants.rb +917 -0
- data/lib/smpp_csv_outputter.rb +1601 -0
- data/lib/smpp_datatypes.rb +89 -0
- data/lib/smpp_decoder.rb +627 -0
- data/lib/smpp_encoder.rb +495 -0
- data/lib/smpp_hex_outputter.rb +36 -0
- data/lib/smpp_outputter_base.rb +315 -0
- data/lib/smpp_structures.rb +98 -0
- data/lib/smpp_txt_outputter.rb +1895 -0
- data/lib/smpp_validator.rb +373 -0
- data/lib/smpp_xml_outputter.rb +34 -0
- data/roadmap +18 -0
- data/setup.rb +1585 -0
- data/test/anthill_smpp_test.rb +29 -0
- data/test/smpp_codec_test.rb +30 -0
- data/test/smpp_datatypes_test.rb +69 -0
- data/test/smpp_outputter_test.rb +1261 -0
- data/test/smpp_parsing_test.rb +1758 -0
- data/test/smpp_rawdump_test.rb +2095 -0
- data/test/smpp_validator_test.rb +441 -0
- metadata +206 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright 2007 Majoron.com (developers@majoron.com)
|
|
3
|
+
# Original sources are available at www.majoron.com
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
#
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
module Majoron
|
|
20
|
+
module AntHill
|
|
21
|
+
module SMPP
|
|
22
|
+
class SMPPBroadcastSMResp < SMPPResp
|
|
23
|
+
# Constructor.
|
|
24
|
+
def initialize(command_status = ErrorCode::ESME_ROK, sequence_number = nil)
|
|
25
|
+
super(CommandId::CM_BROADCAST_SM_RESP, command_status, sequence_number)
|
|
26
|
+
|
|
27
|
+
# Mandatory fields
|
|
28
|
+
@message_id = ""
|
|
29
|
+
|
|
30
|
+
# Optional fields
|
|
31
|
+
@broadcast_error_status = nil
|
|
32
|
+
@failed_broadcast_area_identifier = nil
|
|
33
|
+
|
|
34
|
+
# Optional fields len
|
|
35
|
+
@broadcast_error_status_len = SMPPTLVLen::DWORD_LEN
|
|
36
|
+
@failed_broadcast_area_identifier_len = SMPPTLVLen::ZERO_LEN
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Interface to encode SMPP packet
|
|
40
|
+
def encode_packet(encoder)
|
|
41
|
+
# Encode header and mandatory fields
|
|
42
|
+
encoder.encode_header(@header)
|
|
43
|
+
encoder.encode_message_id(@message_id)
|
|
44
|
+
|
|
45
|
+
# Encode optional fields
|
|
46
|
+
encoder.encode_broadcast_error_status(@broadcast_error_status,
|
|
47
|
+
@broadcast_error_status_len) if !@broadcast_error_status.nil?
|
|
48
|
+
encoder.encode_failed_broadcast_area_identifier(@failed_broadcast_area_identifier,
|
|
49
|
+
@failed_broadcast_area_identifier_len) if !@failed_broadcast_area_identifier.nil?
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Interface to decode SMPP packet
|
|
53
|
+
def decode_packet(decoder)
|
|
54
|
+
# Decode header and mandatory fields
|
|
55
|
+
@header = decoder.decode_header()
|
|
56
|
+
@message_id = decoder.decode_message_id(command_length())
|
|
57
|
+
|
|
58
|
+
# Decode optional fields
|
|
59
|
+
while decoder.has_tlvs()
|
|
60
|
+
case decoder.get_tlv_code()
|
|
61
|
+
when OptTags::TAG_BROADCAST_ERROR_STATUS
|
|
62
|
+
@broadcast_error_status, @broadcast_error_status_len =
|
|
63
|
+
decoder.decode_broadcast_error_status(command_length())
|
|
64
|
+
when OptTags::TAG_BROADCAST_AREA_IDENTIFIER
|
|
65
|
+
id, len = decoder.decode_failed_broadcast_area_identifier(command_length())
|
|
66
|
+
if @failed_broadcast_area_identifier.nil? || @failed_broadcast_area_identifier_len.nil?
|
|
67
|
+
@failed_broadcast_area_identifier = []
|
|
68
|
+
@failed_broadcast_area_identifier_len = []
|
|
69
|
+
end
|
|
70
|
+
@failed_broadcast_area_identifier << id
|
|
71
|
+
@failed_broadcast_area_identifier_len << len
|
|
72
|
+
else
|
|
73
|
+
# Report about error
|
|
74
|
+
raise Errors::UNKNOWN_TAG_MSG + decoder.get_tlv_error()
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Interface to validate SMPP packet
|
|
80
|
+
def validate_packet(validator)
|
|
81
|
+
# Validate header and mandatory fields
|
|
82
|
+
validator.validate_header(@header)
|
|
83
|
+
validator.validate_message_id(@message_id)
|
|
84
|
+
|
|
85
|
+
# Validate optional fields
|
|
86
|
+
validator.validate_broadcast_error_status(@broadcast_error_status,
|
|
87
|
+
@broadcast_error_status_len) if !@broadcast_error_status.nil?
|
|
88
|
+
validator.validate_failed_broadcast_area_identifier(@failed_broadcast_area_identifier,
|
|
89
|
+
@failed_broadcast_area_identifier_len) if !@failed_broadcast_area_identifier.nil?
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Interface to output SMPP packet
|
|
93
|
+
def output_packet(outputter)
|
|
94
|
+
# Output header and mandatory fields
|
|
95
|
+
outputter.output_header(@header)
|
|
96
|
+
outputter.output_message_id(@message_id)
|
|
97
|
+
|
|
98
|
+
# Output optional fields
|
|
99
|
+
outputter.output_broadcast_error_status(@broadcast_error_status,
|
|
100
|
+
@broadcast_error_status_len) if !@broadcast_error_status.nil?
|
|
101
|
+
outputter.output_failed_broadcast_area_identifier(@failed_broadcast_area_identifier,
|
|
102
|
+
@failed_broadcast_area_identifier_len) if !@failed_broadcast_area_identifier.nil?
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
public
|
|
106
|
+
def failed_broadcast_area_identifier=(failed_broadcast_area_identifier)
|
|
107
|
+
@failed_broadcast_area_identifier = failed_broadcast_area_identifier
|
|
108
|
+
@failed_broadcast_area_identifier_len = []
|
|
109
|
+
0.upto(failed_broadcast_area_identifier.size() -1) do | i |
|
|
110
|
+
@failed_broadcast_area_identifier_len << failed_broadcast_area_identifier[i].value.size()
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
public
|
|
116
|
+
# Mandatory fields
|
|
117
|
+
attr_accessor :message_id
|
|
118
|
+
|
|
119
|
+
# Optional fields
|
|
120
|
+
attr_accessor :broadcast_error_status
|
|
121
|
+
attr_reader :failed_broadcast_area_identifier
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
# Optional fields length
|
|
125
|
+
attr_accessor :broadcast_error_status_len
|
|
126
|
+
attr_accessor :failed_broadcast_area_identifier_len
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
end
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright 2007 Majoron.com (developers@majoron.com)
|
|
3
|
+
# Original sources are available at www.majoron.com
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
#
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
module Majoron
|
|
20
|
+
module AntHill
|
|
21
|
+
module SMPP
|
|
22
|
+
class SMPPCancelBroadcastSM < SMPPPDU
|
|
23
|
+
def initialize(command_status = ErrorCode::ESME_ROK, sequence_number = nil)
|
|
24
|
+
super(CommandId::CM_CANCEL_BROADCAST_SM, command_status, sequence_number)
|
|
25
|
+
|
|
26
|
+
# Mandatory fields
|
|
27
|
+
@service_type = ""
|
|
28
|
+
@message_id = ""
|
|
29
|
+
@source_addr_ton = TON::UNKNOWN
|
|
30
|
+
@source_addr_npi = NPI::UNKNOWN
|
|
31
|
+
@source_addr = ""
|
|
32
|
+
|
|
33
|
+
# Optional fields
|
|
34
|
+
@broadcast_content_type = nil
|
|
35
|
+
@user_message_reference = nil
|
|
36
|
+
|
|
37
|
+
# Optional fields length
|
|
38
|
+
@broadcast_content_type_len = SMPPTLVLen::ZERO_LEN
|
|
39
|
+
@user_message_reference_len = SMPPTLVLen::WORD_LEN
|
|
40
|
+
|
|
41
|
+
end
|
|
42
|
+
# Interface to encode SMPP packet
|
|
43
|
+
def encode_packet(encoder)
|
|
44
|
+
# Encode header and mandatory fields
|
|
45
|
+
encoder.encode_header(@header)
|
|
46
|
+
encoder.encode_service_type(@service_type)
|
|
47
|
+
encoder.encode_message_id(@message_id)
|
|
48
|
+
encoder.encode_source_addr_ton(@source_addr_ton)
|
|
49
|
+
encoder.encode_source_addr_npi(@source_addr_npi)
|
|
50
|
+
encoder.encode_source_addr21(@source_addr)
|
|
51
|
+
|
|
52
|
+
# Encode optional fields
|
|
53
|
+
encoder.encode_broadcast_content_type(@broadcast_content_type,
|
|
54
|
+
@broadcast_content_type_len) if !@broadcast_content_type.nil?
|
|
55
|
+
encoder.encode_user_message_reference(@user_message_reference,
|
|
56
|
+
@user_message_reference_len) if !@user_message_reference.nil?
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Interface to decode SMPP packet
|
|
60
|
+
def decode_packet(decoder)
|
|
61
|
+
# Decode header and mandatory fields
|
|
62
|
+
@header = decoder.decode_header()
|
|
63
|
+
@service_type = decoder.decode_service_type(command_length())
|
|
64
|
+
@message_id = decoder.decode_message_id(command_length())
|
|
65
|
+
@source_addr_ton = decoder.decode_source_addr_ton(command_length())
|
|
66
|
+
@source_addr_npi = decoder.decode_source_addr_npi(command_length())
|
|
67
|
+
@source_addr = decoder.decode_source_addr21(command_length())
|
|
68
|
+
|
|
69
|
+
# Decode optional fields
|
|
70
|
+
while decoder.has_tlvs()
|
|
71
|
+
case decoder.get_tlv_code()
|
|
72
|
+
when OptTags::TAG_BROADCAST_CONTENT_TYPE
|
|
73
|
+
@broadcast_content_type, @broadcast_content_type_len =
|
|
74
|
+
decoder.decode_broadcast_content_type(command_length())
|
|
75
|
+
when OptTags::TAG_USER_MESSAGE_REFERENCE
|
|
76
|
+
@user_message_reference, @user_message_reference_len =
|
|
77
|
+
decoder.decode_user_message_reference(command_length())
|
|
78
|
+
else
|
|
79
|
+
# Report about error
|
|
80
|
+
raise Errors::UNKNOWN_TAG_MSG + decoder.get_tlv_error()
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Interface to validate SMPP packet
|
|
86
|
+
def validate_packet(validator)
|
|
87
|
+
# Validate header and mandatory fields
|
|
88
|
+
validator.validate_header(@header)
|
|
89
|
+
validator.validate_service_type(@service_type)
|
|
90
|
+
validator.validate_message_id(@message_id)
|
|
91
|
+
validator.validate_source_addr_ton(@source_addr_ton)
|
|
92
|
+
validator.validate_source_addr_npi(@source_addr_npi)
|
|
93
|
+
validator.validate_source_addr21(@source_addr)
|
|
94
|
+
|
|
95
|
+
# Validate optional fields
|
|
96
|
+
validator.validate_broadcast_content_type(@broadcast_content_type,
|
|
97
|
+
@broadcast_content_type_len) if !@broadcast_content_type.nil?
|
|
98
|
+
validator.validate_user_message_reference(@user_message_reference,
|
|
99
|
+
@user_message_reference_len) if !@user_message_reference.nil?
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Interface to output SMPP packet
|
|
103
|
+
def output_packet(outputter)
|
|
104
|
+
# Output header and mandatory fields
|
|
105
|
+
outputter.output_header(@header)
|
|
106
|
+
outputter.output_service_type(@service_type)
|
|
107
|
+
outputter.output_message_id(@message_id)
|
|
108
|
+
outputter.output_source_addr_ton(@source_addr_ton)
|
|
109
|
+
outputter.output_source_addr_npi(@source_addr_npi)
|
|
110
|
+
outputter.output_source_addr21(@source_addr)
|
|
111
|
+
|
|
112
|
+
# Output optional fields
|
|
113
|
+
outputter.output_broadcast_content_type_opt(@broadcast_content_type,
|
|
114
|
+
@broadcast_content_type_len) if !@broadcast_content_type.nil?
|
|
115
|
+
outputter.output_user_message_reference(@user_message_reference,
|
|
116
|
+
@user_message_reference_len) if !@user_message_reference.nil?
|
|
117
|
+
end
|
|
118
|
+
public
|
|
119
|
+
def broadcast_content_type=(broadcast_content_type)
|
|
120
|
+
@broadcast_content_type = broadcast_content_type
|
|
121
|
+
@broadcast_content_type_len = broadcast_content_type.size()
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
public
|
|
126
|
+
# Mandatory fields
|
|
127
|
+
attr_accessor :service_type
|
|
128
|
+
attr_accessor :message_id
|
|
129
|
+
attr_accessor :source_addr_ton
|
|
130
|
+
attr_accessor :source_addr_npi
|
|
131
|
+
attr_accessor :source_addr
|
|
132
|
+
|
|
133
|
+
# Optional fields
|
|
134
|
+
attr_reader :broadcast_content_type
|
|
135
|
+
attr_accessor :user_message_reference
|
|
136
|
+
|
|
137
|
+
# Optional fields length
|
|
138
|
+
attr_accessor :broadcast_content_type_len
|
|
139
|
+
attr_accessor :user_message_reference_len
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright 2007 Majoron.com (developers@majoron.com)
|
|
3
|
+
# Original sources are available at www.majoron.com
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
#
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
module Majoron
|
|
20
|
+
module AntHill
|
|
21
|
+
module SMPP
|
|
22
|
+
class SMPPCancelBroadcastSMResp < SMPPResp
|
|
23
|
+
# Constructor.
|
|
24
|
+
def initialize(command_status = ErrorCode::ESME_ROK, sequence_number = nil)
|
|
25
|
+
super(CommandId::CM_CANCEL_BROADCAST_SM_RESP, command_status, sequence_number)
|
|
26
|
+
end
|
|
27
|
+
# Interface to encode SMPP packet
|
|
28
|
+
def encode_packet(encoder)
|
|
29
|
+
# Encode header and mandatory fields
|
|
30
|
+
encoder.encode_header(@header)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Interface to decode SMPP packet
|
|
34
|
+
def decode_packet(decoder)
|
|
35
|
+
# Decode header and mandatory fields
|
|
36
|
+
@header = decoder.decode_header()
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Interface to validate SMPP packet
|
|
40
|
+
def validate_packet(validator)
|
|
41
|
+
# Validate header and mandatory fields
|
|
42
|
+
validator.validate_header(@header)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Interface to output SMPP packet
|
|
46
|
+
def output_packet(outputter)
|
|
47
|
+
# Output header and mandatory fields
|
|
48
|
+
outputter.output_header(@header)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
public
|
|
52
|
+
# Mandatory fields
|
|
53
|
+
|
|
54
|
+
# Optional fields
|
|
55
|
+
|
|
56
|
+
# Optional fields length
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright 2007 Majoron.com (developers@majoron.com)
|
|
3
|
+
# Original sources are available at www.majoron.com
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
#
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
module Majoron
|
|
20
|
+
module AntHill
|
|
21
|
+
module SMPP
|
|
22
|
+
class SMPPCancelSM < SMPPPDU
|
|
23
|
+
def initialize(command_status = ErrorCode::ESME_ROK, sequence_number = nil)
|
|
24
|
+
super(CommandId::CM_CANCEL_SM, command_status, sequence_number)
|
|
25
|
+
|
|
26
|
+
# Mandatory fields
|
|
27
|
+
@service_type = ""
|
|
28
|
+
@message_id = ""
|
|
29
|
+
@source_addr_ton = TON::UNKNOWN
|
|
30
|
+
@source_addr_npi = NPI::UNKNOWN
|
|
31
|
+
@source_addr = ""
|
|
32
|
+
@dest_addr_ton = TON::UNKNOWN
|
|
33
|
+
@dest_addr_npi = NPI::UNKNOWN
|
|
34
|
+
@dest_addr = ""
|
|
35
|
+
|
|
36
|
+
end
|
|
37
|
+
# Interface to encode SMPP packet
|
|
38
|
+
def encode_packet(encoder)
|
|
39
|
+
# Encode header and mandatory fields
|
|
40
|
+
encoder.encode_header(@header)
|
|
41
|
+
encoder.encode_service_type(service_type)
|
|
42
|
+
encoder.encode_message_id(message_id)
|
|
43
|
+
encoder.encode_source_addr_ton(source_addr_ton)
|
|
44
|
+
encoder.encode_source_addr_npi(source_addr_npi)
|
|
45
|
+
encoder.encode_source_addr21(source_addr)
|
|
46
|
+
encoder.encode_dest_addr_ton(dest_addr_ton)
|
|
47
|
+
encoder.encode_dest_addr_npi(dest_addr_npi)
|
|
48
|
+
encoder.encode_dest_addr21(dest_addr)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Interface to decode SMPP packet
|
|
52
|
+
def decode_packet(decoder)
|
|
53
|
+
# Decode header and mandatory fields
|
|
54
|
+
@header = decoder.decode_header()
|
|
55
|
+
@service_type = decoder.decode_service_type(command_length())
|
|
56
|
+
@message_id = decoder.decode_message_id(command_length())
|
|
57
|
+
@source_addr_ton = decoder.decode_source_addr_ton(command_length())
|
|
58
|
+
@source_addr_npi = decoder.decode_source_addr_npi(command_length())
|
|
59
|
+
@source_addr = decoder.decode_source_addr21(command_length())
|
|
60
|
+
@dest_addr_ton = decoder.decode_source_addr_ton(command_length())
|
|
61
|
+
@dest_addr_npi = decoder.decode_source_addr_npi(command_length())
|
|
62
|
+
@dest_addr = decoder.decode_source_addr21(command_length())
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Interface to validate SMPP packet
|
|
66
|
+
def validate_packet(validator)
|
|
67
|
+
# Validate header and mandatory fields
|
|
68
|
+
validator.validate_header(@header)
|
|
69
|
+
validator.validate_service_type(service_type)
|
|
70
|
+
validator.validate_message_id(message_id)
|
|
71
|
+
validator.validate_source_addr_ton(source_addr_ton)
|
|
72
|
+
validator.validate_source_addr_npi(source_addr_npi)
|
|
73
|
+
validator.validate_source_addr21(source_addr)
|
|
74
|
+
validator.validate_dest_addr_ton(dest_addr_ton)
|
|
75
|
+
validator.validate_dest_addr_npi(dest_addr_npi)
|
|
76
|
+
validator.validate_dest_addr21(dest_addr)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Interface to output SMPP packet
|
|
80
|
+
def output_packet(outputter)
|
|
81
|
+
# Output header and mandatory fields
|
|
82
|
+
outputter.output_header(@header)
|
|
83
|
+
outputter.output_service_type(service_type)
|
|
84
|
+
outputter.output_message_id(message_id)
|
|
85
|
+
outputter.output_source_addr_ton(source_addr_ton)
|
|
86
|
+
outputter.output_source_addr_npi(source_addr_npi)
|
|
87
|
+
outputter.output_source_addr21(source_addr)
|
|
88
|
+
outputter.output_dest_addr_ton(dest_addr_ton)
|
|
89
|
+
outputter.output_dest_addr_npi(dest_addr_npi)
|
|
90
|
+
outputter.output_dest_addr21(dest_addr)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
public
|
|
94
|
+
# Mandatory fields
|
|
95
|
+
attr_accessor :service_type
|
|
96
|
+
attr_accessor :message_id
|
|
97
|
+
attr_accessor :source_addr_ton
|
|
98
|
+
attr_accessor :source_addr_npi
|
|
99
|
+
attr_accessor :source_addr
|
|
100
|
+
attr_accessor :dest_addr_ton
|
|
101
|
+
attr_accessor :dest_addr_npi
|
|
102
|
+
attr_accessor :dest_addr
|
|
103
|
+
|
|
104
|
+
# Optional fields
|
|
105
|
+
|
|
106
|
+
# Optional fields length
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright 2007 Majoron.com (developers@majoron.com)
|
|
3
|
+
# Original sources are available at www.majoron.com
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
#
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
module Majoron
|
|
20
|
+
module AntHill
|
|
21
|
+
module SMPP
|
|
22
|
+
class SMPPCancelSMResp < SMPPResp
|
|
23
|
+
# Constructor.
|
|
24
|
+
def initialize(command_status = ErrorCode::ESME_ROK, sequence_number = nil)
|
|
25
|
+
super(CommandId::CM_CANCEL_SM_RESP, command_status, sequence_number)
|
|
26
|
+
end
|
|
27
|
+
# Interface to encode SMPP packet
|
|
28
|
+
def encode_packet(encoder)
|
|
29
|
+
# Encode header and mandatory fields
|
|
30
|
+
encoder.encode_header(@header)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Interface to decode SMPP packet
|
|
34
|
+
def decode_packet(decoder)
|
|
35
|
+
# Decode header and mandatory fields
|
|
36
|
+
@header = decoder.decode_header()
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Interface to validate SMPP packet
|
|
40
|
+
def validate_packet(validator)
|
|
41
|
+
# Validate header and mandatory fields
|
|
42
|
+
validator.validate_header(@header)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Interface to output SMPP packet
|
|
46
|
+
def output_packet(outputter)
|
|
47
|
+
# Output header and mandatory fields
|
|
48
|
+
outputter.output_header(@header)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
public
|
|
52
|
+
# Mandatory fields
|
|
53
|
+
|
|
54
|
+
# Optional fields
|
|
55
|
+
|
|
56
|
+
# Optional fields length
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|