aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-04-16 20:03:15 +0200
committerHarald Welte <laforge@gnumonks.org>2019-05-19 07:26:28 +0000
commita94907ec062067845797775172ad7a973e93c7a0 (patch)
tree843e2d35ee594088ec123a382cd65fdf16eceb9f /src
parent6c548dc615543a8b33306185f111329ffb31d6d0 (diff)
bssap: Detect MSC Osmux support on RESET (ACK) recv
Diffstat (limited to 'src')
-rw-r--r--src/osmo-bsc/osmo_bsc_bssap.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index e79a34469..9dee2658a 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -51,6 +51,25 @@
* helpers for the assignment command
*/
+/* We expect MSC to provide use with an Osmocom extension TLV in BSSMAP_RESET to
+ * announce Osmux support */
+static void update_msc_osmux_support(struct bsc_msc_data *msc,
+ struct msgb *msg, unsigned int length)
+{
+ struct tlv_parsed tp;
+ int rc;
+ bool old_value = msc->remote_supports_osmux;
+
+ rc = tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, length - 1, 0, 0);
+ if (rc < 0)
+ LOGP(DMSC, LOGL_NOTICE, "Failed parsing TLV looking for Osmux support\n");
+
+ msc->remote_supports_osmux = !!TLVP_PRESENT(&tp, GSM0808_IE_OSMO_OSMUX_SUPPORT);
+
+ if (old_value != msc->remote_supports_osmux)
+ LOGP(DMSC, LOGL_INFO, "MSC detected AoIP Osmux support changed: %d->%d\n",
+ old_value, msc->remote_supports_osmux);
+}
static int bssmap_handle_reset_ack(struct bsc_msc_data *msc,
struct msgb *msg, unsigned int length)
@@ -63,6 +82,8 @@ static int bssmap_handle_reset_ack(struct bsc_msc_data *msc,
* that we have successfully received the reset-ack message */
a_reset_ack_confirm(msc);
+ update_msc_osmux_support(msc, msg, length);
+
return 0;
}
@@ -81,6 +102,8 @@ static int bssmap_handle_reset(struct bsc_msc_data *msc,
/* Drop all ongoing paging requests that this MSC has created on any BTS */
paging_flush_network(msc->network, msc);
+ update_msc_osmux_support(msc, msg, length);
+
/* Inform the MSC that we have received the reset request and
* that we acted accordingly */
osmo_bsc_sigtran_tx_reset_ack(msc);