From bcb7b32f5ac40a6129461bc3b5c27ce7e0a848db Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Thu, 4 May 2023 15:26:39 +0200 Subject: ASCI: Add support for NOTIFICATION COMMAND (RSL) message This message will be sent to each BTS with a VGCS/VBS channel to notify the served MSs about ongoing group/broadcast calls. It is also used to remove the notification, if the call is terminated. Change-Id: I96ec0ee5d1a772a45f1ebfd64210718c8bf5aa58 Related: OS#4852 --- include/osmocom/bsc/abis_rsl.h | 1 + src/osmo-bsc/abis_rsl.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/include/osmocom/bsc/abis_rsl.h b/include/osmocom/bsc/abis_rsl.h index 06880bf99..83e8f7d17 100644 --- a/include/osmocom/bsc/abis_rsl.h +++ b/include/osmocom/bsc/abis_rsl.h @@ -55,6 +55,7 @@ int rsl_encryption_cmd(struct msgb *msg); int rsl_paging_cmd(struct gsm_bts *bts, uint8_t paging_group, const struct osmo_mobile_identity *mi, uint8_t chan_needed, bool is_gprs); +int rsl_notification_cmd(struct gsm_bts *bts, struct gsm_lchan *lchan, struct gsm0808_group_callref *gc, uint8_t *drx); int rsl_imm_assign_cmd(const struct gsm_bts *bts, uint8_t len, const uint8_t *val); int rsl_tx_imm_assignment(struct gsm_lchan *lchan); int rsl_tx_imm_ass_rej(struct gsm_bts *bts, struct gsm48_req_ref *rqd_ref); diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index 0c3be1ae8..f6acd2f34 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -870,6 +870,45 @@ int rsl_paging_cmd(struct gsm_bts *bts, uint8_t paging_group, return abis_rsl_sendmsg(msg); } +/* Chapter 8.5.10: NOTIFICATION COMMAND */ +int rsl_notification_cmd(struct gsm_bts *bts, struct gsm_lchan *lchan, struct gsm0808_group_callref *gc, uint8_t *drx) +{ + struct abis_rsl_cchan_hdr *cch; + struct msgb *msg = rsl_msgb_alloc(); + struct gsm48_chan_desc cd; + uint8_t sti = (lchan) ? RSL_CMD_INDICATOR_START : RSL_CMD_INDICATOR_STOP; + uint8_t *t; + int rc; + + cch = (struct abis_rsl_cchan_hdr *) msgb_put(msg, sizeof(*cch)); + rsl_init_cchan_hdr(cch, RSL_MT_NOT_CMD); + cch->chan_nr = RSL_CHAN_PCH_AGCH; + + msgb_tlv_put(msg, RSL_IE_CMD_INDICATOR, 1, &sti); + + /* Use TLV encoding from TS 08.08. Change different IE type. */ + t = msg->tail; + gsm0808_enc_group_callref(msg, gc); + *t = RSL_IE_GROUP_CALL_REF; + + if (lchan) { + memset(&cd, 0, sizeof(cd)); + rc = gsm48_lchan2chan_desc(&cd, lchan, lchan->activate.tsc, true); + if (rc) { + LOG_LCHAN(lchan, LOGL_ERROR, "Error encoding Channel Number\n"); + msgb_free(msg); + return rc; + } + msgb_tlv_put(msg, RSL_IE_CHAN_DESC, sizeof(cd), (const uint8_t *)&cd); + + if (drx) + msgb_tlv_put(msg, RSL_IE_NCH_DRX_INFO, 1, drx); + } + + msg->dst = bts->c0->rsl_link_primary; + return abis_rsl_sendmsg(msg); +} + int rsl_forward_layer3_info(struct gsm_lchan *lchan, const uint8_t *l3_info, uint8_t l3_info_len) { struct msgb *msg; -- cgit v1.2.3