K2InformaticsGmbH / smpp_parser

A parser for SMPP protocol PDUs
Apache License 2.0
3 stars 1 forks source link

invalid decoding of `broadcast_error_status` TLV #101

Closed c-bik closed 6 years ago

c-bik commented 6 years ago
Expected : #{broadcast_error_status => 193,
             command_id => <<"broadcast_sm_resp">>,command_length => 51,
             command_status => <<"ESME_ROK">>,
             message_id => <<"this_could_be_a_message_id">>,
             sequence_number => 1}
Got      : #{broadcast_error_status => <<"Á">>,
             command_id => <<"broadcast_sm_resp">>,command_length => 51,
             command_status => <<"ESME_ROK">>,
             message_id => <<"this_could_be_a_message_id">>,
             sequence_number => 1}

Value should be a 32bit (4 bytes) integer

shamis commented 6 years ago

This has been fixed - test case

> PDU = "00 00 00 33 80 00 01 11 00 00 00 00 00 00 00 01 74 68 69 73 5F 63 6F 75 6C 64 5F 62 65 5F 61 5F 6D 65 73 73 61 67 65 5F 69 64 00 06 07 00 04 00 00 00 C1".
> smpp:decode(PDU).
{ok,#{broadcast_error_status => 193,
      command_id => <<"broadcast_sm_resp">>,command_length => 51,
      command_status => <<"ESME_ROK">>,
      message_id => <<"this_could_be_a_message_id">>,
      sequence_number => 1}}