bsc_api: Change submit dtap to allow to automatically use the SACH
For SAPI=3 on a TCH it might be nice to use the SACH to submit the message. The api allows to automatically use the SACH if a message like this is submitted.
This commit is contained in:
parent
2603c1f545
commit
8d380dcadd
|
@ -26,7 +26,7 @@ struct bsc_api {
|
|||
};
|
||||
|
||||
int bsc_api_init(struct gsm_network *network, struct bsc_api *api);
|
||||
int gsm0808_submit_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg, int link_id);
|
||||
int gsm0808_submit_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg, int link_id, int allow_sach);
|
||||
int gsm0808_assign_req(struct gsm_subscriber_connection *conn, int chan_mode, int full_rate);
|
||||
int gsm0808_cipher_mode(struct gsm_subscriber_connection *conn, int cipher,
|
||||
const uint8_t *key, int len, int include_imeisv);
|
||||
|
|
|
@ -174,12 +174,18 @@ int bsc_api_init(struct gsm_network *network, struct bsc_api *api)
|
|||
}
|
||||
|
||||
int gsm0808_submit_dtap(struct gsm_subscriber_connection *conn,
|
||||
struct msgb *msg, int link_id)
|
||||
struct msgb *msg, int link_id, int allow_sach)
|
||||
{
|
||||
uint8_t sapi = link_id & 0x7;
|
||||
msg->lchan = conn->lchan;
|
||||
msg->trx = msg->lchan->ts->trx;
|
||||
|
||||
/* If we are on a TCH and need to submit a SMS (on SAPI=3) we need to use the SACH */
|
||||
if (allow_sach && sapi != 0) {
|
||||
if (conn->lchan->type == GSM_LCHAN_TCH_F || conn->lchan->type == GSM_LCHAN_TCH_H)
|
||||
link_id |= 0x40;
|
||||
}
|
||||
|
||||
msg->l3h = msg->data;
|
||||
if (conn->lchan->sapis[sapi] == LCHAN_SAPI_UNUSED) {
|
||||
OBSC_LINKID_CB(msg) = link_id;
|
||||
|
|
|
@ -104,7 +104,7 @@ static int gsm48_conn_sendmsg(struct msgb *msg, struct gsm_subscriber_connection
|
|||
gh->proto_discr, gh->msg_type);
|
||||
}
|
||||
|
||||
return gsm0808_submit_dtap(conn, msg, 0);
|
||||
return gsm0808_submit_dtap(conn, msg, 0, 0);
|
||||
}
|
||||
|
||||
int gsm48_cc_tx_notify_ss(struct gsm_trans *trans, const char *message)
|
||||
|
|
|
@ -142,7 +142,7 @@ static int gsm411_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *m
|
|||
{
|
||||
DEBUGP(DSMS, "GSM4.11 TX %s\n", hexdump(msg->data, msg->len));
|
||||
msg->l3h = msg->data;
|
||||
return gsm0808_submit_dtap(conn, msg, link_id);
|
||||
return gsm0808_submit_dtap(conn, msg, link_id, 1);
|
||||
}
|
||||
|
||||
/* SMC TC1* is expired */
|
||||
|
|
|
@ -107,7 +107,7 @@ int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn,
|
|||
| (1<<7); /* TI direction = 1 */
|
||||
gh->msg_type = GSM0480_MTYPE_RELEASE_COMPLETE;
|
||||
|
||||
return gsm0808_submit_dtap(conn, msg, 0);
|
||||
return gsm0808_submit_dtap(conn, msg, 0, 0);
|
||||
}
|
||||
|
||||
int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn,
|
||||
|
@ -136,7 +136,7 @@ int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn,
|
|||
gh->proto_discr |= req->transaction_id | (1<<7); /* TI direction = 1 */
|
||||
gh->msg_type = GSM0480_MTYPE_RELEASE_COMPLETE;
|
||||
|
||||
return gsm0808_submit_dtap(conn, msg, 0);
|
||||
return gsm0808_submit_dtap(conn, msg, 0, 0);
|
||||
}
|
||||
|
||||
int gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, int level, const char *text)
|
||||
|
@ -156,7 +156,7 @@ int gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, int level, c
|
|||
gh->proto_discr = GSM48_PDISC_NC_SS;
|
||||
gh->msg_type = GSM0480_MTYPE_REGISTER;
|
||||
|
||||
return gsm0808_submit_dtap(conn, msg, 0);
|
||||
return gsm0808_submit_dtap(conn, msg, 0, 0);
|
||||
}
|
||||
|
||||
int gsm0480_send_releaseComplete(struct gsm_subscriber_connection *conn)
|
||||
|
@ -172,5 +172,5 @@ int gsm0480_send_releaseComplete(struct gsm_subscriber_connection *conn)
|
|||
gh->proto_discr = GSM48_PDISC_NC_SS;
|
||||
gh->msg_type = GSM0480_MTYPE_RELEASE_COMPLETE;
|
||||
|
||||
return gsm0808_submit_dtap(conn, msg, 0);
|
||||
return gsm0808_submit_dtap(conn, msg, 0, 0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue