aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2023-03-28 02:27:16 +0200
committerHarald Welte <laforge@osmocom.org>2023-03-28 15:12:10 +0200
commitc17697d337f657ca18225f8462a76e8a683a4cfb (patch)
tree4c4be3cd00e6963f67c8e490bb39ddbd835c99db
parentbb3ed23e719cd699a5ecb83627ffbdba6b9019ec (diff)
common/vty: Print AMR MultiRate Configuration in "show lchan"
It can be useful to introspect the current active AMR mode set. Related: OS#5944 Change-Id: I630af8c3835c2fcbea325c07db269d25e4e18f62
-rw-r--r--src/common/vty.c14
-rw-r--r--src/osmo-bts-virtual/Makefile.am2
2 files changed, 16 insertions, 0 deletions
diff --git a/src/common/vty.c b/src/common/vty.c
index bd182214..93fc0d62 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -43,6 +43,7 @@
#include <osmocom/core/sockaddr_str.h>
#include <osmocom/trau/osmo_ortp.h>
#include <osmocom/core/fsm.h>
+#include <osmocom/codec/codec.h>
#include <osmo-bts/logging.h>
#include <osmo-bts/gsm_data.h>
@@ -1941,6 +1942,19 @@ static void lchan_dump_full_vty(struct vty *vty, const struct gsm_lchan *lchan)
vty_out(vty, " Channel Mode / Codec: %s%s",
gsm48_chan_mode_name(lchan->tch_mode),
VTY_NEWLINE);
+ if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) {
+ const struct amr_multirate_conf *amr_mrc = &lchan->tch.amr_mr;
+ const struct gsm48_multi_rate_conf *mr_conf =
+ (const struct gsm48_multi_rate_conf *) amr_mrc->gsm48_ie;
+ vty_out(vty, " AMR Multi-Rate Configuration: ICMI=%u, Start Mode=%u gsm48=%02x%02x%s",
+ mr_conf->icmi, mr_conf->smod, amr_mrc->gsm48_ie[0], amr_mrc->gsm48_ie[1], VTY_NEWLINE);
+ for (uint8_t i = 0; i < amr_mrc->num_modes; i++) {
+ const struct amr_mode *amode = &amr_mrc->mode[i];
+ vty_out(vty, " AMR Mode %u (%s), threshold=%u, hysteresis=%u%s",
+ amode->mode, osmo_amr_type_name(amode->mode),
+ amode->threshold, amode->hysteresis, VTY_NEWLINE);
+ }
+ }
if (lchan->abis_ip.bound_ip) {
ia.s_addr = htonl(lchan->abis_ip.bound_ip);
diff --git a/src/osmo-bts-virtual/Makefile.am b/src/osmo-bts-virtual/Makefile.am
index 2ae53b4a..bbb79eca 100644
--- a/src/osmo-bts-virtual/Makefile.am
+++ b/src/osmo-bts-virtual/Makefile.am
@@ -7,6 +7,7 @@ AM_CFLAGS = \
$(LIBOSMOABIS_CFLAGS) \
$(LIBOSMOTRAU_CFLAGS) \
$(LIBOSMONETIF_CFLAGS) \
+ $(LIBOSMOCODEC_CFLAGS) \
$(LIBGPS_CFLAGS) \
$(NULL)
@@ -20,6 +21,7 @@ COMMON_LDADD = \
$(LIBOSMOABIS_LIBS) \
$(LIBOSMOTRAU_LIBS) \
$(LIBOSMONETIF_LIBS) \
+ $(LIBOSMOCODEC_LIBS) \
-ldl \
$(NULL)