Delivery receipts
How delivery receipts arrive as deliver_sm and how to read them.
Ask for a receipt by setting registered_delivery = 1 in submit_sm.
How they arrive
- Receipts come as
deliver_smon a RX or TRX session of the samesystem_id. esm_classis0x04, which marks a delivery receipt.- Answer each
deliver_smwith adeliver_sm_respwithcommand_status = 0. If you do not, we send it again. - If no RX or TRX session is open, receipts wait for a while and are sent when you bind again.
The receipt text
The short_message of the receipt holds the standard text:
id:6f1c2b9e-1d2a-4c55-9a0e-2b7f0c1d3e4f sub:001 dlvrd:001 submit date:2611050830 done date:2611050830 stat:DELIVRD err:000 text:| Part | Meaning |
|---|---|
id | The message_id from your submit_sm_resp. Match on this. |
sub, dlvrd | Submitted and delivered counts. |
submit date, done date | YYMMDDhhmm. |
stat | The final state, see below. |
err | Network error code. 000 means none. |
The message id may also be in the receipted_message_id TLV.
For long messages you get one receipt per segment. Each has the message_id of that segment.
stat values
| stat | Meaning | Charged |
|---|---|---|
DELIVRD | Delivered to the phone. | Yes |
ACCEPTD | Accepted by the network, final state unknown. | Yes |
ENROUTE | Still on its way (not final). | Yes |
EXPIRED | The phone was off or out of reach until the validity time ran out. | Yes |
UNDELIV | The network could not deliver it, for example a wrong number. | Yes |
REJECTD | Refused by the network. | Yes |
DELETED | Deleted by the network. | Yes |
UNKNOWN | No final answer from the network. | Yes |
A credit is used when the message is accepted in submit_sm_resp, not when it is delivered. A message that later fails is not refunded.
To be confirmed
The format of message_id (shown here as a UUID) and how long receipts wait for a client that is not bound have not yet been checked on the live SMS YANU server.