K2InformaticsGmbH / smpp_parser

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

Unpack error {'ESME_RINVSERTYP',"ESME_RINVSERTYP","Invalid Service Type"} #30

Closed walter-weinmann closed 6 years ago

walter-weinmann commented 6 years ago
=== Reason: no match of right hand side value {error,
                                                    <<"Invalid Service Type">>}
  in function  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_cancel_broadcast_sm_SUITE:test_compacted/1 (d:/K2/smpp_parser_idea/smpp_parser/_build/test/lib/smpp_parser/test/generated/ct/compacted_cancel_broadcast_sm_SUITE.erl, line 70)
  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:

 {"cancel_broadcast_sm_issue_30",
  "00 00 00 44 00 00 01 13 00 00 00 00 00 00 00 01 63 75 73 74 6F 6D 00 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 06 31 36 38 2E 31 32 33 2E 32 33 34 2E 33 32 31 00"}
c-bik commented 6 years ago
00 00 00 44 # command_length
00 00 01 13 # command_id (cancel_broadcast_sm)
00 00 00 00 # command_status
00 00 00 01 # sequence_number
63 75 73 74 6F 6D 00 # service_type ("custom")
# 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
06 # source_addr_ton
06 # source_addr_npi
31 36 38 2E 31 32 33 2E 32 33 34 2E 33 32 31 00 # source_addr ("168.123.234.321")

image

Changing service_type "custom" to one of the defined strings above fixes the problem. There isn't a need for custom service_type support currently!