fizzed / cloudhopper-smpp

Efficient, scalable, and flexible Java implementation of the Short Messaging Peer to Peer Protocol (SMPP)
Other
291 stars 132 forks source link

Bug: network_error_code is an octet string which might as a string might have more than 3 characters #10

Open williamsonrichard opened 7 years ago

williamsonrichard commented 7 years ago

In DeliveryReceipt, the value of a network_error_code is regarded invalid if it has more than 3 characters when converted to a string. However, the SMPP protocol allows more than 3 characters: the actual requirement is that we have an octet string of size three. When converted to a string, we might have more than three characters: eg, 0423 0003 0308 0200 is a valid hex network_error_code TLV, which will give err:2050, and a DeliveryReceiptException is thrown.

I don't see a straightforward way to fix this, because the DeliveryReceipt class is based upon parsing a string.