aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmocom/msc/transaction.h5
-rw-r--r--src/libmsc/transaction.c22
2 files changed, 27 insertions, 0 deletions
diff --git a/include/osmocom/msc/transaction.h b/include/osmocom/msc/transaction.h
index b7d7971fe..762eeea28 100644
--- a/include/osmocom/msc/transaction.h
+++ b/include/osmocom/msc/transaction.h
@@ -76,6 +76,9 @@ struct gsm_trans {
struct gsm411_smc_inst smc_inst;
struct gsm411_smr_inst smr_inst;
+ /* SM-RP-MR, Message Reference (see GSM TS 04.11, section 8.2.3) */
+ uint8_t sm_rp_mr;
+
struct gsm_sms *sms;
} sms;
struct {
@@ -99,6 +102,8 @@ struct gsm_trans *trans_find_by_id(struct gsm_subscriber_connection *conn,
uint8_t proto, uint8_t trans_id);
struct gsm_trans *trans_find_by_callref(struct gsm_network *net,
uint32_t callref);
+struct gsm_trans *trans_find_by_sm_rp_mr(struct gsm_subscriber_connection *conn,
+ uint8_t sm_rp_mr);
struct gsm_trans *trans_alloc(struct gsm_network *net,
struct vlr_subscr *vsub,
diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c
index 680d7f306..cffbe0dac 100644
--- a/src/libmsc/transaction.c
+++ b/src/libmsc/transaction.c
@@ -73,6 +73,28 @@ struct gsm_trans *trans_find_by_callref(struct gsm_network *net,
return NULL;
}
+/*! Find a transaction by SM-RP-MR (RP Message Reference)
+ * \param[in] conn Connection in which we want to find transaction
+ * \param[in] sm_rp_mr RP Message Reference (see GSM TS 04.11, section 8.2.3)
+ * \returns Matching transaction, NULL otherwise
+ */
+struct gsm_trans *trans_find_by_sm_rp_mr(struct gsm_subscriber_connection *conn,
+ uint8_t sm_rp_mr)
+{
+ struct gsm_network *net = conn->network;
+ struct vlr_subscr *vsub = conn->vsub;
+ struct gsm_trans *trans;
+
+ llist_for_each_entry(trans, &net->trans_list, entry) {
+ if (trans->vsub == vsub &&
+ trans->protocol == GSM48_PDISC_SMS &&
+ trans->sms.sm_rp_mr == sm_rp_mr)
+ return trans;
+ }
+
+ return NULL;
+}
+
/*! Allocate a new transaction and add it to network list
* \param[in] net Netwokr in which we allocate transaction
* \param[in] subscr Subscriber for which we allocate transaction