There are two ways to get the delivery state. Here, we're looking at a numeric value in a PDU param and turning that into a string representation of what that indicates. If we're examining the message body, we're looking at an arbitrary string that the provider sends us and it can basically be anything.

The `delivery_status()` behaviour you're describing has been changed in this branch. Were you maybe looking at an old version?