K2InformaticsGmbH / smpp_parser

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

no function clause matching smpp:err(undefined). #38

Closed walter-weinmann closed 6 years ago

walter-weinmann commented 6 years ago
=== Reason: no function clause matching smpp:err(undefined) (d:/K2/smpp_parser_idea/smpp_parser/_build/test/lib/smpp_parser/src/smpp.erl, line 461)
  in function  smpp:unpack/2 (d:/K2/smpp_parser_idea/smpp_parser/_build/test/lib/smpp_parser/src/smpp.erl, line 63)
  in call from smpp:decode_bin/1 (d:/K2/smpp_parser_idea/smpp_parser/_build/test/lib/smpp_parser/src/smpp.erl, line 187)
  in call from smpp_test_utils:encode_decode/1 (d:/K2/smpp_parser_idea/smpp_parser/_build/test/lib/smpp_parser/test/src/smpp_test_utils.erl, line 41)
  in call from compacted_query_sm_resp_SUITE:test_compacted/1 (d:/K2/smpp_parser_idea/smpp_parser/_build/test/lib/smpp_parser/test/generated/ct/compacted_query_sm_resp_SUITE.erl, line 49)
  in call from test_server:ts_tc/3 (test_server.erl, line 1546)
  in call from test_server:run_test_case_eval1/6 (test_server.erl, line 1062)
  in call from test_server:run_test_case_eval/9 (test_server.erl, line 994)

Example:

 {"query_sm_resp_issue_38",
  "00 00 00 3E 80 00 00 03 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 39 39 30 30 30 30 30 "
  "30 30 30 30 30 30 30 30 2B 00 05 31"}
c-bik commented 6 years ago

Looks like a currupted PDU, @walter-weinmann can you please check?

00 00 00 3E # command_length
80 00 00 03 # command_id (query_sm_resp)
00 00 00 00 # command_status
00 00 00 01 # sequence_number
# message_id ("this_could_be_a_message_id")
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
39 # source_addr_ton
39 # source_addr_npi
30 30 30 30 30 30 30 30 30 30 30 30 30 2B 00
05 31
walter-weinmann commented 6 years ago

00 00 00 3E # command_length 80 00 00 03 # command_id (query_sm_resp) 00 00 00 00 # command_status 00 00 00 01 # sequence_number 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 # message_id 39 39 30 30 30 30 30 30 30 30 30 30 30 30 30 2B 00 # final_date 05 # message_state 31 # error_code

Looks fine for me

c-bik commented 6 years ago

@walter-weinmann 39 39 30 30 30 30 30 30 30 30 30 30 30 30 30 2B ("990000000000000+") doesn't represent a valid date

Parser is expecting format : Y1,Y2,M1,M2,D1,D2,H1,H2,Min1,Min2,S1,S2,T,N1,N2

Date   = {list_to_integer([Y1,Y2]),
                      list_to_integer([M1,M2]),
                      list_to_integer([D1,D2])},
% {99, 0, 0} is not a valid Erlang date
calendar:valid_date(Date) % should return true