Class: Majoron::AntHill::SMPP::SMPPDeliverSM
- Defined in:
- lib/pdu/smpp_deliver_sm.rb
Instance Attribute Summary collapse
-
#callback_num ⇒ Object
Returns the value of attribute callback_num.
-
#callback_num_len ⇒ Object
Returns the value of attribute callback_num_len.
-
#data_coding ⇒ Object
Returns the value of attribute data_coding.
-
#dest_addr ⇒ Object
Returns the value of attribute dest_addr.
-
#dest_addr_npi ⇒ Object
Returns the value of attribute dest_addr_npi.
-
#dest_addr_ton ⇒ Object
Returns the value of attribute dest_addr_ton.
-
#dest_subaddress ⇒ Object
Returns the value of attribute dest_subaddress.
-
#dest_subaddress_len ⇒ Object
Returns the value of attribute dest_subaddress_len.
-
#destination_port ⇒ Object
Returns the value of attribute destination_port.
-
#destination_port_len ⇒ Object
Returns the value of attribute destination_port_len.
-
#esm_class ⇒ Object
Returns the value of attribute esm_class.
-
#its_session_info ⇒ Object
Returns the value of attribute its_session_info.
-
#its_session_info_len ⇒ Object
Returns the value of attribute its_session_info_len.
-
#language_indicator ⇒ Object
Returns the value of attribute language_indicator.
-
#language_indicator_len ⇒ Object
Returns the value of attribute language_indicator_len.
-
#message_payload ⇒ Object
Returns the value of attribute message_payload.
-
#message_payload_len ⇒ Object
Returns the value of attribute message_payload_len.
-
#message_state ⇒ Object
Returns the value of attribute message_state.
-
#message_state_len ⇒ Object
Returns the value of attribute message_state_len.
-
#network_error_code ⇒ Object
Returns the value of attribute network_error_code.
-
#network_error_code_len ⇒ Object
Returns the value of attribute network_error_code_len.
-
#payload_type ⇒ Object
Returns the value of attribute payload_type.
-
#payload_type_len ⇒ Object
Returns the value of attribute payload_type_len.
-
#priority_flag ⇒ Object
Returns the value of attribute priority_flag.
-
#privacy_indicator ⇒ Object
Returns the value of attribute privacy_indicator.
-
#privacy_indicator_len ⇒ Object
Returns the value of attribute privacy_indicator_len.
-
#protocol_id ⇒ Object
Returns the value of attribute protocol_id.
-
#receipted_message_id ⇒ Object
Returns the value of attribute receipted_message_id.
-
#receipted_message_id_len ⇒ Object
Returns the value of attribute receipted_message_id_len.
-
#registered_delivery ⇒ Object
Returns the value of attribute registered_delivery.
-
#replace_if_present_flag ⇒ Object
Returns the value of attribute replace_if_present_flag.
-
#sar_msg_ref_num ⇒ Object
Returns the value of attribute sar_msg_ref_num.
-
#sar_msg_ref_num_len ⇒ Object
Returns the value of attribute sar_msg_ref_num_len.
-
#sar_segment_seqnum ⇒ Object
Returns the value of attribute sar_segment_seqnum.
-
#sar_segment_seqnum_len ⇒ Object
Returns the value of attribute sar_segment_seqnum_len.
-
#sar_total_segments ⇒ Object
Returns the value of attribute sar_total_segments.
-
#sar_total_segments_len ⇒ Object
Returns the value of attribute sar_total_segments_len.
-
#schedule_delivery_time ⇒ Object
Returns the value of attribute schedule_delivery_time.
-
#service_type ⇒ Object
Mandatory fields.
-
#short_message ⇒ Object
Returns the value of attribute short_message.
-
#sm_default_msg_id ⇒ Object
Returns the value of attribute sm_default_msg_id.
-
#sm_length ⇒ Object
Returns the value of attribute sm_length.
-
#source_addr ⇒ Object
Returns the value of attribute source_addr.
-
#source_addr_npi ⇒ Object
Returns the value of attribute source_addr_npi.
-
#source_addr_ton ⇒ Object
Returns the value of attribute source_addr_ton.
-
#source_port ⇒ Object
Returns the value of attribute source_port.
-
#source_port_len ⇒ Object
Returns the value of attribute source_port_len.
-
#source_subaddress ⇒ Object
Returns the value of attribute source_subaddress.
-
#source_subaddress_len ⇒ Object
Returns the value of attribute source_subaddress_len.
-
#user_message_reference ⇒ Object
Optional fields.
-
#user_message_reference_len ⇒ Object
Optional fields length.
-
#user_response_code ⇒ Object
Returns the value of attribute user_response_code.
-
#user_response_code_len ⇒ Object
Returns the value of attribute user_response_code_len.
-
#validity_period ⇒ Object
Returns the value of attribute validity_period.
Attributes inherited from SMPPPDU
Instance Method Summary collapse
-
#decode_packet(decoder) ⇒ Object
Interface to decode SMPP packet.
-
#encode_packet(encoder) ⇒ Object
Interface to encode SMPP packet.
-
#initialize(command_status = ErrorCode::ESME_ROK, sequence_number = nil) ⇒ SMPPDeliverSM
constructor
A new instance of SMPPDeliverSM.
-
#output_packet(outputter) ⇒ Object
Interface to output SMPP packet.
-
#validate_packet(validator) ⇒ Object
Interface to validate SMPP packet.
Methods inherited from SMPPPDU
#command_id, #command_length, #command_status, #command_status=, #sequence_number, #sequence_number=
Constructor Details
#initialize(command_status = ErrorCode::ESME_ROK, sequence_number = nil) ⇒ SMPPDeliverSM
Returns a new instance of SMPPDeliverSM.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 23 def initialize(command_status = ErrorCode::ESME_ROK, sequence_number = nil) super(CommandId::CM_DELIVER_SM, command_status, sequence_number) # Mandatory fields @service_type = "" @source_addr_ton = 0 @source_addr_npi = 0 @source_addr = "" @dest_addr_ton = 0 @dest_addr_npi = 0 @dest_addr = "" @esm_class = 0 @protocol_id = 0 @priority_flag = 0 @schedule_delivery_time = "" @validity_period = "" @registered_delivery = 0 @replace_if_present_flag = 0 @data_coding = "" @sm_default_msg_id = 0 @sm_length = 0 @short_message = "" # Optional fields @user_message_reference = nil @source_port = nil @destination_port = nil @sar_msg_ref_num = nil @sar_total_segments = nil @sar_segment_seqnum = nil @user_response_code = nil @privacy_indicator = nil @payload_type = nil @message_payload = nil @callback_num = nil @source_subaddress = nil @dest_subaddress = nil @language_indicator = nil @its_session_info = nil @network_error_code = nil @message_state = nil @receipted_message_id = nil # Optional fields len @user_message_reference_len = SMPPTLVLen::WORD_LEN @source_port_len = SMPPTLVLen::WORD_LEN @destination_port_len = SMPPTLVLen::WORD_LEN @sar_msg_ref_num_len = SMPPTLVLen::WORD_LEN @sar_total_segments_len = SMPPTLVLen::BYTE_LEN @sar_segment_seqnum_len = SMPPTLVLen::BYTE_LEN @user_response_code_len = SMPPTLVLen::BYTE_LEN @privacy_indicator_len = SMPPTLVLen::BYTE_LEN @payload_type_len = SMPPTLVLen::BYTE_LEN @message_payload_len = SMPPTLVLen::ZERO_LEN @callback_num_len = SMPPTLVLen::ZERO_LEN @source_subaddress_len = SMPPTLVLen::ZERO_LEN @dest_subaddress_len = SMPPTLVLen::ZERO_LEN @language_indicator_len = SMPPTLVLen::BYTE_LEN @its_session_info_len = SMPPTLVLen::WORD_LEN @network_error_code_len = SMPPTLVLen::BYTE_LEN + SMPPTLVLen::WORD_LEN @message_state_len = SMPPTLVLen::BYTE_LEN @receipted_message_id_len = SMPPTLVLen::ZERO_LEN end |
Instance Attribute Details
#callback_num ⇒ Object
Returns the value of attribute callback_num.
425 426 427 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 425 def callback_num @callback_num end |
#callback_num_len ⇒ Object
Returns the value of attribute callback_num_len.
446 447 448 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 446 def callback_num_len @callback_num_len end |
#data_coding ⇒ Object
Returns the value of attribute data_coding.
408 409 410 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 408 def data_coding @data_coding end |
#dest_addr ⇒ Object
Returns the value of attribute dest_addr.
400 401 402 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 400 def dest_addr @dest_addr end |
#dest_addr_npi ⇒ Object
Returns the value of attribute dest_addr_npi.
399 400 401 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 399 def dest_addr_npi @dest_addr_npi end |
#dest_addr_ton ⇒ Object
Returns the value of attribute dest_addr_ton.
398 399 400 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 398 def dest_addr_ton @dest_addr_ton end |
#dest_subaddress ⇒ Object
Returns the value of attribute dest_subaddress.
427 428 429 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 427 def dest_subaddress @dest_subaddress end |
#dest_subaddress_len ⇒ Object
Returns the value of attribute dest_subaddress_len.
448 449 450 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 448 def dest_subaddress_len @dest_subaddress_len end |
#destination_port ⇒ Object
Returns the value of attribute destination_port.
417 418 419 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 417 def destination_port @destination_port end |
#destination_port_len ⇒ Object
Returns the value of attribute destination_port_len.
438 439 440 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 438 def destination_port_len @destination_port_len end |
#esm_class ⇒ Object
Returns the value of attribute esm_class.
401 402 403 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 401 def esm_class @esm_class end |
#its_session_info ⇒ Object
Returns the value of attribute its_session_info.
429 430 431 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 429 def its_session_info @its_session_info end |
#its_session_info_len ⇒ Object
Returns the value of attribute its_session_info_len.
450 451 452 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 450 def its_session_info_len @its_session_info_len end |
#language_indicator ⇒ Object
Returns the value of attribute language_indicator.
428 429 430 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 428 def language_indicator @language_indicator end |
#language_indicator_len ⇒ Object
Returns the value of attribute language_indicator_len.
449 450 451 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 449 def language_indicator_len @language_indicator_len end |
#message_payload ⇒ Object
Returns the value of attribute message_payload.
424 425 426 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 424 def @message_payload end |
#message_payload_len ⇒ Object
Returns the value of attribute message_payload_len.
445 446 447 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 445 def @message_payload_len end |
#message_state ⇒ Object
Returns the value of attribute message_state.
431 432 433 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 431 def @message_state end |
#message_state_len ⇒ Object
Returns the value of attribute message_state_len.
452 453 454 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 452 def @message_state_len end |
#network_error_code ⇒ Object
Returns the value of attribute network_error_code.
430 431 432 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 430 def network_error_code @network_error_code end |
#network_error_code_len ⇒ Object
Returns the value of attribute network_error_code_len.
451 452 453 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 451 def network_error_code_len @network_error_code_len end |
#payload_type ⇒ Object
Returns the value of attribute payload_type.
423 424 425 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 423 def payload_type @payload_type end |
#payload_type_len ⇒ Object
Returns the value of attribute payload_type_len.
444 445 446 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 444 def payload_type_len @payload_type_len end |
#priority_flag ⇒ Object
Returns the value of attribute priority_flag.
403 404 405 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 403 def priority_flag @priority_flag end |
#privacy_indicator ⇒ Object
Returns the value of attribute privacy_indicator.
422 423 424 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 422 def privacy_indicator @privacy_indicator end |
#privacy_indicator_len ⇒ Object
Returns the value of attribute privacy_indicator_len.
443 444 445 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 443 def privacy_indicator_len @privacy_indicator_len end |
#protocol_id ⇒ Object
Returns the value of attribute protocol_id.
402 403 404 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 402 def protocol_id @protocol_id end |
#receipted_message_id ⇒ Object
Returns the value of attribute receipted_message_id.
432 433 434 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 432 def @receipted_message_id end |
#receipted_message_id_len ⇒ Object
Returns the value of attribute receipted_message_id_len.
453 454 455 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 453 def @receipted_message_id_len end |
#registered_delivery ⇒ Object
Returns the value of attribute registered_delivery.
406 407 408 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 406 def registered_delivery @registered_delivery end |
#replace_if_present_flag ⇒ Object
Returns the value of attribute replace_if_present_flag.
407 408 409 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 407 def replace_if_present_flag @replace_if_present_flag end |
#sar_msg_ref_num ⇒ Object
Returns the value of attribute sar_msg_ref_num.
418 419 420 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 418 def sar_msg_ref_num @sar_msg_ref_num end |
#sar_msg_ref_num_len ⇒ Object
Returns the value of attribute sar_msg_ref_num_len.
439 440 441 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 439 def sar_msg_ref_num_len @sar_msg_ref_num_len end |
#sar_segment_seqnum ⇒ Object
Returns the value of attribute sar_segment_seqnum.
420 421 422 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 420 def sar_segment_seqnum @sar_segment_seqnum end |
#sar_segment_seqnum_len ⇒ Object
Returns the value of attribute sar_segment_seqnum_len.
441 442 443 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 441 def sar_segment_seqnum_len @sar_segment_seqnum_len end |
#sar_total_segments ⇒ Object
Returns the value of attribute sar_total_segments.
419 420 421 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 419 def sar_total_segments @sar_total_segments end |
#sar_total_segments_len ⇒ Object
Returns the value of attribute sar_total_segments_len.
440 441 442 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 440 def sar_total_segments_len @sar_total_segments_len end |
#schedule_delivery_time ⇒ Object
Returns the value of attribute schedule_delivery_time.
404 405 406 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 404 def schedule_delivery_time @schedule_delivery_time end |
#service_type ⇒ Object
Mandatory fields
394 395 396 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 394 def service_type @service_type end |
#short_message ⇒ Object
Returns the value of attribute short_message.
411 412 413 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 411 def @short_message end |
#sm_default_msg_id ⇒ Object
Returns the value of attribute sm_default_msg_id.
409 410 411 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 409 def sm_default_msg_id @sm_default_msg_id end |
#sm_length ⇒ Object
Returns the value of attribute sm_length.
410 411 412 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 410 def sm_length @sm_length end |
#source_addr ⇒ Object
Returns the value of attribute source_addr.
397 398 399 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 397 def source_addr @source_addr end |
#source_addr_npi ⇒ Object
Returns the value of attribute source_addr_npi.
396 397 398 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 396 def source_addr_npi @source_addr_npi end |
#source_addr_ton ⇒ Object
Returns the value of attribute source_addr_ton.
395 396 397 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 395 def source_addr_ton @source_addr_ton end |
#source_port ⇒ Object
Returns the value of attribute source_port.
416 417 418 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 416 def source_port @source_port end |
#source_port_len ⇒ Object
Returns the value of attribute source_port_len.
437 438 439 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 437 def source_port_len @source_port_len end |
#source_subaddress ⇒ Object
Returns the value of attribute source_subaddress.
426 427 428 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 426 def source_subaddress @source_subaddress end |
#source_subaddress_len ⇒ Object
Returns the value of attribute source_subaddress_len.
447 448 449 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 447 def source_subaddress_len @source_subaddress_len end |
#user_message_reference ⇒ Object
Optional fields
415 416 417 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 415 def @user_message_reference end |
#user_message_reference_len ⇒ Object
Optional fields length
436 437 438 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 436 def @user_message_reference_len end |
#user_response_code ⇒ Object
Returns the value of attribute user_response_code.
421 422 423 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 421 def user_response_code @user_response_code end |
#user_response_code_len ⇒ Object
Returns the value of attribute user_response_code_len.
442 443 444 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 442 def user_response_code_len @user_response_code_len end |
#validity_period ⇒ Object
Returns the value of attribute validity_period.
405 406 407 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 405 def validity_period @validity_period end |
Instance Method Details
#decode_packet(decoder) ⇒ Object
Interface to decode SMPP packet
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 151 def decode_packet(decoder) # Decode header and mandatory fields @header = decoder.decode_header() @service_type = decoder.decode_service_type(command_length()) @source_addr_ton = decoder.decode_source_addr_ton(command_length()) @source_addr_npi = decoder.decode_source_addr_npi(command_length()) @source_addr = decoder.decode_source_addr21(command_length()) @dest_addr_ton = decoder.decode_dest_addr_ton(command_length()) @dest_addr_npi = decoder.decode_dest_addr_npi(command_length()) @dest_addr = decoder.decode_dest_addr21(command_length()) @esm_class = decoder.decode_esm_class(command_length()) @protocol_id = decoder.decode_protocol_id(command_length()) @priority_flag = decoder.decode_priority_flag(command_length()) @schedule_delivery_time = decoder.decode_schedule_delivery_time(command_length()) @validity_period = decoder.decode_validity_period(command_length()) @registered_delivery = decoder.decode_registered_delivery(command_length()) @replace_if_present_flag = decoder.decode_replace_if_present_flag(command_length()) @data_coding = decoder.decode_data_coding(command_length()) @sm_default_msg_id = decoder.decode_sm_default_msg_id(command_length()) @sm_length = decoder.decode_sm_length(command_length()) @short_message = decoder.(@sm_length, command_length()) # Decode optional fields while decoder.has_tlvs() case decoder.get_tlv_code() when OptTags::TAG_USER_MESSAGE_REFERENCE @user_message_reference, @user_message_reference_len = decoder.(command_length()) when OptTags::TAG_SOURCE_PORT @source_port, @source_port_len = decoder.decode_source_port(command_length()) when OptTags::TAG_DESTINATION_PORT @destination_port, @destination_port_len = decoder.decode_destination_port(command_length()) when OptTags::TAG_SAR_MSG_REF_NUM @sar_msg_ref_num, @sar_msg_ref_num_len = decoder.decode_sar_msg_ref_num(command_length()) when OptTags::TAG_SAR_TOTAL_SEGMENTS @sar_total_segments, @sar_total_segments_len = decoder.decode_sar_total_segments(command_length()) when OptTags::TAG_SAR_SEGMENT_SEQNUM @sar_segment_seqnum, @sar_segment_seqnum_len = decoder.decode_sar_segment_seqnum(command_length()) when OptTags::TAG_USER_RESPONSE_CODE @user_response_code, @user_response_code_len = decoder.decode_user_response_code(command_length()) when OptTags::TAG_PRIVACY_INDICATOR @privacy_indicator, @privacy_indicator_len = decoder.decode_privacy_indicator(command_length()) when OptTags::TAG_PAYLOAD_TYPE @payload_type, @payload_type_len = decoder.decode_payload_type(command_length()) when OptTags::TAG_MESSAGE_PAYLOAD @message_payload, @message_payload_len = decoder.(command_length()) when OptTags::TAG_CALLBACK_NUM @callback_num, @callback_num_len = decoder.decode_callback_num(command_length()) when OptTags::TAG_SOURCE_SUBADDRESS @source_subaddress, @source_subaddress_len = decoder.decode_source_subaddress(command_length()) when OptTags::TAG_DEST_SUBADDRESS @dest_subaddress, @dest_subaddress_len = decoder.decode_dest_subaddress(command_length()) when OptTags::TAG_LANGUAGE_INDICATOR @language_indicator, @language_indicator_len = decoder.decode_language_indicator(command_length()) when OptTags::TAG_ITS_SESSION_INFO @its_session_info, @its_session_info_len = decoder.decode_its_session_info(command_length()) when OptTags::TAG_NETWORK_ERROR_CODE @network_error_code, @network_error_code_len = decoder.decode_network_error_code(command_length()) when OptTags::TAG_MESSAGE_STATE @message_state, @message_state_len = decoder.(command_length()) when OptTags::TAG_RECEIPTED_MESSAGE_ID @receipted_message_id, @receipted_message_id_len = decoder.(command_length()) else # Report about error raise Errors::UNKNOWN_TAG_MSG + decoder.get_tlv_error() end end end |
#encode_packet(encoder) ⇒ Object
Interface to encode SMPP packet
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 88 def encode_packet(encoder) # Encode header and mandatory fields encoder.encode_header(@header) encoder.encode_service_type(@service_type) encoder.encode_source_addr_ton(@source_addr_ton) encoder.encode_source_addr_npi(@source_addr_npi) encoder.encode_source_addr21(@source_addr) encoder.encode_dest_addr_ton(@dest_addr_ton) encoder.encode_dest_addr_npi(@dest_addr_npi) encoder.encode_dest_addr21(@dest_addr) encoder.encode_esm_class(@esm_class) encoder.encode_protocol_id(@protocol_id) encoder.encode_priority_flag(@priority_flag) encoder.encode_schedule_delivery_time(@schedule_delivery_time) encoder.encode_validity_period(@validity_period) encoder.encode_registered_delivery(@registered_delivery) encoder.encode_replace_if_present_flag(@replace_if_present_flag) encoder.encode_data_coding(@data_coding) encoder.encode_sm_default_msg_id(@sm_default_msg_id) encoder.encode_sm_length(@sm_length) encoder.(@short_message) # Encode optional fields encoder.(@user_message_reference, @user_message_reference_len) if !@user_message_reference.nil? encoder.encode_source_port(@source_port, @source_port_len) if !@source_port.nil? encoder.encode_destination_port(@destination_port, @destination_port_len) if !@destination_port.nil? encoder.encode_sar_msg_ref_num(@sar_msg_ref_num, @sar_msg_ref_num_len) if !@sar_msg_ref_num.nil? encoder.encode_sar_total_segments(@sar_total_segments, @sar_total_segments_len) if !@sar_total_segments.nil? encoder.encode_sar_segment_seqnum(@sar_segment_seqnum, @sar_segment_seqnum_len) if !@sar_segment_seqnum.nil? encoder.encode_user_response_code(@user_response_code, @user_response_code_len) if !@user_response_code.nil? encoder.encode_privacy_indicator(@privacy_indicator, @privacy_indicator_len) if !@privacy_indicator.nil? encoder.encode_payload_type(@payload_type, @payload_type_len) if !@payload_type.nil? encoder.(@message_payload, @message_payload_len) if !@message_payload.nil? encoder.encode_callback_num(@callback_num, @callback_num_len) if !@callback_num.nil? encoder.encode_source_subaddress(@source_subaddress, @source_subaddress_len) if !@source_subaddress.nil? encoder.encode_dest_subaddress(@dest_subaddress, @dest_subaddress_len) if !@dest_subaddress.nil? encoder.encode_language_indicator(@language_indicator, @language_indicator_len) if !@language_indicator.nil? encoder.encode_its_session_info(@its_session_info, @its_session_info_len) if !@its_session_info.nil? encoder.encode_network_error_code(@network_error_code, @network_error_code_len) if !@network_error_code.nil? encoder.(@message_state, @message_state_len) if !@message_state.nil? encoder.(@receipted_message_id, @receipted_message_id_len) if !@receipted_message_id.nil? end |
#output_packet(outputter) ⇒ Object
Interface to output SMPP packet
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 305 def output_packet(outputter) # Output header and mandatory fields outputter.output_header(@header) outputter.output_service_type(@service_type) outputter.output_source_addr_ton(@source_addr_ton) outputter.output_source_addr_npi(@source_addr_npi) outputter.output_source_addr21(@source_addr) outputter.output_dest_addr_ton(@dest_addr_ton) outputter.output_dest_addr_npi(@dest_addr_npi) outputter.output_dest_addr21(@dest_addr) outputter.output_esm_class(@esm_class) outputter.output_protocol_id(@protocol_id) outputter.output_priority_flag(@priority_flag) outputter.output_schedule_delivery_time(@schedule_delivery_time) outputter.output_validity_period(@validity_period) outputter.output_registered_delivery(@registered_delivery) outputter.output_replace_if_present_flag(@replace_if_present_flag) outputter.output_data_coding(@data_coding) outputter.output_sm_default_msg_id(@sm_default_msg_id) outputter.output_sm_length(@sm_length) outputter.(@short_message) # Output optional fields outputter.(@user_message_reference, @user_message_reference_len) if !@user_message_reference.nil? outputter.output_source_port(@source_port, @source_port_len) if !@source_port.nil? outputter.output_destination_port(@destination_port, @destination_port_len) if !@destination_port.nil? outputter.output_sar_msg_ref_num(@sar_msg_ref_num, @sar_msg_ref_num_len) if !@sar_msg_ref_num.nil? outputter.output_sar_total_segments(@sar_total_segments, @sar_total_segments_len) if !@sar_total_segments.nil? outputter.output_sar_segment_seqnum(@sar_segment_seqnum, @sar_segment_seqnum_len) if !@sar_segment_seqnum.nil? outputter.output_user_response_code(@user_response_code, @user_response_code_len) if !@user_response_code.nil? outputter.output_privacy_indicator(@privacy_indicator, @privacy_indicator_len) if !@privacy_indicator.nil? outputter.output_payload_type(@payload_type, @payload_type_len) if !@payload_type.nil? outputter.(@message_payload, @message_payload_len) if !@message_payload.nil? outputter.output_callback_num(@callback_num, @callback_num_len) if !@callback_num.nil? outputter.output_source_subaddress(@source_subaddress, @source_subaddress_len) if !@source_subaddress.nil? outputter.output_dest_subaddress(@dest_subaddress, @dest_subaddress_len) if !@dest_subaddress.nil? outputter.output_language_indicator(@language_indicator, @language_indicator_len) if !@language_indicator.nil? outputter.output_its_session_info(@its_session_info, @its_session_info_len) if !@its_session_info.nil? outputter.output_network_error_code(@network_error_code, @network_error_code_len) if !@network_error_code.nil? outputter.(@message_state, @message_state_len) if !@message_state.nil? outputter.(@receipted_message_id, @receipted_message_id_len) if !@receipted_message_id.nil? end |
#validate_packet(validator) ⇒ Object
Interface to validate SMPP packet
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
# File 'lib/pdu/smpp_deliver_sm.rb', line 238 def validate_packet(validator) # Validate header and mandatory fields validator.validate_header(@header) validator.validate_service_type(@service_type) validator.validate_source_addr_ton(@source_addr_ton) validator.validate_source_addr_npi(@source_addr_npi) validator.validate_source_addr21(@source_addr) validator.validate_dest_addr_ton(@dest_addr_ton) validator.validate_dest_addr_npi(@dest_addr_npi) validator.validate_dest_addr21(@dest_addr) validator.validate_esm_class(@esm_class) validator.validate_protocol_id(@protocol_id) validator.validate_priority_flag(@priority_flag) validator.validate_schedule_delivery_time(@schedule_delivery_time) validator.validate_validity_period(@validity_period) validator.validate_registered_delivery(@registered_delivery) validator.validate_replace_if_present_flag(@replace_if_present_flag) validator.validate_data_coding(@data_coding) validator.validate_sm_default_msg_id(@sm_default_msg_id) validator.validate_sm_length(@sm_length) validator.(@short_message) # Validate optional fields validator.(@user_message_reference, @user_message_reference_len) if !@user_message_reference.nil? validator.validate_source_port(@source_port, @source_port_len) if !@source_port.nil? validator.validate_destination_port(@destination_port, @destination_port_len) if !@destination_port.nil? validator.validate_sar_msg_ref_num(@sar_msg_ref_num, @sar_msg_ref_num_len) if !@sar_msg_ref_num.nil? validator.validate_sar_total_segments(@sar_total_segments, @sar_total_segments_len) if !@sar_total_segments.nil? validator.validate_sar_segment_seqnum(@sar_segment_seqnum, @sar_segment_seqnum_len) if !@sar_segment_seqnum.nil? validator.validate_user_response_code(@user_response_code, @user_response_code_len) if !@user_response_code.nil? validator.validate_privacy_indicator(@privacy_indicator, @privacy_indicator_len) if !@privacy_indicator.nil? validator.validate_payload_type(@payload_type, @payload_type_len) if !@payload_type.nil? validator.(@message_payload, @message_payload_len) if !@message_payload.nil? validator.validate_callback_num(@callback_num, @callback_num_len) if !@callback_num.nil? validator.validate_source_subaddress(@source_subaddress, @source_subaddress_len) if !@source_subaddress.nil? validator.validate_dest_subaddress(@dest_subaddress, @dest_subaddress_len) if !@dest_subaddress.nil? validator.validate_language_indicator(@language_indicator, @language_indicator_len) if !@language_indicator.nil? validator.validate_its_session_info(@its_session_info, @its_session_info_len) if !@its_session_info.nil? validator.validate_network_error_code(@network_error_code, @network_error_code_len) if !@network_error_code.nil? validator.(@message_state, @message_state_len) if !@message_state.nil? validator.(@receipted_message_id, @receipted_message_id_len) if !@receipted_message_id.nil? # Validate complex rules validator.(@short_message, @message_payload) if !@message_payload.nil? end |