Review at  https://gerrit.osmocom.org/3428

libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM messages

Propagate the status report request field to the SMPP message through
the registered_delivery field, so the ESME knows that the mobile phone
is asking for explicit delivery acknowledgment is required. See SMPP 3.4
specs section 5.2.17.

Change-Id: I59af60fa89cd10ae973c5e122789e3e03e3728ee
---
M openbsc/src/libmsc/smpp_openbsc.c
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/28/3428/1

diff --git a/openbsc/src/libmsc/smpp_openbsc.c 
b/openbsc/src/libmsc/smpp_openbsc.c
index 6b89df2..cf78676 100644
--- a/openbsc/src/libmsc/smpp_openbsc.c
+++ b/openbsc/src/libmsc/smpp_openbsc.c
@@ -602,6 +602,10 @@
        return NULL;
 }
 
+/* See SMPP 3.4, Section 5.2.17. registered_delivery (1 byte field). */
+#define SMPP34_NO_DELIVERY_RECEIPT     0x0
+#define SMPP34_DELIVERY_RECEIPT_REQ    0x1
+
 static int deliver_to_esme(struct osmo_esme *esme, struct gsm_sms *sms,
                           struct gsm_subscriber_connection *conn)
 {
@@ -642,7 +646,10 @@
 
        deliver.protocol_id     = sms->protocol_id;
        deliver.priority_flag   = 0;
-       deliver.registered_delivery = 0;
+       if (sms->status_rep_req)
+               deliver.registered_delivery = SMPP34_DELIVERY_RECEIPT_REQ;
+       else
+               deliver.registered_delivery = SMPP34_NO_DELIVERY_RECEIPT;
 
        /* Figure out SMPP DCS from TP-DCS */
        dcs = sms->data_coding_scheme;

-- 
To view, visit https://gerrit.osmocom.org/3428
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I59af60fa89cd10ae973c5e122789e3e03e3728ee
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso <pa...@gnumonks.org>

Reply via email to