aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-04-16 20:04:35 +0200
committerHarald Welte <laforge@gnumonks.org>2019-05-19 07:26:28 +0000
commit4dc95597284972b8c862f63121b91d177569b3a4 (patch)
tree7bfc11816dbecdf91421c88985f04ced3dd4fa2d
parenta94907ec062067845797775172ad7a973e93c7a0 (diff)
bssap: Announce Osmux support on RESET (ACK) send
-rw-r--r--src/osmo-bsc/osmo_bsc_sigtran.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index f2a6d08d7..5d61c3205 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -82,6 +82,14 @@ static int pick_free_conn_id(const struct bsc_msc_data *msc)
return -1;
}
+/* Patch regular BSSMAP RESET to add extra T to announce Osmux support (osmocom extension) */
+static void _gsm0808_extend_announce_osmux(struct msgb *msg)
+{
+ OSMO_ASSERT(msg->l3h[1] == msgb_l3len(msg) - 2); /*TL not in len */
+ msgb_put_u8(msg, GSM0808_IE_OSMO_OSMUX_SUPPORT);
+ msg->l3h[1] = msgb_l3len(msg) - 2;
+}
+
/* Send reset to MSC */
static void osmo_bsc_sigtran_tx_reset(const struct bsc_msc_data *msc)
{
@@ -92,6 +100,10 @@ static void osmo_bsc_sigtran_tx_reset(const struct bsc_msc_data *msc)
OSMO_ASSERT(ss7);
LOGP(DMSC, LOGL_NOTICE, "Sending RESET to MSC: %s\n", osmo_sccp_addr_name(ss7, &msc->a.msc_addr));
msg = gsm0808_create_reset();
+
+ if (msc->use_osmux != OSMUX_USAGE_OFF)
+ _gsm0808_extend_announce_osmux(msg);
+
osmo_sccp_tx_unitdata_msg(msc->a.sccp_user, &msc->a.bsc_addr,
&msc->a.msc_addr, msg);
}
@@ -107,6 +119,10 @@ void osmo_bsc_sigtran_tx_reset_ack(const struct bsc_msc_data *msc)
OSMO_ASSERT(ss7);
LOGP(DMSC, LOGL_NOTICE, "Sending RESET ACK to MSC: %s\n", osmo_sccp_addr_name(ss7, &msc->a.msc_addr));
msg = gsm0808_create_reset_ack();
+
+ if (msc->use_osmux != OSMUX_USAGE_OFF)
+ _gsm0808_extend_announce_osmux(msg);
+
osmo_sccp_tx_unitdata_msg(msc->a.sccp_user, &msc->a.bsc_addr,
&msc->a.msc_addr, msg);
}