diff options
author | Ivan Kluchnikov <kluchnikovi@gmail.com> | 2015-12-21 12:05:56 +0300 |
---|---|---|
committer | Ivan Kluchnikov <kluchnikovi@gmail.com> | 2017-02-07 18:59:55 +0300 |
commit | 8bb11c90fcb333de65f5bdbbe0787ba93a1c9a82 (patch) | |
tree | 6163edbf73d96e25189113b104e851acf97a718e | |
parent | 933de8cb4869be89fe213b7a287da19c858e83c9 (diff) |
trans: Add new parameter message reference for SMS and function for finding transaction by this reference
-rw-r--r-- | openbsc/include/openbsc/transaction.h | 5 | ||||
-rw-r--r-- | openbsc/src/libmsc/transaction.c | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/transaction.h b/openbsc/include/openbsc/transaction.h index 6890f14ae..1cf0874f7 100644 --- a/openbsc/include/openbsc/transaction.h +++ b/openbsc/include/openbsc/transaction.h @@ -32,6 +32,9 @@ struct gsm_trans { /* reference from MNCC or other application */ uint32_t callref; + /* SMS RP message reference */ + uint8_t msg_ref; + /* if traffic channel receive was requested */ int tch_recv; @@ -70,6 +73,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_msgref(struct gsm_subscriber_connection *conn, + uint8_t msg_ref); struct gsm_trans *trans_alloc(struct gsm_network *net, struct gsm_subscriber *subscr, diff --git a/openbsc/src/libmsc/transaction.c b/openbsc/src/libmsc/transaction.c index dba4bed17..3b10fd42a 100644 --- a/openbsc/src/libmsc/transaction.c +++ b/openbsc/src/libmsc/transaction.c @@ -61,6 +61,22 @@ struct gsm_trans *trans_find_by_callref(struct gsm_network *net, return NULL; } +struct gsm_trans *trans_find_by_msgref(struct gsm_subscriber_connection *conn, + uint8_t msg_ref) +{ + struct gsm_trans *trans; + struct gsm_network *net = conn->bts->network; + struct gsm_subscriber *subscr = conn->subscr; + + llist_for_each_entry(trans, &net->trans_list, entry) { + if (trans->subscr == subscr && + trans->protocol == GSM48_PDISC_SMS && + trans->msg_ref == msg_ref) + return trans; + } + return NULL; +} + struct gsm_trans *trans_alloc(struct gsm_network *net, struct gsm_subscriber *subscr, uint8_t protocol, uint8_t trans_id, |