Class: Majoron::AntHill::SMPP::SMPPSubmitMulti
- Defined in:
- lib/pdu/smpp_submit_multi.rb
Instance Attribute Summary collapse
-
#alert_on_msg_delivery ⇒ Object
Returns the value of attribute alert_on_msg_delivery.
-
#alert_on_msg_delivery_len ⇒ Object
Returns the value of attribute alert_on_msg_delivery_len.
-
#callback_num ⇒ Object
Returns the value of attribute callback_num.
-
#callback_num_atag ⇒ Object
Returns the value of attribute callback_num_atag.
-
#callback_num_atag_len ⇒ Object
Returns the value of attribute callback_num_atag_len.
-
#callback_num_len ⇒ Object
Returns the value of attribute callback_num_len.
-
#callback_num_pres_ind ⇒ Object
Returns the value of attribute callback_num_pres_ind.
-
#callback_num_pres_ind_len ⇒ Object
Returns the value of attribute callback_num_pres_ind_len.
-
#data_coding ⇒ Object
Returns the value of attribute data_coding.
-
#dest_addr_subunit ⇒ Object
Returns the value of attribute dest_addr_subunit.
-
#dest_addr_subunit_len ⇒ Object
Returns the value of attribute dest_addr_subunit_len.
-
#dest_addresses ⇒ Object
Returns the value of attribute dest_addresses.
-
#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.
-
#display_time ⇒ Object
Returns the value of attribute display_time.
-
#display_time_len ⇒ Object
Returns the value of attribute display_time_len.
-
#esm_class ⇒ Object
Returns the value of attribute esm_class.
-
#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.
-
#ms_msg_wait_facilities ⇒ Object
Returns the value of attribute ms_msg_wait_facilities.
-
#ms_msg_wait_facilities_len ⇒ Object
Returns the value of attribute ms_msg_wait_facilities_len.
-
#ms_validity ⇒ Object
Returns the value of attribute ms_validity.
-
#ms_validity_len ⇒ Object
Returns the value of attribute ms_validity_len.
-
#number_of_dest ⇒ Object
Returns the value of attribute number_of_dest.
-
#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.
-
#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.
-
#sms_signal ⇒ Object
Returns the value of attribute sms_signal.
-
#sms_signal_len ⇒ Object
Returns the value of attribute sms_signal_len.
-
#source_addr ⇒ Object
Returns the value of attribute source_addr.
-
#source_addr_npi ⇒ Object
Returns the value of attribute source_addr_npi.
-
#source_addr_subunit ⇒ Object
Returns the value of attribute source_addr_subunit.
-
#source_addr_subunit_len ⇒ Object
Returns the value of attribute source_addr_subunit_len.
-
#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.
-
#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) ⇒ SMPPSubmitMulti
constructor
A new instance of SMPPSubmitMulti.
-
#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) ⇒ SMPPSubmitMulti
Returns a new instance of SMPPSubmitMulti.
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 87 88 89 90 91 92 93 94 |
# File 'lib/pdu/smpp_submit_multi.rb', line 24 def initialize(command_status = ErrorCode::ESME_ROK, sequence_number = nil) super(CommandId::CM_SUBMIT_MULTI, command_status, sequence_number) # Mandatory fields @service_type = 0 @source_addr_ton = TON::UNKNOWN @source_addr_npi = NPI::UNKNOWN @source_addr = "" @number_of_dest = 0 @dest_addresses = [] @esm_class = 0 @protocol_id = 0 @priority_flag = 0 @schedule_delivery_time = "" @validity_period = "" @registered_delivery = 0 @replace_if_present_flag = 0 @data_coding = 0 @sm_default_msg_id = 0 @sm_length = 0 @short_message = "" # Optional fields @user_message_reference = nil @source_port = nil @source_addr_subunit = nil @destination_port = nil @dest_addr_subunit = nil @sar_msg_ref_num = nil @sar_total_segments = nil @sar_segment_seqnum = nil @payload_type = nil @message_payload = nil @privacy_indicator = nil @callback_num = nil @callback_num_pres_ind = nil @callback_num_atag = nil @source_subaddress = nil @dest_subaddress = nil @display_time = nil @sms_signal = nil @ms_validity = nil @ms_msg_wait_facilities = nil @alert_on_msg_delivery = nil @language_indicator = nil # Optional fields length @user_message_reference_len = SMPPTLVLen::WORD_LEN @source_port_len = SMPPTLVLen::WORD_LEN @source_addr_subunit_len = SMPPTLVLen::BYTE_LEN @destination_port_len = SMPPTLVLen::WORD_LEN @dest_addr_subunit_len = SMPPTLVLen::BYTE_LEN @sar_msg_ref_num_len = SMPPTLVLen::WORD_LEN @sar_total_segments_len = SMPPTLVLen::BYTE_LEN @sar_segment_seqnum_len = SMPPTLVLen::BYTE_LEN @payload_type_len = SMPPTLVLen::BYTE_LEN @message_payload_len = SMPPTLVLen::ZERO_LEN @privacy_indicator_len = SMPPTLVLen::BYTE_LEN @callback_num_len = SMPPTLVLen::ZERO_LEN @callback_num_pres_ind_len = SMPPTLVLen::BYTE_LEN @callback_num_atag_len = SMPPTLVLen::ZERO_LEN @source_subaddress_len = SMPPTLVLen::ZERO_LEN @dest_subaddress_len = SMPPTLVLen::ZERO_LEN @display_time_len = SMPPTLVLen::BYTE_LEN @sms_signal_len = SMPPTLVLen::WORD_LEN @ms_validity_len = SMPPTLVLen::BYTE_LEN @ms_msg_wait_facilities_len = SMPPTLVLen::BYTE_LEN @alert_on_msg_delivery_len = SMPPTLVLen::BYTE_LEN @language_indicator_len = SMPPTLVLen::BYTE_LEN end |
Instance Attribute Details
#alert_on_msg_delivery ⇒ Object
Returns the value of attribute alert_on_msg_delivery.
488 489 490 |
# File 'lib/pdu/smpp_submit_multi.rb', line 488 def alert_on_msg_delivery @alert_on_msg_delivery end |
#alert_on_msg_delivery_len ⇒ Object
Returns the value of attribute alert_on_msg_delivery_len.
512 513 514 |
# File 'lib/pdu/smpp_submit_multi.rb', line 512 def alert_on_msg_delivery_len @alert_on_msg_delivery_len end |
#callback_num ⇒ Object
Returns the value of attribute callback_num.
479 480 481 |
# File 'lib/pdu/smpp_submit_multi.rb', line 479 def callback_num @callback_num end |
#callback_num_atag ⇒ Object
Returns the value of attribute callback_num_atag.
481 482 483 |
# File 'lib/pdu/smpp_submit_multi.rb', line 481 def callback_num_atag @callback_num_atag end |
#callback_num_atag_len ⇒ Object
Returns the value of attribute callback_num_atag_len.
505 506 507 |
# File 'lib/pdu/smpp_submit_multi.rb', line 505 def callback_num_atag_len @callback_num_atag_len end |
#callback_num_len ⇒ Object
Returns the value of attribute callback_num_len.
503 504 505 |
# File 'lib/pdu/smpp_submit_multi.rb', line 503 def callback_num_len @callback_num_len end |
#callback_num_pres_ind ⇒ Object
Returns the value of attribute callback_num_pres_ind.
480 481 482 |
# File 'lib/pdu/smpp_submit_multi.rb', line 480 def callback_num_pres_ind @callback_num_pres_ind end |
#callback_num_pres_ind_len ⇒ Object
Returns the value of attribute callback_num_pres_ind_len.
504 505 506 |
# File 'lib/pdu/smpp_submit_multi.rb', line 504 def callback_num_pres_ind_len @callback_num_pres_ind_len end |
#data_coding ⇒ Object
Returns the value of attribute data_coding.
461 462 463 |
# File 'lib/pdu/smpp_submit_multi.rb', line 461 def data_coding @data_coding end |
#dest_addr_subunit ⇒ Object
Returns the value of attribute dest_addr_subunit.
472 473 474 |
# File 'lib/pdu/smpp_submit_multi.rb', line 472 def dest_addr_subunit @dest_addr_subunit end |
#dest_addr_subunit_len ⇒ Object
Returns the value of attribute dest_addr_subunit_len.
496 497 498 |
# File 'lib/pdu/smpp_submit_multi.rb', line 496 def dest_addr_subunit_len @dest_addr_subunit_len end |
#dest_addresses ⇒ Object
Returns the value of attribute dest_addresses.
453 454 455 |
# File 'lib/pdu/smpp_submit_multi.rb', line 453 def dest_addresses @dest_addresses end |
#dest_subaddress ⇒ Object
Returns the value of attribute dest_subaddress.
483 484 485 |
# File 'lib/pdu/smpp_submit_multi.rb', line 483 def dest_subaddress @dest_subaddress end |
#dest_subaddress_len ⇒ Object
Returns the value of attribute dest_subaddress_len.
507 508 509 |
# File 'lib/pdu/smpp_submit_multi.rb', line 507 def dest_subaddress_len @dest_subaddress_len end |
#destination_port ⇒ Object
Returns the value of attribute destination_port.
471 472 473 |
# File 'lib/pdu/smpp_submit_multi.rb', line 471 def destination_port @destination_port end |
#destination_port_len ⇒ Object
Returns the value of attribute destination_port_len.
495 496 497 |
# File 'lib/pdu/smpp_submit_multi.rb', line 495 def destination_port_len @destination_port_len end |
#display_time ⇒ Object
Returns the value of attribute display_time.
484 485 486 |
# File 'lib/pdu/smpp_submit_multi.rb', line 484 def display_time @display_time end |
#display_time_len ⇒ Object
Returns the value of attribute display_time_len.
508 509 510 |
# File 'lib/pdu/smpp_submit_multi.rb', line 508 def display_time_len @display_time_len end |
#esm_class ⇒ Object
Returns the value of attribute esm_class.
454 455 456 |
# File 'lib/pdu/smpp_submit_multi.rb', line 454 def esm_class @esm_class end |
#language_indicator ⇒ Object
Returns the value of attribute language_indicator.
489 490 491 |
# File 'lib/pdu/smpp_submit_multi.rb', line 489 def language_indicator @language_indicator end |
#language_indicator_len ⇒ Object
Returns the value of attribute language_indicator_len.
513 514 515 |
# File 'lib/pdu/smpp_submit_multi.rb', line 513 def language_indicator_len @language_indicator_len end |
#message_payload ⇒ Object
Returns the value of attribute message_payload.
477 478 479 |
# File 'lib/pdu/smpp_submit_multi.rb', line 477 def @message_payload end |
#message_payload_len ⇒ Object
Returns the value of attribute message_payload_len.
501 502 503 |
# File 'lib/pdu/smpp_submit_multi.rb', line 501 def @message_payload_len end |
#ms_msg_wait_facilities ⇒ Object
Returns the value of attribute ms_msg_wait_facilities.
487 488 489 |
# File 'lib/pdu/smpp_submit_multi.rb', line 487 def ms_msg_wait_facilities @ms_msg_wait_facilities end |
#ms_msg_wait_facilities_len ⇒ Object
Returns the value of attribute ms_msg_wait_facilities_len.
511 512 513 |
# File 'lib/pdu/smpp_submit_multi.rb', line 511 def ms_msg_wait_facilities_len @ms_msg_wait_facilities_len end |
#ms_validity ⇒ Object
Returns the value of attribute ms_validity.
486 487 488 |
# File 'lib/pdu/smpp_submit_multi.rb', line 486 def ms_validity @ms_validity end |
#ms_validity_len ⇒ Object
Returns the value of attribute ms_validity_len.
510 511 512 |
# File 'lib/pdu/smpp_submit_multi.rb', line 510 def ms_validity_len @ms_validity_len end |
#number_of_dest ⇒ Object
Returns the value of attribute number_of_dest.
452 453 454 |
# File 'lib/pdu/smpp_submit_multi.rb', line 452 def number_of_dest @number_of_dest end |
#payload_type ⇒ Object
Returns the value of attribute payload_type.
476 477 478 |
# File 'lib/pdu/smpp_submit_multi.rb', line 476 def payload_type @payload_type end |
#payload_type_len ⇒ Object
Returns the value of attribute payload_type_len.
500 501 502 |
# File 'lib/pdu/smpp_submit_multi.rb', line 500 def payload_type_len @payload_type_len end |
#priority_flag ⇒ Object
Returns the value of attribute priority_flag.
456 457 458 |
# File 'lib/pdu/smpp_submit_multi.rb', line 456 def priority_flag @priority_flag end |
#privacy_indicator ⇒ Object
Returns the value of attribute privacy_indicator.
478 479 480 |
# File 'lib/pdu/smpp_submit_multi.rb', line 478 def privacy_indicator @privacy_indicator end |
#privacy_indicator_len ⇒ Object
Returns the value of attribute privacy_indicator_len.
502 503 504 |
# File 'lib/pdu/smpp_submit_multi.rb', line 502 def privacy_indicator_len @privacy_indicator_len end |
#protocol_id ⇒ Object
Returns the value of attribute protocol_id.
455 456 457 |
# File 'lib/pdu/smpp_submit_multi.rb', line 455 def protocol_id @protocol_id end |
#registered_delivery ⇒ Object
Returns the value of attribute registered_delivery.
459 460 461 |
# File 'lib/pdu/smpp_submit_multi.rb', line 459 def registered_delivery @registered_delivery end |
#replace_if_present_flag ⇒ Object
Returns the value of attribute replace_if_present_flag.
460 461 462 |
# File 'lib/pdu/smpp_submit_multi.rb', line 460 def replace_if_present_flag @replace_if_present_flag end |
#sar_msg_ref_num ⇒ Object
Returns the value of attribute sar_msg_ref_num.
473 474 475 |
# File 'lib/pdu/smpp_submit_multi.rb', line 473 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.
497 498 499 |
# File 'lib/pdu/smpp_submit_multi.rb', line 497 def sar_msg_ref_num_len @sar_msg_ref_num_len end |
#sar_segment_seqnum ⇒ Object
Returns the value of attribute sar_segment_seqnum.
475 476 477 |
# File 'lib/pdu/smpp_submit_multi.rb', line 475 def sar_segment_seqnum @sar_segment_seqnum end |
#sar_segment_seqnum_len ⇒ Object
Returns the value of attribute sar_segment_seqnum_len.
499 500 501 |
# File 'lib/pdu/smpp_submit_multi.rb', line 499 def sar_segment_seqnum_len @sar_segment_seqnum_len end |
#sar_total_segments ⇒ Object
Returns the value of attribute sar_total_segments.
474 475 476 |
# File 'lib/pdu/smpp_submit_multi.rb', line 474 def sar_total_segments @sar_total_segments end |
#sar_total_segments_len ⇒ Object
Returns the value of attribute sar_total_segments_len.
498 499 500 |
# File 'lib/pdu/smpp_submit_multi.rb', line 498 def sar_total_segments_len @sar_total_segments_len end |
#schedule_delivery_time ⇒ Object
Returns the value of attribute schedule_delivery_time.
457 458 459 |
# File 'lib/pdu/smpp_submit_multi.rb', line 457 def schedule_delivery_time @schedule_delivery_time end |
#service_type ⇒ Object
Mandatory fields
448 449 450 |
# File 'lib/pdu/smpp_submit_multi.rb', line 448 def service_type @service_type end |
#short_message ⇒ Object
Returns the value of attribute short_message.
464 465 466 |
# File 'lib/pdu/smpp_submit_multi.rb', line 464 def @short_message end |
#sm_default_msg_id ⇒ Object
Returns the value of attribute sm_default_msg_id.
462 463 464 |
# File 'lib/pdu/smpp_submit_multi.rb', line 462 def sm_default_msg_id @sm_default_msg_id end |
#sm_length ⇒ Object
Returns the value of attribute sm_length.
463 464 465 |
# File 'lib/pdu/smpp_submit_multi.rb', line 463 def sm_length @sm_length end |
#sms_signal ⇒ Object
Returns the value of attribute sms_signal.
485 486 487 |
# File 'lib/pdu/smpp_submit_multi.rb', line 485 def sms_signal @sms_signal end |
#sms_signal_len ⇒ Object
Returns the value of attribute sms_signal_len.
509 510 511 |
# File 'lib/pdu/smpp_submit_multi.rb', line 509 def sms_signal_len @sms_signal_len end |
#source_addr ⇒ Object
Returns the value of attribute source_addr.
451 452 453 |
# File 'lib/pdu/smpp_submit_multi.rb', line 451 def source_addr @source_addr end |
#source_addr_npi ⇒ Object
Returns the value of attribute source_addr_npi.
450 451 452 |
# File 'lib/pdu/smpp_submit_multi.rb', line 450 def source_addr_npi @source_addr_npi end |
#source_addr_subunit ⇒ Object
Returns the value of attribute source_addr_subunit.
470 471 472 |
# File 'lib/pdu/smpp_submit_multi.rb', line 470 def source_addr_subunit @source_addr_subunit end |
#source_addr_subunit_len ⇒ Object
Returns the value of attribute source_addr_subunit_len.
494 495 496 |
# File 'lib/pdu/smpp_submit_multi.rb', line 494 def source_addr_subunit_len @source_addr_subunit_len end |
#source_addr_ton ⇒ Object
Returns the value of attribute source_addr_ton.
449 450 451 |
# File 'lib/pdu/smpp_submit_multi.rb', line 449 def source_addr_ton @source_addr_ton end |
#source_port ⇒ Object
Returns the value of attribute source_port.
469 470 471 |
# File 'lib/pdu/smpp_submit_multi.rb', line 469 def source_port @source_port end |
#source_port_len ⇒ Object
Returns the value of attribute source_port_len.
493 494 495 |
# File 'lib/pdu/smpp_submit_multi.rb', line 493 def source_port_len @source_port_len end |
#source_subaddress ⇒ Object
Returns the value of attribute source_subaddress.
482 483 484 |
# File 'lib/pdu/smpp_submit_multi.rb', line 482 def source_subaddress @source_subaddress end |
#source_subaddress_len ⇒ Object
Returns the value of attribute source_subaddress_len.
506 507 508 |
# File 'lib/pdu/smpp_submit_multi.rb', line 506 def source_subaddress_len @source_subaddress_len end |
#user_message_reference ⇒ Object
Optional fields
468 469 470 |
# File 'lib/pdu/smpp_submit_multi.rb', line 468 def @user_message_reference end |
#user_message_reference_len ⇒ Object
Optional fields length
492 493 494 |
# File 'lib/pdu/smpp_submit_multi.rb', line 492 def @user_message_reference_len end |
#validity_period ⇒ Object
Returns the value of attribute validity_period.
458 459 460 |
# File 'lib/pdu/smpp_submit_multi.rb', line 458 def validity_period @validity_period end |
Instance Method Details
#decode_packet(decoder) ⇒ Object
Interface to decode SMPP packet
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 236 237 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 |
# File 'lib/pdu/smpp_submit_multi.rb', line 166 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()) @number_of_dest = decoder.decode_number_of_dest(command_length()) @dest_addresses = decoder.decode_dest_addresses(@number_of_dest, 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_SOURCE_ADDR_SUBUNIT @source_addr_subunit, @source_addr_subunit_len = decoder.decode_source_addr_subunit(command_length()) when OptTags::TAG_DESTINATION_PORT @destination_port, @destination_port_len = decoder.decode_destination_port(command_length()) when OptTags::TAG_DEST_ADDR_SUBUNIT @dest_addr_subunit, @dest_addr_subunit_len = decoder.decode_dest_addr_subunit(command_length()) when OptTags::TAG_DEST_ADDR_SUBUNIT @dest_addr_subunit, @dest_addr_subunit_len = decoder.decode_dest_addr_subunit(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_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_PRIVACY_INDICATOR @privacy_indicator, @privacy_indicator_len = decoder.decode_privacy_indicator(command_length()) when OptTags::TAG_CALLBACK_NUM @callback_num, @callback_num_len = decoder.decode_callback_num(command_length()) when OptTags::TAG_CALLBACK_NUM_PRES_IND @callback_num_pres_ind, @callback_num_pres_ind_len = decoder.decode_callback_num_pres_ind(command_length()) when OptTags::TAG_CALLBACK_NUM_ATAG @callback_num_atag, @callback_num_atag_len = decoder.decode_callback_num_atag(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_DISPLAY_TIME @display_time, @display_time_len = decoder.decode_display_time(command_length()) when OptTags::TAG_SMS_SIGNAL @sms_signal, @sms_signal_len = decoder.decode_sms_signal(command_length()) when OptTags::TAG_MS_VALIDITY @ms_validity, @ms_validity_len = decoder.decode_ms_validity(command_length()) when OptTags::TAG_MS_MSG_WAIT_FACILITIES @ms_msg_wait_facilities, @ms_msg_wait_facilities_len = decoder.decode_ms_msg_wait_facilities(command_length()) when OptTags::TAG_ALERT_ON_MESSAGE_DELIVERY @alert_on_msg_delivery, @alert_on_msg_delivery_len = decoder.decode_alert_on_msg_delivery(command_length()) when OptTags::TAG_LANGUAGE_INDICATOR @language_indicator, @language_indicator_len = decoder.decode_language_indicator(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
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 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/pdu/smpp_submit_multi.rb', line 97 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_number_of_dest(@number_of_dest) encoder.encode_dest_addresses(@dest_addresses) 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_source_addr_subunit(@source_addr_subunit, @source_addr_subunit_len) if !@source_addr_subunit.nil? encoder.encode_destination_port(@destination_port, @destination_port_len) if !@destination_port.nil? encoder.encode_dest_addr_subunit(@dest_addr_subunit, @dest_addr_subunit_len) if !@dest_addr_subunit.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_payload_type(@payload_type, @payload_type_len) if !@payload_type.nil? encoder.(@message_payload, @message_payload_len) if !@message_payload.nil? encoder.encode_privacy_indicator(@privacy_indicator, @privacy_indicator_len) if !@privacy_indicator.nil? encoder.encode_callback_num(@callback_num, @callback_num_len) if !@callback_num.nil? encoder.encode_callback_num_pres_ind(@callback_num_pres_ind, @callback_num_pres_ind_len) if !@callback_num_pres_ind.nil? encoder.encode_callback_num_atag(@callback_num_atag, @callback_num_atag_len) if !@callback_num_atag.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_display_time(@display_time, @display_time_len) if !@display_time.nil? encoder.encode_sms_signal(@sms_signal, @sms_signal_len) if !@sms_signal.nil? encoder.encode_ms_validity(@ms_validity, @ms_validity_len) if !@ms_validity.nil? encoder.encode_ms_msg_wait_facilities(@ms_msg_wait_facilities, @ms_msg_wait_facilities_len) if !@ms_msg_wait_facilities.nil? encoder.encode_alert_on_msg_delivery(@alert_on_msg_delivery, @alert_on_msg_delivery_len) if !@alert_on_msg_delivery.nil? encoder.encode_language_indicator(@language_indicator, @language_indicator_len) if !@language_indicator.nil? end |
#output_packet(outputter) ⇒ Object
Interface to output SMPP packet
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 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 |
# File 'lib/pdu/smpp_submit_multi.rb', line 340 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_number_of_dest(@number_of_dest) outputter.output_dest_addresses(@dest_addresses) 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_source_addr_subunit(@source_addr_subunit, @source_addr_subunit_len) if !@source_addr_subunit.nil? outputter.output_destination_port(@destination_port, @destination_port_len) if !@destination_port.nil? outputter.output_dest_addr_subunit(@dest_addr_subunit, @dest_addr_subunit_len) if !@dest_addr_subunit.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_payload_type(@payload_type, @payload_type_len) if !@payload_type.nil? outputter.(@message_payload, @message_payload_len) if !@message_payload.nil? outputter.output_privacy_indicator(@privacy_indicator, @privacy_indicator_len) if !@privacy_indicator.nil? outputter.output_callback_num(@callback_num, @callback_num_len) if !@callback_num.nil? outputter.output_callback_num_pres_ind(@callback_num_pres_ind, @callback_num_pres_ind_len) if !@callback_num_pres_ind.nil? outputter.output_callback_num_atag(@callback_num_atag, @callback_num_atag_len) if !@callback_num_atag.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_display_time(@display_time, @display_time_len) if !@display_time.nil? outputter.output_sms_signal(@sms_signal, @sms_signal_len) if !@sms_signal.nil? outputter.output_ms_validity(@ms_validity, @ms_validity_len) if !@ms_validity.nil? outputter.output_ms_msg_wait_facilities(@ms_msg_wait_facilities, @ms_msg_wait_facilities_len) if !@ms_msg_wait_facilities.nil? outputter.output_alert_on_msg_delivery(@alert_on_msg_delivery, @alert_on_msg_delivery_len) if !@alert_on_msg_delivery.nil? outputter.output_language_indicator(@language_indicator, @language_indicator_len) if !@language_indicator.nil? end |
#validate_packet(validator) ⇒ Object
Interface to validate SMPP packet
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 303 304 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 |
# File 'lib/pdu/smpp_submit_multi.rb', line 267 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_number_of_dest(@number_of_dest) validator.validate_dest_addresses(@dest_addresses, @number_of_dest) 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_source_addr_subunit(@source_addr_subunit, @source_addr_subunit_len) if !@source_addr_subunit.nil? validator.validate_destination_port(@destination_port, @destination_port_len) if !@destination_port.nil? validator.validate_dest_addr_subunit(@dest_addr_subunit, @dest_addr_subunit_len) if !@dest_addr_subunit.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_payload_type(@payload_type, @payload_type_len) if !@payload_type.nil? validator.(@message_payload, @message_payload_len) if !@message_payload.nil? validator.validate_privacy_indicator(@privacy_indicator, @privacy_indicator_len) if !@privacy_indicator.nil? validator.validate_callback_num(@callback_num, @callback_num_len) if !@callback_num.nil? validator.validate_callback_num_pres_ind(@callback_num_pres_ind, @callback_num_pres_ind_len) if !@callback_num_pres_ind.nil? validator.validate_callback_num_atag(@callback_num_atag, @callback_num_atag_len) if !@callback_num_atag.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_display_time(@display_time, @display_time_len) if !@display_time.nil? validator.validate_sms_signal(@sms_signal, @sms_signal_len) if !@sms_signal.nil? validator.validate_ms_validity(@ms_validity, @ms_validity_len) if !@ms_validity.nil? validator.validate_ms_msg_wait_facilities(@ms_msg_wait_facilities, @ms_msg_wait_facilities_len) if !@ms_msg_wait_facilities.nil? validator.validate_alert_on_msg_delivery(@alert_on_msg_delivery, @alert_on_msg_delivery_len) if !@alert_on_msg_delivery.nil? validator.validate_language_indicator(@language_indicator, @language_indicator_len) if !@language_indicator.nil? # Validate complex rules validator.(@short_message, @message_payload) if !@message_payload.nil? end |