Skip to content

Decoding of SMS-STATUS-REPORT PDUs #3

@topac

Description

@topac

SMS-STATUS-REPORT PDU is not properly decoded right now. I tried to tweak your code to make decode it properly. This is only a draft:

      # This code is only valid for SMS-STATUS-REPORT PDUs

      @sca_length = take(2, :integer) * 2                # Service center address length
      if @sca_length > 0
        @sca_type = parse_address_type take(2)            # Service center address type
        @sca = parse_address take(@sca_length - 2), @sca_type, @sca_length # Service center address
      end

      @pdu_type = parse_pdu_type take(2, :binary)   # PDU type octet
      @message_reference = take(2, :integer)

      @address_length = take(2, :integer)

      @address_type = parse_address_type take(2)
      if [:national, :international].include? @address_type
        @address_length = @address_length.odd? ? @address_length + 1 : @address_length # Always take byte aligned - hexdecimal F is added when odd number
      end

      @address = parse_address take(@address_length), @address_type, @address_length

      @sc_timestamp = parse_7byte_timestamp take(14)

      discharge_time = parse_7byte_timestamp take(14)
      status = take(1, :integer)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions