diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-11-10 10:16:02 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-11-15 20:06:46 +0100 |
commit | 8d380dcaddcdd2d1379911388351673f4596f79a (patch) | |
tree | 193a7b4e62b5f929e77fc6e2a093ede96c6c6e9b /openbsc/src/bsc_api.c | |
parent | 2603c1f545cdb24f3cc71f852279dc63e2a7e1ed (diff) |
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.
Diffstat (limited to 'openbsc/src/bsc_api.c')
-rw-r--r-- | openbsc/src/bsc_api.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/openbsc/src/bsc_api.c b/openbsc/src/bsc_api.c index c86d62cc3..085a8c9da 100644 --- a/openbsc/src/bsc_api.c +++ b/openbsc/src/bsc_api.c @@ -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; |