Skip to content

Instantly share code, notes, and snippets.

@grantpullen
Last active September 3, 2023 20:29
Show Gist options
  • Save grantpullen/3d550f31c454e80fda8fc0d5b9105fd0 to your computer and use it in GitHub Desktop.
Save grantpullen/3d550f31c454e80fda8fc0d5b9105fd0 to your computer and use it in GitHub Desktop.

Revisions

  1. grantpullen revised this gist Jul 16, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion KannelDLR.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    #SMSPP Delviery Reports and Kannel
    # SMSPP Delviery Reports and Kannel
    This info page relates to the DLR values which are returned by kannel when requesting DLR. Some SMPP related information is also listed for reference.


  2. grantpullen created this gist Jul 16, 2019.
    90 changes: 90 additions & 0 deletions KannelDLR.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,90 @@
    #SMSPP Delviery Reports and Kannel
    This info page relates to the DLR values which are returned by kannel when requesting DLR. Some SMPP related information is also listed for reference.



    ## dlr-mask
    This [send-sms][1] parameter is used to request for delivery reports with the state of the sent message. This requires the [dlr-url][1] on sendsms-user group or use the dlr-url CGI variable to be set. The value is a bit mask composed of:

    | Value | Description |
    |-------|---------------------------|
    | 1 | Delivered to phone |
    | 2 | Non-Delivered to Phone |
    | 4 | Queued on SMSC |
    | 8 | Delivered to SMSC |
    | 16 | Non-Delivered to SMSC. |

    The values within the mask are added together to get the desired DLR result, e.g. To only receive final values register to (1+2+16) = 19

    ## SMPP message_state mapping to Kannel

    | Message State | Value | Type | Kannel Value |
    |----------------|-------|--------------|--------------|
    | SCHEDULED | 0 | Intermediate | 4 |
    | ENROUTE | 1 | Intermediate | 4 |
    | DELIVERED | 2 | Final | 1 |
    | EXPIRED | 3 | Final | 2 |
    | DELETED | 4 | Final | 2 |
    | UNDELIVERABLE | 5 | Final | 2 |
    | ACCEPTED | 6 | Final | 4 |
    | UNKNOWN | 7 | N/A | 2 |
    | REJECTED | 8 | Final | 2 |
    | SKIPPED | 9 | Final | 2 |

    ## Kannel DLR Return Values
    | Status | Value |
    |--------------------|-------|
    | DLR_NOTHING | 0x00 |
    | DLR_SUCCESS | 0x01 |
    | DLR_FAIL | 0x02 |
    | DLR_BUFFERED | 0x04 |
    | DLR_SMSC_SUCCESS | 0x08 |
    | DLR_SMSC_FAIL | 0x10 |
    | DLR_EXPIRED | 0x22 |
    | DLR_UNKNOWN | 0x42 |
    | DLR_UNDEFINED | -1 |


    ## network_error_code
    The network_error_code parameter is used to indicate the actual network error code for a
    delivery failure. The network error code is technology specific. Refer to [SMPP V5.0 section 4.8.4.42][3] for detailed encoding.

    | Field | Size | Type | Description |
    |------------|------|-----------|-----------------------------------------------|
    | Param Tag | 2 | Integer | 0x0423 |
    | Length | 2 | Integer | Length of value part in octets |
    | Value | 3 | Octet Str | Octet 1 = Network Type |
    | | | | Octet 2,3 = Error Code |
    | | | | |
    | | | | Network Types: |
    | | | | 1 = ANSI 136 Access Denied Reason |
    | | | | 2 = IS 95 Access Denied Reason |
    | | | | 3 = GSM |
    | | | | 4 = ANSI 136 Cause Code |
    | | | | 5 = IS 95 Cause Code |
    | | | | 6 = ANSI-41 Error |
    | | | | 7 = SMPP Error |
    | | | | 8 = Message Center Specific |
    | | | | All other values reserved. |
    | | | | |
    | | | | Error Code: |
    | | | | The remaining 2 octets specify the network |
    | | | | error code appropriate to the network type. |




    ## delivery_failure_reason
    | Value | Reason |
    |-------|-----------------------------------------------------------------------|
    | 0 | Destination unavailable |
    | 1 | Destination Address Invalid (e.g. suspended, no SMS capability, etc.) |
    | 2 | Permanent network error |
    | 3 | Temporary network error |
    | 4-255 | Reserved |


    ---
    [1]: https://www.kannel.org/download/kannel-userguide-snapshot/userguide.html
    [2]: http://opensmpp.org/specs/SMPP_v3_4_Issue1_2.pdf
    [3]: http://opensmpp.org/specs/smppv50.pdf