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
This commit is contained in:
Pablo Neira Ayuso 2017-08-07 14:01:15 +01:00 committed by Neels Hofmeyr
parent 41a5327178
commit 6ceac7c017
1 changed files with 8 additions and 1 deletions

View File

@ -606,6 +606,10 @@ struct osmo_smpp_cmd *smpp_cmd_find_by_seqnum(struct osmo_esme *esme,
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)
{
@ -646,7 +650,10 @@ static int deliver_to_esme(struct osmo_esme *esme, struct gsm_sms *sms,
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;