Class: Majoron::AntHill::SMPP::SMPPBroadcastSM
- Defined in:
- lib/pdu/smpp_broadcast_sm.rb
Instance Attribute Summary collapse
-
#alert_on_msg_delivery ⇒ Object
Optional fields.
-
#alert_on_msg_delivery_len ⇒ Object
Optional fields length.
-
#broadcast_area_identifier ⇒ Object
Returns the value of attribute broadcast_area_identifier.
-
#broadcast_area_identifier_len ⇒ Object
Mandatory fields len.
-
#broadcast_channel_indicator ⇒ Object
Returns the value of attribute broadcast_channel_indicator.
-
#broadcast_channel_indicator_len ⇒ Object
Returns the value of attribute broadcast_channel_indicator_len.
-
#broadcast_content_type ⇒ Object
Returns the value of attribute broadcast_content_type.
-
#broadcast_content_type_info ⇒ Object
Returns the value of attribute broadcast_content_type_info.
-
#broadcast_content_type_info_len ⇒ Object
Returns the value of attribute broadcast_content_type_info_len.
-
#broadcast_content_type_len ⇒ Object
Returns the value of attribute broadcast_content_type_len.
-
#broadcast_frequency_interval ⇒ Object
Returns the value of attribute broadcast_frequency_interval.
-
#broadcast_frequency_interval_len ⇒ Object
Returns the value of attribute broadcast_frequency_interval_len.
-
#broadcast_message_class ⇒ Object
Returns the value of attribute broadcast_message_class.
-
#broadcast_message_class_len ⇒ Object
Returns the value of attribute broadcast_message_class_len.
-
#broadcast_rep_num ⇒ Object
Returns the value of attribute broadcast_rep_num.
-
#broadcast_rep_num_len ⇒ Object
Returns the value of attribute broadcast_rep_num_len.
-
#broadcast_service_group ⇒ Object
Returns the value of attribute broadcast_service_group.
-
#broadcast_service_group_len ⇒ Object
Returns the value of attribute broadcast_service_group_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_port ⇒ Object
Returns the value of attribute dest_port.
-
#dest_port_len ⇒ Object
Returns the value of attribute dest_port_len.
-
#dest_subaddress ⇒ Object
Returns the value of attribute dest_subaddress.
-
#dest_subaddress_len ⇒ Object
Returns the value of attribute dest_subaddress_len.
-
#display_time ⇒ Object
Returns the value of attribute display_time.
-
#display_time_len ⇒ Object
Returns the value of attribute display_time_len.
-
#language_indicator ⇒ Object
Returns the value of attribute language_indicator.
-
#language_indicator_len ⇒ Object
Returns the value of attribute language_indicator_len.
-
#message_id ⇒ Object
Returns the value of attribute message_id.
-
#message_payload ⇒ Object
Returns the value of attribute message_payload.
-
#message_payload_len ⇒ Object
Returns the value of attribute message_payload_len.
-
#ms_validity ⇒ Object
Returns the value of attribute ms_validity.
-
#ms_validity_len ⇒ Object
Returns the value of attribute ms_validity_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.
-
#replace_if_present_flag ⇒ Object
Returns the value of attribute replace_if_present_flag.
-
#schedule_delivery_time ⇒ Object
Returns the value of attribute schedule_delivery_time.
-
#service_type ⇒ Object
Mandatory fields.
-
#sm_default_msg_id ⇒ Object
Returns the value of attribute sm_default_msg_id.
-
#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
Returns the value of attribute user_message_reference.
-
#user_message_reference_len ⇒ Object
Returns the value of attribute user_message_reference_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) ⇒ SMPPBroadcastSM
constructor
A new instance of SMPPBroadcastSM.
-
#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) ⇒ SMPPBroadcastSM
Returns a new instance of SMPPBroadcastSM.
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 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 23 def initialize(command_status = ErrorCode::ESME_ROK, sequence_number = nil) super(CommandId::CM_BROADCAST_SM, command_status, sequence_number) # Mandatory fields @service_type = "" @source_addr_ton = TON::UNKNOWN @source_addr_npi = NPI::UNKNOWN @source_addr = "" @message_id = "" @priority_flag = 0 @schedule_delivery_time = "" @validity_period = "" @replace_if_present_flag = 0 @data_coding = 0 @sm_default_msg_id = 0 @broadcast_area_identifier = nil @broadcast_content_type = nil @broadcast_rep_num = nil @broadcast_frequency_interval = nil # Mandatory fields len @broadcast_area_identifier_len = SMPPTLVLen::ZERO_LEN @broadcast_content_type_len = SMPPTLVLen::ZERO_LEN @broadcast_rep_num_len = SMPPTLVLen::WORD_LEN @broadcast_frequency_interval_len = SMPPTLVLen::ZERO_LEN # Optional fields @alert_on_msg_delivery = nil @broadcast_channel_indicator = nil @broadcast_content_type_info = nil @broadcast_message_class = nil @broadcast_service_group = nil @callback_num = nil @callback_num_atag = nil @callback_num_pres_ind = nil @dest_addr_subunit = nil @dest_subaddress = nil @dest_port = nil @display_time = nil @language_indicator = nil @message_payload = nil @ms_validity = nil @payload_type = nil @privacy_indicator = nil @sms_signal = nil @source_addr_subunit = nil @source_port = nil @source_subaddress = nil @user_message_reference = nil # Optional fields len @alert_on_msg_delivery_len = SMPPTLVLen::BYTE_LEN @broadcast_channel_indicator_len = SMPPTLVLen::BYTE_LEN @broadcast_content_type_info_len = SMPPTLVLen::ZERO_LEN @broadcast_message_class_len = SMPPTLVLen::BYTE_LEN @broadcast_service_group_len = SMPPTLVLen::ZERO_LEN @callback_num_len = SMPPTLVLen::ZERO_LEN @callback_num_atag_len = SMPPTLVLen::ZERO_LEN @callback_num_pres_ind_len = SMPPTLVLen::BYTE_LEN @dest_addr_subunit_len = SMPPTLVLen::BYTE_LEN @dest_subaddress_len = SMPPTLVLen::ZERO_LEN @dest_port_len = SMPPTLVLen::WORD_LEN @display_time_len = SMPPTLVLen::BYTE_LEN @language_indicator_len = SMPPTLVLen::BYTE_LEN @message_payload_len = SMPPTLVLen::ZERO_LEN @ms_validity_len = SMPPTLVLen::BYTE_LEN @payload_type_len = SMPPTLVLen::BYTE_LEN @privacy_indicator_len = SMPPTLVLen::BYTE_LEN @sms_signal_len = SMPPTLVLen::WORD_LEN @source_addr_subunit_len = SMPPTLVLen::BYTE_LEN @source_port_len = SMPPTLVLen::WORD_LEN @source_subaddress_len = SMPPTLVLen::ZERO_LEN @user_message_reference_len = SMPPTLVLen::WORD_LEN end |
Instance Attribute Details
#alert_on_msg_delivery ⇒ Object
Optional fields
514 515 516 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 514 def alert_on_msg_delivery @alert_on_msg_delivery end |
#alert_on_msg_delivery_len ⇒ Object
Optional fields length
539 540 541 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 539 def alert_on_msg_delivery_len @alert_on_msg_delivery_len end |
#broadcast_area_identifier ⇒ Object
Returns the value of attribute broadcast_area_identifier.
502 503 504 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 502 def broadcast_area_identifier @broadcast_area_identifier end |
#broadcast_area_identifier_len ⇒ Object
Mandatory fields len
508 509 510 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 508 def broadcast_area_identifier_len @broadcast_area_identifier_len end |
#broadcast_channel_indicator ⇒ Object
Returns the value of attribute broadcast_channel_indicator.
515 516 517 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 515 def broadcast_channel_indicator @broadcast_channel_indicator end |
#broadcast_channel_indicator_len ⇒ Object
Returns the value of attribute broadcast_channel_indicator_len.
540 541 542 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 540 def broadcast_channel_indicator_len @broadcast_channel_indicator_len end |
#broadcast_content_type ⇒ Object
Returns the value of attribute broadcast_content_type.
503 504 505 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 503 def broadcast_content_type @broadcast_content_type end |
#broadcast_content_type_info ⇒ Object
Returns the value of attribute broadcast_content_type_info.
516 517 518 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 516 def broadcast_content_type_info @broadcast_content_type_info end |
#broadcast_content_type_info_len ⇒ Object
Returns the value of attribute broadcast_content_type_info_len.
541 542 543 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 541 def broadcast_content_type_info_len @broadcast_content_type_info_len end |
#broadcast_content_type_len ⇒ Object
Returns the value of attribute broadcast_content_type_len.
509 510 511 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 509 def broadcast_content_type_len @broadcast_content_type_len end |
#broadcast_frequency_interval ⇒ Object
Returns the value of attribute broadcast_frequency_interval.
505 506 507 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 505 def broadcast_frequency_interval @broadcast_frequency_interval end |
#broadcast_frequency_interval_len ⇒ Object
Returns the value of attribute broadcast_frequency_interval_len.
511 512 513 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 511 def broadcast_frequency_interval_len @broadcast_frequency_interval_len end |
#broadcast_message_class ⇒ Object
Returns the value of attribute broadcast_message_class.
517 518 519 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 517 def @broadcast_message_class end |
#broadcast_message_class_len ⇒ Object
Returns the value of attribute broadcast_message_class_len.
542 543 544 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 542 def @broadcast_message_class_len end |
#broadcast_rep_num ⇒ Object
Returns the value of attribute broadcast_rep_num.
504 505 506 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 504 def broadcast_rep_num @broadcast_rep_num end |
#broadcast_rep_num_len ⇒ Object
Returns the value of attribute broadcast_rep_num_len.
510 511 512 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 510 def broadcast_rep_num_len @broadcast_rep_num_len end |
#broadcast_service_group ⇒ Object
Returns the value of attribute broadcast_service_group.
518 519 520 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 518 def broadcast_service_group @broadcast_service_group end |
#broadcast_service_group_len ⇒ Object
Returns the value of attribute broadcast_service_group_len.
543 544 545 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 543 def broadcast_service_group_len @broadcast_service_group_len end |
#callback_num ⇒ Object
Returns the value of attribute callback_num.
519 520 521 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 519 def callback_num @callback_num end |
#callback_num_atag ⇒ Object
Returns the value of attribute callback_num_atag.
520 521 522 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 520 def callback_num_atag @callback_num_atag end |
#callback_num_atag_len ⇒ Object
Returns the value of attribute callback_num_atag_len.
545 546 547 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 545 def callback_num_atag_len @callback_num_atag_len end |
#callback_num_len ⇒ Object
Returns the value of attribute callback_num_len.
544 545 546 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 544 def callback_num_len @callback_num_len end |
#callback_num_pres_ind ⇒ Object
Returns the value of attribute callback_num_pres_ind.
521 522 523 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 521 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.
546 547 548 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 546 def callback_num_pres_ind_len @callback_num_pres_ind_len end |
#data_coding ⇒ Object
Returns the value of attribute data_coding.
500 501 502 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 500 def data_coding @data_coding end |
#dest_addr_subunit ⇒ Object
Returns the value of attribute dest_addr_subunit.
522 523 524 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 522 def dest_addr_subunit @dest_addr_subunit end |
#dest_addr_subunit_len ⇒ Object
Returns the value of attribute dest_addr_subunit_len.
547 548 549 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 547 def dest_addr_subunit_len @dest_addr_subunit_len end |
#dest_port ⇒ Object
Returns the value of attribute dest_port.
524 525 526 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 524 def dest_port @dest_port end |
#dest_port_len ⇒ Object
Returns the value of attribute dest_port_len.
549 550 551 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 549 def dest_port_len @dest_port_len end |
#dest_subaddress ⇒ Object
Returns the value of attribute dest_subaddress.
523 524 525 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 523 def dest_subaddress @dest_subaddress end |
#dest_subaddress_len ⇒ Object
Returns the value of attribute dest_subaddress_len.
548 549 550 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 548 def dest_subaddress_len @dest_subaddress_len end |
#display_time ⇒ Object
Returns the value of attribute display_time.
525 526 527 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 525 def display_time @display_time end |
#display_time_len ⇒ Object
Returns the value of attribute display_time_len.
550 551 552 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 550 def display_time_len @display_time_len end |
#language_indicator ⇒ Object
Returns the value of attribute language_indicator.
526 527 528 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 526 def language_indicator @language_indicator end |
#language_indicator_len ⇒ Object
Returns the value of attribute language_indicator_len.
551 552 553 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 551 def language_indicator_len @language_indicator_len end |
#message_id ⇒ Object
Returns the value of attribute message_id.
495 496 497 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 495 def @message_id end |
#message_payload ⇒ Object
Returns the value of attribute message_payload.
527 528 529 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 527 def @message_payload end |
#message_payload_len ⇒ Object
Returns the value of attribute message_payload_len.
552 553 554 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 552 def @message_payload_len end |
#ms_validity ⇒ Object
Returns the value of attribute ms_validity.
528 529 530 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 528 def ms_validity @ms_validity end |
#ms_validity_len ⇒ Object
Returns the value of attribute ms_validity_len.
553 554 555 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 553 def ms_validity_len @ms_validity_len end |
#payload_type ⇒ Object
Returns the value of attribute payload_type.
529 530 531 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 529 def payload_type @payload_type end |
#payload_type_len ⇒ Object
Returns the value of attribute payload_type_len.
554 555 556 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 554 def payload_type_len @payload_type_len end |
#priority_flag ⇒ Object
Returns the value of attribute priority_flag.
496 497 498 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 496 def priority_flag @priority_flag end |
#privacy_indicator ⇒ Object
Returns the value of attribute privacy_indicator.
530 531 532 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 530 def privacy_indicator @privacy_indicator end |
#privacy_indicator_len ⇒ Object
Returns the value of attribute privacy_indicator_len.
555 556 557 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 555 def privacy_indicator_len @privacy_indicator_len end |
#replace_if_present_flag ⇒ Object
Returns the value of attribute replace_if_present_flag.
499 500 501 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 499 def replace_if_present_flag @replace_if_present_flag end |
#schedule_delivery_time ⇒ Object
Returns the value of attribute schedule_delivery_time.
497 498 499 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 497 def schedule_delivery_time @schedule_delivery_time end |
#service_type ⇒ Object
Mandatory fields
491 492 493 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 491 def service_type @service_type end |
#sm_default_msg_id ⇒ Object
Returns the value of attribute sm_default_msg_id.
501 502 503 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 501 def sm_default_msg_id @sm_default_msg_id end |
#sms_signal ⇒ Object
Returns the value of attribute sms_signal.
531 532 533 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 531 def sms_signal @sms_signal end |
#sms_signal_len ⇒ Object
Returns the value of attribute sms_signal_len.
556 557 558 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 556 def sms_signal_len @sms_signal_len end |
#source_addr ⇒ Object
Returns the value of attribute source_addr.
494 495 496 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 494 def source_addr @source_addr end |
#source_addr_npi ⇒ Object
Returns the value of attribute source_addr_npi.
493 494 495 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 493 def source_addr_npi @source_addr_npi end |
#source_addr_subunit ⇒ Object
Returns the value of attribute source_addr_subunit.
532 533 534 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 532 def source_addr_subunit @source_addr_subunit end |
#source_addr_subunit_len ⇒ Object
Returns the value of attribute source_addr_subunit_len.
557 558 559 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 557 def source_addr_subunit_len @source_addr_subunit_len end |
#source_addr_ton ⇒ Object
Returns the value of attribute source_addr_ton.
492 493 494 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 492 def source_addr_ton @source_addr_ton end |
#source_port ⇒ Object
Returns the value of attribute source_port.
533 534 535 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 533 def source_port @source_port end |
#source_port_len ⇒ Object
Returns the value of attribute source_port_len.
558 559 560 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 558 def source_port_len @source_port_len end |
#source_subaddress ⇒ Object
Returns the value of attribute source_subaddress.
534 535 536 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 534 def source_subaddress @source_subaddress end |
#source_subaddress_len ⇒ Object
Returns the value of attribute source_subaddress_len.
559 560 561 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 559 def source_subaddress_len @source_subaddress_len end |
#user_message_reference ⇒ Object
Returns the value of attribute user_message_reference.
535 536 537 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 535 def @user_message_reference end |
#user_message_reference_len ⇒ Object
Returns the value of attribute user_message_reference_len.
560 561 562 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 560 def @user_message_reference_len end |
#validity_period ⇒ Object
Returns the value of attribute validity_period.
498 499 500 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 498 def validity_period @validity_period end |
Instance Method Details
#decode_packet(decoder) ⇒ Object
Interface to decode SMPP packet
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 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 173 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()) @message_id = decoder.(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()) @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()) while decoder.has_tlvs() && decoder.get_tlv_code() == OptTags::TAG_BROADCAST_AREA_IDENTIFIER id, len = decoder.decode_broadcast_area_identifier(command_length()) if @broadcast_area_identifier.nil? || @broadcast_area_identifier_len.nil? @broadcast_area_identifier = [] @broadcast_area_identifier_len = [] end @broadcast_area_identifier << id @broadcast_area_identifier_len << len end if decoder.has_tlvs() && decoder.get_tlv_code() == OptTags::TAG_BROADCAST_CONTENT_TYPE @broadcast_content_type, @broadcast_content_type_len = decoder.decode_broadcast_content_type(command_length()) end if decoder.has_tlvs() && decoder.get_tlv_code() == OptTags::TAG_BROADCAST_REP_NUM @broadcast_rep_num, @broadcast_rep_num_len = decoder.decode_broadcast_rep_num(command_length()) end if decoder.has_tlvs() && decoder.get_tlv_code() == OptTags::TAG_BROADCAST_FREQUENCY_INTERVAL @broadcast_frequency_interval, @broadcast_frequency_interval_len = decoder.decode_broadcast_frequency_interval(command_length()) end # Decode optional fields while decoder.has_tlvs() case decoder.get_tlv_code() 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_BROADCAST_CHANNEL_INDICATOR @broadcast_channel_indicator, @broadcast_channel_indicator_len = decoder.decode_broadcast_channel_indicator(command_length()) when OptTags::TAG_BROADCAST_CONTENT_TYPE_INFO @broadcast_content_type_info, @broadcast_content_type_info_len = decoder.decode_broadcast_content_type_info(command_length()) when OptTags::TAG_BROADCAST_MESSAGE_CLASS @broadcast_message_class, @broadcast_message_class_len = decoder.(command_length()) when OptTags::TAG_BROADCAST_SERVICE_GROUP @broadcast_service_group, @broadcast_service_group_len = decoder.decode_broadcast_service_group(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_DEST_ADDR_SUBUNIT @dest_addr_subunit, @dest_addr_subunit_len = decoder.decode_dest_addr_subunit(command_length()) when OptTags::TAG_DEST_SUBADDRESS @dest_subaddress, @dest_subaddress_len = decoder.decode_dest_subaddress(command_length()) when OptTags::TAG_DESTINATION_PORT @dest_port, @dest_port_len = decoder.decode_destination_port(command_length()) when OptTags::TAG_DISPLAY_TIME @display_time, @display_time_len = decoder.decode_display_time(command_length()) when OptTags::TAG_LANGUAGE_INDICATOR @language_indicator, @language_indicator_len = decoder.decode_language_indicator(command_length()) when OptTags::TAG_MESSAGE_PAYLOAD @message_payload, @message_payload_len = decoder.(command_length()) when OptTags::TAG_MS_VALIDITY @ms_validity, @ms_validity_len = decoder.decode_ms_validity(command_length()) when OptTags::TAG_PAYLOAD_TYPE @payload_type, @payload_type_len = decoder.decode_payload_type(command_length()) when OptTags::TAG_PRIVACY_INDICATOR @privacy_indicator, @privacy_indicator_len = decoder.decode_privacy_indicator(command_length()) when OptTags::TAG_SMS_SIGNAL @sms_signal, @sms_signal_len = decoder.decode_sms_signal(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_SOURCE_PORT @source_port, @source_port_len = decoder.decode_source_port(command_length()) when OptTags::TAG_SOURCE_SUBADDRESS @source_subaddress, @source_subaddress_len = decoder.decode_source_subaddress(command_length()) when OptTags::TAG_USER_MESSAGE_REFERENCE @user_message_reference, @user_message_reference_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
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 164 165 166 167 168 169 170 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 100 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.(@message_id) encoder.encode_priority_flag(@priority_flag) encoder.encode_schedule_delivery_time(@schedule_delivery_time) encoder.encode_validity_period(@validity_period) 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) # Encode mandatory fields as TLV structures encoder.encode_broadcast_area_identifier(@broadcast_area_identifier, @broadcast_area_identifier_len) encoder.encode_broadcast_content_type(@broadcast_content_type, @broadcast_content_type_len) encoder.encode_broadcast_rep_num(@broadcast_rep_num, @broadcast_rep_num_len) encoder.encode_broadcast_frequency_interval(@broadcast_frequency_interval, @broadcast_frequency_interval_len) # Encode optional fields encoder.encode_alert_on_msg_delivery(@alert_on_msg_delivery, @alert_on_msg_delivery_len) if !@alert_on_msg_delivery.nil? encoder.encode_broadcast_channel_indicator(@broadcast_channel_indicator, @broadcast_channel_indicator_len) if !@broadcast_channel_indicator.nil? encoder.encode_broadcast_content_type_info(@broadcast_content_type_info, @broadcast_content_type_info_len) if !@broadcast_content_type_info.nil? encoder.(@broadcast_message_class, @broadcast_message_class_len) if !@broadcast_message_class.nil? encoder.encode_broadcast_service_group(@broadcast_service_group, @broadcast_service_group_len) if !@broadcast_service_group.nil? encoder.encode_callback_num(@callback_num, @callback_num_len) if !@callback_num.nil? encoder.encode_callback_num_atag(@callback_num_atag, @callback_num_atag_len) if !@callback_num_atag.nil? encoder.encode_callback_num_pres_ind(@callback_num_pres_ind, @callback_num_pres_ind_len) if !@callback_num_pres_ind.nil? encoder.encode_dest_addr_subunit(@dest_addr_subunit, @dest_addr_subunit_len) if !@dest_addr_subunit.nil? encoder.encode_dest_subaddress(@dest_subaddress, @dest_subaddress_len) if !@dest_subaddress.nil? encoder.encode_destination_port(@dest_port, @dest_port_len) if !@dest_port.nil? encoder.encode_display_time(@display_time, @display_time_len) if !@display_time.nil? encoder.encode_language_indicator(@language_indicator, @language_indicator_len) if !@language_indicator.nil? encoder.(@message_payload, @message_payload_len) if !@message_payload.nil? encoder.encode_ms_validity(@ms_validity, @ms_validity_len) if !@ms_validity.nil? encoder.encode_payload_type(@payload_type, @payload_type_len) if !@payload_type.nil? encoder.encode_privacy_indicator(@privacy_indicator, @privacy_indicator_len) if !@privacy_indicator.nil? encoder.encode_sms_signal(@sms_signal, @sms_signal_len) if !@sms_signal.nil? encoder.encode_source_addr_subunit(@source_addr_subunit, @source_addr_subunit_len) if !@source_addr_subunit.nil? encoder.encode_source_port(@source_port, @source_port_len) if !@source_port.nil? encoder.encode_source_subaddress(@source_subaddress, @source_subaddress_len) if !@source_subaddress.nil? encoder.(@user_message_reference, @user_message_reference_len) if !@user_message_reference.nil? end |
#output_packet(outputter) ⇒ Object
Interface to output SMPP packet
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 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 362 def output_packet(outputter) # Output header and mandatory fields outputter.output_header(@header) outputter.output_source_addr_ton(@source_addr_ton) outputter.output_source_addr_npi(@source_addr_npi) outputter.output_source_addr21(@source_addr) outputter.(@message_id) outputter.output_priority_flag(@priority_flag) outputter.output_schedule_delivery_time(@schedule_delivery_time) outputter.output_validity_period(@validity_period) 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) # Output mandatory fields as TLV structures outputter.output_broadcast_area_identifier(@broadcast_area_identifier, @broadcast_area_identifier_len) outputter.output_broadcast_content_type(@broadcast_content_type, @broadcast_content_type_len) outputter.output_broadcast_rep_num(@broadcast_rep_num, @broadcast_rep_num_len) outputter.output_broadcast_frequency_interval(@broadcast_frequency_interval, @broadcast_frequency_interval_len) # Output optional fields outputter.output_alert_on_msg_delivery(@alert_on_msg_delivery, @alert_on_msg_delivery_len) if !@alert_on_msg_delivery.nil? outputter.output_broadcast_channel_indicator(@broadcast_channel_indicator, @broadcast_channel_indicator_len) if !@broadcast_channel_indicator.nil? outputter.output_broadcast_content_type_info(@broadcast_content_type_info, @broadcast_content_type_info_len) if !@broadcast_content_type_info.nil? outputter.(@broadcast_message_class, @broadcast_message_class_len) if !@broadcast_message_class.nil? outputter.output_broadcast_service_group(@broadcast_service_group, @broadcast_service_group_len) if !@broadcast_service_group.nil? outputter.output_callback_num(@callback_num, @callback_num_len) if !@callback_num.nil? outputter.output_callback_num_atag(@callback_num_atag, @callback_num_atag_len) if !@callback_num_atag.nil? outputter.output_callback_num_pres_ind(@callback_num_pres_ind, @callback_num_pres_ind_len) if !@callback_num_pres_ind.nil? outputter.output_dest_addr_subunit(@dest_addr_subunit, @dest_addr_subunit_len) if !@dest_addr_subunit.nil? outputter.output_dest_subaddress(@dest_subaddress, @dest_subaddress_len) if !@dest_subaddress.nil? outputter.output_destination_port(@dest_port, @dest_port_len) if !@dest_port.nil? outputter.output_display_time(@display_time, @display_time_len) if !@display_time.nil? outputter.output_language_indicator(@language_indicator, @language_indicator_len) if !@language_indicator.nil? outputter.(@message_payload, @message_payload_len) if !@message_payload.nil? outputter.output_ms_validity(@ms_validity, @ms_validity_len) if !@ms_validity.nil? outputter.output_payload_type(@payload_type, @payload_type_len) if !@payload_type.nil? outputter.output_privacy_indicator(@privacy_indicator, @privacy_indicator_len) if !@privacy_indicator.nil? outputter.output_sms_signal(@sms_signal, @sms_signal_len) if !@sms_signal.nil? outputter.output_source_addr_subunit(@source_addr_subunit, @source_addr_subunit_len) if !@source_addr_subunit.nil? outputter.output_source_port(@source_port, @source_port_len) if !@source_port.nil? outputter.output_source_subaddress(@source_subaddress, @source_subaddress_len) if !@source_subaddress.nil? outputter.(@user_message_reference, @user_message_reference_len) if !@user_message_reference.nil? end |
#validate_packet(validator) ⇒ Object
Interface to validate SMPP packet
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 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 |
# File 'lib/pdu/smpp_broadcast_sm.rb', line 290 def validate_packet(validator) # Validate header and mandatory fields validator.validate_header(@header) validator.validate_source_addr_ton(@source_addr_ton) validator.validate_source_addr_npi(@source_addr_npi) validator.validate_source_addr21(@source_addr) validator.(@message_id) validator.validate_priority_flag(@priority_flag) validator.validate_schedule_delivery_time(@schedule_delivery_time) validator.validate_validity_period(@validity_period) 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) # Validate mandatory fields as TLV structures validator.validate_broadcast_area_identifier(@broadcast_area_identifier, @broadcast_area_identifier_len) validator.validate_broadcast_content_type(@broadcast_content_type, @broadcast_content_type) validator.validate_broadcast_rep_num(@broadcast_rep_num, @broadcast_rep_num) validator.validate_broadcast_frequency_interval(@broadcast_frequency_interval, @broadcast_frequency_interval_len) # Validate optional fields validator.validate_alert_on_msg_delivery(@alert_on_msg_delivery, @alert_on_msg_delivery_len) if !@alert_on_msg_delivery.nil? validator.validate_broadcast_channel_indicator(@broadcast_channel_indicator, @broadcast_channel_indicator_len) if !@broadcast_channel_indicator.nil? validator.validate_broadcast_content_type_info(@broadcast_content_type_info, @broadcast_content_type_info_len) if !@broadcast_content_type_info.nil? validator.(@broadcast_message_class, @broadcast_message_class_len) if !@broadcast_message_class.nil? validator.validate_broadcast_service_group(@broadcast_service_group, @broadcast_broadcast_service_group_len) if !@broadcast_service_group.nil? validator.validate_callback_num(@callback_num, @callback_num_len) if !@callback_num.nil? validator.validate_callback_num_atag(@callback_num_atag, @callback_num_atag_len) if !@callback_num_atag.nil? validator.validate_callback_num_pres_ind(@callback_num_pres_ind, @callback_num_pres_ind_len) if !@callback_num_pres_ind.nil? validator.validate_dest_addr_subunit(@dest_addr_subunit, @dest_addr_subunit_len) if !@dest_addr_subunit.nil? validator.validate_dest_subaddress(@dest_subaddress, @dest_subaddress_len) if !@dest_subaddress.nil? validator.validate_destination_port(@dest_port, @dest_port_len) if !@dest_port.nil? validator.validate_display_time(@display_time, @display_time_len) if !@display_time.nil? validator.validate_language_indicator(@language_indicator, @language_indicator_len) if !@language_indicator.nil? validator.(@message_payload, @message_payload_len) if !@message_payload.nil? validator.validate_ms_validity(@ms_validity, @ms_validity_len) if !@ms_validity.nil? validator.validate_payload_type(@payload_type, @payload_type_len) if !@payload_type.nil? validator.validate_privacy_indicator(@privacy_indicator, @privacy_indicator_len) if !@privacy_indicator.nil? validator.validate_sms_signal(@sms_signal, @sms_signal_len) if !@sms_signal.nil? validator.validate_source_addr_subunit(@source_addr_subunit, @source_addr_subunit_len) if !@source_addr_subunit.nil? validator.validate_source_port(@source_port, @source_port_len) if !@source_port.nil? validator.validate_source_subaddress(@source_subaddress, @source_subaddress_len) if !@source_subaddress.nil? validator.(@user_message_reference, @user_message_reference_len) if !@user_message_reference.nil? end |