Change in osmo-msc[master]: (HACK) libmsc/gsm_04_11.c: properly handle MMS indication

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Sun Dec 2 23:13:13 UTC 2018


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/12059


Change subject: (HACK) libmsc/gsm_04_11.c: properly handle MMS indication
......................................................................

(HACK) libmsc/gsm_04_11.c: properly handle MMS indication

MMS (More Messages to Send) is a part of MT-ForwardSM-Req message,
that is used by ESME to indicate that there are more MT SMS messages
to be sent, so the MSC should keep RAN connection open.

Change-Id: Ic46b04913b2e8cc5d11a39426dcc1bfe11f1d31e
Related Change-Id: (TTCN) I6308586a70c4fb3254c519330a61a9667372149f
Related: OS#3587
---
M include/osmocom/msc/gsm_04_11.h
M include/osmocom/msc/ran_conn.h
M include/osmocom/msc/transaction.h
M src/libmsc/gsm_04_11.c
M src/libmsc/gsm_04_11_gsup.c
M src/libmsc/osmo_msc.c
6 files changed, 25 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/59/12059/1

diff --git a/include/osmocom/msc/gsm_04_11.h b/include/osmocom/msc/gsm_04_11.h
index 4297cdb..0e5b3d2 100644
--- a/include/osmocom/msc/gsm_04_11.h
+++ b/include/osmocom/msc/gsm_04_11.h
@@ -42,7 +42,8 @@
 int gsm411_send_sms(struct gsm_network *net,
 		    struct vlr_subscr *vsub,
 		    struct gsm_sms *sms);
-int gsm411_send_rp_data(struct gsm_network *net, struct vlr_subscr *vsub,
+int gsm411_send_rp_data(struct gsm_network *net,
+			struct vlr_subscr *vsub, uint8_t *mms_ind,
 			size_t sm_rp_oa_len, const uint8_t *sm_rp_oa,
 			size_t sm_rp_ud_len, const uint8_t *sm_rp_ud);
 
diff --git a/include/osmocom/msc/ran_conn.h b/include/osmocom/msc/ran_conn.h
index d71872e..5975a59 100644
--- a/include/osmocom/msc/ran_conn.h
+++ b/include/osmocom/msc/ran_conn.h
@@ -220,6 +220,7 @@
 	RAN_CONN_USE_TRANS_SMS,
 	RAN_CONN_USE_TRANS_NC_SS,
 	RAN_CONN_USE_SILENT_CALL,
+	RAN_CONN_USE_MT_SMS_MMTS,
 	RAN_CONN_USE_RELEASE,
 };
 
diff --git a/include/osmocom/msc/transaction.h b/include/osmocom/msc/transaction.h
index 0760c07..a987b1c 100644
--- a/include/osmocom/msc/transaction.h
+++ b/include/osmocom/msc/transaction.h
@@ -78,6 +78,9 @@
 
 			/* SM-RP-MR, Message Reference (see GSM TS 04.11, section 8.2.3) */
 			uint8_t sm_rp_mr;
+			/* SM-RP-MMS, More Messages to Send
+			 * (see GSM 3GPP TS 29.002, section 7.6.8.7) */
+			bool sm_rp_mms;
 
 			struct gsm_sms *sms;
 		} sms;
diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c
index 01f1cb5..c77c4ec 100644
--- a/src/libmsc/gsm_04_11.c
+++ b/src/libmsc/gsm_04_11.c
@@ -1133,7 +1133,8 @@
 }
 
 /* Low-level function to send raw RP-DATA to a given subscriber */
-int gsm411_send_rp_data(struct gsm_network *net, struct vlr_subscr *vsub,
+int gsm411_send_rp_data(struct gsm_network *net,
+			struct vlr_subscr *vsub, uint8_t *mms_ind,
 			size_t sm_rp_oa_len, const uint8_t *sm_rp_oa,
 			size_t sm_rp_ud_len, const uint8_t *sm_rp_ud)
 {
@@ -1146,6 +1147,10 @@
 	if (!trans)
 		return -ENOMEM;
 
+	/* Handle MMS indication */
+	if (mms_ind != NULL && *mms_ind != 0x00)
+		trans->sms.sm_rp_mms = true;
+
 	/* Allocate a message buffer for to be encoded SMS */
 	msg = gsm411_msgb_alloc();
 	if (!msg) {
@@ -1277,6 +1282,17 @@
 	trans->sms.smc_inst.mn_recv = NULL;
 	trans->sms.smc_inst.mm_send = NULL;
 
+	/* HACK: handle SM-RP-MMS (More Messages to Send) */
+	if (trans->conn != NULL) {
+		if (trans->sms.sm_rp_mms) {
+			if (!ran_conn_used_by(trans->conn, RAN_CONN_USE_MT_SMS_MMTS))
+				ran_conn_get(trans->conn, RAN_CONN_USE_MT_SMS_MMTS);
+		} else {
+			if (ran_conn_used_by(trans->conn, RAN_CONN_USE_MT_SMS_MMTS))
+				ran_conn_put(trans->conn, RAN_CONN_USE_MT_SMS_MMTS);
+		}
+	}
+
 	if (trans->sms.sms) {
 		LOGP(DLSMS, LOGL_ERROR, "Transaction contains SMS.\n");
 		send_signal(S_SMS_UNKNOWN_ERROR, trans, trans->sms.sms, 0);
diff --git a/src/libmsc/gsm_04_11_gsup.c b/src/libmsc/gsm_04_11_gsup.c
index 9b15961..2aedbf4 100644
--- a/src/libmsc/gsm_04_11_gsup.c
+++ b/src/libmsc/gsm_04_11_gsup.c
@@ -280,7 +280,7 @@
 		goto msg_error;
 
 	/* Send RP-DATA */
-	rc = gsm411_send_rp_data(net, vsub,
+	rc = gsm411_send_rp_data(net, vsub, gsup_msg->sm_rp_mms,
 		gsup_msg->sm_rp_oa_len, gsup_msg->sm_rp_oa,
 		gsup_msg->sm_rp_ui_len, gsup_msg->sm_rp_ui);
 	if (rc) {
diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c
index 52277b7..a996e14 100644
--- a/src/libmsc/osmo_msc.c
+++ b/src/libmsc/osmo_msc.c
@@ -316,6 +316,7 @@
 	{RAN_CONN_USE_TRANS_SMS,	"trans_sms"},
 	{RAN_CONN_USE_TRANS_NC_SS,	"trans_nc_ss"},
 	{RAN_CONN_USE_SILENT_CALL,	"silent_call"},
+	{RAN_CONN_USE_MT_SMS_MMTS,	"mt_sms_mmts"},
 	{RAN_CONN_USE_RELEASE,		"release"},
 	{0, NULL},
 };

-- 
To view, visit https://gerrit.osmocom.org/12059
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic46b04913b2e8cc5d11a39426dcc1bfe11f1d31e
Gerrit-Change-Number: 12059
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181202/349ea21b/attachment.htm>


More information about the gerrit-log mailing list