trans: Add new parameter message reference for SMS and function for finding transaction by this reference
This commit is contained in:
parent
933de8cb48
commit
8bb11c90fc
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue