twitter-archive / cloudhopper-smpp

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

SmppConstants intermediate delivery is bit 4, not 5 #54

Closed stela closed 10 years ago

stela commented 10 years ago

The SMPP 3.4 spec section 5.2.17 contains an inconsistency in the description of the registered_delivery flag. The text says "bit 5" (0x20) while the bit pattern indicates bit 4 (0x10). Later the spec for SMPP 5.0 section 4.7.21 says "bit 4" and has the same bit pattern (0x10 in both cases).

SmppConstants has REGISTERED_DELIVERY_INTERMEDIATE_NOTIFICATION_MASK=0x20 and REGISTERED_DELIVERY_INTERMEDIATE_NOTIFICATION_REQUESTED=0x20 which appear wrong, think they ought to be 0x10. Test cases (see e.g. SmppUtilTest.java) would also need to be modified as well as they contain 0x20.

Be careful though, the "esm_class" field does use bit 5 for intermediate notifications.

jjlauer commented 10 years ago

Yes, you are correct. The text of the SMPP 3.4 specs says bit 5, but the matrix they show is bit 4. I originally used bit 5 as I copied that out of the doc. However, it's definitely bit 4 like you pointed out. I committed a fix in master that adjusts this and the unit test.